tfy-web-components 0.0.14 → 0.0.16
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/{classNames-f3c6f58e.js → classNames-CC5emYUV.js} +1 -1
- package/dist/{classNames-f3c6f58e.js.map → classNames-CC5emYUV.js.map} +1 -1
- package/dist/colors.d.ts +2 -0
- package/dist/components/atoms/Button.es.js +1 -9
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/IconButton.es.js +1 -10
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.es.js +1 -5
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Spinner.es.js +1 -3
- package/dist/components/atoms/Spinner.es.js.map +1 -1
- package/dist/components/atoms/Tooltip.es.js +1 -3
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/CustomDrawer.es.js +2 -5
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/theme/backgroundColor.es.js.map +1 -1
- package/dist/components/theme/backgroundImage.es.js.map +1 -1
- package/dist/components/theme/colors.d.ts +2 -0
- package/dist/components/theme/colors.es.js +2 -0
- package/dist/components/theme/colors.es.js.map +1 -1
- package/dist/components/theme/dropShadow.es.js.map +1 -1
- package/dist/components/theme/keyframes.es.js.map +1 -1
- package/dist/components/theme/lightColorPlugin.es.js.map +1 -1
- package/dist/components/theme/theme.d.ts +21 -3
- package/dist/components/theme/theme.es.js +33 -9
- package/dist/components/theme/theme.es.js.map +1 -1
- package/dist/components/theme/useTheme.d.ts +3 -3
- package/dist/components/theme/useTheme.es.js +49 -15
- package/dist/components/theme/useTheme.es.js.map +1 -1
- package/dist/components/theme/utils.es.js +69 -111
- package/dist/components/theme/utils.es.js.map +1 -1
- package/dist/index.es.js +0 -6
- package/dist/index.es.js.map +1 -1
- package/dist/theme.d.ts +24 -3
- package/dist/useTheme.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.es.js","sources":["../../../src/components/theme/theme.ts"],"sourcesContent":["import { darkPalette, lightPalette } from './colors'\n\nexport type ThemeMode = 'light' | 'dark'\n\nexport type ThemeModePreference = ThemeMode | 'system'\n\nconst flattenTheme = (prefix: string, obj: any): Record<string, string> => {\n const vars: Record<string, string> = {}\n\n for (const key in obj) {\n const val = obj[key]\n const newKey = prefix ? `${prefix}-${key}` : key\n\n if (typeof val === 'string') {\n vars[`--color-${newKey}`] = val\n } else {\n Object.assign(vars, flattenTheme(newKey, val))\n }\n }\n\n return vars\n}\n\nexport const injectThemes = (lightTheme: any, darkTheme: any) => {\n const lightVars = flattenTheme('', lightTheme)\n const darkVars = flattenTheme('', darkTheme)\n\n // Remove existing theme styles if they exist\n const existingStyle = document.getElementById('theme-css-variables')\n if (existingStyle) {\n existingStyle.remove()\n }\n\n // Create CSS rules instead of inline styles\n const lightRules = Object.entries(lightVars)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join('\\n')\n\n const darkRules = Object.entries(darkVars)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join('\\n')\n\n const css = `\n:root {\n${lightRules}\n}\n\n.dark {\n${darkRules}\n}\n `\n\n // Inject CSS as a style element\n const styleElement = document.createElement('style')\n styleElement.id = 'theme-css-variables'\n styleElement.textContent = css\n document.head.appendChild(styleElement)\n}\n\nexport const getTailwindColors = () => {\n const processPalette = (prefix: string, obj: any): any => {\n const newObj: any = {}\n for (const key in obj) {\n const val = obj[key]\n const newKey = prefix ? `${prefix}-${key}` : key\n if (typeof val === 'string') {\n newObj[key] = `var(--color-${newKey})`\n } else {\n newObj[key] = processPalette(newKey, val)\n }\n }\n return newObj\n }\n\n return processPalette('', lightPalette)\n}\n\nexport const colors = getTailwindColors()\n\n/**\n * Check if running in browser environment\n */\nconst isBrowser = typeof window !== 'undefined'\n\n/**\n * Safe localStorage access with fallback\n */\nconst safeLocalStorage = {\n getItem: (key: string): string | null => {\n try {\n return isBrowser ? localStorage.getItem(key) : null\n } catch {\n return null\n }\n },\n setItem: (key: string, value: string): void => {\n try {\n if (isBrowser) {\n localStorage.setItem(key, value)\n }\n } catch {\n // Silent fail if localStorage is not available\n }\n },\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"theme.es.js","sources":["../../../src/components/theme/theme.ts"],"sourcesContent":["import { darkPalette, lightPalette } from './colors'\n\nexport type ThemeMode = 'light' | 'dark'\n\nexport type ThemeModePreference = ThemeMode | 'system'\n\nconst flattenTheme = (prefix: string, obj: any): Record<string, string> => {\n const vars: Record<string, string> = {}\n\n for (const key in obj) {\n const val = obj[key]\n const newKey = prefix ? `${prefix}-${key}` : key\n\n if (typeof val === 'string') {\n vars[`--color-${newKey}`] = val\n } else {\n Object.assign(vars, flattenTheme(newKey, val))\n }\n }\n\n return vars\n}\n\nexport const injectThemes = (lightTheme: any, darkTheme: any) => {\n const lightVars = flattenTheme('', lightTheme)\n const darkVars = flattenTheme('', darkTheme)\n\n // Remove existing theme styles if they exist\n const existingStyle = document.getElementById('theme-css-variables')\n if (existingStyle) {\n existingStyle.remove()\n }\n\n // Create CSS rules instead of inline styles\n const lightRules = Object.entries(lightVars)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join('\\n')\n\n const darkRules = Object.entries(darkVars)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join('\\n')\n\n const css = `\n:root {\n${lightRules}\n}\n\n.dark {\n${darkRules}\n}\n `\n\n // Inject CSS as a style element\n const styleElement = document.createElement('style')\n styleElement.id = 'theme-css-variables'\n styleElement.textContent = css\n document.head.appendChild(styleElement)\n}\n\nexport const getTailwindColors = () => {\n const processPalette = (prefix: string, obj: any): any => {\n const newObj: any = {}\n for (const key in obj) {\n const val = obj[key]\n const newKey = prefix ? `${prefix}-${key}` : key\n if (typeof val === 'string') {\n newObj[key] = `var(--color-${newKey})`\n } else {\n newObj[key] = processPalette(newKey, val)\n }\n }\n return newObj\n }\n\n return processPalette('', lightPalette)\n}\n\nexport const colors = getTailwindColors()\n\n/**\n * Check if running in browser environment\n */\nconst isBrowser = typeof window !== 'undefined'\n\n/**\n * Safe localStorage access with fallback\n */\nconst safeLocalStorage = {\n getItem: (key: string): string | null => {\n try {\n return isBrowser ? localStorage.getItem(key) : null\n } catch {\n return null\n }\n },\n setItem: (key: string, value: string): void => {\n try {\n if (isBrowser) {\n localStorage.setItem(key, value)\n }\n } catch {\n // Silent fail if localStorage is not available\n }\n },\n}\n\n/**\n * Get system theme preference\n * @returns 'light' or 'dark' based on system preference\n */\nexport const getSystemTheme = (): ThemeMode => {\n if (!isBrowser) return 'light'\n\n try {\n const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches\n return prefersDark ? 'dark' : 'light'\n } catch {\n return 'light'\n }\n}\n\n/**\n * Resolve theme preference to actual theme mode\n * @param preference - 'light', 'dark', or 'system'\n * @returns 'light' or 'dark'\n */\nexport const resolveThemeMode = (preference: ThemeModePreference): ThemeMode => {\n if (preference === 'system') {\n return getSystemTheme()\n }\n return preference\n}\n\n/**\n * Apply theme mode to DOM without persisting to localStorage\n * @param theme - 'light' or 'dark'\n */\nexport const applyThemeMode = (theme: ThemeMode): void => {\n if (!isBrowser) return\n\n try {\n document.documentElement.setAttribute('data-theme', theme)\n\n if (theme === 'dark') {\n document.documentElement.classList.add('dark')\n } else {\n document.documentElement.classList.remove('dark')\n }\n } catch (error) {\n console.warn('Failed to apply theme mode:', error)\n }\n}\n\n/**\n * Set theme mode (with localStorage persistence)\n * @param theme - 'light' or 'dark'\n * @deprecated Use applyThemeMode for backend-managed themes\n */\nexport const setThemeMode = (theme: ThemeMode): void => {\n if (!isBrowser) return\n\n try {\n applyThemeMode(theme)\n safeLocalStorage.setItem('theme-mode', theme)\n } catch (error) {\n console.warn('Failed to set theme mode:', error)\n }\n}\n\nexport const getThemeMode = (tenantPrefered: ThemeModePreference = 'system'): ThemeMode => {\n if (!isBrowser) return 'light'\n\n // Check stored preference\n const stored = safeLocalStorage.getItem('theme-mode')\n if (stored === 'light' || stored === 'dark') {\n return stored\n }\n\n if (tenantPrefered === 'light' || tenantPrefered === 'dark') {\n return tenantPrefered\n }\n\n try {\n const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches\n return prefersDark ? 'dark' : 'light'\n } catch {\n return 'light'\n }\n}\n\n/**\n * Toggle between light and dark themes\n */\nexport const toggleThemeMode = (): ThemeMode => {\n const current = getThemeMode()\n const newTheme: ThemeMode = current === 'light' ? 'dark' : 'light'\n setThemeMode(newTheme)\n return newTheme\n}\n\n/**\n * Initialize theme based on user preference\n * Call this once when your app starts\n * @param userPreference - User's theme preference from backend (defaults to 'system')\n */\nexport const initializeTheme = (userPreference: ThemeModePreference = 'system'): ThemeMode => {\n const resolvedTheme = resolveThemeMode(userPreference)\n if (isBrowser) {\n try {\n injectThemes(lightPalette, darkPalette)\n applyThemeMode(resolvedTheme)\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn('Failed to initialize theme:', error)\n }\n }\n return resolvedTheme\n}\n\n/**\n * Check if current theme is dark mode\n */\nexport const isDarkMode = (): boolean => {\n return getThemeMode() === 'dark'\n}\n"],"names":[],"mappings":";AAMA,MAAM,eAAe,CAAC,QAAgB,QAAqC;AACzE,QAAM,OAA+B,CAAA;AAErC,aAAW,OAAO,KAAK;AACrB,UAAM,MAAM,IAAI,GAAG;AACnB,UAAM,SAAS,SAAS,GAAG,MAAM,IAAI,GAAG,KAAK;AAE7C,QAAI,OAAO,QAAQ,UAAU;AAC3B,WAAK,WAAW,MAAM,EAAE,IAAI;AAAA,IAC9B,OAAO;AACL,aAAO,OAAO,MAAM,aAAa,QAAQ,GAAG,CAAC;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;AAEO,MAAM,eAAe,CAAC,YAAiB,cAAmB;AAC/D,QAAM,YAAY,aAAa,IAAI,UAAU;AAC7C,QAAM,WAAW,aAAa,IAAI,SAAS;AAG3C,QAAM,gBAAgB,SAAS,eAAe,qBAAqB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AM,kBAAkB,MAAiB;AAC9C,QAAM,UAAU,aAAA;AAChB,QAAM,WAAsB,YAAY,UAAU,SAAS;AAC3D,eAAa,QAAQ;AACrB,SAAO;AACT;AAOO,MAAM,kBAAkB,CAAC,iBAAsC,aAAwB;AAC5F,QAAM,gBAAgB,iBAAiB,cAAc;AACrD,MAAI,WAAW;AACb,QAAI;AACF,mBAAa,cAAc,WAAW;AACtC,qBAAe,aAAa;AAAA,IAC9B,SAAS,OAAO;AAEd,cAAQ,KAAK,+BAA+B,KAAK;AAAA,IACnD;AAAA,EACF;AACA,SAAO;AACT;AAKO,MAAM,aAAa,MAAe;AACvC,SAAO,mBAAmB;AAC5B;"}
|
|
@@ -2,13 +2,13 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import type { ThemeMode, ThemeModePreference } from './theme';
|
|
3
3
|
export interface UseThemeReturn {
|
|
4
4
|
mode: ThemeMode;
|
|
5
|
+
preference: ThemeModePreference;
|
|
5
6
|
isDark: boolean;
|
|
6
|
-
setTheme: (
|
|
7
|
-
toggleTheme: () => void;
|
|
7
|
+
setTheme: (preference: ThemeModePreference) => void;
|
|
8
|
+
toggleTheme: (theme: ThemeModePreference) => void;
|
|
8
9
|
}
|
|
9
10
|
interface ThemeProviderProps {
|
|
10
11
|
children: ReactNode;
|
|
11
|
-
tenantThemePreference?: ThemeModePreference;
|
|
12
12
|
}
|
|
13
13
|
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
14
14
|
export declare const useTheme: () => UseThemeReturn;
|
|
@@ -1,27 +1,61 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useState, useEffect, useCallback
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { createContext, useContext, useState, useEffect, useCallback } from "react";
|
|
3
|
+
import { resolveThemeMode, initializeTheme, applyThemeMode, getSystemTheme } from "./theme.es.js";
|
|
4
|
+
const THEME_STORAGE_KEY = "theme-preference";
|
|
5
|
+
const getStoredPreference = () => {
|
|
6
|
+
if (typeof window === "undefined") return "system";
|
|
7
|
+
const stored = localStorage.getItem(THEME_STORAGE_KEY);
|
|
8
|
+
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
9
|
+
return stored;
|
|
10
|
+
}
|
|
11
|
+
return "system";
|
|
12
|
+
};
|
|
5
13
|
const ThemeContext = createContext(void 0);
|
|
6
|
-
const ThemeProvider = ({ children
|
|
7
|
-
const [
|
|
14
|
+
const ThemeProvider = ({ children }) => {
|
|
15
|
+
const [preference, setPreference] = useState(getStoredPreference);
|
|
16
|
+
const [mode, setMode] = useState(() => resolveThemeMode(getStoredPreference()));
|
|
8
17
|
useEffect(() => {
|
|
9
|
-
const
|
|
10
|
-
|
|
18
|
+
const storedPref = getStoredPreference();
|
|
19
|
+
initializeTheme(preference);
|
|
20
|
+
const resolved = resolveThemeMode(storedPref);
|
|
21
|
+
applyThemeMode(resolved);
|
|
11
22
|
}, []);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (typeof window === "undefined") return;
|
|
25
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
26
|
+
const handleSystemThemeChange = () => {
|
|
27
|
+
if (preference === "system") {
|
|
28
|
+
const newMode = getSystemTheme();
|
|
29
|
+
setMode(newMode);
|
|
30
|
+
applyThemeMode(newMode);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
if (mediaQuery.addEventListener) {
|
|
34
|
+
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
35
|
+
} else {
|
|
36
|
+
mediaQuery.addListener(handleSystemThemeChange);
|
|
37
|
+
}
|
|
38
|
+
return () => {
|
|
39
|
+
if (mediaQuery.removeEventListener) {
|
|
40
|
+
mediaQuery.removeEventListener("change", handleSystemThemeChange);
|
|
41
|
+
} else {
|
|
42
|
+
mediaQuery.removeListener(handleSystemThemeChange);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}, [preference]);
|
|
46
|
+
const handleSetTheme = useCallback((newPreference) => {
|
|
47
|
+
setPreference(newPreference);
|
|
48
|
+
const resolvedMode = resolveThemeMode(newPreference);
|
|
49
|
+
setMode(resolvedMode);
|
|
50
|
+
applyThemeMode(resolvedMode);
|
|
51
|
+
localStorage.setItem(THEME_STORAGE_KEY, newPreference);
|
|
19
52
|
}, []);
|
|
20
53
|
const value = {
|
|
21
54
|
mode,
|
|
55
|
+
preference,
|
|
22
56
|
isDark: mode === "dark",
|
|
23
57
|
setTheme: handleSetTheme,
|
|
24
|
-
toggleTheme:
|
|
58
|
+
toggleTheme: handleSetTheme
|
|
25
59
|
};
|
|
26
60
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
27
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.es.js","sources":["../../../src/components/theme/useTheme.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext, useEffect, useState } from 'react'\n\nimport type { ThemeMode, ThemeModePreference } from './theme'\nimport {
|
|
1
|
+
{"version":3,"file":"useTheme.es.js","sources":["../../../src/components/theme/useTheme.tsx"],"sourcesContent":["import { createContext, ReactNode, useCallback, useContext, useEffect, useState } from 'react'\n\nimport type { ThemeMode, ThemeModePreference } from './theme'\nimport { applyThemeMode, getSystemTheme, initializeTheme, resolveThemeMode } from './theme'\n\nconst THEME_STORAGE_KEY = 'theme-preference'\n\nconst getStoredPreference = (): ThemeModePreference => {\n if (typeof window === 'undefined') return 'system'\n const stored = localStorage.getItem(THEME_STORAGE_KEY)\n if (stored === 'light' || stored === 'dark' || stored === 'system') {\n return stored\n }\n return 'system'\n}\n\nexport interface UseThemeReturn {\n mode: ThemeMode\n preference: ThemeModePreference\n isDark: boolean\n setTheme: (preference: ThemeModePreference) => void\n toggleTheme: (theme: ThemeModePreference) => void\n}\n\ninterface ThemeProviderProps {\n children: ReactNode\n}\n\n// Create the theme context\nconst ThemeContext = createContext<UseThemeReturn | undefined>(undefined)\n\n// Theme Provider component\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {\n const [preference, setPreference] = useState<ThemeModePreference>(getStoredPreference)\n\n // Track the resolved theme mode (light or dark)\n const [mode, setMode] = useState<ThemeMode>(() => resolveThemeMode(getStoredPreference()))\n\n // Initialize theme on mount\n useEffect(() => {\n const storedPref = getStoredPreference()\n initializeTheme(preference)\n const resolved = resolveThemeMode(storedPref)\n applyThemeMode(resolved)\n }, [])\n\n // Listen for system theme changes when preference is 'system'\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')\n\n const handleSystemThemeChange = () => {\n // Only respond to system changes if current preference is 'system'\n if (preference === 'system') {\n const newMode = getSystemTheme()\n setMode(newMode)\n applyThemeMode(newMode)\n }\n }\n\n // Listen for changes\n if (mediaQuery.addEventListener) {\n mediaQuery.addEventListener('change', handleSystemThemeChange)\n } else {\n // Fallback for older browsers\n mediaQuery.addListener(handleSystemThemeChange)\n }\n\n return () => {\n if (mediaQuery.removeEventListener) {\n mediaQuery.removeEventListener('change', handleSystemThemeChange)\n } else {\n mediaQuery.removeListener(handleSystemThemeChange)\n }\n }\n }, [preference])\n\n const handleSetTheme = useCallback((newPreference: ThemeModePreference) => {\n setPreference(newPreference)\n const resolvedMode = resolveThemeMode(newPreference)\n setMode(resolvedMode)\n applyThemeMode(resolvedMode)\n\n // Save to localStorage\n localStorage.setItem(THEME_STORAGE_KEY, newPreference)\n }, [])\n\n const value: UseThemeReturn = {\n mode,\n preference,\n isDark: mode === 'dark',\n setTheme: handleSetTheme,\n toggleTheme: handleSetTheme,\n }\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\n// Hook to use the theme context\nexport const useTheme = (): UseThemeReturn => {\n const context = useContext(ThemeContext)\n\n if (context === undefined) {\n throw new Error('useTheme must be used within a ThemeProvider')\n }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a;AACnD,YAAQ,YAAY;AACpB,mBAAe,YAAY;AAG3B,iBAAa,QAAQ,mBAAmB,aAAa;AAAA,EACvD,GAAG,CAAA,CAAE;AAEL,QAAM,QAAwB;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,QAAQ,SAAS;AAAA,IACjB,UAAU;AAAA,IACV,aAAa;AAAA,EAAA;AAGf,SAAO,oBAAC,aAAa,UAAb,EAAsB,OAAe,SAAA,CAAS;AACxD;AAGO,MAAM,WAAW,MAAsB;AAC5C,QAAM,UAAU,WAAW,YAAY;AAEvC,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,8CAA8C;AAAA,EAChE;AAEA,SAAO;AACT;"}
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import { defaultTheme } from "./index.es.js";
|
|
2
|
-
import "./animation.es.js";
|
|
3
|
-
import "./backgroundColor.es.js";
|
|
4
|
-
import "./backgroundImage.es.js";
|
|
5
|
-
import "./borderWidth.es.js";
|
|
6
|
-
import "./cursor.es.js";
|
|
7
|
-
import "./dropShadow.es.js";
|
|
8
|
-
import "./flexGrow.es.js";
|
|
9
|
-
import "./fontSize.es.js";
|
|
10
|
-
import "./height.es.js";
|
|
11
|
-
import "./keyframes.es.js";
|
|
12
|
-
import "./maxHeight.es.js";
|
|
13
|
-
import "./screens.es.js";
|
|
14
|
-
import "./transitionProperty.es.js";
|
|
15
|
-
import "./zIndex.es.js";
|
|
16
2
|
function listCacheClear() {
|
|
17
3
|
this.__data__ = [];
|
|
18
4
|
this.size = 0;
|
|
@@ -91,18 +77,15 @@ function stackHas(key) {
|
|
|
91
77
|
return this.__data__.has(key);
|
|
92
78
|
}
|
|
93
79
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
94
|
-
const freeGlobal$1 = freeGlobal;
|
|
95
80
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
96
|
-
var root = freeGlobal
|
|
97
|
-
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
var
|
|
102
|
-
var nativeObjectToString$1 = objectProto$a.toString;
|
|
103
|
-
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
81
|
+
var root = freeGlobal || freeSelf || Function("return this")();
|
|
82
|
+
var Symbol$1 = root.Symbol;
|
|
83
|
+
var objectProto$9 = Object.prototype;
|
|
84
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
85
|
+
var nativeObjectToString$1 = objectProto$9.toString;
|
|
86
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
104
87
|
function getRawTag(value) {
|
|
105
|
-
var isOwn = hasOwnProperty$
|
|
88
|
+
var isOwn = hasOwnProperty$7.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
106
89
|
try {
|
|
107
90
|
value[symToStringTag$1] = void 0;
|
|
108
91
|
var unmasked = true;
|
|
@@ -118,13 +101,13 @@ function getRawTag(value) {
|
|
|
118
101
|
}
|
|
119
102
|
return result;
|
|
120
103
|
}
|
|
121
|
-
var objectProto$
|
|
122
|
-
var nativeObjectToString = objectProto$
|
|
104
|
+
var objectProto$8 = Object.prototype;
|
|
105
|
+
var nativeObjectToString = objectProto$8.toString;
|
|
123
106
|
function objectToString(value) {
|
|
124
107
|
return nativeObjectToString.call(value);
|
|
125
108
|
}
|
|
126
109
|
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
127
|
-
var symToStringTag = Symbol$
|
|
110
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
128
111
|
function baseGetTag(value) {
|
|
129
112
|
if (value == null) {
|
|
130
113
|
return value === void 0 ? undefinedTag : nullTag;
|
|
@@ -143,10 +126,9 @@ function isFunction(value) {
|
|
|
143
126
|
var tag = baseGetTag(value);
|
|
144
127
|
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
145
128
|
}
|
|
146
|
-
var coreJsData = root
|
|
147
|
-
const coreJsData$1 = coreJsData;
|
|
129
|
+
var coreJsData = root["__core-js_shared__"];
|
|
148
130
|
var maskSrcKey = function() {
|
|
149
|
-
var uid = /[^.]+$/.exec(coreJsData
|
|
131
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
150
132
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
151
133
|
}();
|
|
152
134
|
function isMasked(func) {
|
|
@@ -169,11 +151,11 @@ function toSource(func) {
|
|
|
169
151
|
}
|
|
170
152
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
171
153
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
172
|
-
var funcProto$1 = Function.prototype, objectProto$
|
|
154
|
+
var funcProto$1 = Function.prototype, objectProto$7 = Object.prototype;
|
|
173
155
|
var funcToString$1 = funcProto$1.toString;
|
|
174
|
-
var hasOwnProperty$
|
|
156
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
175
157
|
var reIsNative = RegExp(
|
|
176
|
-
"^" + funcToString$1.call(hasOwnProperty$
|
|
158
|
+
"^" + funcToString$1.call(hasOwnProperty$6).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
177
159
|
);
|
|
178
160
|
function baseIsNative(value) {
|
|
179
161
|
if (!isObject(value) || isMasked(value)) {
|
|
@@ -189,12 +171,10 @@ function getNative(object, key) {
|
|
|
189
171
|
var value = getValue(object, key);
|
|
190
172
|
return baseIsNative(value) ? value : void 0;
|
|
191
173
|
}
|
|
192
|
-
var Map = getNative(root
|
|
193
|
-
const Map$1 = Map;
|
|
174
|
+
var Map = getNative(root, "Map");
|
|
194
175
|
var nativeCreate = getNative(Object, "create");
|
|
195
|
-
const nativeCreate$1 = nativeCreate;
|
|
196
176
|
function hashClear() {
|
|
197
|
-
this.__data__ = nativeCreate
|
|
177
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
198
178
|
this.size = 0;
|
|
199
179
|
}
|
|
200
180
|
function hashDelete(key) {
|
|
@@ -203,27 +183,27 @@ function hashDelete(key) {
|
|
|
203
183
|
return result;
|
|
204
184
|
}
|
|
205
185
|
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
206
|
-
var objectProto$
|
|
207
|
-
var hasOwnProperty$
|
|
186
|
+
var objectProto$6 = Object.prototype;
|
|
187
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
208
188
|
function hashGet(key) {
|
|
209
189
|
var data = this.__data__;
|
|
210
|
-
if (nativeCreate
|
|
190
|
+
if (nativeCreate) {
|
|
211
191
|
var result = data[key];
|
|
212
192
|
return result === HASH_UNDEFINED$1 ? void 0 : result;
|
|
213
193
|
}
|
|
214
|
-
return hasOwnProperty$
|
|
194
|
+
return hasOwnProperty$5.call(data, key) ? data[key] : void 0;
|
|
215
195
|
}
|
|
216
|
-
var objectProto$
|
|
217
|
-
var hasOwnProperty$
|
|
196
|
+
var objectProto$5 = Object.prototype;
|
|
197
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
218
198
|
function hashHas(key) {
|
|
219
199
|
var data = this.__data__;
|
|
220
|
-
return nativeCreate
|
|
200
|
+
return nativeCreate ? data[key] !== void 0 : hasOwnProperty$4.call(data, key);
|
|
221
201
|
}
|
|
222
202
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
223
203
|
function hashSet(key, value) {
|
|
224
204
|
var data = this.__data__;
|
|
225
205
|
this.size += this.has(key) ? 0 : 1;
|
|
226
|
-
data[key] = nativeCreate
|
|
206
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
227
207
|
return this;
|
|
228
208
|
}
|
|
229
209
|
function Hash(entries) {
|
|
@@ -243,7 +223,7 @@ function mapCacheClear() {
|
|
|
243
223
|
this.size = 0;
|
|
244
224
|
this.__data__ = {
|
|
245
225
|
"hash": new Hash(),
|
|
246
|
-
"map": new (Map
|
|
226
|
+
"map": new (Map || ListCache)(),
|
|
247
227
|
"string": new Hash()
|
|
248
228
|
};
|
|
249
229
|
}
|
|
@@ -290,7 +270,7 @@ function stackSet(key, value) {
|
|
|
290
270
|
var data = this.__data__;
|
|
291
271
|
if (data instanceof ListCache) {
|
|
292
272
|
var pairs = data.__data__;
|
|
293
|
-
if (!Map
|
|
273
|
+
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
294
274
|
pairs.push([key, value]);
|
|
295
275
|
this.size = ++data.size;
|
|
296
276
|
return this;
|
|
@@ -318,10 +298,9 @@ var defineProperty = function() {
|
|
|
318
298
|
} catch (e) {
|
|
319
299
|
}
|
|
320
300
|
}();
|
|
321
|
-
const defineProperty$1 = defineProperty;
|
|
322
301
|
function baseAssignValue(object, key, value) {
|
|
323
|
-
if (key == "__proto__" && defineProperty
|
|
324
|
-
defineProperty
|
|
302
|
+
if (key == "__proto__" && defineProperty) {
|
|
303
|
+
defineProperty(object, key, {
|
|
325
304
|
"configurable": true,
|
|
326
305
|
"enumerable": true,
|
|
327
306
|
"value": value,
|
|
@@ -340,7 +319,7 @@ function createBaseFor(fromRight) {
|
|
|
340
319
|
return function(object, iteratee, keysFunc) {
|
|
341
320
|
var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
|
|
342
321
|
while (length--) {
|
|
343
|
-
var key = props[
|
|
322
|
+
var key = props[++index];
|
|
344
323
|
if (iteratee(iterable[key], key, iterable) === false) {
|
|
345
324
|
break;
|
|
346
325
|
}
|
|
@@ -349,28 +328,19 @@ function createBaseFor(fromRight) {
|
|
|
349
328
|
};
|
|
350
329
|
}
|
|
351
330
|
var baseFor = createBaseFor();
|
|
352
|
-
const baseFor$1 = baseFor;
|
|
353
|
-
var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
354
|
-
var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
|
|
355
|
-
var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
|
|
356
|
-
var Buffer$1 = moduleExports$2 ? root$1.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
|
|
357
331
|
function cloneBuffer(buffer, isDeep) {
|
|
358
|
-
|
|
332
|
+
{
|
|
359
333
|
return buffer.slice();
|
|
360
334
|
}
|
|
361
|
-
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
362
|
-
buffer.copy(result);
|
|
363
|
-
return result;
|
|
364
335
|
}
|
|
365
|
-
var Uint8Array = root
|
|
366
|
-
const Uint8Array$1 = Uint8Array;
|
|
336
|
+
var Uint8Array = root.Uint8Array;
|
|
367
337
|
function cloneArrayBuffer(arrayBuffer) {
|
|
368
338
|
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
369
|
-
new Uint8Array
|
|
339
|
+
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
|
|
370
340
|
return result;
|
|
371
341
|
}
|
|
372
342
|
function cloneTypedArray(typedArray, isDeep) {
|
|
373
|
-
var buffer =
|
|
343
|
+
var buffer = cloneArrayBuffer(typedArray.buffer);
|
|
374
344
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
375
345
|
}
|
|
376
346
|
function copyArray(source, array) {
|
|
@@ -382,7 +352,7 @@ function copyArray(source, array) {
|
|
|
382
352
|
return array;
|
|
383
353
|
}
|
|
384
354
|
var objectCreate = Object.create;
|
|
385
|
-
var baseCreate = function() {
|
|
355
|
+
var baseCreate = /* @__PURE__ */ function() {
|
|
386
356
|
function object() {
|
|
387
357
|
}
|
|
388
358
|
return function(proto) {
|
|
@@ -398,21 +368,19 @@ var baseCreate = function() {
|
|
|
398
368
|
return result;
|
|
399
369
|
};
|
|
400
370
|
}();
|
|
401
|
-
const baseCreate$1 = baseCreate;
|
|
402
371
|
function overArg(func, transform) {
|
|
403
372
|
return function(arg) {
|
|
404
373
|
return func(transform(arg));
|
|
405
374
|
};
|
|
406
375
|
}
|
|
407
376
|
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
408
|
-
|
|
409
|
-
var objectProto$5 = Object.prototype;
|
|
377
|
+
var objectProto$4 = Object.prototype;
|
|
410
378
|
function isPrototype(value) {
|
|
411
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$
|
|
379
|
+
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$4;
|
|
412
380
|
return value === proto;
|
|
413
381
|
}
|
|
414
382
|
function initCloneObject(object) {
|
|
415
|
-
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate
|
|
383
|
+
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
416
384
|
}
|
|
417
385
|
function isObjectLike(value) {
|
|
418
386
|
return value != null && typeof value == "object";
|
|
@@ -421,17 +389,15 @@ var argsTag$1 = "[object Arguments]";
|
|
|
421
389
|
function baseIsArguments(value) {
|
|
422
390
|
return isObjectLike(value) && baseGetTag(value) == argsTag$1;
|
|
423
391
|
}
|
|
424
|
-
var objectProto$
|
|
425
|
-
var hasOwnProperty$
|
|
426
|
-
var propertyIsEnumerable = objectProto$
|
|
427
|
-
var isArguments = baseIsArguments(function() {
|
|
392
|
+
var objectProto$3 = Object.prototype;
|
|
393
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
394
|
+
var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
|
|
395
|
+
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
428
396
|
return arguments;
|
|
429
397
|
}()) ? baseIsArguments : function(value) {
|
|
430
|
-
return isObjectLike(value) && hasOwnProperty$
|
|
398
|
+
return isObjectLike(value) && hasOwnProperty$3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
431
399
|
};
|
|
432
|
-
const isArguments$1 = isArguments;
|
|
433
400
|
var isArray = Array.isArray;
|
|
434
|
-
const isArray$1 = isArray;
|
|
435
401
|
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
436
402
|
function isLength(value) {
|
|
437
403
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
@@ -448,24 +414,23 @@ function stubFalse() {
|
|
|
448
414
|
var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
449
415
|
var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
|
|
450
416
|
var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
|
|
451
|
-
var Buffer = moduleExports$1 ? root
|
|
417
|
+
var Buffer = moduleExports$1 ? root.Buffer : void 0;
|
|
452
418
|
var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
|
|
453
419
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
454
|
-
const isBuffer$1 = isBuffer;
|
|
455
420
|
var objectTag$1 = "[object Object]";
|
|
456
|
-
var funcProto = Function.prototype, objectProto$
|
|
421
|
+
var funcProto = Function.prototype, objectProto$2 = Object.prototype;
|
|
457
422
|
var funcToString = funcProto.toString;
|
|
458
|
-
var hasOwnProperty$
|
|
423
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
459
424
|
var objectCtorString = funcToString.call(Object);
|
|
460
425
|
function isPlainObject(value) {
|
|
461
426
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag$1) {
|
|
462
427
|
return false;
|
|
463
428
|
}
|
|
464
|
-
var proto = getPrototype
|
|
429
|
+
var proto = getPrototype(value);
|
|
465
430
|
if (proto === null) {
|
|
466
431
|
return true;
|
|
467
432
|
}
|
|
468
|
-
var Ctor = hasOwnProperty$
|
|
433
|
+
var Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor;
|
|
469
434
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
470
435
|
}
|
|
471
436
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
|
|
@@ -484,7 +449,7 @@ function baseUnary(func) {
|
|
|
484
449
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
485
450
|
var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
|
|
486
451
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
487
|
-
var freeProcess = moduleExports && freeGlobal
|
|
452
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
488
453
|
var nodeUtil = function() {
|
|
489
454
|
try {
|
|
490
455
|
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
@@ -495,10 +460,8 @@ var nodeUtil = function() {
|
|
|
495
460
|
} catch (e) {
|
|
496
461
|
}
|
|
497
462
|
}();
|
|
498
|
-
|
|
499
|
-
var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
|
|
463
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
500
464
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
501
|
-
const isTypedArray$1 = isTypedArray;
|
|
502
465
|
function safeGet(object, key) {
|
|
503
466
|
if (key === "constructor" && typeof object[key] === "function") {
|
|
504
467
|
return;
|
|
@@ -508,11 +471,11 @@ function safeGet(object, key) {
|
|
|
508
471
|
}
|
|
509
472
|
return object[key];
|
|
510
473
|
}
|
|
511
|
-
var objectProto$
|
|
512
|
-
var hasOwnProperty$
|
|
474
|
+
var objectProto$1 = Object.prototype;
|
|
475
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
513
476
|
function assignValue(object, key, value) {
|
|
514
477
|
var objValue = object[key];
|
|
515
|
-
if (!(hasOwnProperty$
|
|
478
|
+
if (!(hasOwnProperty$1.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
516
479
|
baseAssignValue(object, key, value);
|
|
517
480
|
}
|
|
518
481
|
}
|
|
@@ -522,7 +485,7 @@ function copyObject(source, props, object, customizer) {
|
|
|
522
485
|
var index = -1, length = props.length;
|
|
523
486
|
while (++index < length) {
|
|
524
487
|
var key = props[index];
|
|
525
|
-
var newValue =
|
|
488
|
+
var newValue = void 0;
|
|
526
489
|
if (newValue === void 0) {
|
|
527
490
|
newValue = source[key];
|
|
528
491
|
}
|
|
@@ -548,12 +511,10 @@ function isIndex(value, length) {
|
|
|
548
511
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
549
512
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
550
513
|
}
|
|
551
|
-
var objectProto$1 = Object.prototype;
|
|
552
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
553
514
|
function arrayLikeKeys(value, inherited) {
|
|
554
|
-
var isArr = isArray
|
|
515
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
555
516
|
for (var key in value) {
|
|
556
|
-
if (
|
|
517
|
+
if (!(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
557
518
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
558
519
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
559
520
|
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
@@ -587,7 +548,7 @@ function baseKeysIn(object) {
|
|
|
587
548
|
return result;
|
|
588
549
|
}
|
|
589
550
|
function keysIn(object) {
|
|
590
|
-
return isArrayLike(object) ? arrayLikeKeys(object
|
|
551
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeysIn(object);
|
|
591
552
|
}
|
|
592
553
|
function toPlainObject(value) {
|
|
593
554
|
return copyObject(value, keysIn(value));
|
|
@@ -601,25 +562,25 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta
|
|
|
601
562
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
|
|
602
563
|
var isCommon = newValue === void 0;
|
|
603
564
|
if (isCommon) {
|
|
604
|
-
var isArr = isArray
|
|
565
|
+
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
605
566
|
newValue = srcValue;
|
|
606
567
|
if (isArr || isBuff || isTyped) {
|
|
607
|
-
if (isArray
|
|
568
|
+
if (isArray(objValue)) {
|
|
608
569
|
newValue = objValue;
|
|
609
570
|
} else if (isArrayLikeObject(objValue)) {
|
|
610
571
|
newValue = copyArray(objValue);
|
|
611
572
|
} else if (isBuff) {
|
|
612
573
|
isCommon = false;
|
|
613
|
-
newValue = cloneBuffer(srcValue
|
|
574
|
+
newValue = cloneBuffer(srcValue);
|
|
614
575
|
} else if (isTyped) {
|
|
615
576
|
isCommon = false;
|
|
616
|
-
newValue = cloneTypedArray(srcValue
|
|
577
|
+
newValue = cloneTypedArray(srcValue);
|
|
617
578
|
} else {
|
|
618
579
|
newValue = [];
|
|
619
580
|
}
|
|
620
|
-
} else if (isPlainObject(srcValue) || isArguments
|
|
581
|
+
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
621
582
|
newValue = objValue;
|
|
622
|
-
if (isArguments
|
|
583
|
+
if (isArguments(objValue)) {
|
|
623
584
|
newValue = toPlainObject(objValue);
|
|
624
585
|
} else if (!isObject(objValue) || isFunction(objValue)) {
|
|
625
586
|
newValue = initCloneObject(srcValue);
|
|
@@ -639,7 +600,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
|
639
600
|
if (object === source) {
|
|
640
601
|
return;
|
|
641
602
|
}
|
|
642
|
-
baseFor
|
|
603
|
+
baseFor(source, function(srcValue, key) {
|
|
643
604
|
stack || (stack = new Stack());
|
|
644
605
|
if (isObject(srcValue)) {
|
|
645
606
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
@@ -690,15 +651,14 @@ function constant(value) {
|
|
|
690
651
|
return value;
|
|
691
652
|
};
|
|
692
653
|
}
|
|
693
|
-
var baseSetToString = !defineProperty
|
|
694
|
-
return defineProperty
|
|
654
|
+
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
655
|
+
return defineProperty(func, "toString", {
|
|
695
656
|
"configurable": true,
|
|
696
657
|
"enumerable": false,
|
|
697
658
|
"value": constant(string),
|
|
698
659
|
"writable": true
|
|
699
660
|
});
|
|
700
661
|
};
|
|
701
|
-
const baseSetToString$1 = baseSetToString;
|
|
702
662
|
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
703
663
|
var nativeNow = Date.now;
|
|
704
664
|
function shortOut(func) {
|
|
@@ -716,10 +676,9 @@ function shortOut(func) {
|
|
|
716
676
|
return func.apply(void 0, arguments);
|
|
717
677
|
};
|
|
718
678
|
}
|
|
719
|
-
var setToString = shortOut(baseSetToString
|
|
720
|
-
const setToString$1 = setToString;
|
|
679
|
+
var setToString = shortOut(baseSetToString);
|
|
721
680
|
function baseRest(func, start) {
|
|
722
|
-
return setToString
|
|
681
|
+
return setToString(overRest(func, start, identity), func + "");
|
|
723
682
|
}
|
|
724
683
|
function isIterateeCall(value, index, object) {
|
|
725
684
|
if (!isObject(object)) {
|
|
@@ -752,9 +711,8 @@ function createAssigner(assigner) {
|
|
|
752
711
|
var merge = createAssigner(function(object, source, srcIndex) {
|
|
753
712
|
baseMerge(object, source, srcIndex);
|
|
754
713
|
});
|
|
755
|
-
const _merge = merge;
|
|
756
714
|
function extendCustomTheme(customTheme) {
|
|
757
|
-
return
|
|
715
|
+
return merge({}, defaultTheme, customTheme);
|
|
758
716
|
}
|
|
759
717
|
export {
|
|
760
718
|
extendCustomTheme
|