403Webshell
Server IP : 46.62.235.243  /  Your IP : 216.73.216.217
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux Linkabili3Dicembre 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/linkabili/node_modules/css-loader/dist/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/linkabili/node_modules/css-loader/dist/plugins/postcss-import-parser.js
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _postcss = _interopRequireDefault(require("postcss"));

var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));

var _loaderUtils = require("loader-utils");

var _utils = require("../utils");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const pluginName = 'postcss-import-parser';

function getParsedValue(node) {
  if (node.type === 'function' && node.value.toLowerCase() === 'url') {
    const {
      nodes
    } = node;
    const isStringValue = nodes.length !== 0 && nodes[0].type === 'string';
    const url = isStringValue ? nodes[0].value : _postcssValueParser.default.stringify(nodes);
    return {
      url,
      isStringValue
    };
  }

  if (node.type === 'string') {
    const url = node.value;
    return {
      url,
      isStringValue: true
    };
  }

  return null;
}

function parseImport(params) {
  const {
    nodes
  } = (0, _postcssValueParser.default)(params);

  if (nodes.length === 0) {
    return null;
  }

  const value = getParsedValue(nodes[0]);

  if (!value) {
    return null;
  }

  let {
    url
  } = value;

  if (url.trim().length === 0) {
    return null;
  }

  if ((0, _loaderUtils.isUrlRequest)(url)) {
    const {
      isStringValue
    } = value;
    url = (0, _utils.normalizeUrl)(url, isStringValue);
  }

  return {
    url,
    media: _postcssValueParser.default.stringify(nodes.slice(1)).trim().toLowerCase()
  };
}

function walkAtRules(css, result, filter) {
  const items = [];
  css.walkAtRules(/^import$/i, atRule => {
    // Convert only top-level @import
    if (atRule.parent.type !== 'root') {
      return;
    }

    if (atRule.nodes) {
      result.warn("It looks like you didn't end your @import statement correctly. " + 'Child nodes are attached to it.', {
        node: atRule
      });
      return;
    }

    const parsed = parseImport(atRule.params);

    if (!parsed) {
      // eslint-disable-next-line consistent-return
      return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
        node: atRule
      });
    }

    if (filter && !filter(parsed)) {
      return;
    }

    atRule.remove();
    items.push(parsed);
  });
  return items;
}

var _default = _postcss.default.plugin(pluginName, options => function process(css, result) {
  const items = walkAtRules(css, result, options.filter);
  items.forEach(item => {
    const {
      url,
      media
    } = item;
    result.messages.push({
      pluginName,
      type: 'import',
      value: {
        type: '@import',
        url,
        media
      }
    });
  });
});

exports.default = _default;

Youez - 2016 - github.com/yon3zu
LinuXploit