1
0
Fork 0

Added Statistics calculation

Statistics now show calculated values
This commit is contained in:
Techognito 2025-09-04 17:30:00 +02:00
parent fe87374e47
commit fc0f69dacb
2147 changed files with 141321 additions and 39 deletions

11069
node_modules/@mui/x-internals/CHANGELOG.md generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
export type EventListener = (...args: any[]) => void;
export interface EventListenerOptions {
isFirst?: boolean;
}
interface EventListenerCollection {
/**
* List of listeners to run before the others
* They are run in the opposite order of the registration order
*/
highPriority: Map<EventListener, true>;
/**
* List of events to run after the high priority listeners
* They are run in the registration order
*/
regular: Map<EventListener, true>;
}
export declare class EventManager {
maxListeners: number;
warnOnce: boolean;
events: {
[eventName: string]: EventListenerCollection;
};
on(eventName: string, listener: EventListener, options?: EventListenerOptions): void;
removeListener(eventName: string, listener: EventListener): void;
removeAllListeners(): void;
emit(eventName: string, ...args: any[]): void;
once(eventName: string, listener: EventListener): void;
}
export {};

View file

@ -0,0 +1,74 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EventManager = void 0;
// Used https://gist.github.com/mudge/5830382 as a starting point.
// See https://github.com/browserify/events/blob/master/events.js for
// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.
class EventManager {
maxListeners = 20;
warnOnce = false;
events = {};
on(eventName, listener, options = {}) {
let collection = this.events[eventName];
if (!collection) {
collection = {
highPriority: new Map(),
regular: new Map()
};
this.events[eventName] = collection;
}
if (options.isFirst) {
collection.highPriority.set(listener, true);
} else {
collection.regular.set(listener, true);
}
if (process.env.NODE_ENV !== 'production') {
const collectionSize = collection.highPriority.size + collection.regular.size;
if (collectionSize > this.maxListeners && !this.warnOnce) {
this.warnOnce = true;
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join('\n'));
}
}
}
removeListener(eventName, listener) {
if (this.events[eventName]) {
this.events[eventName].regular.delete(listener);
this.events[eventName].highPriority.delete(listener);
}
}
removeAllListeners() {
this.events = {};
}
emit(eventName, ...args) {
const collection = this.events[eventName];
if (!collection) {
return;
}
const highPriorityListeners = Array.from(collection.highPriority.keys());
const regularListeners = Array.from(collection.regular.keys());
for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {
const listener = highPriorityListeners[i];
if (collection.highPriority.has(listener)) {
listener.apply(this, args);
}
}
for (let i = 0; i < regularListeners.length; i += 1) {
const listener = regularListeners[i];
if (collection.regular.has(listener)) {
listener.apply(this, args);
}
}
}
once(eventName, listener) {
// eslint-disable-next-line consistent-this
const that = this;
this.on(eventName, function oneTimeListener(...args) {
that.removeListener(eventName, oneTimeListener);
listener.apply(that, args);
});
}
}
exports.EventManager = EventManager;

View file

@ -0,0 +1,2 @@
export { EventManager } from "./EventManager.js";
export type { EventListenerOptions } from "./EventManager.js";

12
node_modules/@mui/x-internals/EventManager/index.js generated vendored Normal file
View file

@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "EventManager", {
enumerable: true,
get: function () {
return _EventManager.EventManager;
}
});
var _EventManager = require("./EventManager");

21
node_modules/@mui/x-internals/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Material-UI SAS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

4
node_modules/@mui/x-internals/README.md generated vendored Normal file
View file

@ -0,0 +1,4 @@
# @mui/x-internals
Shared utilities used by MUI X packages.
This package should never be installed or used directly.

View file

@ -0,0 +1,14 @@
import * as React from 'react';
export interface ToolbarContextValue {
focusableItemId: string | null;
registerItem: (id: string, ref: React.RefObject<HTMLButtonElement | null>) => void;
unregisterItem: (id: string) => void;
onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
onItemFocus: (id: string) => void;
onItemDisabled: (id: string, disabled: boolean) => void;
}
export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
export declare function useToolbarContext(): ToolbarContextValue;
export declare function ToolbarContextProvider({
children
}: React.PropsWithChildren): React.JSX.Element;

View file

@ -0,0 +1,171 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ToolbarContext = void 0;
exports.ToolbarContextProvider = ToolbarContextProvider;
exports.useToolbarContext = useToolbarContext;
var React = _interopRequireWildcard(require("react"));
var _jsxRuntime = require("react/jsx-runtime");
const ToolbarContext = exports.ToolbarContext = /*#__PURE__*/React.createContext(undefined);
if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
function useToolbarContext() {
const context = React.useContext(ToolbarContext);
if (context === undefined) {
throw new Error('MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.');
}
return context;
}
function ToolbarContextProvider({
children
}) {
const [focusableItemId, setFocusableItemId] = React.useState(null);
const focusableItemIdRef = React.useRef(focusableItemId);
const [items, setItems] = React.useState([]);
const getSortedItems = React.useCallback(() => items.sort(sortByDocumentPosition), [items]);
const findEnabledItem = React.useCallback((startIndex, step, wrap = true) => {
let index = startIndex;
const sortedItems = getSortedItems();
const itemCount = sortedItems.length;
// Look for enabled items in the specified direction
for (let i = 0; i < itemCount; i += 1) {
index += step;
// Handle wrapping around the ends
if (index >= itemCount) {
if (!wrap) {
return -1;
}
index = 0;
} else if (index < 0) {
if (!wrap) {
return -1;
}
index = itemCount - 1;
}
// Return if we found an enabled item
if (!sortedItems[index].ref.current?.disabled && sortedItems[index].ref.current?.ariaDisabled !== 'true') {
return index;
}
}
// If we've checked all items and found none enabled
return -1;
}, [getSortedItems]);
const registerItem = React.useCallback((id, itemRef) => {
setItems(prevItems => [...prevItems, {
id,
ref: itemRef
}]);
}, []);
const unregisterItem = React.useCallback(id => {
setItems(prevItems => prevItems.filter(i => i.id !== id));
}, []);
const onItemKeyDown = React.useCallback(event => {
if (!focusableItemId) {
return;
}
const sortedItems = getSortedItems();
const focusableItemIndex = sortedItems.findIndex(item => item.id === focusableItemId);
let newIndex = -1;
if (event.key === 'ArrowRight') {
event.preventDefault();
newIndex = findEnabledItem(focusableItemIndex, 1);
} else if (event.key === 'ArrowLeft') {
event.preventDefault();
newIndex = findEnabledItem(focusableItemIndex, -1);
} else if (event.key === 'Home') {
event.preventDefault();
newIndex = findEnabledItem(-1, 1, false);
} else if (event.key === 'End') {
event.preventDefault();
newIndex = findEnabledItem(sortedItems.length, -1, false);
}
// TODO: Check why this is necessary
if (newIndex >= 0 && newIndex < sortedItems.length) {
const item = sortedItems[newIndex];
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}, [getSortedItems, focusableItemId, findEnabledItem]);
const onItemFocus = React.useCallback(id => {
if (focusableItemId !== id) {
setFocusableItemId(id);
}
}, [focusableItemId, setFocusableItemId]);
const onItemDisabled = React.useCallback(id => {
const sortedItems = getSortedItems();
const currentIndex = sortedItems.findIndex(item => item.id === id);
const newIndex = findEnabledItem(currentIndex, 1);
if (newIndex >= 0 && newIndex < sortedItems.length) {
const item = sortedItems[newIndex];
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}, [getSortedItems, findEnabledItem]);
React.useEffect(() => {
focusableItemIdRef.current = focusableItemId;
}, [focusableItemId]);
React.useEffect(() => {
const sortedItems = getSortedItems();
if (sortedItems.length > 0) {
// Set initial focusable item
if (!focusableItemIdRef.current) {
setFocusableItemId(sortedItems[0].id);
return;
}
const focusableItemIndex = sortedItems.findIndex(item => item.id === focusableItemIdRef.current);
if (!sortedItems[focusableItemIndex]) {
// Last item has been removed from the items array
const item = sortedItems[sortedItems.length - 1];
if (item) {
setFocusableItemId(item.id);
item.ref.current?.focus();
}
} else if (focusableItemIndex === -1) {
// Focused item has been removed from the items array
const item = sortedItems[focusableItemIndex];
if (item) {
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}
}
}, [getSortedItems, findEnabledItem]);
const contextValue = React.useMemo(() => ({
focusableItemId,
registerItem,
unregisterItem,
onItemKeyDown,
onItemFocus,
onItemDisabled
}), [focusableItemId, registerItem, unregisterItem, onItemKeyDown, onItemFocus, onItemDisabled]);
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarContext.Provider, {
value: contextValue,
children: children
});
}
/* eslint-disable no-bitwise */
function sortByDocumentPosition(a, b) {
if (!a.ref.current || !b.ref.current) {
return 0;
}
const position = a.ref.current.compareDocumentPosition(b.ref.current);
if (!position) {
return 0;
}
if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
return -1;
}
if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
return 1;
}
return 0;
}

