import { isSignal } from '@angular/core';
import { clsx } from 'clsx';
import MiniSearch from 'minisearch';
import { of, delay, finalize, isObservable, from } from 'rxjs';
import { twMerge } from 'tailwind-merge';
import * as echarts from 'echarts';
import { FormArray, FormGroup } from '@angular/forms';

const Z_DIVIDE_SCALE = {
    none: 1,
    thousand: 1_000,
    million: 1_000_000,
    billion: 1_000_000_000,
};
const Z_LOCALE_MAP = {
    vi: 'vi-VN',
    en: 'en-US',
};
const Z_EXCEL_NUMBER_FORMAT_MAP = {
    '1.0-0': '#,##0',
    '1.0-1': '#,##0.0',
    '1.0-2': '#,##0.00',
    '1.0-3': '#,##0.000',
    '1.1-1': '#,##0.0',
    '1.1-2': '#,##0.00',
    '1.1-3': '#,##0.000',
    '1.2-2': '#,##0.00',
};

const zMergeClasses = (...inputs) => twMerge(clsx(inputs));
const zNormalize = (value) => value
    .trim()
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, '_')
    .replace(/^_+|_+$/g, '');
const zTransform = (value) => {
    if (typeof value === 'string') {
        return value === '';
    }
    if (typeof value === 'number') {
        return value === 0;
    }
    return value;
};
const zUuid = (prefix = '') => {
    const id = crypto.randomUUID();
    return prefix ? `${prefix}-${id}` : id;
};
const zNoop = () => void 0;
const zFormatNum = (value, options = {}) => {
    const { divide = 'none', format = '1.0-2', percent = false, emptyCheck = 'strict', locale = 'vi', placeholder = '-', } = options;
    if (value === null || value === undefined) {
        return placeholder;
    }
    const numValue = Number(value);
    if (Number.isNaN(numValue)) {
        return placeholder;
    }
    if (emptyCheck === 'includeZero' && numValue === 0) {
        return placeholder;
    }
    const scaledValue = numValue / Z_DIVIDE_SCALE[divide];
    const matched = format.match(/1\.(\d)-(\d)/);
    const minDigits = matched ? parseInt(matched[1], 10) : 0;
    const maxDigits = matched ? parseInt(matched[2], 10) : 2;
    const lang = document.documentElement.lang || locale;
    const formatted = new Intl.NumberFormat(Z_LOCALE_MAP[lang] || 'vi-VN', {
        minimumFractionDigits: minDigits,
        maximumFractionDigits: maxDigits,
    }).format(scaledValue);
    return percent ? `${formatted}%` : formatted;
};
const zFormatNumExcel = (cell, value, options = {}) => {
    const { divide = 'none', format = '1.0-1', percent = false, emptyCheck = 'strict' } = options;
    if (value === null || value === undefined || value === '') {
        return undefined;
    }
    const numValue = Number(value);
    if (Number.isNaN(numValue)) {
        return undefined;
    }
    if (emptyCheck === 'includeZero' && numValue === 0) {
        return undefined;
    }
    const scaledValue = numValue / Z_DIVIDE_SCALE[divide];
    let numFmt = Z_EXCEL_NUMBER_FORMAT_MAP[format] || '#,##0.0';
    if (percent) {
        numFmt = numFmt + '"%"';
    }
    if (cell) {
        cell.value = '\u200B' + scaledValue;
        cell.numFmt = numFmt;
    }
    return scaledValue;
};
const zCapitalCase = (text, type = 'first') => {
    if (!text) {
        return '';
    }
    switch (type) {
        case 'all':
            return text.toUpperCase();
        case 'sentence':
            return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
        case 'first':
        default:
            return text
                .toLowerCase()
                .split(' ')
                .map(word => word.charAt(0).toUpperCase() + word.slice(1))
                .join(' ');
    }
};
const zDecodeUnicode = (str) => {
    if (!str) {
        return '';
    }
    str = str.replace(/\\\\u/g, '\\u');
    str = str.replace(/\\u([\dA-Fa-f]{4})/g, (_, g1) => String.fromCharCode(parseInt(g1, 16)));
    str = str.replace(/(^|[^\\])u([\dA-Fa-f]{4})/g, (_, p1, g1) => p1 + String.fromCharCode(parseInt(g1, 16)));
    return str.replace(/([\uD800-\uDBFF])([\uDC00-\uDFFF])/g, (_, high, low) => {
        const hi = high.charCodeAt(0);
        const lo = low.charCodeAt(0);
        const codePoint = (hi - 0xd800) * 0x400 + (lo - 0xdc00) + 0x10000;
        return String.fromCodePoint(codePoint);
    });
};
const zRandomColor = () => {
    const h = Math.floor(Math.random() * 360);
    const s = Math.floor(Math.random() * 40) + 60;
    const l = Math.floor(Math.random() * 20) + 60;
    const hsl = `hsl(${h}, ${s}%, ${l}%)`;
    const a = s / 100;
    const b = l / 100;
    const c = (1 - Math.abs(2 * b - 1)) * a;
    const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
    const m = b - c / 2;
    const hueSegment = Math.floor(h / 60) % 6;
    const rgbMap = [
        [c, x, 0],
        [x, c, 0],
        [0, c, x],
        [0, x, c],
        [x, 0, c],
        [c, 0, x],
    ];
    const [r, g, bl] = rgbMap[hueSegment];
    const R = Math.round((r + m) * 255);
    const G = Math.round((g + m) * 255);
    const B = Math.round((bl + m) * 255);
    const rgb = `rgb(${R}, ${G}, ${B})`;
    const toHex = (n) => n.toString(16).padStart(2, '0');
    const hex = `#${toHex(R)}${toHex(G)}${toHex(B)}`;
    return { hex, rgb, hsl };
};
const zConvertColorToArgb = (color) => {
    if (color.startsWith('#')) {
        return 'FF' + color.substring(1).toUpperCase();
    }
    if (color.startsWith('rgb')) {
        const matches = color.match(/\d+/g);
        if (matches && matches.length >= 3) {
            const r = parseInt(matches[0]).toString(16).padStart(2, '0');
            const g = parseInt(matches[1]).toString(16).padStart(2, '0');
            const b = parseInt(matches[2]).toString(16).padStart(2, '0');
            return `FF${r}${g}${b}`.toUpperCase();
        }
    }
    return 'FF000000';
};
const zCleanObject = (obj) => {
    if (obj !== Object(obj)) {
        return obj;
    }
    return Object.entries(obj).reduce((acc, [key, value]) => {
        if (value === null || value === undefined) {
            return acc;
        }
        const cleaned = zCleanObject(value);
        if (cleaned !== null &&
            cleaned !== undefined &&
            (typeof cleaned !== 'object' || Object.keys(cleaned).length > 0)) {
            acc[key] = cleaned;
        }
        return acc;
    }, {});
};
const zTreeFlatten = (list, keyMap, parentKeyMap, sortFn) => {
    const sortedList = sortFn ? [...list].sort(sortFn) : list;
    const byParent = {};
    for (const item of sortedList) {
        const parentKey = item[parentKeyMap] ?? 'root';
        if (!byParent[parentKey]) {
            byParent[parentKey] = [];
        }
        byParent[parentKey].push(item);
    }
    const flatten = (parentKey, level, parentsKey) => {
        const children = byParent[parentKey ?? 'root'] || [];
        return children.flatMap(child => {
            const keyVal = String(child[keyMap]);
            const newParents = [...parentsKey, keyVal];
            return [{ ...child, level, parentsKey }, ...flatten(keyVal, level + 1, newParents)];
        });
    };
    return flatten(null, 0, []);
};
const zTreeBuild = (list, keyMap, parentKeyMap, sortFn) => {
    const sortedList = sortFn ? [...list].sort(sortFn) : list;
    const byParent = {};
    for (const item of sortedList) {
        const parentKey = item[parentKeyMap] ?? 'root';
        if (!byParent[parentKey]) {
            byParent[parentKey] = [];
        }
        byParent[parentKey].push(item);
    }
    const buildTree = (parentKey, level, parentsKey) => {
        const children = byParent[parentKey ?? 'root'] || [];
        return children.map(child => {
            const keyVal = String(child[keyMap]);
            const newParents = [...parentsKey, keyVal];
            return {
                ...child,
                level,
                parentsKey,
                children: buildTree(keyVal, level + 1, newParents),
            };
        });
    };
    return buildTree(null, 0, []);
};
const VIETNAMESE_MAP = {
    à: 'a',
    á: 'a',
    ạ: 'a',
    ả: 'a',
    ã: 'a',
    â: 'a',
    ầ: 'a',
    ấ: 'a',
    ậ: 'a',
    ẩ: 'a',
    ẫ: 'a',
    ă: 'a',
    ằ: 'a',
    ắ: 'a',
    ặ: 'a',
    ẳ: 'a',
    ẵ: 'a',
    è: 'e',
    é: 'e',
    ẹ: 'e',
    ẻ: 'e',
    ẽ: 'e',
    ê: 'e',
    ề: 'e',
    ế: 'e',
    ệ: 'e',
    ể: 'e',
    ễ: 'e',
    ì: 'i',
    í: 'i',
    ị: 'i',
    ỉ: 'i',
    ĩ: 'i',
    ò: 'o',
    ó: 'o',
    ọ: 'o',
    ỏ: 'o',
    õ: 'o',
    ô: 'o',
    ồ: 'o',
    ố: 'o',
    ộ: 'o',
    ổ: 'o',
    ỗ: 'o',
    ơ: 'o',
    ờ: 'o',
    ớ: 'o',
    ợ: 'o',
    ở: 'o',
    ỡ: 'o',
    ù: 'u',
    ú: 'u',
    ụ: 'u',
    ủ: 'u',
    ũ: 'u',
    ư: 'u',
    ừ: 'u',
    ứ: 'u',
    ự: 'u',
    ử: 'u',
    ữ: 'u',
    ỳ: 'y',
    ý: 'y',
    ỵ: 'y',
    ỷ: 'y',
    ỹ: 'y',
    đ: 'd',
    À: 'A',
    Á: 'A',
    Ạ: 'A',
    Ả: 'A',
    Ã: 'A',
    Â: 'A',
    Ầ: 'A',
    Ấ: 'A',
    Ậ: 'A',
    Ẩ: 'A',
    Ẫ: 'A',
    Ă: 'A',
    Ằ: 'A',
    Ắ: 'A',
    Ặ: 'A',
    Ẳ: 'A',
    Ẵ: 'A',
    È: 'E',
    É: 'E',
    Ẹ: 'E',
    Ẻ: 'E',
    Ẽ: 'E',
    Ê: 'E',
    Ề: 'E',
    Ế: 'E',
    Ệ: 'E',
    Ể: 'E',
    Ễ: 'E',
    Ì: 'I',
    Í: 'I',
    Ị: 'I',
    Ỉ: 'I',
    Ĩ: 'I',
    Ò: 'O',
    Ó: 'O',
    Ọ: 'O',
    Ỏ: 'O',
    Õ: 'O',
    Ô: 'O',
    Ồ: 'O',
    Ố: 'O',
    Ộ: 'O',
    Ổ: 'O',
    Ỗ: 'O',
    Ơ: 'O',
    Ờ: 'O',
    Ớ: 'O',
    Ợ: 'O',
    Ở: 'O',
    Ỡ: 'O',
    Ù: 'U',
    Ú: 'U',
    Ụ: 'U',
    Ủ: 'U',
    Ũ: 'U',
    Ư: 'U',
    Ừ: 'U',
    Ứ: 'U',
    Ự: 'U',
    Ử: 'U',
    Ữ: 'U',
    Ỳ: 'Y',
    Ý: 'Y',
    Ỵ: 'Y',
    Ỷ: 'Y',
    Ỹ: 'Y',
    Đ: 'D',
};
const zRemoveVietnamese = (str) => str
    .split('')
    .map(char => VIETNAMESE_MAP[char] || char)
    .join('');
