import{fileURLToPath as o}from"node:url";import{getPackageType as n}from"./package-json-reader.mjs";import{codes as t}from"./errors.mjs";const{ERR_UNKNOWN_FILE_EXTENSION:r}=t,e={}.hasOwnProperty,s={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};const c={__proto__:null,"data:":function(o){const{1:n}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(o.pathname)||[null,null,null];return function(o){return o&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(o)?"module":"application/json"===o?"json":null}(n)},"file:":function(t,e,c){const i=function(o){const n=o.pathname;let t=n.length;for(;t--;){const o=n.codePointAt(t);if(47===o)return"";if(46===o)return 47===n.codePointAt(t-1)?"":n.slice(t)}return""}(t);if(".js"===i){const o=n(t);return"none"!==o?o:"commonjs"}if(""===i){const o=n(t);return"none"===o||"commonjs"===o?"commonjs":"module"}const m=s[i];if(m)return m;if(c)return;const u=o(t);throw new r(i,u)},"http:":i,"https:":i,"node:":()=>"builtin"};function i(){}function m(o,n){const t=o.protocol;return e.call(c,t)&&c[t](o,n,!0)||null}export{m as defaultGetFormatWithoutErrors};import u from"node:url";import l from"node:path";import a from"node:module";const p=u.fileURLToPath(import.meta.url);l.dirname(p),a.createRequire(import.meta.url);