{"version":3,"file":"env.mjs","names":["isDevelopment","__DEV__","process","env","NODE_ENV","getNodeEnv","import","meta","MODE","isI18nDisabled","raw","REACT_APP_I18N_DISABLED","undefined","value","String","trim","toLowerCase"],"sources":["../../src/utilities/env.js"],"sourcesContent":["/* eslint-disable custom-rules/no-process-env */\n/**\n * Utility to detect if running in a development environment.\n * Compatible with multiple dev servers (Vite, Webpack, etc.)\n *\n * This function safely checks the NODE_ENV in a way that's compatible\n * with tree-shaking and various build tools.\n */\nexport function isDevelopment() {\n  // Check for Vite's __DEV__ global first (preferred for Vite)\n  if (typeof __DEV__ !== 'undefined') {\n    return __DEV__;\n  }\n\n  // Fallback to NODE_ENV for other environments\n  // Using typeof check to avoid direct process.env reference issues\n  if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) {\n    return process.env.NODE_ENV !== 'production';\n  }\n\n  // Default to false if we can't determine\n  return false;\n}\n\n/**\n * Utility to get the current NODE_ENV value.\n * Compatible with multiple dev servers (Vite, Webpack, etc.)\n */\nexport function getNodeEnv() {\n  // Check for common environment variable patterns\n  if (typeof import.meta !== 'undefined' && import.meta.env && import.meta.env.MODE) {\n    return import.meta.env.MODE;\n  }\n\n  if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV) {\n    return process.env.NODE_ENV;\n  }\n\n  return 'production';\n}\n\n/**\n * Whether the translation stack has been turned OFF, read from the app's .env:\n *\n *   REACT_APP_I18N_DISABLED=true\n *\n * Defaults to FALSE - absent, empty or unrecognised means the flag is not set,\n * so i18n stays ON and an app that never touches the variable is unaffected.\n * Only an explicit true/1/on/yes disables the stack.\n *\n * ONE variable, `REACT_APP_` prefixed, for both bundlers. That is this repo's\n * convention (see configService/README.md): the Vite apps set\n * `envPrefix: ['VITE_', 'REACT_APP_']` and keep the historical CRA prefix in\n * their env files, so a VITE_-prefixed alias would be a second spelling nobody\n * uses. It is read off BOTH objects because the two bundlers expose it\n * differently - Vite inlines `import.meta.env`, webpack/CRA inlines\n * `process.env` - and the library ships prebuilt, so it cannot know which one\n * consumes it.\n *\n * Accesses are deliberately STATIC member expressions: that is the form both\n * bundlers' replace step inlines, and a computed key silently yields undefined.\n *\n * NOTE: inlined at BUILD time, so flipping this needs a rebuild, not just a\n * redeploy. That is the right trade for a per-environment kill switch; if you\n * ever need to toggle it at runtime it has to move into ConfigService's\n * loadConfigObject instead.\n */\nexport function isI18nDisabled() {\n  let raw;\n\n  if (typeof import.meta !== 'undefined' && import.meta.env) {\n    raw = import.meta.env.REACT_APP_I18N_DISABLED;\n  }\n\n  if (raw === undefined && typeof process !== 'undefined' && process.env) {\n    raw = process.env.REACT_APP_I18N_DISABLED;\n  }\n\n  if (raw === undefined || raw === null || raw === '') {\n    return false;\n  }\n\n  // Env values arrive as STRINGS. Boolean('false') is true, so the comparison\n  // has to be explicit or `REACT_APP_I18N_DISABLED=false` would disable i18n -\n  // the exact opposite of what it says.\n  const value = String(raw).trim().toLowerCase();\n  return value === 'true' || value === '1' || value === 'on' || value === 'yes';\n}\n"],"mappings":";;;;;;;;AAQA,SAAgBA,gBAAgB;AAE9B,KAAI,OAAOC,YAAY,YACrB,QAAOA;AAKT,KAAI,OAAOC,YAAY,eAAeA,QAAQC,OAAOD,QAAQC,IAAIC,SAC/D,QAAOF,QAAQC,IAAIC,aAAa;AAIlC,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CT,SAAgBK,iBAAiB;CAC/B,IAAIC;AAEJ,KAAI,OAAOJ,OAAOC,SAAS,eAAeD,OAAOC,KAAKJ,IACpDO,OAAMJ,OAAOC,KAAKJ,IAAIQ;AAGxB,KAAID,QAAQE,KAAAA,KAAa,OAAOV,YAAY,eAAeA,QAAQC,IACjEO,OAAMR,QAAQC,IAAIQ;AAGpB,KAAID,QAAQE,KAAAA,KAAaF,QAAQ,QAAQA,QAAQ,GAC/C,QAAO;CAMT,MAAMG,QAAQC,OAAOJ,IAAI,CAACK,MAAM,CAACC,aAAa;AAC9C,QAAOH,UAAU,UAAUA,UAAU,OAAOA,UAAU,QAAQA,UAAU"}