// Force strict mode and setup for ESM
"use strict";
import {
  init_esbuild_shims
} from "./chunk-5O2XNYP6.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/core/src/core/openaiContentGenerator/constants.ts
init_esbuild_shims();
var DEFAULT_TIMEOUT = 12e4;
var DISABLED_REQUEST_TIMEOUT_MS = 2147483647;
function resolveRequestTimeout(timeout) {
  if (timeout === void 0 || timeout === null) {
    return DEFAULT_TIMEOUT;
  }
  return timeout <= 0 ? DISABLED_REQUEST_TIMEOUT_MS : timeout;
}
__name(resolveRequestTimeout, "resolveRequestTimeout");
var DEFAULT_STREAM_IDLE_TIMEOUT_MS = 24e4;
var QWEN_STREAM_IDLE_TIMEOUT_MS_ENV = "QWEN_STREAM_IDLE_TIMEOUT_MS";
var MAX_STREAM_IDLE_TIMEOUT_MS = 2147483647;
var DEFAULT_MAX_RETRIES = 3;
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
var DEFAULT_DASHSCOPE_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
var DASHSCOPE_PROXY_BASE_URL = process.env["DASHSCOPE_PROXY_BASE_URL"];

// packages/core/src/utils/request-tokenizer/supportedImageFormats.ts
init_esbuild_shims();
var SUPPORTED_IMAGE_MIME_TYPES = [
  "image/bmp",
  "image/gif",
  "image/jpeg",
  "image/jpg",
  // Alternative MIME type for JPEG
  "image/png",
  "image/tiff",
  "image/webp",
  "image/heic"
];
function isSupportedImageMimeType(mimeType) {
  return SUPPORTED_IMAGE_MIME_TYPES.includes(
    mimeType
  );
}
__name(isSupportedImageMimeType, "isSupportedImageMimeType");
function getSupportedImageFormatsString() {
  return SUPPORTED_IMAGE_MIME_TYPES.map(
    (type) => type.replace("image/", "").toUpperCase()
  ).join(", ");
}
__name(getSupportedImageFormatsString, "getSupportedImageFormatsString");
function getUnsupportedImageFormatWarning() {
  return `Only the following image formats are supported: ${getSupportedImageFormatsString()}. Other formats may not work as expected.`;
}
__name(getUnsupportedImageFormatWarning, "getUnsupportedImageFormatWarning");

export {
  resolveRequestTimeout,
  DEFAULT_STREAM_IDLE_TIMEOUT_MS,
  QWEN_STREAM_IDLE_TIMEOUT_MS_ENV,
  MAX_STREAM_IDLE_TIMEOUT_MS,
  DEFAULT_MAX_RETRIES,
  DEFAULT_OPENAI_BASE_URL,
  DEFAULT_DASHSCOPE_BASE_URL,
  DASHSCOPE_PROXY_BASE_URL,
  SUPPORTED_IMAGE_MIME_TYPES,
  isSupportedImageMimeType,
  getSupportedImageFormatsString,
  getUnsupportedImageFormatWarning
};
/**
 * @license
 * Copyright 2025 Qwen
 * SPDX-License-Identifier: Apache-2.0
 */
