UNPKG

@lidick/mt-react-view

Version:

A React component library

1,210 lines 679 kB
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); import React, { memo, useState, useEffect, useMemo, forwardRef, useRef, useImperativeHandle, useCallback } from "react"; import ReactDOM, { createPortal } from "react-dom"; var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; function getDefaultExportFromCjs(x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; } function getAugmentedNamespace(n) { if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n; var f = n.default; if (typeof f == "function") { var a = function a2() { if (this instanceof a2) { return Reflect.construct(f, arguments, this.constructor); } return f.apply(this, arguments); }; a.prototype = f.prototype; } else a = {}; Object.defineProperty(a, "__esModule", { value: true }); Object.keys(n).forEach(function(k) { var d = Object.getOwnPropertyDescriptor(n, k); Object.defineProperty(a, k, d.get ? d : { enumerable: true, get: function() { return n[k]; } }); }); return a; } var jsxRuntime = { exports: {} }; var reactJsxRuntime_production_min = {}; /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var hasRequiredReactJsxRuntime_production_min; function requireReactJsxRuntime_production_min() { if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min; hasRequiredReactJsxRuntime_production_min = 1; var f = React, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true }; function q(c, a, g) { var b, d = {}, e = null, h = null; void 0 !== g && (e = "" + g); void 0 !== a.key && (e = "" + a.key); void 0 !== a.ref && (h = a.ref); for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]); return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current }; } reactJsxRuntime_production_min.Fragment = l; reactJsxRuntime_production_min.jsx = q; reactJsxRuntime_production_min.jsxs = q; return reactJsxRuntime_production_min; } var hasRequiredJsxRuntime; function requireJsxRuntime() { if (hasRequiredJsxRuntime) return jsxRuntime.exports; hasRequiredJsxRuntime = 1; { jsxRuntime.exports = requireReactJsxRuntime_production_min(); } return jsxRuntime.exports; } var jsxRuntimeExports = requireJsxRuntime(); const isNumber = (value) => { return typeof value === "number" && !isNaN(value); }; const isString = (str) => { return typeof str === "string"; }; const isObject = (obj) => { return obj !== null && typeof obj === "object"; }; const isArray = (arr) => { return Array.isArray(arr); }; const isFunction = (arr) => { return typeof arr === "function"; }; const isZeroType = (str) => { return str === 0 || str === "0" || str === "" || str === "null" || str === "undefined" || str === void 0 || str === null; }; const isStringEmpty = (str) => { let condition = typeof str === "undefined" || str === null || str === "undefined" || str === void 0; if (typeof str === "string") { condition = condition || str.trim().length === 0; } return condition; }; const isNumberEmpty = (str) => { return typeof str === "undefined" || str === void 0 || str === null || str === 0 || isNaN(str); }; const isEmptyObject = (obj) => { return Object.keys(obj).length === 0; }; const isObjectEmpty = (obj) => { return Object.keys(obj).length === 0; }; const isArrayEmpty = (arr) => { if (isObjectEmpty(arr)) return true; if (typeof arr === "undefined" || arr === null || arr === void 0) return true; if (arr === "" || arr === 0) return true; return Array.isArray(arr) && arr.length === 0; }; const isObjectValuesValid = (obj) => { return Object.values(obj).every((value) => value !== "" && value !== null && value !== void 0); }; const clearEmpty = (val) => { val = val.replace(" ", ""); if (val.indexOf(" ") !== -1) { return clearEmpty(val); } else { return val; } }; const mtDebounce = (fn2, delay) => { let timer = null; return function(...args) { if (timer) clearTimeout(timer); timer = setTimeout(() => { fn2.apply(this, args); timer = null; }, delay); }; }; const mtThrottle = (fn2, delay) => { let timer = null; return function(...args) { if (!timer) { fn2.apply(this, args); timer = setTimeout(() => { timer = null; }, delay); } }; }; const genFileId = () => { const timestamp = Date.now(); const randomNum = Math.floor(Math.random() * 1e4); return Number(`${timestamp}${randomNum}`); }; const keysOf = (arr) => Object.keys(arr); const MOBILE_RE = /Mobi/i; const ANDROID_RE = /android/i; const IOS_RE = /iPhone|iPad|iPod/i; const WIN_RE = /Windows/i; const MAC_RE = /Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh/i; const checkIsBrowser = () => typeof window !== "undefined" && typeof document !== "undefined"; const isClient = () => { return typeof window !== "undefined" && typeof window.document !== "undefined"; }; const isFirefox = () => { return typeof window.InstallTrigger !== "undefined" || isClient() && /firefox/i.test(window.navigator.userAgent); }; const checkIsMobile = (userAgent = "") => { if (userAgent === "" && isBrowser) userAgent = navigator.userAgent; return MOBILE_RE.test(userAgent); }; const checkIsiOS = (userAgent = "") => { if (userAgent === "" && isBrowser) userAgent = navigator.userAgent; return IOS_RE.test(userAgent); }; const checkIsAndroid = (userAgent = "") => { if (userAgent === "" && isBrowser) userAgent = navigator.userAgent; return ANDROID_RE.test(userAgent); }; const checkIsWin = (userAgent = "") => { if (isBrowser) { return navigator.platform.includes("Win") || WIN_RE.test(navigator.userAgent); } else { return WIN_RE.test(userAgent); } }; const checkIsMac = (userAgent = "") => { if (isBrowser) { return navigator.platform.includes("Mac") || MAC_RE.test(navigator.userAgent); } else { return MAC_RE.test(userAgent); } }; const isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; const isWin = checkIsWin(); const isMac = checkIsMac(); const isMobile = checkIsMobile(); const isAndroid = checkIsAndroid(); const isiOS = checkIsiOS(); const isDesktop = isWin || isMac && !isiOS; function createCustomClassSheet(vars, className) { const cssVars = Object.entries(vars).map(([key, val]) => ` ${key}: ${val};`).join("\n"); const cssText = `.${className} { ${cssVars} }`; const styleTag = document.createElement("style"); styleTag.innerHTML = cssText; document.head.appendChild(styleTag); return { className, sheet: styleTag.sheet ?? void 0 }; } const setAssignCssSelectorVariable = (keyAndValues, cssSelectorText = ":root", targetSheet = void 0) => { if (targetSheet === void 0) { targetSheet = Array.from(document.styleSheets).find((sheet) => { try { return Array.from(sheet.cssRules).some((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); } catch { return false; } }); } if (!targetSheet) return; const rootRule = Array.from(targetSheet.cssRules).find((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); if (!rootRule) return; Object.entries(keyAndValues).forEach(([key, value]) => { rootRule.style.setProperty(`${key}`, value); }); }; const removeAssignCssSelectorVariable = (varNames, cssSelectorText = ":root", targetSheet = void 0) => { if (targetSheet === void 0) { targetSheet = Array.from(document.styleSheets).find((sheet) => { try { return Array.from(sheet.cssRules).some((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); } catch { return false; } }); } if (!targetSheet) return; const rootRule = Array.from(targetSheet.cssRules).find((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); if (!rootRule) return; varNames.forEach((key) => { rootRule.style.removeProperty(`${key}`); }); }; function resetAssignCssSelectorVariable(cssSelectorText = ":root", targetSheet = void 0) { if (targetSheet === void 0) { targetSheet = Array.from(document.styleSheets).find((sheet) => { try { return Array.from(sheet.cssRules).some((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); } catch { return false; } }); } if (!targetSheet) return; const rootRule = Array.from(targetSheet.cssRules).find((rule) => rule instanceof CSSStyleRule && rule.selectorText === cssSelectorText); if (!rootRule) return; const toRemove = []; for (let i = 0; i < rootRule.style.length; i++) { const propName = rootRule.style.item(i); if (propName.startsWith("--")) { toRemove.push(propName); } } toRemove.forEach((key) => { rootRule.style.removeProperty(key); }); } const getClientHeight = (isBrowserView = true) => { if (typeof window === "undefined") { return 0; } if (isBrowserView) { if (window.innerHeight) { return window.innerHeight; } return 0; } let clientHeight = 0; if (document.body.clientHeight && document.documentElement.clientHeight) { clientHeight = document.body.clientHeight < document.documentElement.clientHeight ? document.body.clientHeight : document.documentElement.clientHeight; } else { clientHeight = document.body.clientHeight > document.documentElement.clientHeight ? document.body.clientHeight : document.documentElement.clientHeight; } return clientHeight; }; const getClientWidth = () => { return ( //document.compatMode 表明当前文档的渲染模式是怪异模式/混杂模式还是标准模式。 (document.compatMode == "BackCompat" ? document.body : document.documentElement).clientWidth ); }; const MtBackTop = memo(({ children = null, customClass = "", target = "", visibilityWidth = 1535, visibilityHeight = 100, right: right2 = 40, bottom: bottom2 = 40, zIndex = 1e3, style = {} }) => { const [showBtn, setShowBtn] = useState(false); const scrollToTop2 = () => { if (!isBrowser) return false; let height = document.documentElement.scrollTop || document.body.scrollTop; if (target) { const targetDom = document.querySelector(target); if (targetDom) { height = targetDom.scrollTop || targetDom.scrollTop; } } if (height > 0) { window.requestAnimationFrame(scrollToTop2); window.scrollTo({ top: 0, behavior: "smooth" }); } }; useEffect(() => { if (!isBrowser) return; function handleScroll() { let targetDom = window; if (target) { targetDom = document.querySelector(target) || window; } if (targetDom && targetDom.innerWidth > visibilityWidth && targetDom.scrollY > visibilityHeight) { setShowBtn(true); } else { setShowBtn(false); } } window.addEventListener("scroll", handleScroll); return () => { window.removeEventListener("scroll", handleScroll); }; }, []); useEffect(() => { if (!isBrowser) return; if (right2 !== 40) { setAssignCssSelectorVariable({ "--mt-back-top-right": right2 + "px" }); } if (bottom2 !== 40) { setAssignCssSelectorVariable({ "--mt-back-top-bottom": bottom2 + "px" }); } if (zIndex && zIndex !== 1e3) { setAssignCssSelectorVariable({ "--mt-back-top-z-index": zIndex }); } }, [right2, bottom2, zIndex]); return showBtn ? jsxRuntimeExports.jsx("div", { className: "mt-back-top " + customClass, onClick: scrollToTop2, style: { ...style }, children: children ? children : jsxRuntimeExports.jsx("div", { className: "mt-icon-sort-up" }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}); }); const MtBreadCrumb = memo(({ customClass = "", separator = "/", items = [], params = {} }) => { function separatorShow(item, index) { if ((items == null ? void 0 : items.length) && items.length - 1 > index) { let showSeparator = separator; if (separator !== "/") { if (separator === "") { showSeparator = jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", children: jsxRuntimeExports.jsx("path", { fill: "currentColor", d: "M6.47 4.29l3.54 3.53c.1.1.1.26 0 .36L6.47 11.7a.75.75 0 1 0 1.06 1.06l3.54-3.53c.68-.69.68-1.8 0-2.48L7.53 3.23a.75.75 0 0 0-1.06 1.06z" }) }); } showSeparator = separator; } return jsxRuntimeExports.jsx("span", { className: "mt-breadcrumb__separator", children: showSeparator }); } } let breadcrumbClass = "mt-breadcrumb"; if (customClass) { breadcrumbClass += " " + customClass; } return jsxRuntimeExports.jsx("div", { className: breadcrumbClass, children: items == null ? void 0 : items.map((item, index) => { if ("type" in item && item.type === "separator") { return jsxRuntimeExports.jsx("span", { children: item.separator }, index); } const className = (item == null ? void 0 : item.className) || ""; const title = item == null ? void 0 : item.title; let checkTitle = title; if (params) { if (typeof title === "string") { checkTitle = title.replace(/:([^/]+)/, (_2, key) => `${params[key]}`); } } let showTitle = checkTitle; if ("href" in item) { showTitle = jsxRuntimeExports.jsx("a", { href: item.href, target: "_blank", children: checkTitle }, index); } return jsxRuntimeExports.jsxs("span", { className: `mt-breadcrumb__item ${className}`, children: [jsxRuntimeExports.jsx("span", { className: "mt-breadcrumb__inner", onClick: (e) => { var _a; return "onClick" in item && ((_a = item.onClick) == null ? void 0 : _a.call(item, e)); }, children: showTitle }), separatorShow(item, index)] }, index); }) }); }); const randomString = (length = 8) => { const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let result = ""; for (let i = 0; i < length; i++) { result += chars.charAt(Math.floor(Math.random() * chars.length)); } return result; }; const flagLineStrToCamel = (str, flag = "_") => { let arr = str.split(flag); for (let i = 1; i < arr.length; i++) { arr[i] = arr[i][0].toUpperCase() + arr[i].slice(1); } return arr.join(""); }; const upperCaseToFlagLineStr = (str, flag = "-") => { let temp = str.replace(/[A-Z]/g, (match) => { return flag + match.toLowerCase(); }); if (temp.slice(0, 1) === flag) { temp = temp.slice(1); } return temp; }; const LinkDefault = { href: "", target: "_blank", rel: "nofollow", customAttr: { "position": "test" } }; const MtButton = memo(({ children = null, buttonText = "", shape = "plain", type = "fill", link = LinkDefault, buttonPadding = "8px clamp(1rem, 0.9rem + 0.5vw, 1.5rem)", size = "1.25rem", style = {}, disabled = false, customClass = "", bgColor = "#fff", hoverBgColor = "rgba(3, 187, 133, 0.1)", fontColor = "#424A4F", fontHoverColor = "#00986B", borderLineSize = "1px", borderColor = "", hoverBorderColor = "", onClick = null }) => { const [customClassStyleInfo, setCustomClassStyleInfo] = useState({ className: "", sheet: void 0 }); useEffect(() => { if (!isBrowser) return; const randomStr = "mt-button-" + randomString(); setCustomClassStyleInfo(createCustomClassSheet({ "--mt-button-border-color": "none", "--mt-button-bg-color": "#fff", "--mt-button-padding": "8px clamp(1rem, 0.9rem + 0.5vw, 1.5rem)", "--mt-button-border-radius": "#424A4F", "--mt-button-hover-color": "#00986B", "--mt-button-hover-border": "none", "--mt-button-hover-font-color": "#fff", "--mt-button-active-color": "#03BB85", "--mt-button-active-font-color": "#fff", "--mt-button-active-border": "none", "--mt-button-font-size": "1.25rem", "--mt-button-scale-font-size": "calc(var(--mt-button-font-size) * 0.9)" }, randomStr)); }, []); const fontSize = size; let withBorder = true; if (type) { if (["noBorderHoverFill", "noBorderFill"].includes(type)) { withBorder = false; } } const [showButtonClass, setShowButtonClass] = useState("mt-button"); useEffect(() => { let showButtonClassTemp = "mt-button"; const showButtonCheck = withBorder ? "mt-button-border" : ((link == null ? void 0 : link.href) || null) && type === "noBorderFill" ? "mt-button-is-link-tag" : ""; if (!isStringEmpty(customClassStyleInfo.className)) { showButtonClassTemp += " " + customClassStyleInfo.className; } if (!isStringEmpty(customClass)) { showButtonClassTemp += " " + customClass; } if (!isStringEmpty(showButtonCheck)) { showButtonClassTemp += " " + showButtonCheck; } setShowButtonClass(showButtonClassTemp); }, [customClass, customClassStyleInfo.className]); const [linkButton, setLinkButton] = useState(!isStringEmpty(link == null ? void 0 : link.href)); const setLinkButtonInfo = () => { if (!isStringEmpty(link == null ? void 0 : link.href)) { link = { ...link, target: (link == null ? void 0 : link.target) ?? LinkDefault.target, rel: (link == null ? void 0 : link.rel) ?? LinkDefault.rel, customAttr: (link == null ? void 0 : link.customAttr) ?? LinkDefault.customAttr }; } }; useEffect(() => { if (!isBrowser) return; setLinkButtonInfo(); if (!isStringEmpty(link == null ? void 0 : link.href)) { setLinkButton(true); } }, [link == null ? void 0 : link.href]); const dataAttributes = useMemo(() => { const attributes = {}; const customAttrs = (link == null ? void 0 : link.customAttr) || {}; for (const key in customAttrs) { if (customAttrs[key]) { attributes[`data-${key}`] = customAttrs[key]; } } return attributes; }, [link == null ? void 0 : link.customAttr]); let borderRadius = useMemo(() => { if (shape === "circle") return "50%"; if (shape === "round") return "35px"; return "5px"; }, [shape]); useEffect(() => { if (!isBrowser) return; let insetDomVariableStyle = {}; if (isStringEmpty(customClass)) { let hoverColor = hoverBgColor, hoverFontColor = fontHoverColor; if (style == null ? void 0 : style.backgroundColor) { bgColor = style.backgroundColor; } else if (style == null ? void 0 : style.background) { bgColor = style.background; } let activeColor = bgColor; if (style == null ? void 0 : style.color) { fontColor = style.color; } let activeFontColor = fontColor; if (style == null ? void 0 : style.borderColor) { borderColor = style.borderColor; } let activeBorderColor = borderColor; switch (type) { case "noFill": hoverColor = ""; if (isStringEmpty(borderColor)) { borderColor = fontColor; activeBorderColor = fontColor; } if (isStringEmpty(hoverBorderColor)) { hoverBorderColor = fontHoverColor; } break; case "hoverFill": if (isStringEmpty(borderColor)) { borderColor = fontColor; activeBorderColor = fontColor; } if (isStringEmpty(hoverBorderColor)) { hoverBorderColor = hoverBgColor; } break; case "hoverFillOnlyBorder": hoverColor = ""; hoverFontColor = fontColor; if (isStringEmpty(borderColor)) { borderColor = fontColor; activeBorderColor = fontColor; } if (isStringEmpty(hoverBorderColor)) { hoverBorderColor = hoverBgColor; } break; case "noBorderHoverFill": borderColor = ""; hoverBorderColor = ""; activeBorderColor = ""; break; case "noBorderFill": hoverColor = bgColor; hoverFontColor = fontColor; borderColor = ""; hoverBorderColor = ""; activeBorderColor = ""; break; } if (disabled) { hoverColor = bgColor; activeColor = bgColor; hoverBorderColor = borderColor; hoverFontColor = fontColor; } if (style == null ? void 0 : style.borderWidth) { borderLineSize = style.borderWidth; } if (style == null ? void 0 : style.borderRadius) { borderRadius = style.borderRadius; } if (borderRadius !== "5px") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-border-radius": borderRadius }; } if (hoverColor !== "#00986B") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-hover-color": hoverColor }; } if (hoverBorderColor) { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-hover-border": `${borderLineSize} solid ${hoverBorderColor}` }; } if (activeBorderColor) { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-active-border": `${borderLineSize} solid ${activeBorderColor}` }; } if (hoverFontColor !== "#fff") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-hover-font-color": hoverFontColor }; } if (activeColor !== "#03BB85") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-active-color": activeColor }; } if (activeFontColor !== "#fff") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-active-font-color": activeFontColor }; } if (bgColor !== "#fff") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-bg-color": bgColor }; } if (fontColor !== "#424A4F") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-font-color": fontColor }; } if (buttonPadding !== "8px clamp(1rem, 0.9rem + 0.5vw, 1.5rem)") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-padding": buttonPadding }; } if (fontSize !== "1.25rem") { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-font-size": fontSize }; } if (borderColor) { insetDomVariableStyle = { ...insetDomVariableStyle, "--mt-button-border-color": `${borderLineSize} solid ${borderColor}` }; } } if (!isEmptyObject(insetDomVariableStyle)) { setAssignCssSelectorVariable(insetDomVariableStyle, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); } }, [customClass, hoverBgColor, fontHoverColor, bgColor, fontColor, borderColor, type, style, disabled, customClassStyleInfo.className]); const buttonVariableAndCss = useMemo(() => { let insetDomStyle = {}; if (isStringEmpty(customClass)) { insetDomStyle = {}; if (style) { insetDomStyle = { ...insetDomStyle, ...style }; } } return { buttonStyle: insetDomStyle }; }, [customClass, style]); function buttonShow() { return jsxRuntimeExports.jsx("button", { style: buttonVariableAndCss.buttonStyle, disabled: disabled ?? false, className: showButtonClass, onClick: (event) => { if (typeof onClick === "function" && onClick) onClick(event); }, children: children ? children : buttonText }); } function aLinkShow() { const spanClasName = disabled ? "mt-button-span-disabled" : ""; const aClassName = disabled ? showButtonClass + " mt-button-a-disabled" : showButtonClass + ""; return jsxRuntimeExports.jsx("span", { className: spanClasName, children: jsxRuntimeExports.jsx("a", { className: aClassName, href: (link == null ? void 0 : link.href) ?? LinkDefault.href, target: (link == null ? void 0 : link.target) ?? LinkDefault.target, rel: (link == null ? void 0 : link.rel) ?? LinkDefault.rel, ...dataAttributes, style: buttonVariableAndCss.buttonStyle, children: children ? children : buttonText }) }); } return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: linkButton ? aLinkShow() : buttonShow() }); }); const MtCard = memo(({ children = null, header = "Card name", footer = "Footer content", bodyStyle = {}, bodyClass = "", shadow = "always", headerSlot = null, footerSlot = null }) => { const shadowClass = useMemo(() => { if (shadow === "always") return "mt-card--shadow-always"; if (shadow === "hover") return "mt-card--shadow-hover"; return "mt-card--shadow-never"; }, [shadow]); return jsxRuntimeExports.jsxs("div", { className: "mt-card " + shadowClass, children: [headerSlot || header ? jsxRuntimeExports.jsx("div", { className: "mt-card__header", children: headerSlot || jsxRuntimeExports.jsx("div", { className: "mt-card__header-default", children: header }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), children ? jsxRuntimeExports.jsx("div", { className: "mt-card__body " + bodyClass, style: { ...bodyStyle }, children }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), footerSlot || footer ? jsxRuntimeExports.jsx("div", { className: "mt-card__footer", children: footerSlot || jsxRuntimeExports.jsx("div", { className: "mt-card__footer-default", children: footer }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})] }); }); const MtCarousel = memo(forwardRef(({ children = null, label = "1", customClass = "", activeIndex = 0, onChangeActiveIndex = (index) => { }, height = "", initialIndex = 0, trigger = "click", indicatorPosition = "inside", indicatorBg = "rgba(255, 255, 255, .15)", indicatorNoActiveColor = "rgba(0, 0, 0, 1)", style = {}, autoplay = true, interval = 3e3, arrow: arrow2 = "hover", pauseOnHover = true, leftSlideBtn = "", rightSlideBtn = "", allowSlide = true, onclickItem = (index) => { }, onChangeItem = (newIndex, oldIndex) => { } }, ref) => { let dateIcon = ""; const [customClassStyleInfo, setCustomClassStyleInfo] = useState({ className: "", sheet: void 0 }); useEffect(() => { if (!isBrowser) return; const randomStr = "mt-carousel-" + randomString(); setCustomClassStyleInfo(createCustomClassSheet({ "--mt-carousel-box-height": "300px", "--mt-carousel-height": "300px", "--mt-carousel-item-height": "auto", "--mt-carousel-indicator-bottom": "20px", "--mt-carousel-indicator-bg-color": "rgba(255, 255, 255, 0.15)", "--mt-carousel-indicator-no-active-color": "rgba(0, 0, 0, 1)" }, randomStr)); }, []); const mtCarousel = useRef(null); const mtCarouselLayout = useRef(null); const mtCarouselBody = useRef(null); const mtCarouselIndicator = useRef(null); let mtCarouselNode = mtCarousel.current; let mtCarouselLayoutNode = mtCarouselLayout.current; let mtCarouselBodyNode = mtCarouselBody.current; let mtCarouselIndicatorNode = mtCarouselIndicator.current; useEffect(() => { if (!isBrowser) return; mtCarouselNode = mtCarousel.current; mtCarouselLayoutNode = mtCarouselLayout.current; mtCarouselBodyNode = mtCarouselBody.current; mtCarouselIndicatorNode = mtCarouselIndicator.current; }, [mtCarousel.current, mtCarouselLayout.current, mtCarouselBody.current, mtCarouselIndicator.current]); const [currIndex, setCurrIndex] = useState(initialIndex); const [isAutoPlay, setIsAutoPlay] = useState(autoplay); const [maxHeight, setMaxHeight] = useState("100%"); let startX = 0; const [deltaX, setDeltaX] = useState(0); const timerRef = useRef(null); const slideCount = useMemo(() => { return React.Children.count(children); }, [children]); const indicatorClass = useMemo(() => { if (!["outside", "inside"].includes(indicatorPosition)) { return "indicator-hide"; } if (indicatorPosition === "outside") { return "indicator-outside"; } if (indicatorPosition === "inside") { return "indicator-inside"; } return ""; }, [indicatorPosition]); const toggle = (i) => { if (!isBrowser) return false; let oldCurrIndex = currIndex; if (oldCurrIndex === void 0) { return; } let result = oldCurrIndex; result += i; if (result >= slideCount) { result = 0; } if (result < 0) { result = slideCount - 1; } setCurrIndex(result); if (onChangeItem) { onChangeItem(result, oldCurrIndex); } }; useEffect(() => { if (!isBrowser) return; calculateMaxHeight(); }, [currIndex]); const handleTouchStart = (event) => { if (!isBrowser) return false; if (allowSlide) { clearTimer(); startX = event.touches ? event.touches[0].clientX : event.clientX; } }; const handleTouchEnd = (event) => { if (!isBrowser) return false; if (allowSlide) { const endX = event.changedTouches ? event.changedTouches[0].clientX : event.clientX; let checkState = endX - startX; setDeltaX(checkState); } }; useEffect(() => { if (!isBrowser) return; let checkState = deltaX; if (checkState > 50) { toggle(-1); } else if (checkState < -50) { toggle(1); } clearTimer(); if (isAutoPlay) { doAutoPlay(); } }, [deltaX]); const showCurrIndexItemByOver = (index) => { if (!isBrowser) return false; if (trigger === "hover") { setCurrIndex(index); } return; }; const showCurrIndexItemByClick = (index) => { if (!isBrowser) return false; if (trigger === "click") { setCurrIndex(index); } return; }; const calculateMaxHeight = () => { if (!isBrowser) return false; if (mtCarouselBodyNode) { let mtCarouselIndicatorHeight = 0; if (indicatorPosition === "outside") { mtCarouselIndicatorHeight = mtCarouselIndicatorNode.offsetHeight; } const itemListDom = mtCarouselBodyNode.querySelectorAll(".carousel-item" + label); if (height && !isStringEmpty(height)) { if (!["auto", "fill-auto"].includes(height)) { let carouselHeight = height; let nodeBoxHeight = mtCarouselIndicatorHeight ? `calc(${carouselHeight} + ${mtCarouselIndicatorHeight}px)` : carouselHeight; if (mtCarouselNode) { mtCarouselNode.style.height = nodeBoxHeight; mtCarouselLayoutNode.style.height = carouselHeight; setAssignCssSelectorVariable({ "--mt-carousel-box-height": nodeBoxHeight, "--mt-carousel-height": carouselHeight, "--mt-carousel-item-height": height }, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); } } } else { if (itemListDom.length > 0) { const heights = Array.from(itemListDom).map((item) => { return item.offsetHeight; }); let getMaxHeight = Math.max(...heights); setMaxHeight((_2) => { let checkMaxHeight = `${getMaxHeight}px`; let carouselHeight = checkMaxHeight; let carouselItemHeight = "auto"; if (mtCarouselNode) { if (height === "fill-auto") { carouselItemHeight = "100%"; } if (height === "auto") { carouselItemHeight = heights[currIndex] + "px"; carouselHeight = carouselItemHeight; carouselItemHeight = "fit-content"; } let nodeBoxHeight = mtCarouselIndicatorHeight ? `calc(${carouselHeight} + ${mtCarouselIndicatorHeight}px)` : carouselHeight; mtCarouselNode.style.height = nodeBoxHeight; mtCarouselLayoutNode.style.height = carouselHeight; setAssignCssSelectorVariable({ "--mt-carousel-box-height": nodeBoxHeight, "--mt-carousel-height": carouselHeight }, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); if (carouselItemHeight !== "auto") { setAssignCssSelectorVariable({ "--mt-carousel-item-height": carouselItemHeight }, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); } } return checkMaxHeight; }); } } if (mtCarouselNode) { let triggerBgColor = indicatorBg; if (isStringEmpty(triggerBgColor)) { triggerBgColor = "unset"; } if (triggerBgColor && triggerBgColor !== "rgba(255, 255, 255, .15)") { setAssignCssSelectorVariable({ "--mt-carousel-indicator-bg-color": triggerBgColor }, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); } if (indicatorNoActiveColor && indicatorNoActiveColor !== "rgba(0, 0, 0, 1)") { setAssignCssSelectorVariable({ "--mt-carousel-indicator-no-active-color": indicatorNoActiveColor }, "." + customClassStyleInfo.className, customClassStyleInfo.sheet); } } } }; const [autoPlayTime, setAutoPlayTime] = useState(0); const doAutoPlay = () => { if (!isBrowser) return false; if (interval) { timerRef.current = setInterval(() => { setAutoPlayTime((prevAutoPlayTime) => { return (prevAutoPlayTime || 0) + 1; }); }, interval); } }; const enter = () => { if (!isBrowser) return false; if (pauseOnHover) { clearTimer(); } }; const leave = () => { if (!isBrowser) return false; if (pauseOnHover) { clearTimer(); if (isAutoPlay) { doAutoPlay(); } } }; const clickItem = (currIndex2) => { if (!isBrowser) return false; if (onclickItem) { onclickItem(currIndex2); } return; }; useEffect(() => { if (!isBrowser) return; setIsAutoPlay(autoplay); }, [autoplay]); useEffect(() => { if (!isBrowser) return; if (onChangeActiveIndex && currIndex !== void 0) { onChangeActiveIndex(currIndex); } }, [currIndex]); useEffect(() => { if (!isBrowser) return; setCurrIndex(activeIndex); }, [activeIndex]); useEffect(() => { if (!isBrowser) return; if (isAutoPlay && timerRef.current) { toggle(1); } }, [autoPlayTime]); const clearTimer = () => { if (!isBrowser) return false; if (timerRef.current !== null) { clearInterval(timerRef.current); timerRef.current = null; } }; const next = () => { if (!isBrowser) return false; toggle(1); }; const prev = () => { if (!isBrowser) return false; toggle(-1); }; const goTo = (slideNumber) => { if (!isBrowser) return false; setCurrIndex(slideNumber); }; let [isClient2, setIsClient] = useState(false); useEffect(() => { setIsClient(() => isBrowser); }); useImperativeHandle(ref, () => { if (!isClient2) return {}; return { next, prev, goTo }; }, []); useEffect(() => { if (!isBrowser) return; const animateInFrameByAgain = () => { calculateMaxHeight(); requestAnimationFrame(animateInFrameByAgain); }; clearTimer(); if (isAutoPlay) { doAutoPlay(); } if (isFirefox()) { animateInFrameByAgain(); } else { requestAnimationFrame(() => { calculateMaxHeight(); }); } window.addEventListener("resize", calculateMaxHeight); if (mtCarouselBodyNode) { const images = mtCarouselBodyNode.querySelectorAll("img"); images.forEach((img) => { img.ondragstart = () => false; }); mtCarouselBodyNode.addEventListener("touchstart", handleTouchStart); mtCarouselBodyNode.addEventListener("touchend", handleTouchEnd); mtCarouselBodyNode.addEventListener("mousedown", handleTouchStart); mtCarouselBodyNode.addEventListener("mouseup", handleTouchEnd); } return () => { clearTimer(); window.removeEventListener("resize", calculateMaxHeight); mtCarouselBodyNode.removeEventListener("touchstart", handleTouchStart); mtCarouselBodyNode.removeEventListener("touchend", handleTouchEnd); mtCarouselBodyNode.removeEventListener("mousedown", handleTouchStart); mtCarouselBodyNode.removeEventListener("mouseup", handleTouchEnd); }; }, []); const [mtCarouselClass, setMtCarouselClass] = useState("mt-carousel"); useEffect(() => { if (!isBrowser) return; let mtCarouselClassTemp = "mt-carousel"; if (!isStringEmpty(customClass)) { mtCarouselClassTemp += " " + customClass; } if (!isStringEmpty(customClassStyleInfo.className)) { mtCarouselClassTemp += " " + customClassStyleInfo.className; } if (arrow2 === "hover") { mtCarouselClassTemp += " mt-carousel-arrow-hover-show"; } if (arrow2 === "always") { mtCarouselClassTemp += " mt-carousel-arrow-always-show"; } setMtCarouselClass(mtCarouselClassTemp); }, [customClass, customClassStyleInfo, arrow2]); const childrenArray = React.Children.toArray(children); const leftNavBtn = (dateIcon2) => { return jsxRuntimeExports.jsx("img", { src: dateIcon2, alt: "", width: "20", height: "20", style: { width: "20px", height: "20px" } }); }; const rightNavBtn = (dateIcon2) => { return jsxRuntimeExports.jsx("img", { src: dateIcon2, alt: "", width: "20", height: "20", style: { width: "20px", height: "20px" } }); }; return jsxRuntimeExports.jsx("div", { className: mtCarouselClass, ref: mtCarousel, onMouseEnter: () => enter(), onMouseLeave: () => leave(), children: jsxRuntimeExports.jsxs("div", { className: "carousel-layout", ref: mtCarouselLayout, children: [jsxRuntimeExports.jsx("div", { className: "carousel-body", ref: mtCarouselBody, children: [...Array(slideCount)].map((_2, index) => { let currClassName = "carousel-item carousel-item" + label; if (index === currIndex) { currClassName += " carousel-item-fade"; } return jsxRuntimeExports.jsx("div", { className: currClassName, onClick: () => clickItem(index), children: children != null ? childrenArray[index] || jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}) }, index); }) }), jsxRuntimeExports.jsx("div", { className: "arrow prev", onClick: () => toggle(-1), children: leftSlideBtn ? typeof leftSlideBtn === "string" ? leftNavBtn(leftSlideBtn) : leftSlideBtn : leftNavBtn(dateIcon) }), jsxRuntimeExports.jsx("div", { className: "arrow next", onClick: () => toggle(1), children: rightSlideBtn ? typeof rightSlideBtn === "string" ? rightNavBtn(rightSlideBtn) : rightSlideBtn : rightNavBtn(dateIcon) }), jsxRuntimeExports.jsx("div", { className: "carousel-indicator " + indicatorClass, ref: mtCarouselIndicator, children: [...Array(slideCount)].map((_2, index) => { return jsxRuntimeExports.jsx("span", { className: "carousel-indicator-item" + (currIndex === index ? " indicator-active" : ""), onClick: () => showCurrIndexItemByClick(index), onMouseOver: () => showCurrIndexItemByOver(index) }, index); }) })] }) }); })); const MtCeilCard = memo(({ children = null, listClass = "", header = "", headerDesc = "", headerClass = "", items = [], titleHoverAnimation = true, onClickItem = null }) => { const defaultItem = { link: { src: "", target: "_blank", stopPre: false }, title: "", titleIcon: "", content: "", contentIcon: "" }; const headerDivClass = useMemo(() => { let tempClass = "mt-ceil-card-h3"; let tempCustomClass = ""; if (headerClass) { tempCustomClass = typeof headerClass === "string" ? headerClass : headerClass(); } tempClass += tempCustomClass ? " " + tempCustomClass : ""; return tempClass; }, [headerClass]); const ulClass = useMemo(() => { let tempClass = "mt-ceil-card-ul"; let tempCustomClass = ""; if (listClass) { tempCustomClass = typeof listClass === "string" ? listClass : listClass(); } tempClass += tempCustomClass ? " " + tempCustomClass : ""; return tempClass; }, [listClass]); const handlerClickItem = (event, item) => { var _a; if (!isBrowser) return false; if ((_a = item == null ? void 0 : item.link) == null ? void 0 : _a.stopPre) { event.preventDefault(); event.stopPropagation(); } if (onClickItem && typeof onClickItem === "function") { onClickItem(item); } }; const isDisableHoverClass = useMemo(() => { return !titleHoverAnimation ? "disable-hover" : ""; }, [titleHoverAnimation]); const showListItem = useMemo(() => { return items.map((item) => { return { ...defaultItem, ...item }; }); }, [items]); return jsxRuntimeExports.jsxs("div", { className: "mt-ceil-card", children: [header ? jsxRuntimeExports.jsxs("h3", { className: headerDivClass, children: [header, jsxRuntimeExports.jsx("span", { children: headerDesc })] }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), jsxRuntimeExports.jsx("ul", { className: ulClass, children: showListItem.map((item, index) => { var _a, _b; return jsxRuntimeExports.jsx("li", { children: jsxRuntimeExports.jsxs("a", { href: (_a = item == null ? void 0 : item.link) == null ? void 0 : _a.src, target: (_b = item == null ? void 0 : item.link) == null ? void 0 : _b.target, className: isDisableHoverClass, onClick: (event) => handlerClickItem(event, item), children: [item.title ? jsxRuntimeExports.jsxs("div", { children: [item.titleIcon ? jsxRuntimeExports.jsx("span", { className: "left-icon", children: item.titleIcon }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), jsxRuntimeExports.jsxs("span", { children: [" ", item.title] })] }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), item.content ? jsxRuntimeExports.jsxs("div", { className: "mt-ceil-card-content", children: [item.contentIcon ? jsxRuntimeExports.jsx("span", { className: "left-icon", children: jsxRuntimeExports.jsx("img", { src: item.contentIcon, alt: "" }) }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}), jsxRuntimeExports.jsx("span", { children: item.content })] }) : jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {})] }) }, index); }) })] }); }); var lodash$1 = { exports: {} }; /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ var lodash = lodash$1.exports; var hasRequiredLodash; function requireLodash() { if (hasRequiredLodash) return lodash$1.exports; hasRequiredLodash = 1; (function(module, exports) { (function() { var undefined$1; var VERSION2 = "4.17.21"; var LARGE_ARRAY_SIZE = 200; var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; var HASH_UNDEFINED = "__lodash_hash_undefined__"; var MAX_MEMOIZE_SIZE = 500; var PLACEHOLDER = "__lodash_placeholder__"; var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; var HOT_COUNT = 800, HOT_SPAN = 16; var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; var wrapFlags = [ ["ary", WRAP_ARY_FLAG], ["bind", WRAP_BIND_FLAG], ["bindKey", WRAP_BIND_KEY_FLAG], ["curry", WRAP_CURRY_FLAG], ["curryRight", WRAP_CURRY_RIGHT_FLAG], ["flip", WRAP_FLIP_FLAG], ["partial", WRAP_PARTIAL_FLAG], ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], ["rearg", WRAP_REARG_FLAG] ]; var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); var reTrimStart = /^\s+/; var reWhitespace = /\s/; var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; var reEscapeChar = /\\(\\)?/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; var reFlags = /\w*$/; var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; var reIsBinary = /^0b[01]+$/i; var reIsHostCtor = /^\[object .+?Constructor\]$/; var reIsOctal = /^0o[0-7]+$/i; var reIsUint = /^(?:0|[1-9]\d*)$/; var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; var reNoMatch = /($^)/; var reUnescapedString = /['\n\r\u2028\u2029\\]/g; var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; var rsMiscLower = "(?:"