const getDeepValue = (obj, path) => {
    try {
        const value = path.split('.').reduce((acc, key) => {
            if (acc && typeof acc === 'object' && key in acc) {
                return acc[key];
            }
            return '';
        }, obj);
        if (Array.isArray(value)) {
            return value.map(v => String(v)).join(' ');
        }
        return value;
    }
    catch {
        return '';
    }
};
const zMiniSearch = (data, query, fields, idField) => {
    if (!query) {
        return data;
    }
    const fieldStrings = fields.map(f => String(f));
    const idFieldString = idField ? String(idField) : '_index';
    const useCustomId = !!idField;
    const flatData = data.map((item, index) => ({
        ...item,
        ...(!useCustomId && { _index: index }),
        ...Object.fromEntries(fieldStrings.map(field => [field, getDeepValue(item, field)])),
    }));
    const search = new MiniSearch({
        idField: idFieldString,
        fields: fieldStrings,
        storeFields: [idFieldString],
        tokenize: (text) => zRemoveVietnamese(text.toLowerCase())
            .split(/[\s@.\-_]+/)
            .filter(Boolean),
        processTerm: (term) => zRemoveVietnamese(term.toLowerCase()),
    });
    search.addAll(flatData);
    const results = search.search(query, { prefix: true });
    if (useCustomId) {
        const resultIds = new Set(results.map(result => result.id));
        return data.filter(item => resultIds.has(item[idFieldString]));
    }
    return results.map(result => data[result._index]);
};
const zMiniSearch$ = (data, query, fields, options) => {
    const { idField, loading, fakeDelay = 200 } = options ?? {};
    if (loading && isSignal(loading)) {
        loading.set(true);
    }
    return of(zMiniSearch(data, query, fields, idField)).pipe(delay(fakeDelay), finalize(() => {
        if (loading && isSignal(loading)) {
            loading.set(false);
        }
    }));
};
const _detectDevice = (ua) => {
    if (/Mobi|Android.*Mobile|iPhone|iPod|BlackBerry|IEMobile/i.test(ua)) {
        return 'mobile';
    }
    if (/iPad|Android(?!.*Mobile)|Tablet/i.test(ua)) {
        return 'tablet';
    }
    return 'desktop';
};
const zDetectBrowser = () => {
    const ua = navigator.userAgent;
    const result = {
        name: 'Unknown',
        version: '',
        agent: ua,
        device: _detectDevice(ua),
        time: new Date().toISOString(),
    };
    if (!navigator.userAgentData) {
        return result;
    }
    const brands = navigator.userAgentData.brands || [];
    const isMobile = navigator.userAgentData.mobile;
    if (isMobile) {
        result.device = 'mobile';
    }
    const mainBrand = brands.find((b) => !['Chromium', 'Not_A Brand', 'Not A;Brand', 'Not/A)Brand'].includes(b.brand));
    if (mainBrand) {
        result.name = mainBrand.brand.replace('Google ', '');
        result.version = mainBrand.version;
        return result;
    }
    const chromium = brands.find((b) => b.brand === 'Chromium');
    if (chromium) {
        result.name = 'Chrome';
        result.version = chromium.version;
    }
    return result;
};

