/**
 * Bundled from validate-npm-package-name
 * This is a zero-dependency bundle created by esbuild.
 */
"use strict";var l=Object.defineProperty;var o=(n,t)=>l(n,"name",{value:t,configurable:!0});var{builtinModules:u}=require("module"),h=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),f=["node_modules","favicon.ico"];function p(n){var t=[],e=[];if(n===null)return e.push("name cannot be null"),r(t,e);if(n===void 0)return e.push("name cannot be undefined"),r(t,e);if(typeof n!="string")return e.push("name must be a string"),r(t,e);if(n.length||e.push("name length must be greater than zero"),n.startsWith(".")&&e.push("name cannot start with a period"),n.match(/^_/)&&e.push("name cannot start with an underscore"),n.trim()!==n&&e.push("name cannot contain leading or trailing spaces"),f.forEach(function(c){n.toLowerCase()===c&&e.push(c+" is not a valid package name")}),u.includes(n.toLowerCase())&&t.push(n+" is a core module name"),n.length>214&&t.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var a=n.match(h);if(a){var s=a[1],i=a[2];if(i.startsWith(".")&&e.push("name cannot start with a period"),encodeURIComponent(s)===s&&encodeURIComponent(i)===i)return r(t,e)}e.push("name can only contain URL-friendly characters")}return r(t,e)}o(p,"validate");var r=o(function(n,t){var e={validForNewPackages:t.length===0&&n.length===0,validForOldPackages:t.length===0,warnings:n,errors:t};return e.warnings.length||delete e.warnings,e.errors.length||delete e.errors,e},"done");module.exports=p;