View file

@ -0,0 +1,2 @@
export * from "./ToolbarContext.js";
export * from "./useRegisterToolbarButton.js";

27
node_modules/@mui/x-internals/ToolbarContext/index.js generated vendored Normal file
View file

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ToolbarContext = require("./ToolbarContext");
Object.keys(_ToolbarContext).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _ToolbarContext[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _ToolbarContext[key];
}
});
});
var _useRegisterToolbarButton = require("./useRegisterToolbarButton");
Object.keys(_useRegisterToolbarButton).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _useRegisterToolbarButton[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _useRegisterToolbarButton[key];
}
});
});

View file

@ -0,0 +1,10 @@
import * as React from 'react';
interface ToolbarItemProps extends Pick<React.ComponentProps<'button'>, 'onKeyDown' | 'onFocus' | 'aria-disabled' | 'disabled'> {}
export declare function useRegisterToolbarButton(props: ToolbarItemProps, ref: React.RefObject<HTMLButtonElement | null>): {
tabIndex: number;
disabled: boolean | undefined;
'aria-disabled': (boolean | "true" | "false") | undefined;
onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
onFocus: (event: React.FocusEvent<HTMLButtonElement>) => void;
};
export {};

View file

@ -0,0 +1,62 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useRegisterToolbarButton = useRegisterToolbarButton;
var React = _interopRequireWildcard(require("react"));
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
var _ToolbarContext = require("./ToolbarContext");
function useRegisterToolbarButton(props, ref) {
const {
onKeyDown,
onFocus,
disabled,
'aria-disabled': ariaDisabled
} = props;
const id = (0, _useId.default)();
const {
focusableItemId,
registerItem,
unregisterItem,
onItemKeyDown,
onItemFocus,
onItemDisabled
} = (0, _ToolbarContext.useToolbarContext)();
const handleKeyDown = event => {
onItemKeyDown(event);
onKeyDown?.(event);
};
const handleFocus = event => {
onItemFocus(id);
onFocus?.(event);
};
React.useEffect(() => {
registerItem(id, ref);
return () => unregisterItem(id);
}, [id, ref, registerItem, unregisterItem]);
const previousDisabled = React.useRef(disabled);
React.useEffect(() => {
if (previousDisabled.current !== disabled && disabled === true) {
onItemDisabled(id, disabled);
}
previousDisabled.current = disabled;
}, [disabled, id, onItemDisabled]);
const previousAriaDisabled = React.useRef(ariaDisabled);
React.useEffect(() => {
if (previousAriaDisabled.current !== ariaDisabled && ariaDisabled === true) {
onItemDisabled(id, true);
}
previousAriaDisabled.current = ariaDisabled;
}, [ariaDisabled, id, onItemDisabled]);
return {
tabIndex: focusableItemId === id ? 0 : -1,
disabled,
'aria-disabled': ariaDisabled,
onKeyDown: handleKeyDown,
onFocus: handleFocus
};
}

View file

@ -0,0 +1,29 @@
export type EventListener = (...args: any[]) => void;
export interface EventListenerOptions {
isFirst?: boolean;
}
interface EventListenerCollection {
/**
* List of listeners to run before the others
* They are run in the opposite order of the registration order
*/
highPriority: Map<EventListener, true>;
/**
* List of events to run after the high priority listeners
* They are run in the registration order
*/
regular: Map<EventListener, true>;
}
export declare class EventManager {
maxListeners: number;
warnOnce: boolean;
events: {
[eventName: string]: EventListenerCollection;
};
on(eventName: string, listener: EventListener, options?: EventListenerOptions): void;
removeListener(eventName: string, listener: EventListener): void;
removeAllListeners(): void;
emit(eventName: string, ...args: any[]): void;
once(eventName: string, listener: EventListener): void;
}
export {};

View file