/** Số option mặc định mỗi lần component tự gọi load. */
const Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE = 20;
/** Chuẩn hóa kết quả sync/Promise/Observable về Observable để component xử lý thống nhất. */
function zToAsyncOptionsObservable(result) {
    if (isObservable(result)) {
        return result;
    }
    if (zIsPromiseLike(result)) {
        return from(result);
    }
    return of(result);
}
/** Gộp option mới vào danh sách cũ và loại bỏ phần tử trùng theo dedupeBy/default key. */
function zMergeAsyncOptions(current, next, dedupeBy) {
    const merged = new Map();
    for (const option of [...current, ...next]) {
        const key = zGetAsyncOptionKey(option, dedupeBy);
        if (!merged.has(key)) {
            merged.set(key, option);
        }
    }
    return Array.from(merged.values());
}
/** Tính còn dữ liệu để load-more dựa trên hasMore, total hoặc độ dài page vừa trả về. */
function zResolveAsyncOptionsHasMore(result, pageSize, loadedCount) {
    if (result.items.length === 0) {
        return false;
    }
    if (typeof result.hasMore === 'boolean') {
        return result.hasMore;
    }
    if (typeof result.total === 'number') {
        return loadedCount < result.total;
    }
    return result.items.length >= pageSize;
}
/** Lấy khóa ổn định cho option, hỗ trợ value là object và vẫn cho phép truyền dedupeBy riêng. */
function zGetAsyncOptionKey(option, dedupeBy) {
    const customKey = dedupeBy?.(option);
    if (customKey !== undefined && customKey !== null) {
        return customKey;
    }
    const record = option;
    // eslint-disable-next-line prefer-destructuring
    const value = record['value'];
    if (!zIsRecord(value)) {
        return value ?? record['label'] ?? option;
    }
    for (const key of ['id', 'code', 'key', 'value']) {
        if (key in value) {
            return value[key];
        }
    }
    try {
        return JSON.stringify(value);
    }
    catch {
        return record['label'] ?? value;
    }
}
function zIsPromiseLike(value) {
    return zIsRecord(value) && typeof value['then'] === 'function';
}
function zIsRecord(value) {
    return typeof value === 'object' && value !== null;
}

const Z_ECHARTS_DEFAULT_FONT = `'Lexend', 'Arial', 'Helvetica', 'sans-serif'`;
/**
 * Register custom Z-UI theme for ECharts
 * @param options - Theme configuration options
 */
function zRegisterEchartsTheme(options = {}) {
    const { themeName = 'zTheme', fontFamily = Z_ECHARTS_DEFAULT_FONT } = options;
    echarts.registerTheme(themeName, {
        textStyle: {
            fontFamily,
            color: '#333',
        },
        title: {
            textStyle: {
                fontFamily,
                fontWeight: '450',
            },
        },
        legend: {
            textStyle: {
                fontFamily,
                fontSize: 13,
                color: '#333',
            },
        },
        tooltip: {
            textStyle: {
                fontFamily,
                color: '#333',
                fontSize: 13,
            },
        },
        axisPointer: {
            lineStyle: { color: '#999' },
            crossStyle: { color: '#999' },
        },
        categoryAxis: {
            axisLine: { lineStyle: { color: '#ccc' } },
            axisTick: { lineStyle: { color: '#ccc' } },
            axisLabel: {
                fontFamily,
                color: '#444',
                fontSize: 12,
            },
            splitLine: { show: false },
        },
        valueAxis: {
            axisLine: { lineStyle: { color: '#ccc' } },
            axisTick: { lineStyle: { color: '#ccc' } },
            axisLabel: {
                fontFamily,
                color: '#444',
                fontSize: 12,
            },
            splitLine: { lineStyle: { color: '#eee' } },
        },
    });
}

/**
 * Submit form and mark invalid controls as dirty (supports nested FormArray/FormGroup)
 * @param form - FormGroup or FormArray to submit
 * @returns true if form is valid, false otherwise
 */
const zValidForm = (form) => {
    if (form.invalid) {
        markFormAsInvalid(form);
        return false;
    }
    return true;
};
/**
 * Recursively mark invalid controls as dirty (handles nested FormArray/FormGroup)
 */
const markFormAsInvalid = (form) => {
    Object.values(form.controls).forEach(control => {
        if (control instanceof FormArray) {
            markFormAsInvalid(control);
            return;
        }
        if (control instanceof FormGroup) {
            markFormAsInvalid(control);
            return;
        }
        if (control?.invalid) {
            control.markAsDirty();
            control.updateValueAndValidity({ onlySelf: true });
        }
    });
};
/**
 * Debug invalid form controls by logging to console
 * @param form - FormGroup to debug
 * @param parentKey - Parent key for nested controls
 */
