import { NzConfigService, inputToRGB, rgbToHex, rgbToHsv } from "./chunk-ZHMJ6SNN.js"; import { Platform } from "./chunk-IAC53GOD.js"; import { InputBoolean, warn } from "./chunk-M5GY4FCO.js"; import { DomSanitizer } from "./chunk-Y4CEYMY2.js"; import { HttpBackend, HttpClient } from "./chunk-X7WBA24Z.js"; import { DOCUMENT } from "./chunk-OSQBUYO6.js"; import { ChangeDetectorRef, Directive, ElementRef, Inject, Injectable, InjectionToken, Input, NgModule, NgZone, Observable, Optional, Renderer2, RendererFactory2, SecurityContext, Self, Subject, __decorate, catchError, filter, finalize, from, isDevMode, map, of, setClassMetadata, share, take, takeUntil, tap, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵclassProp, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdirectiveInject, ɵɵinject } from "./chunk-FGESKT7O.js"; import { __spreadProps, __spreadValues } from "./chunk-HSNDBVJ3.js"; // node_modules/@ant-design/colors/es/generate.js var hueStep = 2; var saturationStep = 0.16; var saturationStep2 = 0.05; var brightnessStep1 = 0.05; var brightnessStep2 = 0.15; var lightColorCount = 5; var darkColorCount = 4; var darkColorMap = [{ index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }]; function toHsv(_ref) { var r = _ref.r, g = _ref.g, b = _ref.b; var hsv = rgbToHsv(r, g, b); return { h: hsv.h * 360, s: hsv.s, v: hsv.v }; } function toHex(_ref2) { var r = _ref2.r, g = _ref2.g, b = _ref2.b; return "#".concat(rgbToHex(r, g, b, false)); } function mix(rgb1, rgb2, amount) { var p = amount / 100; var rgb = { r: (rgb2.r - rgb1.r) * p + rgb1.r, g: (rgb2.g - rgb1.g) * p + rgb1.g, b: (rgb2.b - rgb1.b) * p + rgb1.b }; return rgb; } function getHue(hsv, i, light) { var hue; if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) { hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i; } else { hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i; } if (hue < 0) { hue += 360; } else if (hue >= 360) { hue -= 360; } return hue; } function getSaturation(hsv, i, light) { if (hsv.h === 0 && hsv.s === 0) { return hsv.s; } var saturation; if (light) { saturation = hsv.s - saturationStep * i; } else if (i === darkColorCount) { saturation = hsv.s + saturationStep; } else { saturation = hsv.s + saturationStep2 * i; } if (saturation > 1) { saturation = 1; } if (light && i === lightColorCount && saturation > 0.1) { saturation = 0.1; } if (saturation < 0.06) { saturation = 0.06; } return Number(saturation.toFixed(2)); } function getValue(hsv, i, light) { var value; if (light) { value = hsv.v + brightnessStep1 * i; } else { value = hsv.v - brightnessStep2 * i; } if (value > 1) { value = 1; } return Number(value.toFixed(2)); } function generate(color) { var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var patterns = []; var pColor = inputToRGB(color); for (var i = lightColorCount; i > 0; i -= 1) { var hsv = toHsv(pColor); var colorString = toHex(inputToRGB({ h: getHue(hsv, i, true), s: getSaturation(hsv, i, true), v: getValue(hsv, i, true) })); patterns.push(colorString); } patterns.push(toHex(pColor)); for (var _i = 1; _i <= darkColorCount; _i += 1) { var _hsv = toHsv(pColor); var _colorString = toHex(inputToRGB({ h: getHue(_hsv, _i), s: getSaturation(_hsv, _i), v: getValue(_hsv, _i) })); patterns.push(_colorString); } if (opts.theme === "dark") { return darkColorMap.map(function(_ref3) { var index = _ref3.index, opacity = _ref3.opacity; var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || "#141414"), inputToRGB(patterns[index]), opacity * 100)); return darkColorString; }); } return patterns; } // node_modules/@ant-design/colors/es/index.js var presetPrimaryColors = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1677FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666" }; var presetPalettes = {}; var presetDarkPalettes = {}; Object.keys(presetPrimaryColors).forEach(function(key) { presetPalettes[key] = generate(presetPrimaryColors[key]); presetPalettes[key].primary = presetPalettes[key][5]; presetDarkPalettes[key] = generate(presetPrimaryColors[key], { theme: "dark", backgroundColor: "#141414" }); presetDarkPalettes[key].primary = presetDarkPalettes[key][5]; }); var red = presetPalettes.red; var volcano = presetPalettes.volcano; var gold = presetPalettes.gold; var orange = presetPalettes.orange; var yellow = presetPalettes.yellow; var lime = presetPalettes.lime; var green = presetPalettes.green; var cyan = presetPalettes.cyan; var blue = presetPalettes.blue; var geekblue = presetPalettes.geekblue; var purple = presetPalettes.purple; var magenta = presetPalettes.magenta; var grey = presetPalettes.grey; var gray = presetPalettes.grey; // node_modules/@ant-design/icons-angular/fesm2022/ant-design-icons-angular.mjs var ANT_ICON_ANGULAR_CONSOLE_PREFIX = "[@ant-design/icons-angular]:"; function error(message) { console.error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX} ${message}.`); } function warn2(message) { if (isDevMode()) { console.warn(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX} ${message}.`); } } function getSecondaryColor(primaryColor) { return generate(primaryColor)[0]; } function withSuffix(name2, theme) { switch (theme) { case "fill": return `${name2}-fill`; case "outline": return `${name2}-o`; case "twotone": return `${name2}-twotone`; case void 0: return name2; default: throw new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}Theme "${theme}" is not a recognized theme!`); } } function withSuffixAndColor(name2, theme, pri, sec) { return `${withSuffix(name2, theme)}-${pri}-${sec}`; } function mapAbbrToTheme(abbr) { return abbr === "o" ? "outline" : abbr; } function alreadyHasAThemeSuffix(name2) { return name2.endsWith("-fill") || name2.endsWith("-o") || name2.endsWith("-twotone"); } function isIconDefinition(target) { return typeof target === "object" && typeof target.name === "string" && (typeof target.theme === "string" || target.theme === void 0) && typeof target.icon === "string"; } function getIconDefinitionFromAbbr(str) { const arr = str.split("-"); const theme = mapAbbrToTheme(arr.splice(arr.length - 1, 1)[0]); const name2 = arr.join("-"); return { name: name2, theme, icon: "" }; } function cloneSVG(svg) { return svg.cloneNode(true); } function replaceFillColor(raw) { return raw.replace(/['"]#333['"]/g, '"primaryColor"').replace(/['"]#E6E6E6['"]/g, '"secondaryColor"').replace(/['"]#D9D9D9['"]/g, '"secondaryColor"').replace(/['"]#D8D8D8['"]/g, '"secondaryColor"'); } function getNameAndNamespace(type) { const split = type.split(":"); switch (split.length) { case 1: return [type, ""]; case 2: return [split[1], split[0]]; default: throw new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}The icon type ${type} is not valid!`); } } function hasNamespace(type) { return getNameAndNamespace(type)[1] !== ""; } function NameSpaceIsNotSpecifyError() { return new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}Type should have a namespace. Try "namespace:${name}".`); } function IconNotFoundError(icon) { return new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}the icon ${icon} does not exist or is not registered.`); } function HttpModuleNotImport() { error(`you need to import "HttpClientModule" to use dynamic importing.`); return null; } function UrlNotSafeError(url) { return new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}The url "${url}" is unsafe.`); } function SVGTagNotFoundError() { return new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX} tag not found.`); } function DynamicLoadingTimeoutError() { return new Error(`${ANT_ICON_ANGULAR_CONSOLE_PREFIX}Importing timeout error.`); } var JSONP_HANDLER_NAME = "__ant_icon_load"; var ANT_ICONS = new InjectionToken("ant_icons"); var _IconService = class _IconService { set twoToneColor({ primaryColor, secondaryColor }) { this._twoToneColorPalette.primaryColor = primaryColor; this._twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor); } get twoToneColor() { return __spreadValues({}, this._twoToneColorPalette); } /** * Disable dynamic loading (support static loading only). */ get _disableDynamicLoading() { return false; } constructor(_rendererFactory, _handler, _document, sanitizer, _antIcons) { this._rendererFactory = _rendererFactory; this._handler = _handler; this._document = _document; this.sanitizer = sanitizer; this._antIcons = _antIcons; this.defaultTheme = "outline"; this._svgDefinitions = /* @__PURE__ */ new Map(); this._svgRenderedDefinitions = /* @__PURE__ */ new Map(); this._inProgressFetches = /* @__PURE__ */ new Map(); this._assetsUrlRoot = ""; this._twoToneColorPalette = { primaryColor: "#333333", secondaryColor: "#E6E6E6" }; this._enableJsonpLoading = false; this._jsonpIconLoad$ = new Subject(); this._renderer = this._rendererFactory.createRenderer(null, null); if (this._handler) { this._http = new HttpClient(this._handler); } if (this._antIcons) { this.addIcon(...this._antIcons); } } /** * Call this method to switch to jsonp like loading. */ useJsonpLoading() { if (!this._enableJsonpLoading) { this._enableJsonpLoading = true; window[JSONP_HANDLER_NAME] = (icon) => { this._jsonpIconLoad$.next(icon); }; } else { warn2("You are already using jsonp loading."); } } /** * Change the prefix of the inline svg resources, so they could be deployed elsewhere, like CDN. * @param prefix */ changeAssetsSource(prefix) { this._assetsUrlRoot = prefix.endsWith("/") ? prefix : prefix + "/"; } /** * Add icons provided by ant design. * @param icons */ addIcon(...icons) { icons.forEach((icon) => { this._svgDefinitions.set(withSuffix(icon.name, icon.theme), icon); }); } /** * Register an icon. Namespace is required. * @param type * @param literal */ addIconLiteral(type, literal) { const [_, namespace] = getNameAndNamespace(type); if (!namespace) { throw NameSpaceIsNotSpecifyError(); } this.addIcon({ name: type, icon: literal }); } /** * Remove all cache. */ clear() { this._svgDefinitions.clear(); this._svgRenderedDefinitions.clear(); } /** * Get a rendered `SVGElement`. * @param icon * @param twoToneColor */ getRenderedContent(icon, twoToneColor) { const definition = isIconDefinition(icon) ? icon : this._svgDefinitions.get(icon) || null; if (!definition && this._disableDynamicLoading) { throw IconNotFoundError(icon); } const $iconDefinition = definition ? of(definition) : this._loadIconDynamically(icon); return $iconDefinition.pipe(map((i) => { if (!i) { throw IconNotFoundError(icon); } return this._loadSVGFromCacheOrCreateNew(i, twoToneColor); })); } getCachedIcons() { return this._svgDefinitions; } /** * Get raw svg and assemble a `IconDefinition` object. * @param type */ _loadIconDynamically(type) { if (!this._http && !this._enableJsonpLoading) { return of(HttpModuleNotImport()); } let inProgress = this._inProgressFetches.get(type); if (!inProgress) { const [name2, namespace] = getNameAndNamespace(type); const icon = namespace ? { name: type, icon: "" } : getIconDefinitionFromAbbr(name2); const suffix = this._enableJsonpLoading ? ".js" : ".svg"; const url = (namespace ? `${this._assetsUrlRoot}assets/${namespace}/${name2}` : `${this._assetsUrlRoot}assets/${icon.theme}/${icon.name}`) + suffix; const safeUrl = this.sanitizer.sanitize(SecurityContext.URL, url); if (!safeUrl) { throw UrlNotSafeError(url); } const source = !this._enableJsonpLoading ? this._http.get(safeUrl, { responseType: "text" }).pipe(map((literal) => __spreadProps(__spreadValues({}, icon), { icon: literal }))) : this._loadIconDynamicallyWithJsonp(icon, safeUrl); inProgress = source.pipe(tap((definition) => this.addIcon(definition)), finalize(() => this._inProgressFetches.delete(type)), catchError(() => of(null)), share()); this._inProgressFetches.set(type, inProgress); } return inProgress; } _loadIconDynamicallyWithJsonp(icon, url) { return new Observable((subscriber) => { const loader = this._document.createElement("script"); const timer = setTimeout(() => { clean(); subscriber.error(DynamicLoadingTimeoutError()); }, 6e3); loader.src = url; function clean() { loader.parentNode.removeChild(loader); clearTimeout(timer); } this._document.body.appendChild(loader); this._jsonpIconLoad$.pipe(filter((i) => i.name === icon.name && i.theme === icon.theme), take(1)).subscribe((i) => { subscriber.next(i); clean(); }); }); } /** * Render a new `SVGElement` for a given `IconDefinition`, or make a copy from cache. * @param icon * @param twoToneColor */ _loadSVGFromCacheOrCreateNew(icon, twoToneColor) { let svg; const pri = twoToneColor || this._twoToneColorPalette.primaryColor; const sec = getSecondaryColor(pri) || this._twoToneColorPalette.secondaryColor; const key = icon.theme === "twotone" ? withSuffixAndColor(icon.name, icon.theme, pri, sec) : icon.theme === void 0 ? icon.name : withSuffix(icon.name, icon.theme); const cached = this._svgRenderedDefinitions.get(key); if (cached) { svg = cached.icon; } else { svg = this._setSVGAttribute(this._colorizeSVGIcon( // Icons provided by ant design should be refined to remove preset colors. this._createSVGElementFromString(hasNamespace(icon.name) ? icon.icon : replaceFillColor(icon.icon)), icon.theme === "twotone", pri, sec )); this._svgRenderedDefinitions.set(key, __spreadProps(__spreadValues({}, icon), { icon: svg })); } return cloneSVG(svg); } _createSVGElementFromString(str) { const div = this._document.createElement("div"); div.innerHTML = str; const svg = div.querySelector("svg"); if (!svg) { throw SVGTagNotFoundError; } return svg; } _setSVGAttribute(svg) { this._renderer.setAttribute(svg, "width", "1em"); this._renderer.setAttribute(svg, "height", "1em"); return svg; } _colorizeSVGIcon(svg, twotone, pri, sec) { if (twotone) { const children = svg.childNodes; const length = children.length; for (let i = 0; i < length; i++) { const child = children[i]; if (child.getAttribute("fill") === "secondaryColor") { this._renderer.setAttribute(child, "fill", sec); } else { this._renderer.setAttribute(child, "fill", pri); } } } this._renderer.setAttribute(svg, "fill", "currentColor"); return svg; } }; _IconService.ɵfac = function IconService_Factory(t) { return new (t || _IconService)(ɵɵinject(RendererFactory2), ɵɵinject(HttpBackend, 8), ɵɵinject(DOCUMENT, 8), ɵɵinject(DomSanitizer), ɵɵinject(ANT_ICONS, 8)); }; _IconService.ɵprov = ɵɵdefineInjectable({ token: _IconService, factory: _IconService.ɵfac }); var IconService = _IconService; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(IconService, [{ type: Injectable }], () => [{ type: RendererFactory2 }, { type: HttpBackend, decorators: [{ type: Optional }] }, { type: void 0, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT] }] }, { type: DomSanitizer }, { type: void 0, decorators: [{ type: Optional }, { type: Inject, args: [ANT_ICONS] }] }], null); })(); function checkMeta(prev, after) { return prev.type === after.type && prev.theme === after.theme && prev.twoToneColor === after.twoToneColor; } var _IconDirective = class _IconDirective { constructor(_iconService, _elementRef, _renderer) { this._iconService = _iconService; this._elementRef = _elementRef; this._renderer = _renderer; } ngOnChanges(changes) { if (changes.type || changes.theme || changes.twoToneColor) { this._changeIcon(); } } /** * Render a new icon in the current element. Remove the icon when `type` is falsy. */ _changeIcon() { return new Promise((resolve) => { if (!this.type) { this._clearSVGElement(); resolve(null); return; } const beforeMeta = this._getSelfRenderMeta(); this._iconService.getRenderedContent(this._parseIconType(this.type, this.theme), this.twoToneColor).subscribe((svg) => { const afterMeta = this._getSelfRenderMeta(); if (checkMeta(beforeMeta, afterMeta)) { this._setSVGElement(svg); resolve(svg); } else { resolve(null); } }); }); } _getSelfRenderMeta() { return { type: this.type, theme: this.theme, twoToneColor: this.twoToneColor }; } /** * Parse a icon to the standard form, an `IconDefinition` or a string like 'account-book-fill` (with a theme suffixed). * If namespace is specified, ignore theme because it meaningless for users' icons. * * @param type * @param theme */ _parseIconType(type, theme) { if (isIconDefinition(type)) { return type; } else { const [name2, namespace] = getNameAndNamespace(type); if (namespace) { return type; } if (alreadyHasAThemeSuffix(name2)) { if (!!theme) { warn2(`'type' ${name2} already gets a theme inside so 'theme' ${theme} would be ignored`); } return name2; } else { return withSuffix(name2, theme || this._iconService.defaultTheme); } } } _setSVGElement(svg) { this._clearSVGElement(); this._renderer.appendChild(this._elementRef.nativeElement, svg); } _clearSVGElement() { const el = this._elementRef.nativeElement; const children = el.childNodes; const length = children.length; for (let i = length - 1; i >= 0; i--) { const child = children[i]; if (child.tagName?.toLowerCase() === "svg") { this._renderer.removeChild(el, child); } } } }; _IconDirective.ɵfac = function IconDirective_Factory(t) { return new (t || _IconDirective)(ɵɵdirectiveInject(IconService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2)); }; _IconDirective.ɵdir = ɵɵdefineDirective({ type: _IconDirective, selectors: [["", "antIcon", ""]], inputs: { type: "type", theme: "theme", twoToneColor: "twoToneColor" }, features: [ɵɵNgOnChangesFeature] }); var IconDirective = _IconDirective; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(IconDirective, [{ type: Directive, args: [{ selector: "[antIcon]" }] }], () => [{ type: IconService }, { type: ElementRef }, { type: Renderer2 }], { type: [{ type: Input }], theme: [{ type: Input }], twoToneColor: [{ type: Input }] }); })(); var _IconModule = class _IconModule { }; _IconModule.ɵfac = function IconModule_Factory(t) { return new (t || _IconModule)(); }; _IconModule.ɵmod = ɵɵdefineNgModule({ type: _IconModule, declarations: [IconDirective], exports: [IconDirective] }); _IconModule.ɵinj = ɵɵdefineInjector({ providers: [IconService] }); var IconModule = _IconModule; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(IconModule, [{ type: NgModule, args: [{ exports: [IconDirective], declarations: [IconDirective], providers: [IconService] }] }], null, null); })(); // node_modules/@ant-design/icons-angular/fesm2022/ant-design-icons-angular-icons.mjs var BarsOutline = { name: "bars", theme: "outline", icon: '' }; var CalendarOutline = { name: "calendar", theme: "outline", icon: '' }; var CaretDownFill = { name: "caret-down", theme: "fill", icon: '' }; var CaretUpFill = { name: "caret-up", theme: "fill", icon: '' }; var CheckCircleFill = { name: "check-circle", theme: "fill", icon: '' }; var CheckCircleOutline = { name: "check-circle", theme: "outline", icon: '' }; var CheckOutline = { name: "check", theme: "outline", icon: '' }; var CaretDownOutline = { name: "caret-down", theme: "outline", icon: '' }; var CloseCircleFill = { name: "close-circle", theme: "fill", icon: '' }; var CloseCircleOutline = { name: "close-circle", theme: "outline", icon: '' }; var ClockCircleOutline = { name: "clock-circle", theme: "outline", icon: '' }; var CloseOutline = { name: "close", theme: "outline", icon: '' }; var CaretUpOutline = { name: "caret-up", theme: "outline", icon: '' }; var CopyOutline = { name: "copy", theme: "outline", icon: '' }; var DeleteOutline = { name: "delete", theme: "outline", icon: '' }; var DoubleLeftOutline = { name: "double-left", theme: "outline", icon: '' }; var DoubleRightOutline = { name: "double-right", theme: "outline", icon: '' }; var DownOutline = { name: "down", theme: "outline", icon: '' }; var EditOutline = { name: "edit", theme: "outline", icon: '' }; var EllipsisOutline = { name: "ellipsis", theme: "outline", icon: '' }; var ExclamationCircleOutline = { name: "exclamation-circle", theme: "outline", icon: '' }; var ExclamationCircleFill = { name: "exclamation-circle", theme: "fill", icon: '' }; var FileFill = { name: "file", theme: "fill", icon: '' }; var FilterFill = { name: "filter", theme: "fill", icon: '' }; var InfoCircleOutline = { name: "info-circle", theme: "outline", icon: '' }; var InfoCircleFill = { name: "info-circle", theme: "fill", icon: '' }; var FileOutline = { name: "file", theme: "outline", icon: '' }; var LeftOutline = { name: "left", theme: "outline", icon: '' }; var LoadingOutline = { name: "loading", theme: "outline", icon: '' }; var EyeOutline = { name: "eye", theme: "outline", icon: '' }; var PaperClipOutline = { name: "paper-clip", theme: "outline", icon: '' }; var QuestionCircleOutline = { name: "question-circle", theme: "outline", icon: '' }; var RightOutline = { name: "right", theme: "outline", icon: '' }; var RotateLeftOutline = { name: "rotate-left", theme: "outline", icon: '' }; var RotateRightOutline = { name: "rotate-right", theme: "outline", icon: '' }; var SearchOutline = { name: "search", theme: "outline", icon: '' }; var StarFill = { name: "star", theme: "fill", icon: '' }; var SwapRightOutline = { name: "swap-right", theme: "outline", icon: '' }; var UploadOutline = { name: "upload", theme: "outline", icon: '' }; var UpOutline = { name: "up", theme: "outline", icon: '' }; var VerticalAlignTopOutline = { name: "vertical-align-top", theme: "outline", icon: '' }; var ZoomInOutline = { name: "zoom-in", theme: "outline", icon: '' }; var ZoomOutOutline = { name: "zoom-out", theme: "outline", icon: '' }; // node_modules/ng-zorro-antd/fesm2022/ng-zorro-antd-icon.mjs var NZ_ICONS_USED_BY_ZORRO = [BarsOutline, CalendarOutline, CaretUpFill, CaretUpOutline, CaretDownFill, CaretDownOutline, CheckCircleFill, CheckCircleOutline, CheckOutline, ClockCircleOutline, CloseCircleOutline, CloseCircleFill, CloseOutline, CopyOutline, DeleteOutline, DoubleLeftOutline, DoubleRightOutline, DownOutline, EditOutline, EllipsisOutline, ExclamationCircleFill, ExclamationCircleOutline, EyeOutline, FileFill, FileOutline, FilterFill, InfoCircleFill, InfoCircleOutline, LeftOutline, LoadingOutline, PaperClipOutline, QuestionCircleOutline, RightOutline, RotateRightOutline, RotateLeftOutline, StarFill, SearchOutline, StarFill, UploadOutline, VerticalAlignTopOutline, UpOutline, SwapRightOutline, ZoomInOutline, ZoomOutOutline]; var NZ_ICONS = new InjectionToken("nz_icons"); var NZ_ICON_DEFAULT_TWOTONE_COLOR = new InjectionToken("nz_icon_default_twotone_color"); var DEFAULT_TWOTONE_COLOR = "#1890ff"; var _NzIconService = class _NzIconService extends IconService { get _disableDynamicLoading() { return !this.platform.isBrowser; } ngOnDestroy() { if (this.subscription) { this.subscription.unsubscribe(); this.subscription = null; } } normalizeSvgElement(svg) { if (!svg.getAttribute("viewBox")) { this._renderer.setAttribute(svg, "viewBox", "0 0 1024 1024"); } if (!svg.getAttribute("width") || !svg.getAttribute("height")) { this._renderer.setAttribute(svg, "width", "1em"); this._renderer.setAttribute(svg, "height", "1em"); } if (!svg.getAttribute("fill")) { this._renderer.setAttribute(svg, "fill", "currentColor"); } } fetchFromIconfont(opt) { const { scriptUrl } = opt; if (this._document && !this.iconfontCache.has(scriptUrl)) { const script = this._renderer.createElement("script"); this._renderer.setAttribute(script, "src", scriptUrl); this._renderer.setAttribute(script, "data-namespace", scriptUrl.replace(/^(https?|http):/g, "")); this._renderer.appendChild(this._document.body, script); this.iconfontCache.add(scriptUrl); } } createIconfontIcon(type) { return this._createSVGElementFromString(``); } constructor(rendererFactory, sanitizer, nzConfigService, platform, handler, _document, icons) { super(rendererFactory, handler, _document, sanitizer, [...NZ_ICONS_USED_BY_ZORRO, ...icons || []]); this.nzConfigService = nzConfigService; this.platform = platform; this.configUpdated$ = new Subject(); this.iconfontCache = /* @__PURE__ */ new Set(); this.subscription = null; this.onConfigChange(); this.configDefaultTwotoneColor(); this.configDefaultTheme(); } onConfigChange() { this.subscription = this.nzConfigService.getConfigChangeEventForComponent("icon").subscribe(() => { this.configDefaultTwotoneColor(); this.configDefaultTheme(); this.configUpdated$.next(); }); } configDefaultTheme() { const iconConfig = this.getConfig(); this.defaultTheme = iconConfig.nzTheme || "outline"; } configDefaultTwotoneColor() { const iconConfig = this.getConfig(); const defaultTwotoneColor = iconConfig.nzTwotoneColor || DEFAULT_TWOTONE_COLOR; let primaryColor = DEFAULT_TWOTONE_COLOR; if (defaultTwotoneColor) { if (defaultTwotoneColor.startsWith("#")) { primaryColor = defaultTwotoneColor; } else { warn("Twotone color must be a hex color!"); } } this.twoToneColor = { primaryColor }; } getConfig() { return this.nzConfigService.getConfigForComponent("icon") || {}; } }; _NzIconService.ɵfac = function NzIconService_Factory(t) { return new (t || _NzIconService)(ɵɵinject(RendererFactory2), ɵɵinject(DomSanitizer), ɵɵinject(NzConfigService), ɵɵinject(Platform), ɵɵinject(HttpBackend, 8), ɵɵinject(DOCUMENT, 8), ɵɵinject(NZ_ICONS, 8)); }; _NzIconService.ɵprov = ɵɵdefineInjectable({ token: _NzIconService, factory: _NzIconService.ɵfac, providedIn: "root" }); var NzIconService = _NzIconService; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NzIconService, [{ type: Injectable, args: [{ providedIn: "root" }] }], () => [{ type: RendererFactory2 }, { type: DomSanitizer }, { type: NzConfigService }, { type: Platform }, { type: HttpBackend, decorators: [{ type: Optional }] }, { type: void 0, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT] }] }, { type: void 0, decorators: [{ type: Optional }, { type: Inject, args: [NZ_ICONS] }] }], null); })(); var NZ_ICONS_PATCH = new InjectionToken("nz_icons_patch"); var _NzIconPatchService = class _NzIconPatchService { constructor(extraIcons, rootIconService) { this.extraIcons = extraIcons; this.rootIconService = rootIconService; this.patched = false; } doPatch() { if (this.patched) { return; } this.extraIcons.forEach((iconDefinition) => this.rootIconService.addIcon(iconDefinition)); this.patched = true; } }; _NzIconPatchService.ɵfac = function NzIconPatchService_Factory(t) { return new (t || _NzIconPatchService)(ɵɵinject(NZ_ICONS_PATCH, 2), ɵɵinject(NzIconService)); }; _NzIconPatchService.ɵprov = ɵɵdefineInjectable({ token: _NzIconPatchService, factory: _NzIconPatchService.ɵfac }); var NzIconPatchService = _NzIconPatchService; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NzIconPatchService, [{ type: Injectable }], () => [{ type: void 0, decorators: [{ type: Self }, { type: Inject, args: [NZ_ICONS_PATCH] }] }, { type: NzIconService }], null); })(); var _NzIconDirective = class _NzIconDirective extends IconDirective { set nzSpin(value) { this.spin = value; } set nzType(value) { this.type = value; } set nzTheme(value) { this.theme = value; } set nzTwotoneColor(value) { this.twoToneColor = value; } set nzIconfont(value) { this.iconfont = value; } constructor(ngZone, changeDetectorRef, elementRef, iconService, renderer, iconPatch) { super(iconService, elementRef, renderer); this.ngZone = ngZone; this.changeDetectorRef = changeDetectorRef; this.iconService = iconService; this.renderer = renderer; this.cacheClassName = null; this.nzRotate = 0; this.spin = false; this.destroy$ = new Subject(); if (iconPatch) { iconPatch.doPatch(); } this.el = elementRef.nativeElement; } ngOnChanges(changes) { const { nzType, nzTwotoneColor, nzSpin, nzTheme, nzRotate } = changes; if (nzType || nzTwotoneColor || nzSpin || nzTheme) { this.changeIcon2(); } else if (nzRotate) { this.handleRotate(this.el.firstChild); } else { this._setSVGElement(this.iconService.createIconfontIcon(`#${this.iconfont}`)); } } ngOnInit() { this.renderer.setAttribute(this.el, "class", `anticon ${this.el.className}`.trim()); } /** * If custom content is provided, try to normalize SVG elements. */ ngAfterContentChecked() { if (!this.type) { const children = this.el.children; let length = children.length; if (!this.type && children.length) { while (length--) { const child = children[length]; if (child.tagName.toLowerCase() === "svg") { this.iconService.normalizeSvgElement(child); } } } } } ngOnDestroy() { this.destroy$.next(); } /** * Replacement of `changeIcon` for more modifications. */ changeIcon2() { this.setClassName(); this.ngZone.runOutsideAngular(() => { from(this._changeIcon()).pipe(takeUntil(this.destroy$)).subscribe({ next: (svgOrRemove) => { this.ngZone.run(() => { this.changeDetectorRef.detectChanges(); if (svgOrRemove) { this.setSVGData(svgOrRemove); this.handleSpin(svgOrRemove); this.handleRotate(svgOrRemove); } }); }, error: warn }); }); } handleSpin(svg) { if (this.spin || this.type === "loading") { this.renderer.addClass(svg, "anticon-spin"); } else { this.renderer.removeClass(svg, "anticon-spin"); } } handleRotate(svg) { if (this.nzRotate) { this.renderer.setAttribute(svg, "style", `transform: rotate(${this.nzRotate}deg)`); } else { this.renderer.removeAttribute(svg, "style"); } } setClassName() { if (this.cacheClassName) { this.renderer.removeClass(this.el, this.cacheClassName); } this.cacheClassName = `anticon-${this.type}`; this.renderer.addClass(this.el, this.cacheClassName); } setSVGData(svg) { this.renderer.setAttribute(svg, "data-icon", this.type); this.renderer.setAttribute(svg, "aria-hidden", "true"); } }; _NzIconDirective.ɵfac = function NzIconDirective_Factory(t) { return new (t || _NzIconDirective)(ɵɵdirectiveInject(NgZone), ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(NzIconService), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(NzIconPatchService, 8)); }; _NzIconDirective.ɵdir = ɵɵdefineDirective({ type: _NzIconDirective, selectors: [["", "nz-icon", ""]], hostVars: 2, hostBindings: function NzIconDirective_HostBindings(rf, ctx) { if (rf & 2) { ɵɵclassProp("anticon", true); } }, inputs: { nzSpin: "nzSpin", nzRotate: "nzRotate", nzType: "nzType", nzTheme: "nzTheme", nzTwotoneColor: "nzTwotoneColor", nzIconfont: "nzIconfont" }, exportAs: ["nzIcon"], standalone: true, features: [ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature] }); var NzIconDirective = _NzIconDirective; __decorate([InputBoolean()], NzIconDirective.prototype, "nzSpin", null); (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NzIconDirective, [{ type: Directive, args: [{ selector: "[nz-icon]", exportAs: "nzIcon", host: { "[class.anticon]": "true" }, standalone: true }] }], () => [{ type: NgZone }, { type: ChangeDetectorRef }, { type: ElementRef }, { type: NzIconService }, { type: Renderer2 }, { type: NzIconPatchService, decorators: [{ type: Optional }] }], { nzSpin: [{ type: Input }], nzRotate: [{ type: Input }], nzType: [{ type: Input }], nzTheme: [{ type: Input }], nzTwotoneColor: [{ type: Input }], nzIconfont: [{ type: Input }] }); })(); var _NzIconModule = class _NzIconModule { static forRoot(icons) { return { ngModule: _NzIconModule, providers: [{ provide: NZ_ICONS, useValue: icons }] }; } static forChild(icons) { return { ngModule: _NzIconModule, providers: [NzIconPatchService, { provide: NZ_ICONS_PATCH, useValue: icons }] }; } }; _NzIconModule.ɵfac = function NzIconModule_Factory(t) { return new (t || _NzIconModule)(); }; _NzIconModule.ɵmod = ɵɵdefineNgModule({ type: _NzIconModule, imports: [NzIconDirective], exports: [NzIconDirective] }); _NzIconModule.ɵinj = ɵɵdefineInjector({}); var NzIconModule = _NzIconModule; (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NzIconModule, [{ type: NgModule, args: [{ imports: [NzIconDirective], exports: [NzIconDirective] }] }], null, null); })(); export { NZ_ICONS_USED_BY_ZORRO, NZ_ICONS, NZ_ICON_DEFAULT_TWOTONE_COLOR, DEFAULT_TWOTONE_COLOR, NzIconService, NZ_ICONS_PATCH, NzIconPatchService, NzIconDirective, NzIconModule }; //# sourceMappingURL=chunk-VWMHIMW7.js.map