@ -0,0 +1,67 @@
// Used https://gist.github.com/mudge/5830382 as a starting point.
// See https://github.com/browserify/events/blob/master/events.js for
// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.
export class EventManager {
maxListeners = 20;
warnOnce = false;
events = {};
on(eventName, listener, options = {}) {
let collection = this.events[eventName];
if (!collection) {
collection = {
highPriority: new Map(),
regular: new Map()
};
this.events[eventName] = collection;
}
if (options.isFirst) {
collection.highPriority.set(listener, true);
} else {
collection.regular.set(listener, true);
}
if (process.env.NODE_ENV !== 'production') {
const collectionSize = collection.highPriority.size + collection.regular.size;
if (collectionSize > this.maxListeners && !this.warnOnce) {
this.warnOnce = true;
console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`].join('\n'));
}
}
}
removeListener(eventName, listener) {
if (this.events[eventName]) {
this.events[eventName].regular.delete(listener);
this.events[eventName].highPriority.delete(listener);
}
}
removeAllListeners() {
this.events = {};
}
emit(eventName, ...args) {
const collection = this.events[eventName];
if (!collection) {
return;
}
const highPriorityListeners = Array.from(collection.highPriority.keys());
const regularListeners = Array.from(collection.regular.keys());
for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {
const listener = highPriorityListeners[i];
if (collection.highPriority.has(listener)) {
listener.apply(this, args);
}
}
for (let i = 0; i < regularListeners.length; i += 1) {
const listener = regularListeners[i];
if (collection.regular.has(listener)) {
listener.apply(this, args);
}
}
}
once(eventName, listener) {
// eslint-disable-next-line consistent-this
const that = this;
this.on(eventName, function oneTimeListener(...args) {
that.removeListener(eventName, oneTimeListener);
listener.apply(that, args);
});
}
}

View file

@ -0,0 +1,2 @@
export { EventManager } from "./EventManager.js";
export type { EventListenerOptions } from "./EventManager.js";

View file

@ -0,0 +1 @@
export { EventManager } from "./EventManager.js";

View file

@ -0,0 +1,14 @@
import * as React from 'react';
export interface ToolbarContextValue {
focusableItemId: string | null;
registerItem: (id: string, ref: React.RefObject<HTMLButtonElement | null>) => void;
unregisterItem: (id: string) => void;
onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
onItemFocus: (id: string) => void;
onItemDisabled: (id: string, disabled: boolean) => void;
}
export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
export declare function useToolbarContext(): ToolbarContextValue;
export declare function ToolbarContextProvider({
children
}: React.PropsWithChildren): React.JSX.Element;

View file

@ -0,0 +1,163 @@
'use client';
import * as React from 'react';
import { jsx as _jsx } from "react/jsx-runtime";
export const ToolbarContext = /*#__PURE__*/React.createContext(undefined);
if (process.env.NODE_ENV !== "production") ToolbarContext.displayName = "ToolbarContext";
export function useToolbarContext() {
const context = React.useContext(ToolbarContext);
if (context === undefined) {
throw new Error('MUI X: Missing context. Toolbar subcomponents must be placed within a <Toolbar /> component.');
}
return context;
}
export function ToolbarContextProvider({
children
}) {
const [focusableItemId, setFocusableItemId] = React.useState(null);
const focusableItemIdRef = React.useRef(focusableItemId);
const [items, setItems] = React.useState([]);
const getSortedItems = React.useCallback(() => items.sort(sortByDocumentPosition), [items]);
const findEnabledItem = React.useCallback((startIndex, step, wrap = true) => {
let index = startIndex;
const sortedItems = getSortedItems();
const itemCount = sortedItems.length;
// Look for enabled items in the specified direction
for (let i = 0; i < itemCount; i += 1) {
index += step;
// Handle wrapping around the ends
if (index >= itemCount) {
if (!wrap) {
return -1;
}
index = 0;
} else if (index < 0) {
if (!wrap) {
return -1;
}
index = itemCount - 1;
}
// Return if we found an enabled item
if (!sortedItems[index].ref.current?.disabled && sortedItems[index].ref.current?.ariaDisabled !== 'true') {
return index;
}
}
// If we've checked all items and found none enabled
return -1;
}, [getSortedItems]);
const registerItem = React.useCallback((id, itemRef) => {
setItems(prevItems => [...prevItems, {
id,
ref: itemRef
}]);
}, []);
const unregisterItem = React.useCallback(id => {
setItems(prevItems => prevItems.filter(i => i.id !== id));
}, []);
const onItemKeyDown = React.useCallback(event => {
if (!focusableItemId) {
return;
}
const sortedItems = getSortedItems();
const focusableItemIndex = sortedItems.findIndex(item => item.id === focusableItemId);
let newIndex = -1;
if (event.key === 'ArrowRight') {
event.preventDefault();
newIndex = findEnabledItem(focusableItemIndex, 1);
} else if (event.key === 'ArrowLeft') {
event.preventDefault();
newIndex = findEnabledItem(focusableItemIndex, -1);
} else if (event.key === 'Home') {
event.preventDefault();
newIndex = findEnabledItem(-1, 1, false);
} else if (event.key === 'End') {
event.preventDefault();
newIndex = findEnabledItem(sortedItems.length, -1, false);
}
// TODO: Check why this is necessary
if (newIndex >= 0 && newIndex < sortedItems.length) {
const item = sortedItems[newIndex];
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}, [getSortedItems, focusableItemId, findEnabledItem]);
const onItemFocus = React.useCallback(id => {
if (focusableItemId !== id) {
setFocusableItemId(id);
}
}, [focusableItemId, setFocusableItemId]);
const onItemDisabled = React.useCallback(id => {
const sortedItems = getSortedItems();
const currentIndex = sortedItems.findIndex(item => item.id === id);
const newIndex = findEnabledItem(currentIndex, 1);
if (newIndex >= 0 && newIndex < sortedItems.length) {
const item = sortedItems[newIndex];
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}, [getSortedItems, findEnabledItem]);
React.useEffect(() => {
focusableItemIdRef.current = focusableItemId;
}, [focusableItemId]);
React.useEffect(() => {
const sortedItems = getSortedItems();
if (sortedItems.length > 0) {
// Set initial focusable item
if (!focusableItemIdRef.current) {
setFocusableItemId(sortedItems[0].id);
return;
}
const focusableItemIndex = sortedItems.findIndex(item => item.id === focusableItemIdRef.current);
if (!sortedItems[focusableItemIndex]) {
// Last item has been removed from the items array
const item = sortedItems[sortedItems.length - 1];
if (item) {
setFocusableItemId(item.id);
item.ref.current?.focus();
}
} else if (focusableItemIndex === -1) {
// Focused item has been removed from the items array
const item = sortedItems[focusableItemIndex];
if (item) {
setFocusableItemId(item.id);
item.ref.current?.focus();
}
}
}
}, [getSortedItems, findEnabledItem]);
const contextValue = React.useMemo(() => ({
focusableItemId,
registerItem,
unregisterItem,
onItemKeyDown,
onItemFocus,
onItemDisabled
}), [focusableItemId, registerItem, unregisterItem, onItemKeyDown, onItemFocus, onItemDisabled]);
return /*#__PURE__*/_jsx(ToolbarContext.Provider, {
value: contextValue,
children: children
});
}
/* eslint-disable no-bitwise */
function sortByDocumentPosition(a, b) {
if (!a.ref.current || !b.ref.current) {
return 0;
}
const position = a.ref.current.compareDocumentPosition(b.ref.current);
if (!position) {
return 0;
}
if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
return -1;
}
if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
return 1;
}
return 0;
}

View file

@ -0,0 +1,2 @@
export * from "./ToolbarContext.js";
export * from "./useRegisterToolbarButton.js";

View file

@ -0,0 +1,2 @@
export * from "./ToolbarContext.js";
export * from "./useRegisterToolbarButton.js";

View file

@ -0,0 +1,10 @@
import * as React from 'react';
interface ToolbarItemProps extends Pick<React.ComponentProps<'button'>, 'onKeyDown' | 'onFocus' | 'aria-disabled' | 'disabled'> {}
export declare function useRegisterToolbarButton(props: ToolbarItemProps, ref: React.RefObject<HTMLButtonElement | null>): {
tabIndex: number;
disabled: boolean | undefined;
'aria-disabled': (boolean | "true" | "false") | undefined;
onKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
onFocus: (event: React.FocusEvent<HTMLButtonElement>) => void;
};
export {};

View file

@ -0,0 +1,55 @@
'use client';
import * as React from 'react';
import useId from '@mui/utils/useId';
import { useToolbarContext } from "./ToolbarContext.js";
export function useRegisterToolbarButton(props, ref) {
const {
onKeyDown,
onFocus,
disabled,
'aria-disabled': ariaDisabled
} = props;
const id = useId();
const {
focusableItemId,
registerItem,
unregisterItem,
onItemKeyDown,
onItemFocus,
onItemDisabled
} = useToolbarContext();
const handleKeyDown = event => {
onItemKeyDown(event);
onKeyDown?.(event);
};
const handleFocus = event => {
onItemFocus(id);
onFocus?.(event);
};
React.useEffect(() => {
registerItem(id, ref);
return () => unregisterItem(id);
}, [id, ref, registerItem, unregisterItem]);
const previousDisabled = React.useRef(disabled);
React.useEffect(() => {
if (previousDisabled.current !== disabled && disabled === true) {
onItemDisabled(id, disabled);
}
previousDisabled.current = disabled;
}, [disabled, id, onItemDisabled]);
const previousAriaDisabled = React.useRef(ariaDisabled);
React.useEffect(() => {
if (previousAriaDisabled.current !== ariaDisabled && ariaDisabled === true) {
onItemDisabled(id, true);
}
previousAriaDisabled.current = ariaDisabled;
}, [ariaDisabled, id, onItemDisabled]);
return {
tabIndex: focusableItemId === id ? 0 : -1,
disabled,
'aria-disabled': ariaDisabled,
onKeyDown: handleKeyDown,
onFocus: handleFocus
};
}

1
node_modules/@mui/x-internals/esm/export/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export { loadStyleSheets } from "./loadStyleSheets.js";

1
node_modules/@mui/x-internals/esm/export/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
export { loadStyleSheets } from "./loadStyleSheets.js";

View file

@ -0,0 +1,7 @@
/**
* Loads all stylesheets from the given root element into the document.
* @returns an array of promises that resolve when each stylesheet is loaded
* @param document Document to load stylesheets into
* @param root Document or ShadowRoot to load stylesheets from
*/
export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot): Promise<void>[];

View file

@ -0,0 +1,42 @@
/**
* Loads all stylesheets from the given root element into the document.
* @returns an array of promises that resolve when each stylesheet is loaded
* @param document Document to load stylesheets into
* @param root Document or ShadowRoot to load stylesheets from
*/
export function loadStyleSheets(document, root) {
const stylesheetLoadPromises = [];
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
for (let i = 0; i < headStyleElements.length; i += 1) {
const node = headStyleElements[i];
if (node.tagName === 'STYLE') {
const newHeadStyleElements = document.createElement(node.tagName);
const sheet = node.sheet;
if (sheet) {
let styleCSS = '';
for (let j = 0; j < sheet.cssRules.length; j += 1) {
if (typeof sheet.cssRules[j].cssText === 'string') {
styleCSS += `${sheet.cssRules[j].cssText}\r\n`;
}
}
newHeadStyleElements.appendChild(document.createTextNode(styleCSS));
document.head.appendChild(newHeadStyleElements);
}
} else if (node.getAttribute('href')) {
// If `href` tag is empty, avoid loading these links
const newHeadStyleElements = document.createElement(node.tagName);
for (let j = 0; j < node.attributes.length; j += 1) {
const attr = node.attributes[j];
if (attr) {
newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');
}
}
stylesheetLoadPromises.push(new Promise(resolve => {
newHeadStyleElements.addEventListener('load', () => resolve());
}));
document.head.appendChild(newHeadStyleElements);
}
}
return stylesheetLoadPromises;
}

View file

@ -0,0 +1,12 @@
/**
* A fast array comparison function that compares two arrays for equality.
*
* Assumes that the arrays are ordered and contain only primitive values.
*
* It is faster than `fastObjectShallowCompare` for arrays.
*
* Returns true for instance equality, even if inputs are not arrays.
*
* @returns true if arrays contain the same elements in the same order, false otherwise.
*/
export declare function fastArrayCompare<T>(a: T, b: T): boolean;

View file

@ -0,0 +1,31 @@
/**
* A fast array comparison function that compares two arrays for equality.
*
* Assumes that the arrays are ordered and contain only primitive values.
*
* It is faster than `fastObjectShallowCompare` for arrays.
*
* Returns true for instance equality, even if inputs are not arrays.
*
* @returns true if arrays contain the same elements in the same order, false otherwise.
*/
export function fastArrayCompare(a, b) {
if (a === b) {
return true;
}
if (!Array.isArray(a) || !Array.isArray(b)) {
return false;
}
let i = a.length;
if (i !== b.length) {
return false;
}
// eslint-disable-next-line no-plusplus
while (i--) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}

View file

@ -0,0 +1 @@
export { fastArrayCompare } from "./fastArrayCompare.js";

View file

@ -0,0 +1 @@
export { fastArrayCompare } from "./fastArrayCompare.js";

View file

@ -0,0 +1 @@
export declare function fastMemo<T>(component: T): T;

View file

@ -0,0 +1,5 @@
import * as React from 'react';
import { fastObjectShallowCompare } from "../fastObjectShallowCompare/index.js";
export function fastMemo(component) {
return /*#__PURE__*/React.memo(component, fastObjectShallowCompare);
}

View file

@ -0,0 +1 @@
export { fastMemo } from "./fastMemo.js";

1
node_modules/@mui/x-internals/esm/fastMemo/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
export { fastMemo } from "./fastMemo.js";

View file

@ -0,0 +1,5 @@
/**
* Fast shallow compare for objects.
* @returns true if objects are equal.
*/
export declare function fastObjectShallowCompare<T extends Record<string, any> | null>(a: T, b: T): boolean;

View file

@ -0,0 +1,33 @@
const is = Object.is;
/**
* Fast shallow compare for objects.
* @returns true if objects are equal.
*/
export function fastObjectShallowCompare(a, b) {
if (a === b) {
return true;
}
if (!(a instanceof Object) || !(b instanceof Object)) {
return false;
}
let aLength = 0;
let bLength = 0;
/* eslint-disable guard-for-in */
for (const key in a) {
aLength += 1;
if (!is(a[key], b[key])) {
return false;
}
if (!(key in b)) {
return false;
}
}
/* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
for (const _ in b) {
bLength += 1;
}
return aLength === bLength;
}

View file

@ -0,0 +1 @@
export { fastObjectShallowCompare } from "./fastObjectShallowCompare.js";

View file

@ -0,0 +1 @@
export { fastObjectShallowCompare } from "./fastObjectShallowCompare.js";

View file

@ -0,0 +1,4 @@
import * as React from 'react';
export declare const forwardRef: <T, P = {}>(render: React.ForwardRefRenderFunction<T, P & {
ref: React.Ref<T>;
}>) => React.ForwardRefExoticComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;

View file

@ -0,0 +1,16 @@
import * as React from 'react';
import reactMajor from "../reactMajor/index.js";
// Compatibility shim that ensures stable props object for forwardRef components
// Fixes https://github.com/facebook/react/issues/31613
// We ensure that the ref is always present in the props object (even if that's not the case for older versions of React) to avoid the footgun of spreading props over the ref in the newer versions of React.
// Footgun: <Component ref={ref} {...props} /> will break past React 19, but the types will now warn us that we should use <Component {...props} ref={ref} /> instead.
export const forwardRef = render => {
if (reactMajor >= 19) {
const Component = props => render(props, props.ref ?? null);
Component.displayName = render.displayName ?? render.name;
return Component;
}
return /*#__PURE__*/React.forwardRef(render);
};
if (process.env.NODE_ENV !== "production") forwardRef.displayName = "forwardRef";

View file

@ -0,0 +1 @@
export * from "./forwardRef.js";

View file

@ -0,0 +1 @@
export * from "./forwardRef.js";

6
node_modules/@mui/x-internals/esm/hash/hash.d.ts generated vendored Normal file
View file

@ -0,0 +1,6 @@
export declare const hash: typeof xxh;
/**
* Returns an xxh hash of `input` formatted as a decimal string.
*/
declare function xxh(input: string): string;
export {};

61
node_modules/@mui/x-internals/esm/hash/hash.js generated vendored Normal file
View file

@ -0,0 +1,61 @@
const encoder = new TextEncoder();
// bufferLength must be a multiple of 4 to satisfy Int32Array constraints
let bufferLength = 2 * 1024;
let buffer = new ArrayBuffer(bufferLength);
let uint8View = new Uint8Array(buffer);
let int32View = new Int32Array(buffer);
export const hash = xxh;
/**
* Returns an xxh hash of `input` formatted as a decimal string.
*/
// prettier-ignore
function xxh(input) {
/* eslint-disable no-bitwise */
// Worst-case scenario: full string of 2-byte characters
const requiredLength = input.length * 2;
if (requiredLength > bufferLength) {
// buffer.resize() is only available in recent browsers, so we re-allocate
// a new and views
bufferLength = requiredLength + (4 - requiredLength % 4);
buffer = new ArrayBuffer(bufferLength);
uint8View = new Uint8Array(buffer);
int32View = new Int32Array(buffer);
}
const length8 = encoder.encodeInto(input, uint8View).written;
const seed = 0;
const len = length8 | 0;
let i = 0;
let h = (seed + len | 0) + 0x165667B1 | 0;
if (len < 16) {
for (; (i + 3 | 0) < len; i = i + 4 | 0) {
h = Math.imul(rotl32(h + Math.imul(int32View[i] | 0, 0xC2B2AE3D) | 0, 17) | 0, 0x27D4EB2F);
}
} else {
let v0 = seed + 0x24234428 | 0;
let v1 = seed + 0x85EBCA77 | 0;
let v2 = seed;
let v3 = seed - 0x9E3779B1 | 0;
for (; (i + 15 | 0) < len; i = i + 16 | 0) {
v0 = Math.imul(rotl32(v0 + Math.imul(int32View[i + 0 | 0] | 0, 0x85EBCA77) | 0, 13) | 0, 0x9E3779B1);
v1 = Math.imul(rotl32(v1 + Math.imul(int32View[i + 4 | 0] | 0, 0x85EBCA77) | 0, 13) | 0, 0x9E3779B1);
v2 = Math.imul(rotl32(v2 + Math.imul(int32View[i + 8 | 0] | 0, 0x85EBCA77) | 0, 13) | 0, 0x9E3779B1);
v3 = Math.imul(rotl32(v3 + Math.imul(int32View[i + 12 | 0] | 0, 0x85EBCA77) | 0, 13) | 0, 0x9E3779B1);
}
h = (((rotl32(v0, 1) | 0 + rotl32(v1, 7) | 0) + rotl32(v2, 12) | 0) + rotl32(v3, 18) | 0) + len | 0;
for (; (i + 3 | 0) < len; i = i + 4 | 0) {
h = Math.imul(rotl32(h + Math.imul(int32View[i] | 0, 0xC2B2AE3D) | 0, 17) | 0, 0x27D4EB2F);
}
}
for (; i < len; i = i + 1 | 0) {
h = Math.imul(rotl32(h + Math.imul(uint8View[i] | 0, 0x165667B1) | 0, 11) | 0, 0x9E3779B1);
}
h = Math.imul(h ^ h >>> 15, 0x85EBCA77);
h = Math.imul(h ^ h >>> 13, 0xC2B2AE3D);
return ((h ^ h >>> 16) >>> 0).toString();
}
function rotl32(x, r) {
return x << r | x >>> 32 - r;
}

2
node_modules/@mui/x-internals/esm/hash/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
export * from "./hash.js";
export * from "./stringify.js";

2
node_modules/@mui/x-internals/esm/hash/index.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
export * from "./hash.js";
export * from "./stringify.js";

View file

@ -0,0 +1,6 @@
/**
* A JSON.stringify that handles circular references safely.
* Fixes: https://github.com/mui/mui-x/issues/17521
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
*/
export declare function stringify(input: object | string | number | null): string;

21
node_modules/@mui/x-internals/esm/hash/stringify.js generated vendored Normal file
View file

@ -0,0 +1,21 @@
/**
* A JSON.stringify that handles circular references safely.
* Fixes: https://github.com/mui/mui-x/issues/17521
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
*/
export function stringify(input) {
const seen = new WeakSet();
return JSON.stringify(input, (_, v) => {
// https://github.com/mui/mui-x/issues/17855
if (typeof window !== 'undefined' && v === window || typeof document !== 'undefined' && v === document) {
return v.toString();
}
if (v !== null && typeof v === 'object') {
if (seen.has(v)) {
return null;
}
seen.add(v);
}
return v;
});
}

View file

@ -0,0 +1 @@
export * from "./isDeepEqual.js";

View file

@ -0,0 +1 @@
export * from "./isDeepEqual.js";

View file

@ -0,0 +1,29 @@
/**
* Based on `fast-deep-equal`
*
* MIT License
*
* Copyright (c) 2017 Evgeny Poberezkin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* Check if two values are deeply equal.
*/
export declare function isDeepEqual<T>(actual: any, expected: T): actual is T;

View file

@ -0,0 +1,124 @@
/**
* Based on `fast-deep-equal`
*
* MIT License
*
* Copyright (c) 2017 Evgeny Poberezkin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* Check if two values are deeply equal.
*/
export function isDeepEqual(a, b) {
if (a === b) {
return true;
}
if (a && b && typeof a === 'object' && typeof b === 'object') {
if (a.constructor !== b.constructor) {
return false;
}
if (Array.isArray(a)) {
const length = a.length;
if (length !== b.length) {
return false;
}
for (let i = 0; i < length; i += 1) {
if (!isDeepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
if (a instanceof Map && b instanceof Map) {
if (a.size !== b.size) {
return false;
}
const entriesA = Array.from(a.entries());
for (let i = 0; i < entriesA.length; i += 1) {
if (!b.has(entriesA[i][0])) {
return false;
}
}
for (let i = 0; i < entriesA.length; i += 1) {
const entryA = entriesA[i];
if (!isDeepEqual(entryA[1], b.get(entryA[0]))) {
return false;
}
}
return true;
}
if (a instanceof Set && b instanceof Set) {
if (a.size !== b.size) {
return false;
}
const entries = Array.from(a.entries());
for (let i = 0; i < entries.length; i += 1) {
if (!b.has(entries[i][0])) {
return false;
}
}
return true;
}
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
const length = a.length;
if (length !== b.length) {
return false;
}
for (let i = 0; i < length; i += 1) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
if (a.constructor === RegExp) {
return a.source === b.source && a.flags === b.flags;
}
if (a.valueOf !== Object.prototype.valueOf) {
return a.valueOf() === b.valueOf();
}
if (a.toString !== Object.prototype.toString) {
return a.toString() === b.toString();
}
const keys = Object.keys(a);
const length = keys.length;
if (length !== Object.keys(b).length) {
return false;
}
for (let i = 0; i < length; i += 1) {
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {
return false;
}
}
for (let i = 0; i < length; i += 1) {
const key = keys[i];
if (!isDeepEqual(a[key], b[key])) {
return false;
}
}
return true;
}
// true if both NaN, false otherwise
// eslint-disable-next-line no-self-compare
return a !== a && b !== b;
}

View file

@ -0,0 +1 @@
export { isObjectEmpty } from "./isObjectEmpty.js";

View file

@ -0,0 +1 @@
export { isObjectEmpty } from "./isObjectEmpty.js";

View file

@ -0,0 +1 @@
export declare function isObjectEmpty(object: any): boolean;

View file

@ -0,0 +1,7 @@
export function isObjectEmpty(object) {
// eslint-disable-next-line
for (const _ in object) {
return false;
}
return true;
}

View file

@ -0,0 +1 @@
export { lruMemoize } from 'reselect';

View file

@ -0,0 +1 @@
export { lruMemoize } from 'reselect';

1
node_modules/@mui/x-internals/esm/math/index.d.ts generated vendored Normal file
View file

@ -0,0 +1 @@
export declare function roundToDecimalPlaces(value: number, decimals: number): number;

3
node_modules/@mui/x-internals/esm/math/index.js generated vendored Normal file
View file

@ -0,0 +1,3 @@
export function roundToDecimalPlaces(value, decimals) {
return Math.round(value * 10 ** decimals) / 10 ** decimals;
}

1
node_modules/@mui/x-internals/esm/package.json generated vendored Normal file
View file

@ -0,0 +1 @@
{"type":"module","sideEffects":false}

View file

@ -0,0 +1,7 @@
export declare const isFirefox: boolean;
export declare const isJSDOM: boolean;
declare const _default: {
isFirefox: boolean;
isJSDOM: boolean;
};
export default _default;

7
node_modules/@mui/x-internals/esm/platform/index.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : 'empty';
export const isFirefox = userAgent.includes('firefox');
export const isJSDOM = typeof window !== 'undefined' && /jsdom|HappyDOM/.test(window.navigator.userAgent);
export default {
isFirefox,
isJSDOM
};

View file

@ -0,0 +1 @@
export * from "./rafThrottle.js";

View file

@ -0,0 +1 @@
export * from "./rafThrottle.js";

View file

@ -0,0 +1,16 @@
export interface Cancelable {
clear(): void;
}
/**
* Creates a throttled function that only invokes `fn` at most once per animation frame.
*
* @example
* ```ts
* const throttled = rafThrottle((value: number) => console.log(value));
* window.addEventListener('scroll', (e) => throttled(e.target.scrollTop));
* ```
*
* @param fn Callback function
* @return The `requestAnimationFrame` throttled function
*/
export declare function rafThrottle<T extends (...args: any[]) => any>(fn: T): T & Cancelable;

View file

@ -0,0 +1,33 @@
/**
* Creates a throttled function that only invokes `fn` at most once per animation frame.
*
* @example
* ```ts
* const throttled = rafThrottle((value: number) => console.log(value));
* window.addEventListener('scroll', (e) => throttled(e.target.scrollTop));
* ```
*
* @param fn Callback function
* @return The `requestAnimationFrame` throttled function
*/
export function rafThrottle(fn) {
let lastArgs;
let rafRef;
const later = () => {
rafRef = null;
fn(...lastArgs);
};
function throttled(...args) {
lastArgs = args;
if (!rafRef) {
rafRef = requestAnimationFrame(later);
}
}
throttled.clear = () => {
if (rafRef) {
cancelAnimationFrame(rafRef);
rafRef = null;
}
};
return throttled;
}

View file

@ -0,0 +1,2 @@
declare const _default: number;
export default _default;

View file

@ -0,0 +1,2 @@
import * as React from 'react';
export default parseInt(React.version, 10);

2
node_modules/@mui/x-internals/esm/slots/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,2 @@
import * as React from 'react';
export type PropsFromSlot<Slot extends React.JSXElementConstructor<any> | React.ElementType | null | undefined> = NonNullable<Slot> extends React.ElementType<infer P> ? P : React.ComponentProps<NonNullable<Slot>>;

1
node_modules/@mui/x-internals/esm/slots/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

14
node_modules/@mui/x-internals/esm/store/Store.d.ts generated vendored Normal file
View file

@ -0,0 +1,14 @@
type Listener<T> = (value: T) => void;
export declare class Store<State> {
state: State;
private listeners;
private updateTick;
static create<T>(state: T): Store<T>;
constructor(state: State);
subscribe: (fn: Listener<State>) => () => void;
getSnapshot: () => State;
setState(newState: State): void;
update(changes: Partial<State>): void;
set<T>(key: keyof State, value: T): void;
}
export {};

57
node_modules/@mui/x-internals/esm/store/Store.js generated vendored Normal file
View file

@ -0,0 +1,57 @@
import _extends from "@babel/runtime/helpers/esm/extends";
/* eslint-disable no-cond-assign */
export class Store {
// HACK: `any` fixes adding listeners that accept partial state.
// Internal state to handle recursive `setState()` calls
static create(state) {
return new Store(state);
}
constructor(state) {
this.state = state;
this.listeners = new Set();
this.updateTick = 0;
}
subscribe = fn => {
this.listeners.add(fn);
return () => {
this.listeners.delete(fn);
};
};
getSnapshot = () => {
return this.state;
};
setState(newState) {
this.state = newState;
this.updateTick += 1;
const currentTick = this.updateTick;
const it = this.listeners.values();
let result;
while (result = it.next(), !result.done) {
if (currentTick !== this.updateTick) {
// If the tick has changed, a recursive `setState` call has been made,
// and it has already notified all listeners.
return;
}
const listener = result.value;
listener(newState);
}
}
update(changes) {
for (const key in changes) {
if (!Object.is(this.state[key], changes[key])) {
this.setState(_extends({}, this.state, changes));
return;
}
}
}
set(key, value) {
if (!Object.is(this.state[key], value)) {
this.setState(_extends({}, this.state, {
[key]: value
}));
}
}
}

View file

@ -0,0 +1,4 @@
import type { CreateSelectorFunction } from "./createSelectorType.js";
export type { CreateSelectorFunction } from "./createSelectorType.js";
export declare const createSelector: CreateSelectorFunction;
export declare const createSelectorMemoized: CreateSelectorFunction;

View file

@ -0,0 +1,139 @@
import { lruMemoize, createSelectorCreator } from 'reselect';
/* eslint-disable no-underscore-dangle */ // __cacheKey__
const reselectCreateSelector = createSelectorCreator({
memoize: lruMemoize,
memoizeOptions: {
maxSize: 1,
equalityCheck: Object.is
}
});
/* eslint-disable id-denylist */
export const createSelector = (a, b, c, d, e, f, ...other) => {
if (other.length > 0) {
throw new Error('Unsupported number of selectors');
}
let selector;
if (a && b && c && d && e && f) {
selector = (state, a1, a2, a3) => {
const va = a(state, a1, a2, a3);
const vb = b(state, a1, a2, a3);
const vc = c(state, a1, a2, a3);
const vd = d(state, a1, a2, a3);
const ve = e(state, a1, a2, a3);
return f(va, vb, vc, vd, ve, a1, a2, a3);
};
} else if (a && b && c && d && e) {
selector = (state, a1, a2, a3) => {
const va = a(state, a1, a2, a3);
const vb = b(state, a1, a2, a3);
const vc = c(state, a1, a2, a3);
const vd = d(state, a1, a2, a3);
return e(va, vb, vc, vd, a1, a2, a3);
};
} else if (a && b && c && d) {
selector = (state, a1, a2, a3) => {
const va = a(state, a1, a2, a3);
const vb = b(state, a1, a2, a3);
const vc = c(state, a1, a2, a3);
return d(va, vb, vc, a1, a2, a3);
};
} else if (a && b && c) {
selector = (state, a1, a2, a3) => {
const va = a(state, a1, a2, a3);
const vb = b(state, a1, a2, a3);
return c(va, vb, a1, a2, a3);
};
} else if (a && b) {
selector = (state, a1, a2, a3) => {
const va = a(state, a1, a2, a3);
return b(va, a1, a2, a3);
};
} else if (a) {
selector = a;
} else {
throw new Error('Missing arguments');
}
return selector;
};
/* eslint-enable id-denylist */
export const createSelectorMemoized = (...inputs) => {
const cache = new WeakMap();
let nextCacheId = 1;
const combiner = inputs[inputs.length - 1];
const nSelectors = inputs.length - 1 || 1;
// (s1, s2, ..., sN, a1, a2, a3) => { ... }
const argsLength = Math.max(combiner.length - nSelectors, 0);
if (argsLength > 3) {
throw new Error('Unsupported number of arguments');
}
// prettier-ignore
const selector = (state, a1, a2, a3) => {
let cacheKey = state.__cacheKey__;
if (!cacheKey) {
cacheKey = {
id: nextCacheId
};
state.__cacheKey__ = cacheKey;
nextCacheId += 1;
}
let fn = cache.get(cacheKey);
if (!fn) {
const selectors = inputs.length === 1 ? [x => x, combiner] : inputs;
let reselectArgs = inputs;
const selectorArgs = [undefined, undefined, undefined];
switch (argsLength) {
case 0:
break;
case 1:
{
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], combiner];
break;
}
case 2:
{
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], combiner];
break;
}
case 3:
{
reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], () => selectorArgs[2], combiner];
break;
}
default:
throw new Error('Unsupported number of arguments');
}
fn = reselectCreateSelector(...reselectArgs);
fn.selectorArgs = selectorArgs;
cache.set(cacheKey, fn);
}
/* eslint-disable no-fallthrough */
switch (argsLength) {
case 3:
fn.selectorArgs[2] = a3;
case 2:
fn.selectorArgs[1] = a2;
case 1:
fn.selectorArgs[0] = a1;
case 0:
default:
}
switch (argsLength) {
case 0:
return fn(state);
case 1:
return fn(state, a1);
case 2:
return fn(state, a1, a2);
case 3:
return fn(state, a1, a2, a3);
default:
throw new Error('unreachable');
}
};
return selector;
};

View file

@ -0,0 +1,9 @@
import type { Selector } from 'reselect';
export type CreateSelectorFunction = <const Args extends any[], const Selectors extends ReadonlyArray<Selector<any>>, const Combiner extends (...args: readonly [...ReturnTypes<Selectors>, ...Args]) => any>(...items: [...Selectors, Combiner]) => (...args: Selectors['length'] extends 0 ? MergeParams<ReturnTypes<Selectors>, Parameters<Combiner>> : [StateFromSelectorList<Selectors>, ...MergeParams<ReturnTypes<Selectors>, Parameters<Combiner>>]) => ReturnType<Combiner>;
type StateFromSelectorList<Selectors extends readonly any[]> = Selectors extends [f: infer F, ...other: infer R] ? StateFromSelector<F> extends StateFromSelectorList<R> ? StateFromSelector<F> : StateFromSelectorList<R> : {};
type StateFromSelector<T> = T extends ((first: infer F, ...args: any[]) => any) ? F : never;
type Fn = (...args: any[]) => any;
type ReturnTypes<FunctionsArray extends readonly Fn[]> = { [Index in keyof FunctionsArray]: FunctionsArray[Index] extends FunctionsArray[number] ? ReturnType<FunctionsArray[Index]> : never };
type MergeParams<STypes extends readonly unknown[], CTypes extends readonly unknown[]> = STypes['length'] extends 0 ? CTypes : MergeParams<DropFirst<STypes>, DropFirst<CTypes>>;
type DropFirst<T> = T extends [any, ...infer Xs] ? Xs : [];
export {};

View file

@ -0,0 +1 @@
export {};

4
node_modules/@mui/x-internals/esm/store/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,4 @@
export * from "./createSelector.js";
export * from "./useStore.js";
export * from "./useStoreEffect.js";
export * from "./Store.js";

4
node_modules/@mui/x-internals/esm/store/index.js generated vendored Normal file
View file

@ -0,0 +1,4 @@
export * from "./createSelector.js";
export * from "./useStore.js";
export * from "./useStoreEffect.js";
export * from "./Store.js";

View file

@ -0,0 +1,5 @@
import type { Store } from "./Store.js";
export declare function useStore<State, Value>(store: Store<State>, selector: (state: State) => Value): Value;
export declare function useStore<State, Value, A1>(store: Store<State>, selector: (state: State, a1: A1) => Value, a1: A1): Value;
export declare function useStore<State, Value, A1, A2>(store: Store<State>, selector: (state: State, a1: A1, a2: A2) => Value, a1: A1, a2: A2): Value;
export declare function useStore<State, Value, A1, A2, A3>(store: Store<State>, selector: (state: State, a1: A1, a2: A2, a3: A3) => Value, a1: A1, a2: A2, a3: A3): Value;

7
node_modules/@mui/x-internals/esm/store/useStore.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.
* More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';
export function useStore(store, selector, a1, a2, a3) {
const selectorWithArgs = state => selector(state, a1, a2, a3);
return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, selectorWithArgs);
}

View file

@ -0,0 +1,6 @@
import type { Store } from "./Store.js";
/**
* An Effect implementation for the Store. This should be used for side-effects only. To
* compute and store derived state, use `createSelectorMemoized` instead.
*/
export declare function useStoreEffect<State, Value>(store: Store<State>, selector: (state: State) => Value, effect: (previous: Value, next: Value) => void): void;

View file

@ -0,0 +1,48 @@
import useLazyRef from '@mui/utils/useLazyRef';
import useOnMount from '@mui/utils/useOnMount';
const noop = () => {};
/**
* An Effect implementation for the Store. This should be used for side-effects only. To
* compute and store derived state, use `createSelectorMemoized` instead.
*/
export function useStoreEffect(store, selector, effect) {
const instance = useLazyRef(initialize, {
store,
selector
}).current;
instance.effect = effect;
useOnMount(instance.onMount);
}
// `useLazyRef` typings are incorrect, `params` should not be optional
function initialize(params) {
const {
store,
selector
} = params;
let previousState = selector(store.state);
const instance = {
effect: noop,
dispose: null,
// We want a single subscription done right away and cleared on unmount only,
// but React triggers `useOnMount` multiple times in dev, so we need to manage
// the subscription anyway.
subscribe: () => {
instance.dispose ??= store.subscribe(state => {
const nextState = selector(state);
instance.effect(previousState, nextState);
previousState = nextState;
});
},
onMount: () => {
instance.subscribe();
return () => {
instance.dispose?.();
instance.dispose = null;
};
}
};
instance.subscribe();
return instance;
}

View file

@ -0,0 +1 @@
export * from "./throttle.js";

1
node_modules/@mui/x-internals/esm/throttle/index.js generated vendored Normal file
View file

@ -0,0 +1 @@
export * from "./throttle.js";

View file

@ -0,0 +1,4 @@
export interface Cancelable {
clear(): void;
}
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable;

19
node_modules/@mui/x-internals/esm/throttle/throttle.js generated vendored Normal file
View file

@ -0,0 +1,19 @@
export function throttle(func, wait = 166) {
let timeout;
let lastArgs;
const later = () => {
timeout = undefined;
func(...lastArgs);
};
function throttled(...args) {
lastArgs = args;
if (timeout === undefined) {
timeout = setTimeout(later, wait);
}
}
throttled.clear = () => {
clearTimeout(timeout);
timeout = undefined;
};
return throttled;
}

View file

@ -0,0 +1,11 @@
type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : S;
/**
* Append string P to all keys in T.
* If K is provided, only append P to keys in K.
*
* @template T - The type to append keys to.
* @template P - The string to append.
* @template K - The keys to append P to.
*/
export type AppendKeys<T, P extends string, K extends string = string> = { [key in keyof T as key extends K ? `${key}${CapitalizeFirstLetter<P>}` : key]: T[key] };
export {};

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,8 @@
/**
* Combines a type with required and additional properties.
*
* @template P - The original type.
* @template RequiredProps - The keys to make required.
* @template AdditionalProps - Additional properties to include.
*/
export type DefaultizedProps<P extends {}, RequiredProps extends keyof P, AdditionalProps extends {} = {}> = Omit<P, RequiredProps | keyof AdditionalProps> & Required<Pick<P, RequiredProps>> & AdditionalProps;

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,7 @@
/**
* Makes specified keys in a type optional.
*
* @template T - The original type.
* @template K - The keys to make optional.
*/
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,7 @@
/**
* Makes specified keys in a type required.
*
* @template T - The original type.
* @template K - The keys to make required.
*/
export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;

View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,5 @@
import * as React from 'react';
export type MuiBaseEvent = React.SyntheticEvent<HTMLElement> | DocumentEventMap[keyof DocumentEventMap] | {};
export type MuiEvent<E extends MuiBaseEvent = MuiBaseEvent> = E & {
defaultMuiPrevented?: boolean;
};

1
node_modules/@mui/x-internals/esm/types/MuiEvent.js generated vendored Normal file
View file

@ -0,0 +1 @@
export {};

View file

@ -0,0 +1,11 @@
type CapitalizeFirstLetter<S extends string> = S extends `${infer First}${infer Rest}` ? `${Uppercase<First>}${Rest}` : S;
/**
* Prepend string P to all keys in T.
* If K is provided, only prepend P to keys in K.
*
* @template T - The type to prepend keys to.
* @template P - The string to prepend.
* @template K - The keys to prepend P to.
*/
export type PrependKeys<T, P extends string, K extends string = string> = { [key in keyof T as key extends K ? `${P}${CapitalizeFirstLetter<key>}` : key]: T[key] };
export {};

View file

@ -0,0 +1 @@
export {};

Some files were not shown because too many files have changed in this diff Show more