const zDebugFormInvalid = (form, parentKey = '') => {
    Object.keys(form.controls).forEach(key => {
        const control = form.get(key);
        const controlPath = parentKey ? `${parentKey}.${key}` : key;
        if (control instanceof FormGroup) {
            zDebugFormInvalid(control, controlPath);
            return;
        }
        if (control instanceof FormArray) {
            control.controls.forEach((ctrl, index) => {
                const arrayPath = `${controlPath}[${index}]`;
                if (ctrl instanceof FormGroup) {
                    zDebugFormInvalid(ctrl, arrayPath);
                    return;
                }
                if (ctrl?.invalid) {
                    console.log(`❌ Field: ${arrayPath}`, ctrl.errors);
                }
            });
            return;
        }
        if (control?.invalid) {
            console.log(`❌ Field: ${controlPath}`, control.errors);
        }
    });
};

const Z_EMOJI_SHEET = [
    {
        id: 'smileys-people',
        labelKey: 'i18n_z_ui_emoji_category_smileys',
        icon: 'lucideSmile',
        emojis: [
            '😀',
            '😁',
            '😂',
            '🤣',
            '😃',
            '😄',
            '😅',
            '😆',
            '😉',
            '😊',
            '😋',
            '😎',
            '😍',
            '😘',
            '😗',
            '😙',
            '😚',
            '🙂',
            '🤗',
            '🤩',
            '🤔',
            '😐',
            '😑',
            '😶',
            '🙄',
            '😏',
            '😣',
            '😥',
            '😮',
            '😴',
            '😷',
            '🤒',
            '🤕',
            '😵',
            '😡',
            '😤',
            '😭',
            '😱',
            '👋',
            '🤚',
            '✋',
            '👌',
            '👍',
            '👎',
            '✌️',
            '🤞',
            '🤟',
            '🙏',
            '👏',
            '💪',
            '🤝',
            '🙌',
        ],
    },
    {
        id: 'animals-nature',
        labelKey: 'i18n_z_ui_emoji_category_animals',
        icon: 'lucidePawPrint',
        emojis: [
            '🐶',
            '🐱',
            '🐭',
            '🐹',
            '🐰',
            '🦊',
            '🐻',
            '🐼',
            '🐨',
            '🐯',
            '🦁',
            '🐮',
            '🐷',
            '🐸',
            '🐵',
            '🐔',
            '🐧',
            '🐦',
            '🐤',
            '🐣',
            '🦆',
            '🦅',
            '🐺',
            '🐗',
            '🐴',
            '🐝',
            '🐛',
            '🦋',
            '🐌',
            '🐞',
            '🐜',
            '🐢',
            '🐍',
            '🐙',
            '🐠',
            '🐟',
            '🐬',
            '🐳',
            '🐋',
            '🌸',
            '🌹',
            '🌻',
            '🍀',
            '🌴',
            '🌵',
            '🌊',
            '🌈',
            '⚡',
            '🌙',
            '⭐',
            '☀️',
            '⛄',
        ],
    },
    {
        id: 'food-drink',
        labelKey: 'i18n_z_ui_emoji_category_food',
        icon: 'lucideApple',
        emojis: [
            '🍎',
            '🍐',
            '🍊',
            '🍋',
            '🍌',
            '🍉',
            '🍇',
            '🍓',
            '🍒',
            '🍑',
            '🍍',
            '🥭',
            '🍅',
            '🥑',
            '🥦',
            '🥕',
            '🌽',
            '🥔',
            '🍞',
            '🥐',
            '🥨',
            '🧀',
            '🥚',
            '🍳',
            '🥞',
            '🥓',
            '🍔',
            '🍟',
            '🍕',
            '🌮',
            '🌯',
            '🍜',
            '🍝',
            '🍣',
            '🍤',
            '🍱',
            '🍚',
            '🍰',
            '🧁',
            '🍩',
            '🍪',
            '🍫',
            '🍿',
            '🍺',
            '🍷',
            '🍸',
            '🍹',
            '☕',
            '🍵',
            '🧋',
        ],
    },
    {
        id: 'activities',
        labelKey: 'i18n_z_ui_emoji_category_activities',
        icon: 'lucidePartyPopper',
        emojis: [
            '⚽',
            '🏀',
            '🏈',
            '⚾',
            '🎾',
            '🏐',
            '🏉',
            '🎱',
            '🏓',
            '🏸',
            '🥊',
            '🥋',
            '🏆',
            '🎯',
            '🪀',
            '🎮',
            '🎲',
            '🎼',
            '🎹',
            '🎸',
            '🎷',
            '🥁',
            '🎤',
            '🎧',
            '🎨',
            '🎬',
            '🎭',
            '🎪',
            '🎟️',
            '🎫',
            '🏅',
            '🥇',
            '🥈',
            '🥉',
            '🚴',
            '🏄',
            '⛷️',
            '🧗',
        ],
    },
    {
        id: 'travel-places',
        labelKey: 'i18n_z_ui_emoji_category_travel',
        icon: 'lucideCar',
        emojis: [
            '🚗',
            '🚕',
            '🚙',
            '🚌',
            '🚎',
            '🚐',
            '🚑',
            '🚒',
            '🚓',
            '🚚',
            '🚛',
            '🚜',
            '🏍️',
            '🚲',
            '✈️',
            '🚀',
            '🛸',
            '🚁',
            '🛳️',
            '⛵',
            '🚤',
            '🚆',
            '🚇',
            '🚉',
            '🗺️',
            '🌍',
            '🌎',
            '🌏',
            '🏖️',
            '🏕️',
            '🏞️',
            '🏟️',
            '🏛️',
            '🏰',
            '🏯',
            '🗽',
            '🗼',
            '🏙️',
            '🌅',
            '🌄',
            '⛺',
        ],
    },
    {
        id: 'objects',
        labelKey: 'i18n_z_ui_emoji_category_objects',
        icon: 'lucideLightbulb',
        emojis: [
            '💡',
            '🔦',
            '🧰',
            '🔧',
            '🔨',
            '🪛',
            '⌛',
            '⏰',
            '📱',
            '💻',
            '🖥️',
            '🖨️',
            '🎥',
            '📷',
            '📸',
            '📺',
            '📻',
            '🎙️',
            '📦',
            '📌',
            '📎',
            '✂️',
            '🧷',
            '🔑',
            '🔒',
            '🔓',
            '🧲',
            '🧪',
            '🧫',
            '🧬',
            '🔭',
            '🧯',
            '🛒',
            '🧺',
            '🪑',
            '🛋️',
            '🛏️',
            '💼',
            '🎒',
            '👓',
            '🕶️',
            '☂️',
            '🕯️',
        ],
    },
    {
        id: 'symbols',
        labelKey: 'i18n_z_ui_emoji_category_symbols',
        icon: 'lucideHash',
        emojis: [
            '❤️',
            '🧡',
            '💛',
            '💚',
            '💙',
            '💜',
            '🖤',
            '🤍',
            '🤎',
            '💔',
            '❣️',
            '💯',
            '✅',
            '☑️',
            '✔️',
            '✖️',
            '➕',
            '➖',
            '➗',
            '⭐',
            '🌟',
            '✨',
            '🔥',
            '💥',
            '⚡',
            '☮️',
            '☢️',
            '☣️',
            '♻️',
            '⚠️',
            '❗',
            '❓',
            '‼️',
            '⁉️',
            '♾️',
            '🔞',
            '🔔',
            '🔕',
            '📣',
            '🔊',
            '🔈',
        ],
    },
    {
        id: 'flags',
        labelKey: 'i18n_z_ui_emoji_category_flags',
        icon: 'lucideFlag',
        emojis: [
            '🇻🇳',
            '🇺🇸',
            '🇬🇧',
            '🇫🇷',
            '🇩🇪',
            '🇯🇵',
            '🇰🇷',
            '🇨🇳',
            '🇨🇦',
            '🇦🇺',
            '🇮🇹',
            '🇪🇸',
            '🇷🇺',
            '🇧🇷',
            '🇮🇳',
            '🇲🇽',
            '🇸🇬',
            '🇹🇭',
            '🇵🇭',
            '🇮🇩',
            '🇲🇾',
            '🇳🇱',
            '🇸🇪',
            '🇳🇴',
            '🇩🇰',
            '🇫🇮',
        ],
    },
];

