{"version":3,"sources":["jsdelivr-header.js","/npm/azunt@1.1.1/src/azunt.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACHA,OAAO,MAAQ,OAAO,OAAS,CAAC,EAGhC,OAAO,MAAM,SAAW,CAMpB,sBAAuB,WACnB,OAAO,IAAI,MAAO,mBACtB,GAIJ,OAAO,MAAM,KAAO,CAQhB,aAAc,SAAU,EAAK,EAAW,EAAS,OAC7C,GAAmB,iBAAR,GAAoB,GAAa,EAAG,MAAO,GAEtD,MAAM,EAAQ,MAAM,KAAK,GACzB,OAAO,EAAM,QAAU,EACjB,EACA,EAAM,MAAM,EAAG,GAAW,KAAK,IAAM,CAC/C,GAIJ,OAAO,MAAM,MAAQ,CAMjB,cAAe,SAAU,EAAU,EAAW,KAC1C,MAAM,EAAQ,SAAS,cAAc,SACrC,EAAM,UAAY,iBACZ,mCACe,oOAQrB,SAAS,KAAK,YAAY,EAC9B,GAGJ,OAAO,MAAM,GAAK,CAUd,gBAAiB,SAAU,EAAU,EAAkB,GAAI,EAAW,IAAK,GAAa,GAEpF,MAAM,MAAM,cAAc,EAAU,GAGpC,SAAS,iBAAiB,GAAU,SAAQ,IACxC,MAAM,EAAe,EAAG,YAAY,OAC9B,EAAY,MAAM,KAAK,aAAa,EAAc,GAEpD,IAAc,IACd,EAAG,YAAc,EACb,IACA,EAAG,MAAQ,GAEnB,GAER","file":"/npm/azunt@1.1.1/src/azunt.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/azunt@1.1.1/src/azunt.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// azunt.js - JavaScript Utility Library\r\n\r\n// Define the Azunt namespace globally (if it doesn't already exist)\r\nwindow.Azunt = window.Azunt || {};\r\n\r\n// Azunt.TimeZone: Time-related utilities\r\nwindow.Azunt.TimeZone = {\r\n    /**\r\n     * Returns the local timezone offset in minutes.\r\n     * Example: -540 for Korea Standard Time (UTC+9)\r\n     * @returns {number}\r\n     */\r\n    getLocalOffsetMinutes: function () {\r\n        return new Date().getTimezoneOffset();\r\n    }\r\n};\r\n\r\n// Azunt.Text: Text-related utilities\r\nwindow.Azunt.Text = {\r\n    /**\r\n     * Safely truncates a string containing emojis or surrogate pairs.\r\n     * @param {string} str - The input string to truncate.\r\n     * @param {number} maxLength - The number of visible characters to keep.\r\n     * @param {string} suffix - The suffix to append if truncated (default is \"...\").\r\n     * @returns {string} The safely truncated string.\r\n     */\r\n    truncateSafe: function (str, maxLength, suffix = \"...\") {\r\n        if (typeof str !== \"string\" || maxLength <= 0) return \"\";\r\n\r\n        const chars = Array.from(str); // Handles surrogate pairs\r\n        return chars.length <= maxLength\r\n            ? str\r\n            : chars.slice(0, maxLength).join(\"\") + suffix;\r\n    }\r\n};\r\n\r\n// Azunt.Style: CSS utility helpers\r\nwindow.Azunt.Style = {\r\n    /**\r\n     * Applies single-line ellipsis (...) style to a CSS selector.\r\n     * @param {string} selector - CSS selector to apply the style to.\r\n     * @param {number} maxWidth - Max width in pixels (default: 250).\r\n     */\r\n    applyEllipsis: function (selector, maxWidth = 250) {\r\n        const style = document.createElement(\"style\");\r\n        style.innerHTML = `\r\n            ${selector} {\r\n                max-width: ${maxWidth}px;\r\n                white-space: nowrap;\r\n                overflow: hidden;\r\n                text-overflow: ellipsis;\r\n                display: inline-block;\r\n                vertical-align: middle;\r\n            }\r\n        `;\r\n        document.head.appendChild(style);\r\n    }\r\n};\r\n\r\nwindow.Azunt.UI = {\r\n    /**\r\n     * Truncates the text content of elements matching the selector,\r\n     * safely handles emojis, and applies CSS ellipsis styling.\r\n     *\r\n     * @param {string} selector - CSS selector (e.g., '.title-cell').\r\n     * @param {number} maxTextElements - Max number of visible characters.\r\n     * @param {number} maxWidth - Max pixel width to apply CSS ellipsis.\r\n     * @param {boolean} addTooltip - Whether to set the original text as title.\r\n     */\r\n    applyTruncation: function (selector, maxTextElements = 30, maxWidth = 250, addTooltip = true) {\r\n        // Apply CSS-based ellipsis\r\n        Azunt.Style.applyEllipsis(selector, maxWidth);\r\n\r\n        // Select and truncate each matching element\r\n        document.querySelectorAll(selector).forEach(el => {\r\n            const originalText = el.textContent.trim();\r\n            const truncated = Azunt.Text.truncateSafe(originalText, maxTextElements);\r\n\r\n            if (truncated !== originalText) {\r\n                el.textContent = truncated;\r\n                if (addTooltip) {\r\n                    el.title = originalText;\r\n                }\r\n            }\r\n        });\r\n    }\r\n};\r\n"]}