"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../../../../../_virtual/ExplorerSync.js"),S=require("../../../../../../_virtual/___vite-browser-external.js"),f=require("./ExplorerBase.js"),x=require("./readFile.js"),m=require("./cacheWrapper.js"),v=require("./getDirectory.js");var u;function g(){if(u)return n.__exports;u=1,Object.defineProperty(n.__exports,"__esModule",{value:!0}),n.__exports.ExplorerSync=void 0;var i=d(S),h=f.__require(),a=x.__require(),l=m.__require(),y=v.__require();function d(o){return o&&o.__esModule?o:{default:o}}class _ extends h.ExplorerBase{constructor(r){super(r)}searchSync(r=process.cwd()){const e=(0,y.getDirectorySync)(r);return this.searchFromDirectorySync(e)}searchFromDirectorySync(r){const e=i.default.resolve(process.cwd(),r),t=()=>{const s=this.searchDirectorySync(e),c=this.nextDirectoryToSearch(e,s);return c?this.searchFromDirectorySync(c):this.config.transform(s)};return this.searchCache?(0,l.cacheWrapperSync)(this.searchCache,e,t):t()}searchDirectorySync(r){for(const e of this.config.searchPlaces){const t=this.loadSearchPlaceSync(r,e);if(this.shouldSearchStopWithResult(t)===!0)return t}return null}loadSearchPlaceSync(r,e){const t=i.default.join(r,e),s=(0,a.readFileSync)(t);return this.createCosmiconfigResultSync(t,s)}loadFileContentSync(r,e){return e===null?null:e.trim()===""?void 0:this.getLoaderEntryForFile(r)(r,e)}createCosmiconfigResultSync(r,e){const t=this.loadFileContentSync(r,e);return this.loadedContentToCosmiconfigResult(r,t)}loadSync(r){this.validateFilePath(r);const e=i.default.resolve(process.cwd(),r),t=()=>{const s=(0,a.readFileSync)(e,{throwNotFound:!0}),c=this.createCosmiconfigResultSync(e,s);return this.config.transform(c)};return this.loadCache?(0,l.cacheWrapperSync)(this.loadCache,e,t):t()}}return n.__exports.ExplorerSync=_,n.__exports}exports.__require=g;
//# sourceMappingURL=ExplorerSync.js.map