const Z_EMOJI_KEYWORDS = new Map([
    // Smileys & People
    ['😀', ['grinning', 'face', 'happy', 'smile']],
    ['😁', ['grin', 'face', 'happy', 'smile', 'teeth']],
    ['😂', ['joy', 'tears', 'laugh', 'cry', 'happy', 'funny']],
    ['🤣', ['rofl', 'rolling', 'laugh', 'funny', 'floor']],
    ['😃', ['smiley', 'happy', 'face', 'smile']],
    ['😄', ['smile', 'happy', 'face', 'eyes']],
    ['😅', ['sweat', 'smile', 'nervous', 'relief']],
    ['😆', ['hehe', 'laugh', 'happy', 'smile']],
    ['😉', ['wink', 'face', 'flirt']],
    ['😊', ['blush', 'happy', 'shy', 'smile', 'face']],
    ['😋', ['yum', 'tongue', 'delicious', 'food', 'taste']],
    ['😎', ['cool', 'sunglasses', 'face']],
    ['😍', ['heart', 'eyes', 'love', 'crush']],
    ['😘', ['kiss', 'heart', 'love', 'face']],
    ['😗', ['kiss', 'face']],
    ['😙', ['kiss', 'smile', 'face']],
    ['😚', ['kiss', 'closed', 'eyes', 'face']],
    ['🙂', ['slightly', 'smile', 'face']],
    ['🤗', ['hug', 'hugs', 'face', 'open', 'hands']],
    ['🤩', ['star', 'struck', 'wow', 'excited', 'face']],
    ['🤔', ['thinking', 'hmm', 'face', 'think']],
    ['😐', ['neutral', 'face', 'meh']],
    ['😑', ['expressionless', 'face', 'blank']],
    ['😶', ['no', 'mouth', 'silent', 'face', 'mute']],
    ['🙄', ['eye', 'roll', 'face']],
    ['😏', ['smirk', 'face', 'suggestive']],
    ['😣', ['persevere', 'face', 'struggle']],
    ['😥', ['sad', 'relief', 'face', 'sweat']],
    ['😮', ['open', 'mouth', 'surprised', 'face', 'wow']],
    ['😴', ['sleep', 'zzz', 'face', 'tired']],
    ['😷', ['mask', 'sick', 'ill', 'face', 'cold']],
    ['🤒', ['thermometer', 'sick', 'ill', 'face', 'fever']],
    ['🤕', ['bandage', 'hurt', 'face', 'injured']],
    ['😵', ['dizzy', 'face', 'confused']],
    ['😡', ['angry', 'mad', 'face', 'pout']],
    ['😤', ['triumph', 'angry', 'face', 'steam', 'nose']],
    ['😭', ['sob', 'cry', 'sad', 'face', 'tears', 'weep']],
    ['😱', ['scream', 'fear', 'face', 'shock', 'horror']],
    ['👋', ['wave', 'hello', 'hi', 'bye', 'hand']],
    ['🤚', ['raised', 'back', 'hand']],
    ['✋', ['hand', 'stop', 'high', 'five']],
    ['👌', ['ok', 'hand', 'perfect', 'good']],
    ['👍', ['thumbs', 'up', 'like', 'good', 'yes', 'hand']],
    ['👎', ['thumbs', 'down', 'no', 'bad', 'hand']],
    ['✌️', ['peace', 'victory', 'hand', 'two']],
    ['🤞', ['crossed', 'fingers', 'luck', 'hope', 'hand']],
    ['🤟', ['love', 'you', 'rock', 'hand', 'sign']],
    ['🙏', ['pray', 'please', 'thank', 'hands', 'fold']],
    ['👏', ['clap', 'bravo', 'applause', 'hand']],
    ['💪', ['muscle', 'strong', 'bicep', 'flex', 'arm']],
    ['🤝', ['handshake', 'deal', 'agree', 'meet', 'hands']],
    ['🙌', ['raised', 'hands', 'hooray', 'celebrate', 'party']],
    // Animals & Nature
    ['🐶', ['dog', 'puppy', 'pet', 'face']],
    ['🐱', ['cat', 'kitten', 'pet', 'face']],
    ['🐭', ['mouse', 'face']],
    ['🐹', ['hamster', 'face', 'pet']],
    ['🐰', ['rabbit', 'bunny', 'face']],
    ['🦊', ['fox', 'face']],
    ['🐻', ['bear', 'face']],
    ['🐼', ['panda', 'face']],
    ['🐨', ['koala', 'face']],
    ['🐯', ['tiger', 'face']],
    ['🦁', ['lion', 'face']],
    ['🐮', ['cow', 'face']],
    ['🐷', ['pig', 'face']],
    ['🐸', ['frog', 'face']],
    ['🐵', ['monkey', 'face']],
    ['🐔', ['chicken', 'hen', 'bird']],
    ['🐧', ['penguin', 'bird', 'face']],
    ['🐦', ['bird', 'tweet', 'face']],
    ['🐤', ['baby', 'chick', 'bird', 'face']],
    ['🐣', ['hatching', 'chick', 'bird', 'face']],
    ['🦆', ['duck', 'bird']],
    ['🦅', ['eagle', 'bird']],
    ['🐺', ['wolf', 'face']],
    ['🐗', ['boar', 'pig']],
    ['🐴', ['horse', 'face']],
    ['🐝', ['bee', 'honey', 'insect', 'buzz']],
    ['🐛', ['bug', 'insect', 'caterpillar']],
    ['🦋', ['butterfly', 'insect']],
    ['🐌', ['snail', 'slow']],
    ['🐞', ['ladybug', 'beetle', 'insect', 'bug']],
    ['🐜', ['ant', 'insect']],
    ['🐢', ['turtle', 'slow', 'tortoise']],
    ['🐍', ['snake', 'python', 'viper']],
    ['🐙', ['octopus', 'sea']],
    ['🐠', ['tropical', 'fish', 'sea']],
    ['🐟', ['fish', 'sea']],
    ['🐬', ['dolphin', 'sea', 'flipper']],
    ['🐳', ['whale', 'sea', 'spout']],
    ['🐋', ['whale', 'sea']],
    ['🌸', ['cherry', 'blossom', 'flower', 'spring']],
    ['🌹', ['rose', 'flower', 'love']],
    ['🌻', ['sunflower', 'flower']],
    ['🍀', ['four', 'leaf', 'clover', 'luck', 'lucky']],
    ['🌴', ['palm', 'tree', 'tropical']],
    ['🌵', ['cactus', 'desert', 'plant']],
    ['🌊', ['wave', 'sea', 'ocean', 'water']],
    ['🌈', ['rainbow', 'colors', 'pride']],
    ['⚡', ['lightning', 'thunder', 'bolt', 'electric', 'zap']],
    ['🌙', ['moon', 'crescent', 'night', 'sleep']],
    ['⭐', ['star', 'favorite']],
    ['☀️', ['sun', 'sunny', 'bright', 'weather', 'hot']],
    ['⛄', ['snowman', 'winter', 'cold', 'christmas']],
    // Food & Drink
    ['🍎', ['apple', 'fruit', 'red']],
    ['🍐', ['pear', 'fruit']],
    ['🍊', ['orange', 'fruit', 'tangerine', 'citrus']],
    ['🍋', ['lemon', 'fruit', 'citrus', 'sour']],
    ['🍌', ['banana', 'fruit']],
    ['🍉', ['watermelon', 'fruit', 'summer']],
    ['🍇', ['grapes', 'fruit', 'wine']],
    ['🍓', ['strawberry', 'fruit', 'berry']],
    ['🍒', ['cherry', 'fruit', 'red']],
    ['🍑', ['peach', 'fruit']],
    ['🍍', ['pineapple', 'fruit', 'tropical']],
    ['🥭', ['mango', 'fruit', 'tropical']],
    ['🍅', ['tomato', 'fruit', 'vegetable', 'red']],
    ['🥑', ['avocado', 'fruit', 'green']],
    ['🥦', ['broccoli', 'vegetable', 'green']],
    ['🥕', ['carrot', 'vegetable', 'orange']],
    ['🌽', ['corn', 'vegetable']],
    ['🥔', ['potato', 'vegetable']],
    ['🍞', ['bread', 'toast', 'food']],
    ['🥐', ['croissant', 'bread', 'french', 'food']],
    ['🥨', ['pretzel', 'bread', 'snack']],
    ['🧀', ['cheese', 'food', 'yellow']],
    ['🥚', ['egg', 'food']],
    ['🍳', ['fried', 'egg', 'breakfast', 'food', 'cook']],
    ['🥞', ['pancakes', 'breakfast', 'food']],
    ['🥓', ['bacon', 'breakfast', 'food', 'meat']],
    ['🍔', ['burger', 'hamburger', 'food', 'fast', 'food']],
    ['🍟', ['fries', 'french', 'fries', 'food', 'fast', 'food']],
    ['🍕', ['pizza', 'food', 'italian']],
    ['🌮', ['taco', 'food', 'mexican']],
    ['🌯', ['burrito', 'food', 'mexican']],
    ['🍜', ['ramen', 'noodle', 'soup', 'food']],
    ['🍝', ['pasta', 'spaghetti', 'food', 'italian']],
    ['🍣', ['sushi', 'food', 'japanese']],
    ['🍤', ['fried', 'shrimp', 'food']],
    ['🍱', ['bento', 'box', 'food', 'japanese']],
    ['🍚', ['rice', 'food']],
    ['🍰', ['cake', 'dessert', 'food', 'slice']],
    ['🧁', ['cupcake', 'dessert', 'food']],
    ['🍩', ['donut', 'doughnut', 'dessert', 'food']],
    ['🍪', ['cookie', 'dessert', 'food']],
    ['🍫', ['chocolate', 'candy', 'food', 'sweet']],
    ['🍿', ['popcorn', 'snack', 'movie']],
    ['🍺', ['beer', 'drink', 'alcohol', 'mug']],
    ['🍷', ['wine', 'drink', 'alcohol', 'glass']],
    ['🍸', ['cocktail', 'drink', 'alcohol', 'martini']],
    ['🍹', ['tropical', 'drink', 'cocktail', 'alcohol']],
    ['☕', ['coffee', 'drink', 'hot', 'mug', 'tea']],
    ['🍵', ['tea', 'drink', 'green', 'hot']],
    ['🧋', ['boba', 'bubble', 'tea', 'drink']],
    // Activities
    ['⚽', ['soccer', 'ball', 'football', 'sport']],
    ['🏀', ['basketball', 'ball', 'sport']],
    ['🏈', ['football', 'american', 'ball', 'sport']],
    ['⚾', ['baseball', 'ball', 'sport']],
    ['🎾', ['tennis', 'ball', 'sport', 'racket']],
    ['🏐', ['volleyball', 'ball', 'sport']],
    ['🏉', ['rugby', 'ball', 'sport']],
    ['🎱', ['pool', 'billiards', 'ball', 'eight']],
    ['🏓', ['ping', 'pong', 'table', 'tennis', 'sport']],
    ['🏸', ['badminton', 'sport', 'shuttlecock']],
    ['🥊', ['boxing', 'glove', 'sport', 'fight']],
    ['🥋', ['martial', 'arts', 'karate', 'uniform', 'sport']],
    ['🏆', ['trophy', 'winner', 'award', 'champion', 'cup']],
    ['🎯', ['target', 'bullseye', 'dart', 'direct', 'hit']],
    ['🪀', ['yo-yo', 'toy']],
    ['🎮', ['video', 'game', 'controller', 'play']],
    ['🎲', ['die', 'dice', 'game', 'random']],
    ['🎼', ['musical', 'score', 'music']],
    ['🎹', ['piano', 'keyboard', 'music', 'instrument']],
    ['🎸', ['guitar', 'music', 'instrument']],
    ['🎷', ['saxophone', 'music', 'instrument', 'jazz']],
    ['🥁', ['drum', 'music', 'instrument', 'drumstick']],
    ['🎤', ['microphone', 'mic', 'sing', 'karaoke', 'music']],
    ['🎧', ['headphones', 'music', 'listen', 'earphone']],
    ['🎨', ['art', 'palette', 'paint', 'colors', 'creative']],
    ['🎬', ['clapperboard', 'movie', 'film', 'cinema']],
    ['🎭', ['performing', 'arts', 'theater', 'masks', 'drama']],
    ['🎪', ['circus', 'tent', 'carnival']],
    ['🎟️', ['ticket', 'admission', 'entry']],
    ['🎫', ['ticket', 'admission', 'entry']],
    ['🏅', ['medal', 'sports', 'award']],
    ['🥇', ['gold', 'medal', 'first', 'place', 'winner', '1st']],
    ['🥈', ['silver', 'medal', 'second', 'place', '2nd']],
    ['🥉', ['bronze', 'medal', 'third', 'place', '3rd']],
    ['🚴', ['cyclist', 'bicycle', 'bike', 'sport']],
    ['🏄', ['surfer', 'surfing', 'wave', 'sport']],
    ['⛷️', ['skier', 'skiing', 'snow', 'sport']],
    ['🧗', ['climber', 'climbing', 'rock', 'sport']],
    // Travel & Places
    ['🚗', ['car', 'automobile', 'drive', 'vehicle']],
    ['🚕', ['taxi', 'cab', 'car', 'vehicle']],
    ['🚙', ['blue', 'car', 'automobile', 'suv', 'vehicle']],
    ['🚌', ['bus', 'vehicle', 'public']],
    ['🚎', ['bus', 'trolley', 'vehicle']],
    ['🚐', ['minibus', 'van', 'vehicle']],
    ['🚑', ['ambulance', 'emergency', 'vehicle', 'hospital']],
    ['🚒', ['fire', 'truck', 'emergency', 'vehicle']],
    ['🚓', ['police', 'car', 'vehicle', 'cop']],
    ['🚚', ['truck', 'delivery', 'vehicle']],
    ['🚛', ['truck', 'lorry', 'vehicle']],
    ['🚜', ['tractor', 'farm', 'vehicle']],
    ['🏍️', ['motorcycle', 'motorbike', 'bike', 'vehicle']],
    ['🚲', ['bicycle', 'bike', 'cycle', 'vehicle']],
    ['✈️', ['airplane', 'plane', 'fly', 'flight', 'travel']],
    ['🚀', ['rocket', 'space', 'launch', 'ship']],
    ['🛸', ['ufo', 'alien', 'space', 'flying', 'saucer']],
    ['🚁', ['helicopter', 'chopper', 'vehicle']],
    ['🛳️', ['passenger', 'ship', 'cruise', 'boat']],
    ['⛵', ['sailboat', 'sailing', 'boat', 'yacht']],
    ['🚤', ['speedboat', 'boat', 'fast']],
    ['🚆', ['train', 'railway', 'locomotive']],
    ['🚇', ['metro', 'subway', 'underground', 'tube']],
    ['🚉', ['station', 'train', 'railway']],
    ['🗺️', ['world', 'map', 'travel', 'geography']],
    ['🌍', ['earth', 'globe', 'world', 'africa', 'europe']],
    ['🌎', ['earth', 'globe', 'world', 'americas']],
    ['🌏', ['earth', 'globe', 'world', 'asia', 'australia']],
    ['🏖️', ['beach', 'umbrella', 'sun', 'sand', 'vacation']],
    ['🏕️', ['camping', 'tent', 'outdoors', 'nature']],
    ['🏞️', ['national', 'park', 'landscape', 'nature']],
    ['🏟️', ['stadium', 'arena', 'sport']],
    ['🏛️', ['classical', 'building', 'museum', 'columns']],
    ['🏰', ['castle', 'european', 'fortress']],
    ['🏯', ['japanese', 'castle', 'fortress']],
    ['🗽', ['statue', 'liberty', 'new', 'york', 'freedom']],
    ['🗼', ['tower', 'tokyo', 'landmark']],
    ['🏙️', ['cityscape', 'city', 'skyline', 'buildings']],
    ['🌅', ['sunrise', 'sun', 'morning', 'dawn']],
    ['🌄', ['sunrise', 'mountains', 'morning']],
    ['⛺', ['camping', 'tent', 'outdoors']],
    // Objects
    ['💡', ['light', 'bulb', 'idea', 'electric']],
    ['🔦', ['flashlight', 'torch', 'light']],
    ['🧰', ['toolbox', 'tools', 'repair']],
    ['🔧', ['wrench', 'tool', 'repair', 'fix']],
    ['🔨', ['hammer', 'tool', 'build', 'fix']],
    ['🪛', ['screwdriver', 'tool', 'fix']],
    ['⌛', ['hourglass', 'time', 'sand', 'timer']],
    ['⏰', ['alarm', 'clock', 'time', 'watch']],
    ['📱', ['phone', 'mobile', 'smartphone', 'cell', 'telephone']],
    ['💻', ['laptop', 'computer', 'pc', 'mac', 'keyboard']],
    ['🖥️', ['desktop', 'computer', 'monitor', 'screen']],
    ['🖨️', ['printer', 'print']],
    ['🎥', ['movie', 'camera', 'video', 'film']],
    ['📷', ['camera', 'photo', 'picture']],
    ['📸', ['camera', 'flash', 'photo', 'picture']],
    ['📺', ['television', 'tv', 'watch', 'screen']],
    ['📻', ['radio', 'music', 'broadcast']],
    ['🎙️', ['studio', 'microphone', 'mic', 'record']],
    ['📦', ['package', 'box', 'parcel', 'delivery']],
    ['📌', ['pin', 'pushpin', 'thumbtack', 'bookmark']],
    ['📎', ['paperclip', 'attachment', 'clip']],
    ['✂️', ['scissors', 'cut', 'tool']],
    ['🧷', ['safety', 'pin', 'needle']],
    ['🔑', ['key', 'lock', 'unlock', 'password']],
    ['🔒', ['locked', 'lock', 'secure', 'padlock']],
    ['🔓', ['unlocked', 'lock', 'open', 'padlock']],
    ['🧲', ['magnet', 'magnetic']],
    ['🧪', ['test', 'tube', 'experiment', 'science', 'lab']],
    ['🧫', ['petri', 'dish', 'science', 'lab']],
    ['🧬', ['dna', 'genetics', 'science', 'biology']],
    ['🔭', ['telescope', 'space', 'stars', 'astronomy']],
    ['🧯', ['fire', 'extinguisher', 'safety']],
    ['🛒', ['shopping', 'cart', 'basket', 'buy']],
    ['🧺', ['basket', 'picnic', 'laundry']],
    ['🪑', ['chair', 'seat', 'furniture']],
    ['🛋️', ['couch', 'sofa', 'furniture', 'living', 'room']],
    ['🛏️', ['bed', 'sleep', 'furniture', 'rest']],
    ['💼', ['briefcase', 'work', 'business', 'bag']],
    ['🎒', ['backpack', 'school', 'bag', 'hiking']],
    ['👓', ['glasses', 'eyeglasses', 'spectacles']],
    ['🕶️', ['sunglasses', 'cool', 'dark', 'glasses']],
    ['☂️', ['umbrella', 'rain', 'weather', 'parasol']],
    ['🕯️', ['candle', 'light', 'wax', 'flame']],
    // Symbols
    ['❤️', ['heart', 'love', 'red', 'like']],
    ['🧡', ['orange', 'heart', 'love']],
    ['💛', ['yellow', 'heart', 'love']],
    ['💚', ['green', 'heart', 'love']],
    ['💙', ['blue', 'heart', 'love']],
    ['💜', ['purple', 'heart', 'love']],
    ['🖤', ['black', 'heart', 'love', 'dark']],
    ['🤍', ['white', 'heart', 'love']],
    ['🤎', ['brown', 'heart', 'love']],
    ['💔', ['broken', 'heart', 'sad', 'love', 'break']],
    ['❣️', ['heart', 'exclamation', 'love', 'adornment']],
    ['💯', ['hundred', 'perfect', 'score', 'complete', '100']],
    ['✅', ['check', 'done', 'complete', 'yes', 'tick', 'green']],
    ['☑️', ['ballot', 'check', 'box', 'done', 'tick']],
    ['✔️', ['check', 'mark', 'done', 'yes', 'tick']],
    ['✖️', ['multiply', 'cross', 'delete', 'remove', 'wrong']],
    ['➕', ['plus', 'add', 'math', 'positive']],
    ['➖', ['minus', 'subtract', 'math', 'negative']],
    ['➗', ['divide', 'division', 'math']],
    ['⭐', ['star', 'favorite', 'gold']],
    ['🌟', ['glowing', 'star', 'sparkle', 'bright', 'glitter']],
    ['✨', ['sparkles', 'stars', 'shine', 'glitter', 'magic', 'clean']],
    ['🔥', ['fire', 'flame', 'hot', 'lit', 'burn', 'blazing']],
    ['💥', ['collision', 'boom', 'blast', 'explode', 'impact']],
    ['⚡', ['lightning', 'thunder', 'bolt', 'electric', 'zap', 'power']],
    ['☮️', ['peace', 'symbol', 'hippie']],
    ['☢️', ['radioactive', 'nuclear', 'warning', 'danger']],
    ['☣️', ['biohazard', 'danger', 'warning', 'toxic']],
    ['♻️', ['recycle', 'green', 'environment', 'sustainable']],
    ['⚠️', ['warning', 'caution', 'alert', 'danger']],
    ['❗', ['exclamation', 'mark', 'important', 'red', 'alert']],
    ['❓', ['question', 'mark', 'what', 'confused']],
    ['‼️', ['double', 'exclamation', 'mark', 'important']],
    ['⁉️', ['interrobang', 'question', 'exclamation', 'surprise']],
    ['♾️', ['infinity', 'forever', 'endless', 'limitless']],
    ['🔞', ['underage', 'no', 'one', 'under', '18', 'restricted']],
    ['🔔', ['bell', 'notification', 'alert', 'ring', 'chime']],
    ['🔕', ['muted', 'bell', 'silent', 'quiet', 'off', 'notification']],
    ['📣', ['megaphone', 'loudspeaker', 'announcement', 'bullhorn']],
    ['🔊', ['loud', 'speaker', 'volume', 'sound', 'audio']],
    ['🔈', ['speaker', 'low', 'volume', 'sound', 'quiet']],
    // Flags (common searchable ones)
    ['🇻🇳', ['vietnam', 'vietnamese', 'flag']],
    ['🇺🇸', ['usa', 'united', 'states', 'america', 'flag', 'american']],
    ['🇬🇧', ['uk', 'united', 'kingdom', 'britain', 'flag', 'british']],
    ['🇫🇷', ['france', 'french', 'flag']],
    ['🇩🇪', ['germany', 'german', 'flag']],
    ['🇯🇵', ['japan', 'japanese', 'flag']],
    ['🇰🇷', ['korea', 'korean', 'south', 'flag']],
    ['🇨🇳', ['china', 'chinese', 'flag']],
    ['🇨🇦', ['canada', 'canadian', 'flag']],
    ['🇦🇺', ['australia', 'australian', 'flag']],
    ['🇮🇹', ['italy', 'italian', 'flag']],
    ['🇪🇸', ['spain', 'spanish', 'flag']],
    ['🇷🇺', ['russia', 'russian', 'flag']],
    ['🇧🇷', ['brazil', 'brazilian', 'flag']],
    ['🇮🇳', ['india', 'indian', 'flag']],
    ['🇲🇽', ['mexico', 'mexican', 'flag']],
    ['🇸🇬', ['singapore', 'singaporean', 'flag']],
    ['🇹🇭', ['thailand', 'thai', 'flag']],
    ['🇵🇭', ['philippines', 'filipino', 'flag']],
    ['🇮🇩', ['indonesia', 'indonesian', 'flag']],
    ['🇲🇾', ['malaysia', 'malaysian', 'flag']],
]);

