/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@hashicorp/nextjs-scripts@19.0.3/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const util_1=__importDefault(require("util")),bundle_analyzer_1=__importDefault(require("@next/bundle-analyzer")),next_optimized_images_1=__importDefault(require("next-optimized-images")),next_transpile_modules_1=__importDefault(require("next-transpile-modules")),with_css_1=__importDefault(require("./plugins/with-css")),with_graphql_basic_1=__importDefault(require("./plugins/with-graphql-basic")),get_hashicorp_packages_1=require("./lib/get-hashicorp-packages"),debugLog=util_1.default.debuglog("nextjs-scripts");function withHashicorp({css:e={},dato:t={},transpileModules:s=[]}={}){return function(r={}){const i=[next_optimized_images_1.default,bundle_analyzer_1.default({enabled:"true"===process.env.ANALYZE}),with_css_1.default(e),with_graphql_basic_1.default()];r.future={...r.future,strictPostcssConfiguration:!0};const n=get_hashicorp_packages_1.getHashicorpPackages(process.cwd());debugLog("detected @hashicorp dependencies: %s",n),i.unshift(next_transpile_modules_1.default([...s,...n])),(null==t?void 0:t.token)&&(r.env||(r.env={}),process.env.HASHI_DATO_TOKEN=t.token,r.env.HASHI_DATO_TOKEN=t.token),(null==t?void 0:t.environment)&&(r.env||(r.env={}),process.env.HASHI_DATO_ENVIRONMENT=t.environment,r.env.HASHI_DATO_ENVIRONMENT=t.environment);const a=[],_=[{source:"/:path*{/}?",headers:[{key:"X-Frame-Options",value:"SAMEORIGIN"}]}];if(r.tipBranch&&process.env.VERCEL_GIT_COMMIT_REF==r.tipBranch&&a.push({source:"/:path*{/}?",headers:[{key:"X-Robots-Tag",value:"noindex"}]}),r.headers){const e=r.headers;r.headers=()=>e().then((e=>[...a,...e,..._]))}else r.headers=()=>Promise.resolve([...a,..._]);return i.reduce(((e,t)=>t(e)),r)}}module.exports=withHashicorp;
//# sourceMappingURL=/sm/56436182cfcd713791211a58a4cbec9fd8e13b625b96f90a8373ac3e89b6b0a0.map