@dbs-portal/module-identity
Version:
Identity management module for user and role management
1 lines • 487 kB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["../../../../node_modules/@ant-design/icons/es/components/Context.js","../../../../node_modules/classnames/index.js","../../../../node_modules/@ant-design/icons/node_modules/@ant-design/fast-color/es/presetColors.js","../../../../node_modules/@ant-design/icons/node_modules/@ant-design/fast-color/es/FastColor.js","../../../../node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/generate.js","../../../../node_modules/@ant-design/icons/node_modules/@ant-design/colors/es/presets.js","../../../../node_modules/@rc-component/util/es/Dom/canUseDom.js","../../../../node_modules/@rc-component/util/es/Dom/contains.js","../../../../node_modules/@rc-component/util/es/Dom/dynamicCSS.js","../../../../node_modules/@rc-component/util/es/Dom/shadow.js","../../../../node_modules/@rc-component/util/es/warning.js","../../../../node_modules/@ant-design/icons/es/utils.js","../../../../node_modules/@ant-design/icons/es/components/IconBase.js","../../../../node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js","../../../../node_modules/@ant-design/icons/es/components/AntdIcon.js","../../../../node_modules/@ant-design/icons-svg/es/asn/ArrowLeftOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/ArrowLeftOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/CalendarOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/CalendarOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/CheckCircleOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/CheckCircleOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/CloseCircleOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/CloseCircleOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/DeleteOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/DeleteOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/EditOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/EditOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/ExportOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/ExportOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/EyeInvisibleOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/EyeTwoTone.js","../../../../node_modules/@ant-design/icons/es/icons/EyeTwoTone.js","../../../../node_modules/@ant-design/icons-svg/es/asn/FilterOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/FilterOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/InfoCircleOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/InfoCircleOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/LockOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/LockOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/LoginOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/LoginOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/LogoutOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/LogoutOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/MailOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/MailOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/PhoneOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/PhoneOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/PlusOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/ReloadOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/ReloadOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/SafetyOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/SafetyOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/SearchOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/SearchOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/UnlockOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/UnlockOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/UserOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/UserOutlined.js","../../../../node_modules/@ant-design/icons-svg/es/asn/WarningOutlined.js","../../../../node_modules/@ant-design/icons/es/icons/WarningOutlined.js","../src/components/UserList.tsx","../src/services/user-service.ts","../src/services/role-service.ts","../src/hooks/use-users.ts","../src/hooks/use-roles.ts","../src/components/UserCreate.tsx","../../../../node_modules/date-fns/toDate.mjs","../../../../node_modules/date-fns/constructFrom.mjs","../../../../node_modules/date-fns/constants.mjs","../../../../node_modules/date-fns/_lib/defaultOptions.mjs","../../../../node_modules/date-fns/startOfWeek.mjs","../../../../node_modules/date-fns/startOfISOWeek.mjs","../../../../node_modules/date-fns/getISOWeekYear.mjs","../../../../node_modules/date-fns/startOfDay.mjs","../../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.mjs","../../../../node_modules/date-fns/differenceInCalendarDays.mjs","../../../../node_modules/date-fns/startOfISOWeekYear.mjs","../../../../node_modules/date-fns/isDate.mjs","../../../../node_modules/date-fns/isValid.mjs","../../../../node_modules/date-fns/startOfYear.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatDistance.mjs","../../../../node_modules/date-fns/locale/_lib/buildFormatLongFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatLong.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/formatRelative.mjs","../../../../node_modules/date-fns/locale/_lib/buildLocalizeFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/localize.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchFn.mjs","../../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.mjs","../../../../node_modules/date-fns/locale/en-US/_lib/match.mjs","../../../../node_modules/date-fns/locale/en-US.mjs","../../../../node_modules/date-fns/getDayOfYear.mjs","../../../../node_modules/date-fns/getISOWeek.mjs","../../../../node_modules/date-fns/getWeekYear.mjs","../../../../node_modules/date-fns/startOfWeekYear.mjs","../../../../node_modules/date-fns/getWeek.mjs","../../../../node_modules/date-fns/_lib/addLeadingZeros.mjs","../../../../node_modules/date-fns/_lib/format/lightFormatters.mjs","../../../../node_modules/date-fns/_lib/format/formatters.mjs","../../../../node_modules/date-fns/_lib/format/longFormatters.mjs","../../../../node_modules/date-fns/_lib/protectedTokens.mjs","../../../../node_modules/date-fns/format.mjs","../src/components/UserDetails.tsx","../src/components/UserEdit.tsx","../src/components/RoleList.tsx","../src/components/RoleCreate.tsx","../src/components/RoleDetails.tsx","../src/components/RoleEdit.tsx","../src/components/IdentityAdmin.tsx","../src/components/IdentityAudit.tsx","../src/pages/UserListPage.tsx","../src/pages/UserCreatePage.tsx","../src/pages/UserDetailsPage.tsx","../src/pages/UserEditPage.tsx","../src/pages/RoleListPage.tsx","../src/pages/RoleCreatePage.tsx","../src/pages/RoleDetailsPage.tsx","../src/pages/RoleEditPage.tsx","../src/pages/IdentityAdminPage.tsx","../src/pages/IdentityAuditPage.tsx","../src/index.ts"],"sourcesContent":["import { createContext } from 'react';\nconst IconContext = /*#__PURE__*/createContext({});\nexport default IconContext;","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","// 36 Hex to reduce the size of the file\nexport default {\n aliceblue: '9ehhb',\n antiquewhite: '9sgk7',\n aqua: '1ekf',\n aquamarine: '4zsno',\n azure: '9eiv3',\n beige: '9lhp8',\n bisque: '9zg04',\n black: '0',\n blanchedalmond: '9zhe5',\n blue: '73',\n blueviolet: '5e31e',\n brown: '6g016',\n burlywood: '8ouiv',\n cadetblue: '3qba8',\n chartreuse: '4zshs',\n chocolate: '87k0u',\n coral: '9yvyo',\n cornflowerblue: '3xael',\n cornsilk: '9zjz0',\n crimson: '8l4xo',\n cyan: '1ekf',\n darkblue: '3v',\n darkcyan: 'rkb',\n darkgoldenrod: '776yz',\n darkgray: '6mbhl',\n darkgreen: 'jr4',\n darkgrey: '6mbhl',\n darkkhaki: '7ehkb',\n darkmagenta: '5f91n',\n darkolivegreen: '3bzfz',\n darkorange: '9yygw',\n darkorchid: '5z6x8',\n darkred: '5f8xs',\n darksalmon: '9441m',\n darkseagreen: '5lwgf',\n darkslateblue: '2th1n',\n darkslategray: '1ugcv',\n darkslategrey: '1ugcv',\n darkturquoise: '14up',\n darkviolet: '5rw7n',\n deeppink: '9yavn',\n deepskyblue: '11xb',\n dimgray: '442g9',\n dimgrey: '442g9',\n dodgerblue: '16xof',\n firebrick: '6y7tu',\n floralwhite: '9zkds',\n forestgreen: '1cisi',\n fuchsia: '9y70f',\n gainsboro: '8m8kc',\n ghostwhite: '9pq0v',\n goldenrod: '8j4f4',\n gold: '9zda8',\n gray: '50i2o',\n green: 'pa8',\n greenyellow: '6senj',\n grey: '50i2o',\n honeydew: '9eiuo',\n hotpink: '9yrp0',\n indianred: '80gnw',\n indigo: '2xcoy',\n ivory: '9zldc',\n khaki: '9edu4',\n lavenderblush: '9ziet',\n lavender: '90c8q',\n lawngreen: '4vk74',\n lemonchiffon: '9zkct',\n lightblue: '6s73a',\n lightcoral: '9dtog',\n lightcyan: '8s1rz',\n lightgoldenrodyellow: '9sjiq',\n lightgray: '89jo3',\n lightgreen: '5nkwg',\n lightgrey: '89jo3',\n lightpink: '9z6wx',\n lightsalmon: '9z2ii',\n lightseagreen: '19xgq',\n lightskyblue: '5arju',\n lightslategray: '4nwk9',\n lightslategrey: '4nwk9',\n lightsteelblue: '6wau6',\n lightyellow: '9zlcw',\n lime: '1edc',\n limegreen: '1zcxe',\n linen: '9shk6',\n magenta: '9y70f',\n maroon: '4zsow',\n mediumaquamarine: '40eju',\n mediumblue: '5p',\n mediumorchid: '79qkz',\n mediumpurple: '5r3rv',\n mediumseagreen: '2d9ip',\n mediumslateblue: '4tcku',\n mediumspringgreen: '1di2',\n mediumturquoise: '2uabw',\n mediumvioletred: '7rn9h',\n midnightblue: 'z980',\n mintcream: '9ljp6',\n mistyrose: '9zg0x',\n moccasin: '9zfzp',\n navajowhite: '9zest',\n navy: '3k',\n oldlace: '9wq92',\n olive: '50hz4',\n olivedrab: '472ub',\n orange: '9z3eo',\n orangered: '9ykg0',\n orchid: '8iu3a',\n palegoldenrod: '9bl4a',\n palegreen: '5yw0o',\n paleturquoise: '6v4ku',\n palevioletred: '8k8lv',\n papayawhip: '9zi6t',\n peachpuff: '9ze0p',\n peru: '80oqn',\n pink: '9z8wb',\n plum: '8nba5',\n powderblue: '6wgdi',\n purple: '4zssg',\n rebeccapurple: '3zk49',\n red: '9y6tc',\n rosybrown: '7cv4f',\n royalblue: '2jvtt',\n saddlebrown: '5fmkz',\n salmon: '9rvci',\n sandybrown: '9jn1c',\n seagreen: '1tdnb',\n seashell: '9zje6',\n sienna: '6973h',\n silver: '7ir40',\n skyblue: '5arjf',\n slateblue: '45e4t',\n slategray: '4e100',\n slategrey: '4e100',\n snow: '9zke2',\n springgreen: '1egv',\n steelblue: '2r1kk',\n tan: '87yx8',\n teal: 'pds',\n thistle: '8ggk8',\n tomato: '9yqfb',\n turquoise: '2j4r4',\n violet: '9b10u',\n wheat: '9ld4j',\n white: '9zldr',\n whitesmoke: '9lhpx',\n yellow: '9zl6o',\n yellowgreen: '61fzm'\n};","import presetColors from \"./presetColors\";\nconst round = Math.round;\n\n/**\n * Support format, alpha unit will check the % mark:\n * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]\n * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]\n * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]\n * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]\n * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]\n *\n * When `base` is provided, the percentage value will be divided by `base`.\n */\nfunction splitColorStr(str, parseNum) {\n const match = str\n // Remove str before `(`\n .replace(/^[^(]*\\((.*)/, '$1')\n // Remove str after `)`\n .replace(/\\).*/, '').match(/\\d*\\.?\\d+%?/g) || [];\n const numList = match.map(item => parseFloat(item));\n for (let i = 0; i < 3; i += 1) {\n numList[i] = parseNum(numList[i] || 0, match[i] || '', i);\n }\n\n // For alpha. 50% should be 0.5\n if (match[3]) {\n numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];\n } else {\n // By default, alpha is 1\n numList[3] = 1;\n }\n return numList;\n}\nconst parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;\n\n/** round and limit number to integer between 0-255 */\nfunction limitRange(value, max) {\n const mergedMax = max || 255;\n if (value > mergedMax) {\n return mergedMax;\n }\n if (value < 0) {\n return 0;\n }\n return value;\n}\nexport class FastColor {\n /**\n * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.\n */\n isValid = true;\n\n /**\n * Red, R in RGB\n */\n r = 0;\n\n /**\n * Green, G in RGB\n */\n g = 0;\n\n /**\n * Blue, B in RGB\n */\n b = 0;\n\n /**\n * Alpha/Opacity, A in RGBA/HSLA\n */\n a = 1;\n\n // HSV privates\n _h;\n _s;\n _l;\n _v;\n\n // intermediate variables to calculate HSL/HSV\n _max;\n _min;\n _brightness;\n constructor(input) {\n /**\n * Always check 3 char in the object to determine the format.\n * We not use function in check to save bundle size.\n * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.\n */\n function matchFormat(str) {\n return str[0] in input && str[1] in input && str[2] in input;\n }\n if (!input) {\n // Do nothing since already initialized\n } else if (typeof input === 'string') {\n const trimStr = input.trim();\n function matchPrefix(prefix) {\n return trimStr.startsWith(prefix);\n }\n if (/^#?[A-F\\d]{3,8}$/i.test(trimStr)) {\n this.fromHexString(trimStr);\n } else if (matchPrefix('rgb')) {\n this.fromRgbString(trimStr);\n } else if (matchPrefix('hsl')) {\n this.fromHslString(trimStr);\n } else if (matchPrefix('hsv') || matchPrefix('hsb')) {\n this.fromHsvString(trimStr);\n } else {\n // From preset color\n const presetColor = presetColors[trimStr.toLowerCase()];\n if (presetColor) {\n this.fromHexString(\n // Convert 36 hex to 16 hex\n parseInt(presetColor, 36).toString(16).padStart(6, '0'));\n }\n }\n } else if (input instanceof FastColor) {\n this.r = input.r;\n this.g = input.g;\n this.b = input.b;\n this.a = input.a;\n this._h = input._h;\n this._s = input._s;\n this._l = input._l;\n this._v = input._v;\n } else if (matchFormat('rgb')) {\n this.r = limitRange(input.r);\n this.g = limitRange(input.g);\n this.b = limitRange(input.b);\n this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;\n } else if (matchFormat('hsl')) {\n this.fromHsl(input);\n } else if (matchFormat('hsv')) {\n this.fromHsv(input);\n } else {\n throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));\n }\n }\n\n // ======================= Setter =======================\n\n setR(value) {\n return this._sc('r', value);\n }\n setG(value) {\n return this._sc('g', value);\n }\n setB(value) {\n return this._sc('b', value);\n }\n setA(value) {\n return this._sc('a', value, 1);\n }\n setHue(value) {\n const hsv = this.toHsv();\n hsv.h = value;\n return this._c(hsv);\n }\n\n // ======================= Getter =======================\n /**\n * Returns the perceived luminance of a color, from 0-1.\n * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n */\n getLuminance() {\n function adjustGamma(raw) {\n const val = raw / 255;\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n }\n const R = adjustGamma(this.r);\n const G = adjustGamma(this.g);\n const B = adjustGamma(this.b);\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n }\n getHue() {\n if (typeof this._h === 'undefined') {\n const delta = this.getMax() - this.getMin();\n if (delta === 0) {\n this._h = 0;\n } else {\n this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));\n }\n }\n return this._h;\n }\n getSaturation() {\n if (typeof this._s === 'undefined') {\n const delta = this.getMax() - this.getMin();\n if (delta === 0) {\n this._s = 0;\n } else {\n this._s = delta / this.getMax();\n }\n }\n return this._s;\n }\n getLightness() {\n if (typeof this._l === 'undefined') {\n this._l = (this.getMax() + this.getMin()) / 510;\n }\n return this._l;\n }\n getValue() {\n if (typeof this._v === 'undefined') {\n this._v = this.getMax() / 255;\n }\n return this._v;\n }\n\n /**\n * Returns the perceived brightness of the color, from 0-255.\n * Note: this is not the b of HSB\n * @see http://www.w3.org/TR/AERT#color-contrast\n */\n getBrightness() {\n if (typeof this._brightness === 'undefined') {\n this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;\n }\n return this._brightness;\n }\n\n // ======================== Func ========================\n\n darken(amount = 10) {\n const h = this.getHue();\n const s = this.getSaturation();\n let l = this.getLightness() - amount / 100;\n if (l < 0) {\n l = 0;\n }\n return this._c({\n h,\n s,\n l,\n a: this.a\n });\n }\n lighten(amount = 10) {\n const h = this.getHue();\n const s = this.getSaturation();\n let l = this.getLightness() + amount / 100;\n if (l > 1) {\n l = 1;\n }\n return this._c({\n h,\n s,\n l,\n a: this.a\n });\n }\n\n /**\n * Mix the current color a given amount with another color, from 0 to 100.\n * 0 means no mixing (return current color).\n */\n mix(input, amount = 50) {\n const color = this._c(input);\n const p = amount / 100;\n const calc = key => (color[key] - this[key]) * p + this[key];\n const rgba = {\n r: round(calc('r')),\n g: round(calc('g')),\n b: round(calc('b')),\n a: round(calc('a') * 100) / 100\n };\n return this._c(rgba);\n }\n\n /**\n * Mix the color with pure white, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return white.\n */\n tint(amount = 10) {\n return this.mix({\n r: 255,\n g: 255,\n b: 255,\n a: 1\n }, amount);\n }\n\n /**\n * Mix the color with pure black, from 0 to 100.\n * Providing 0 will do nothing, providing 100 will always return black.\n */\n shade(amount = 10) {\n return this.mix({\n r: 0,\n g: 0,\n b: 0,\n a: 1\n }, amount);\n }\n onBackground(background) {\n const bg = this._c(background);\n const alpha = this.a + bg.a * (1 - this.a);\n const calc = key => {\n return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);\n };\n return this._c({\n r: calc('r'),\n g: calc('g'),\n b: calc('b'),\n a: alpha\n });\n }\n\n // ======================= Status =======================\n isDark() {\n return this.getBrightness() < 128;\n }\n isLight() {\n return this.getBrightness() >= 128;\n }\n\n // ======================== MISC ========================\n equals(other) {\n return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;\n }\n clone() {\n return this._c(this);\n }\n\n // ======================= Format =======================\n toHexString() {\n let hex = '#';\n const rHex = (this.r || 0).toString(16);\n hex += rHex.length === 2 ? rHex : '0' + rHex;\n const gHex = (this.g || 0).toString(16);\n hex += gHex.length === 2 ? gHex : '0' + gHex;\n const bHex = (this.b || 0).toString(16);\n hex += bHex.length === 2 ? bHex : '0' + bHex;\n if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {\n const aHex = round(this.a * 255).toString(16);\n hex += aHex.length === 2 ? aHex : '0' + aHex;\n }\n return hex;\n }\n\n /** CSS support color pattern */\n toHsl() {\n return {\n h: this.getHue(),\n s: this.getSaturation(),\n l: this.getLightness(),\n a: this.a\n };\n }\n\n /** CSS support color pattern */\n toHslString() {\n const h = this.getHue();\n const s = round(this.getSaturation() * 100);\n const l = round(this.getLightness() * 100);\n return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;\n }\n\n /** Same as toHsb */\n toHsv() {\n return {\n h: this.getHue(),\n s: this.getSaturation(),\n v: this.getValue(),\n a: this.a\n };\n }\n toRgb() {\n return {\n r: this.r,\n g: this.g,\n b: this.b,\n a: this.a\n };\n }\n toRgbString() {\n return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;\n }\n toString() {\n return this.toRgbString();\n }\n\n // ====================== Privates ======================\n /** Return a new FastColor object with one channel changed */\n _sc(rgb, value, max) {\n const clone = this.clone();\n clone[rgb] = limitRange(value, max);\n return clone;\n }\n _c(input) {\n return new this.constructor(input);\n }\n getMax() {\n if (typeof this._max === 'undefined') {\n this._max = Math.max(this.r, this.g, this.b);\n }\n return this._max;\n }\n getMin() {\n if (typeof this._min === 'undefined') {\n this._min = Math.min(this.r, this.g, this.b);\n }\n return this._min;\n }\n fromHexString(trimStr) {\n const withoutPrefix = trimStr.replace('#', '');\n function connectNum(index1, index2) {\n return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);\n }\n if (withoutPrefix.length < 6) {\n // #rgb or #rgba\n this.r = connectNum(0);\n this.g = connectNum(1);\n this.b = connectNum(2);\n this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;\n } else {\n // #rrggbb or #rrggbbaa\n this.r = connectNum(0, 1);\n this.g = connectNum(2, 3);\n this.b = connectNum(4, 5);\n this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;\n }\n }\n fromHsl({\n h,\n s,\n l,\n a\n }) {\n this._h = h % 360;\n this._s = s;\n this._l = l;\n this.a = typeof a === 'number' ? a : 1;\n if (s <= 0) {\n const rgb = round(l * 255);\n this.r = rgb;\n this.g = rgb;\n this.b = rgb;\n }\n let r = 0,\n g = 0,\n b = 0;\n const huePrime = h / 60;\n const chroma = (1 - Math.abs(2 * l - 1)) * s;\n const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));\n if (huePrime >= 0 && huePrime < 1) {\n r = chroma;\n g = secondComponent;\n } else if (huePrime >= 1 && huePrime < 2) {\n r = secondComponent;\n g = chroma;\n } else if (huePrime >= 2 && huePrime < 3) {\n g = chroma;\n b = secondComponent;\n } else if (huePrime >= 3 && huePrime < 4) {\n g = secondComponent;\n b = chroma;\n } else if (huePrime >= 4 && huePrime < 5) {\n r = secondComponent;\n b = chroma;\n } else if (huePrime >= 5 && huePrime < 6) {\n r = chroma;\n b = secondComponent;\n }\n const lightnessModification = l - chroma / 2;\n this.r = round((r + lightnessModification) * 255);\n this.g = round((g + lightnessModification) * 255);\n this.b = round((b + lightnessModification) * 255);\n }\n fromHsv({\n h,\n s,\n v,\n a\n }) {\n this._h = h % 360;\n this._s = s;\n this._v = v;\n this.a = typeof a === 'number' ? a : 1;\n const vv = round(v * 255);\n this.r = vv;\n this.g = vv;\n this.b = vv;\n if (s <= 0) {\n return;\n }\n const hh = h / 60;\n const i = Math.floor(hh);\n const ff = hh - i;\n const p = round(v * (1.0 - s) * 255);\n const q = round(v * (1.0 - s * ff) * 255);\n const t = round(v * (1.0 - s * (1.0 - ff)) * 255);\n switch (i) {\n case 0:\n this.g = t;\n this.b = p;\n break;\n case 1:\n this.r = q;\n this.b = p;\n break;\n case 2:\n this.r = p;\n this.b = t;\n break;\n case 3:\n this.r = p;\n this.g = q;\n break;\n case 4:\n this.r = t;\n this.g = p;\n break;\n case 5:\n default:\n this.g = p;\n this.b = q;\n break;\n }\n }\n fromHsvString(trimStr) {\n const cells = splitColorStr(trimStr, parseHSVorHSL);\n this.fromHsv({\n h: cells[0],\n s: cells[1],\n v: cells[2],\n a: cells[3]\n });\n }\n fromHslString(trimStr) {\n const cells = splitColorStr(trimStr, parseHSVorHSL);\n this.fromHsl({\n h: cells[0],\n s: cells[1],\n l: cells[2],\n a: cells[3]\n });\n }\n fromRgbString(trimStr) {\n const cells = splitColorStr(trimStr, (num, txt) =>\n // Convert percentage to number. e.g. 50% -> 128\n txt.includes('%') ? round(num / 100 * 255) : num);\n this.r = cells[0];\n this.g = cells[1];\n this.b = cells[2];\n this.a = cells[3];\n }\n}","import { FastColor } from '@ant-design/fast-color';\nconst hueStep = 2; // 色相阶梯\nconst saturationStep = 0.16; // 饱和度阶梯,浅色部分\nconst saturationStep2 = 0.05; // 饱和度阶梯,深色部分\nconst brightnessStep1 = 0.05; // 亮度阶梯,浅色部分\nconst brightnessStep2 = 0.15; // 亮度阶梯,深色部分\nconst lightColorCount = 5; // 浅色数量,主色上\nconst darkColorCount = 4; // 深色数量,主色下\n\n// 暗色主题颜色映射关系表\nconst darkColorMap = [{\n index: 7,\n amount: 15\n}, {\n index: 6,\n amount: 25\n}, {\n index: 5,\n amount: 30\n}, {\n index: 5,\n amount: 45\n}, {\n index: 5,\n amount: 65\n}, {\n index: 5,\n amount: 85\n}, {\n index: 4,\n amount: 90\n}, {\n index: 3,\n amount: 95\n}, {\n index: 2,\n amount: 97\n}, {\n index: 1,\n amount: 98\n}];\nfunction getHue(hsv, i, light) {\n let hue;\n // 根据色相不同,色相转向不同\n if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {\n hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;\n } else {\n hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;\n }\n if (hue < 0) {\n hue += 360;\n } else if (hue >= 360) {\n hue -= 360;\n }\n return hue;\n}\nfunction getSaturation(hsv, i, light) {\n // grey color don't change saturation\n if (hsv.h === 0 && hsv.s === 0) {\n return hsv.s;\n }\n let saturation;\n if (light) {\n saturation = hsv.s - saturationStep * i;\n } else if (i === darkColorCount) {\n saturation = hsv.s + saturationStep;\n } else {\n saturation = hsv.s + saturationStep2 * i;\n }\n // 边界值修正\n if (saturation > 1) {\n saturation = 1;\n }\n // 第一格的 s 限制在 0.06-0.1 之间\n if (light && i === lightColorCount && saturation > 0.1) {\n saturation = 0.1;\n }\n if (saturation < 0.06) {\n saturation = 0.06;\n }\n return Math.round(saturation * 100) / 100;\n}\nfunction getValue(hsv, i, light) {\n let value;\n if (light) {\n value = hsv.v + brightnessStep1 * i;\n } else {\n value = hsv.v - brightnessStep2 * i;\n }\n // Clamp value between 0 and 1\n value = Math.max(0, Math.min(1, value));\n return Math.round(value * 100) / 100;\n}\nexport default function generate(color, opts = {}) {\n const patterns = [];\n const pColor = new FastColor(color);\n const hsv = pColor.toHsv();\n for (let i = lightColorCount; i > 0; i -= 1) {\n const c = new FastColor({\n h: getHue(hsv, i, true),\n s: getSaturation(hsv, i, true),\n v: getValue(hsv, i, true)\n });\n patterns.push(c);\n }\n patterns.push(pColor);\n for (let i = 1; i <= darkColorCount; i += 1) {\n const c = new FastColor({\n h: getHue(hsv, i),\n s: getSaturation(hsv, i),\n v: getValue(hsv, i)\n });\n patterns.push(c);\n }\n\n // dark theme patterns\n if (opts.theme === 'dark') {\n return darkColorMap.map(({\n index,\n amount\n }) => new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString());\n }\n return patterns.map(c => c.toHexString());\n}","// Generated by script. Do NOT modify!\n\nexport const presetPrimaryColors = {\n \"red\": \"#F5222D\",\n \"volcano\": \"#FA541C\",\n \"orange\": \"#FA8C16\",\n \"gold\": \"#FAAD14\",\n \"yellow\": \"#FADB14\",\n \"lime\": \"#A0D911\",\n \"green\": \"#52C41A\",\n \"cyan\": \"#13C2C2\",\n \"blue\": \"#1677FF\",\n \"geekblue\": \"#2F54EB\",\n \"purple\": \"#722ED1\",\n \"magenta\": \"#EB2F96\",\n \"grey\": \"#666666\"\n};\nexport const red = [\"#fff1f0\", \"#ffccc7\", \"#ffa39e\", \"#ff7875\", \"#ff4d4f\", \"#f5222d\", \"#cf1322\", \"#a8071a\", \"#820014\", \"#5c0011\"];\nred.primary = red[5];\nexport const volcano = [\"#fff2e8\", \"#ffd8bf\", \"#ffbb96\", \"#ff9c6e\", \"#ff7a45\", \"#fa541c\", \"#d4380d\", \"#ad2102\", \"#871400\", \"#610b00\"];\nvolcano.primary = volcano[5];\nexport const orange = [\"#fff7e6\", \"#ffe7ba\", \"#ffd591\", \"#ffc069\", \"#ffa940\", \"#fa8c16\", \"#d46b08\", \"#ad4e00\", \"#873800\", \"#612500\"];\norange.primary = orange[5];\nexport const gold = [\"#fffbe6\", \"#fff1b8\", \"#ffe58f\", \"#ffd666\", \"#ffc53d\", \"#faad14\", \"#d48806\", \"#ad6800\", \"#874d00\", \"#613400\"];\ngold.primary = gold[5];\nexport const yellow = [\"#feffe6\", \"#ffffb8\", \"#fffb8f\", \"#fff566\", \"#ffec3d\", \"#fadb14\", \"#d4b106\", \"#ad8b00\", \"#876800\", \"#614700\"];\nyellow.primary = yellow[5];\nexport const lime = [\"#fcffe6\", \"#f4ffb8\", \"#eaff8f\", \"#d3f261\", \"#bae637\", \"#a0d911\", \"#7cb305\", \"#5b8c00\", \"#3f6600\", \"#254000\"];\nlime.primary = lime[5];\nexport const green = [\"#f6ffed\", \"#d9f7be\", \"#b7eb8f\", \"#95de64\", \"#73d13d\", \"#52c41a\", \"#389e0d\", \"#237804\", \"#135200\", \"#092b00\"];\ngreen.primary = green[5];\nexport const cyan = [\"#e6fffb\", \"#b5f5ec\", \"#87e8de\", \"#5cdbd3\", \"#36cfc9\", \"#13c2c2\", \"#08979c\", \"#006d75\", \"#00474f\", \"#002329\"];\ncyan.primary = cyan[5];\nexport const blue = [\"#e6f4ff\", \"#bae0ff\", \"#91caff\", \"#69b1ff\", \"#4096ff\", \"#1677ff\", \"#0958d9\", \"#003eb3\", \"#002c8c\", \"#001d66\"];\nblue.primary = blue[5];\nexport const geekblue = [\"#f0f5ff\", \"#d6e4ff\", \"#adc6ff\", \"#85a5ff\", \"#597ef7\", \"#2f54eb\", \"#1d39c4\", \"#10239e\", \"#061178\", \"#030852\"];\ngeekblue.primary = geekblue[5];\nexport const purple = [\"#f9f0ff\", \"#efdbff\", \"#d3adf7\", \"#b37feb\", \"#9254de\", \"#722ed1\", \"#531dab\", \"#391085\", \"#22075e\", \"#120338\"];\npurple.primary = purple[5];\nexport const magenta = [\"#fff0f6\", \"#ffd6e7\", \"#ffadd2\", \"#ff85c0\", \"#f759ab\", \"#eb2f96\", \"#c41d7f\", \"#9e1068\", \"#780650\", \"#520339\"];\nmagenta.primary = magenta[5];\nexport const grey = [\"#a6a6a6\", \"#999999\", \"#8c8c8c\", \"#808080\", \"#737373\", \"#666666\", \"#404040\", \"#1a1a1a\", \"#000000\", \"#000000\"];\ngrey.primary = grey[5];\nexport const gray = grey;\nexport const presetPalettes = {\n red,\n volcano,\n orange,\n gold,\n yellow,\n lime,\n green,\n cyan,\n blue,\n geekblue,\n purple,\n magenta,\n grey\n};\nexport const redDark = [\"#2a1215\", \"#431418\", \"#58181c\", \"#791a1f\", \"#a61d24\", \"#d32029\", \"#e84749\", \"#f37370\", \"#f89f9a\", \"#fac8c3\"];\nredDark.primary = redDark[5];\nexport const volcanoDark = [\"#2b1611\", \"#441d12\", \"#592716\", \"#7c3118\", \"#aa3e19\", \"#d84a1b\", \"#e87040\", \"#f3956a\", \"#f8b692\", \"#fad4bc\"];\nvolcanoDark.primary = volcanoDark[5];\nexport const orangeDark = [\"#2b1d11\", \"#442a11\", \"#593815\", \"#7c4a15\", \"#aa6215\", \"#d87a16\", \"#e89a3c\", \"#f3b765\", \"#f8cf8d\", \"#fae3b7\"];\norangeDark.primary = orangeDark[5];\nexport const goldDark = [\"#2b2111\", \"#443111\", \"#594214\", \"#7c5914\", \"#aa7714\", \"#d89614\", \"#e8b339\", \"#f3cc62\", \"#f8df8b\", \"#faedb5\"];\ngoldDark.primary = goldDark[5];\nexport const yellowDark = [\"#2b2611\", \"#443b11\", \"#595014\", \"#7c6e14\", \"#aa9514\", \"#d8bd14\", \"#e8d639\", \"#f3ea62\", \"#f8f48b\", \"#fafab5\"];\nyellowDark.primary = yellowDark[5];\nexport const limeDark = [\"#1f2611\", \"#2e3c10\", \"#3e4f13\", \"#536d13\", \"#6f9412\", \"#8bbb11\", \"#a9d134\", \"#c9e75d\", \"#e4f88b\", \"#f0fab5\"];\nlimeDark.primary = limeDark[5];\nexport const greenDark = [\"#162312\", \"#1d3712\", \"#274916\", \"#306317\", \"#3c8618\", \"#49aa19\", \"#6abe39\", \"#8fd460\", \"#b2e58b\", \"#d5f2bb\"];\ngreenDark.primary = greenDark[5];\nexport const cyanDark = [\"#112123\", \"#113536\", \"#144848\", \"#146262\", \"#138585\", \"#13a8a8\", \"#33bcb7\", \"#58d1c9\", \"#84e2d8\", \"#b2f1e8\"];\ncyanDark.primary = cyanDark[5];\nexport const blueDark = [\"#111a2c\", \"#112545\", \"#15325b\", \"#15417e\", \"#1554ad\", \"#1668dc\", \"#3c89e8\", \"#65a9f3\", \"#8dc5f8\", \"#b7dcfa\"];\nblueDark.primary = blueDark[5];\nexport const geekblueDark = [\"#131629\", \"#161d40\", \"#1c2755\", \"#203175\", \"#263ea0\", \"#2b4acb\", \"#5273e0\", \"#7f9ef3\", \"#a8c1f8\", \"#d2e0fa\"];\ngeekblueDark.primary = geekblueDark[5];\nexport const purpleDark = [\"#1a1325\", \"#24163a\", \"#301c4d\", \"#3e2069\", \"#51258f\", \"#642ab5\", \"#854eca\", \"#ab7ae0\", \"#cda8f0\", \"#ebd7fa\"];\npurpleDark.primary = purpleDark[5];\nexport const magentaDark = [\"#291321\", \"#40162f\", \"#551c3b\", \"#75204f\", \"#a02669\", \"#cb2b83\", \"#e0529c\", \"#f37fb7\", \"#f8a8cc\", \"#fad2e3\"];\nmagentaDark.primary = magentaDark[5];\nexport const greyDark = [\"#151515\", \"#1f1f1f\", \"#2d2d2d\", \"#393939\", \"#494949\", \"#5a5a5a\", \"#6a6a6a\", \"#7b7b7b\", \"#888888\", \"#969696\"];\ngreyDark.primary = greyDark[5];\nexport const presetDarkPalettes = {\n red: redDark,\n volcano: volcanoDark,\n orange: orangeDark,\n gold: goldDark,\n yellow: yellowDark,\n lime: limeDark,\n green: greenDark,\n cyan: cyanDark,\n blue: blueDark,\n geekblue: geekblueDark,\n purple: purpleDark,\n magenta: magentaDark,\n grey: greyDark\n};","export default function canUseDom() {\n return !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n}","export default function contains(root, n) {\n if (!root) {\n return false;\n }\n\n // Use native if support\n if (root.contains) {\n return root.contains(n);\n }\n\n // `document.contains` not support with IE11\n let node = n;\n while (node) {\n if (node === root) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}","import canUseDom from \"./canUseDom\";\nimport contains from \"./contains\";\nconst APPEND_ORDER = 'data-rc-order';\nconst APPEND_PRIORITY = 'data-rc-priority';\nconst MARK_KEY = `rc-util-key`;\nconst containerCache = new Map();\nfunction getMark({\n mark\n} = {}) {\n if (mark) {\n return mark.startsWith('data-') ? mark : `data-${mark}`;\n }\n return MARK_KEY;\n}\nfunction getContainer(option) {\n if (option.attachTo) {\n return option.attachTo;\n }\n const head = document.querySelector('head');\n return head || document.body;\n}\nfunction getOrder(prepend) {\n if (prepend === 'queue') {\n return 'prependQueue';\n }\n return prepend ? 'prepend' : 'append';\n}\n\n/**\n * Find style which inject by rc-util\n */\nfunction findStyles(container) {\n return Array.from((containerCache.get(container) || container).children).filter(node => node.tagName === 'STYLE');\n}\nexport function injectCSS(css, option = {}) {\n if (!canUseDom()) {\n return null;\n }\n const {\n csp,\n prepend,\n priority = 0\n } = option;\n const mergedOrder = getOrder(prepend);\n const isPrependQueue = mergedOrder === 'prependQueue';\n const styleNode = document.createElement('style');\n styleNode.setAttribute(APPEND_ORDER, mergedOrder);\n if (isPrependQueue && priority) {\n styleNode.setAttribute(APPEND_PRIORITY, `${priority}`);\n }\n if (csp?.nonce) {\n styleNode.nonce = csp?.nonce;\n }\n styleNode.innerHTML = css;\n const container = getContainer(option);\n const {\n firstChild\n } = container;\n if (prepend) {\n // If is queue `prepend`, it will prepend first style and then append rest style\n if (isPrependQueue) {\n const existStyle = (option.styles || findStyles(container)).filter(node => {\n // Ignore style which not injected by rc-util with prepend\n if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {\n return false;\n }\n\n // Ignore style which priority less then new style\n const nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);\n return priority >= nodePriority;\n });\n if (existStyle.length) {\n container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);\n return styleNode;\n }\n }\n\n // Use `insertBefore` as `prepend`\n container.insertBefore(styleNode, firstChild);\n } else {\n container.appendChild(styleNode);\n }\n return styleNode;\n}\nfunction findExistNode(key, option = {}) {\n let {\n styles\n } = option;\n styles ||= findStyles(getContainer(option));\n return styles.find(node => node.getAttribute(getMark(option)) === key);\n}\nexport function removeCSS(key, option = {}) {\n const existNode = findExistNode(key, option);\n if (existNode) {\n const container = getContainer(option);\n container.removeChild(existNode);\n }\n}\n\n/**\n * qiankun will inject `appendChild` to insert into other\n */\nfunction syncRealContainer(container, option) {\n const cachedRealContainer = containerCache.get(container);\n\n // Find real container when not cached or cached container removed\n if (!cachedRealContainer || !contains(document, cachedRealContainer)) {\n const placeholderStyle = injectCSS('', option);\n const {\n parentNode\n } = placeholderStyle;\n containerCache.set(container, parentNode);\n container.removeChild(placeholderStyle);\n }\n}\n\n/**\n * manually clear container cache to avoid global cache in unit testes\n */\nexport function clearContainerCache() {\n containerCache.clear();\n}\nexport function updateCSS(css, key, originOption = {}) {\n const container = getContainer(originOption);\n const styles = findStyles(container);\n const option = {\n ...originOption,\n styles\n };\n\n // Sync real parent\n syncRealContainer(container, option);\n const existNode = findExistNode(key, option);\n if (existNode) {\n if (option.csp?.nonce && existNode.nonce !== option.csp?.nonce) {\n existNode.nonce = option.csp?.nonce;\n }\n if (existNode.innerHTML !== css) {\n existNode.innerHTML = css;\n }\n return existNode;\n }\n const newNode = injectCSS(css, option);\n newNode.setAttribute(getMark(option), key);\n return newNode;\n}","function getRoot(ele) {\n return ele?.getRootNode?.();\n}\n\n/**\n * Check if is in shadowRoot\n */\nexport function inShadow(ele) {\n return getRoot(ele) instanceof ShadowRoot;\n}\n\n/**\n * Return shadowRoot if possible\n */\nexport function getShadowRoot(ele) {\n return inShadow(ele) ? getRoot(ele) : null;\n}","/* eslint-disable no-console */\nlet warned = {};\nconst preWarningFns = [];\n\n/**\n * Pre warning enable you to parse content before console.error.\n * Modify to null will prevent warning.\n */\nexport const preMessage = fn => {\n preWarningFns.push(fn);\n};\n\n/**\n * Warning if condition not match.\n * @param valid Condition\n * @param message Warning message\n * @example\n * ```js\n * warning(false, 'some error'); // print some error\n * warning(true, 'some error'); // print nothing\n * warning(1 === 2, 'some error'); // print some error\n * ```\n */\nexport function warning(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'warning'), message);\n if (finalMessage) {\n console.error(`Warning: ${finalMessage}`);\n }\n }\n}\n\n/** @see Similar to {@link warning} */\nexport function note(valid, message) {\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'note'), message);\n if (finalMessage) {\n console.warn(`Note: ${finalMessage}`);\n }\n }\n}\nexport function resetWarned() {\n warned = {};\n}\nexport function call(method, valid, message) {\n if (!valid && !warned[message]) {\n method(false, message);\n warned[message] = true;\n }\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function warningOnce(valid, message) {\n call(warning, valid, message);\n}\n\n/** @see Same as {@link warning}, but only warn once for the same message */\nexport function noteOnce(valid, message) {\n call(note, valid, message);\n}\nwarningOnce.preMessage = preMessage;\nwarningOnce.resetWarned = resetWarned;\nwarningOnce.noteOnce = noteOnce;\nexport default warningOnce;","import { generate as generateColor } from '@ant-design/colors';\nimport { updateCSS } from \"@rc-component/util/es/Dom/dynamicCSS\";\nimport { getShadowRoot } from \"@rc-component/util/es/Dom/shadow\";\nimport warn from \"@rc-component/util/es/warning\";\nimport React, { useContext, useEffect } from 'react';\nimport IconContext from \"./components/Context\";\nfunction camelCase(input) {\n return input.replace(/-(.)/g, (match, g) => g.toUpperCase());\n}\nexport function warning(valid, message) {\n warn(valid, `[@ant-design/icons] ${message}`);\n}\nexport function isIconDefinition(target) {\n return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');\n}\nexport function normalizeAttrs(attrs = {}) {\n return Object.keys(attrs).reduce((acc, key) => {\n const val = attrs[key];\n switch (key) {\n case 'class':\n acc.className = val;\n delete acc.class;\n break;\n default:\n delete acc[key];\n acc[camelCase(key)] = val;\n }\n return acc;\n }, {});\n}\nexport function generate(node, key, rootProps) {\n if (!rootProps) {\n return /*#__PURE__*/React.createElement(node.tag, {\n key,\n ...normalizeAttrs(node.attrs)\n }, (node.children || []).map((child, index) => generate(child, `${key}-${node.tag}-${index}`)));\n }\n return /*#__PURE__*/React.createElement(node.tag, {\n key,\n ...normalizeAttrs(node.attrs),\n ...rootProps\n }, (node.children || []).map((child, index) => generate(child, `${key}-${node.tag}-${index}`)));\n}\nexport function getSecondaryColor(primaryColor) {\n // choose the second color\n return generateColor(primaryColor)[0];\n}\nexport function normalizeTwoToneColors(twoToneColor) {\n if (!twoToneColor) {\n return [];\n }\n return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];\n}\n\n// These props make sure that the SVG behaviours like general text.\n// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4\nexport const svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nexport const iconStyles = `\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n`;\nexport const useInsertStyles = eleRef => {\n const {\n csp,\n prefixCls,\n layer\n } = useContext(IconContext);\n let mergedStyleStr = iconStyles;\n if (prefixCls) {\n mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);\n }\n if (layer) {\n mergedStyleStr = `@layer ${layer} {\\n${mergedStyleStr}\\n}`;\n }\n useEffect(() => {\n const ele = eleRef.current;\n const shadowRoot = getShadowRoot(ele);\n updateCSS(mergedStyleStr, '@ant-design-icons', {\n prepend: !layer,\n csp,\n attachTo: shadowRoot\n });\n }, []);\n};","import * as React from 'react';\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from \"../utils\";\nconst twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6',\n calculated: false\n};\nfunction setTwoToneColors({\n primaryColor,\n secondaryColor\n}) {\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\nfunction getTwoToneColors() {\n return {\n ...twoToneColorPalette\n };\n}\nconst IconBase = props => {\n const {\n icon,\n className,\n onClick,\n style,\n primaryColor,\n secondaryColor,\n ...restProps\n } = props;\n const svgRef = React.useRef();\n let colors = twoToneColorPalette;\n if (primaryColor) {\n colors = {\n primaryColor,\n secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n };\n }\n useInsertStyles(svgRef);\n warning(isIconDefinition(icon), `icon should be icon definiton, but got ${icon}`);\n if (!isIconDefinition(icon)) {\n return null;\n }\n let target = icon;\n if (target && typeof target.icon === 'function') {\n target = {\n ...target,\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n };\n }\n return generate(target.icon, `svg-${target.name}`, {\n className,\n onClick,\n style,\n 'data-icon': target.name,\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n ...restProps,\n ref: svgRef\n });\n};\nIconBase.displayName = 'IconReact';\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;","import ReactIcon from \"./IconBase\";\nimport { normalizeTwoToneColors } from \"../utils\";\nexport function setTwoToneColor(twoToneColor) {\n const [primaryColor, secondaryColor] = normalizeTwoToneColors(twoToneColor);\n return ReactIcon.setTwoToneColors({\n primaryColor,\n secondaryColor\n });\n}\nexport function getTwoToneColor() {\n const colors = ReactIcon.getTwoToneColors();\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n return [colors.primaryColor, colors.secondaryColor];\n}","'use client';\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { blue } from '@ant-design/colors';\nimport Context from \"./Context\";\nimport ReactIcon from \"./IconBase\";\nimport { getTwoToneColor, setTwoToneColor } from \"./twoTonePrimaryColor\";\nimport { normalizeTwoToneColors } from \"../utils\";\n// Initial setting\n// should move it to antd main repo?\nsetTwoToneColor(blue.primary);\n\n// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720\n\nconst Icon = /*#__PURE__*/React.forwardRef((props, ref) => {\n const {\n // affect outter <i>...</i>\n className,\n // affect inner <svg>...</svg>\n icon,\n spi