/**
 * Unified event types for Z-UI form components
 * Allows components to emit native DOM events with type discrimination
 */
function zCreateEvent(type, event) {
    return { type, event };
}

/**
 * Utils types index
 */

/**
 * Utils index
 */

/**
 * Generated bundle index. Do not edit.
 */

export { VIETNAMESE_MAP, Z_ASYNC_OPTIONS_DEFAULT_PAGE_SIZE, Z_DIVIDE_SCALE, Z_EMOJI_KEYWORDS, Z_EMOJI_SHEET, Z_EXCEL_NUMBER_FORMAT_MAP, Z_LOCALE_MAP, zCapitalCase, zCleanObject, zConvertColorToArgb, zCreateEvent, zDebugFormInvalid, zDecodeUnicode, zDetectBrowser, zFormatNum, zFormatNumExcel, zGetAsyncOptionKey, zMergeAsyncOptions, zMergeClasses, zMiniSearch, zMiniSearch$, zNoop, zNormalize, zRandomColor, zRegisterEchartsTheme, zRemoveVietnamese, zResolveAsyncOptionsHasMore, zToAsyncOptionsObservable, zTransform, zTreeBuild, zTreeFlatten, zUuid, zValidForm };
//# sourceMappingURL=shival99-z-ui-utils.mjs.map
