/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { formatNumber as i } from "@arcgis/core/intl.js";
const p = /* @__PURE__ */ new Map([
  ["a3-landscape", "a3-landscape"],
  ["a3-portrait", "a3-portrait"],
  ["a4-landscape", "a4-landscape"],
  ["a4-portrait", "a4-portrait"],
  ["letter-ansi-a-landscape", "ansi-a-landscape"],
  ["letter-ansi-a-portrait", "ansi-a-portrait"],
  ["tabloid-ansi-b-landscape", "ansi-b-landscape"],
  ["tabloid-ansi-b-portrait", "ansi-b-portrait"]
]), u = /^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/iu;
function f(a) {
  if (!a)
    return;
  const t = a.layoutTemplateInfo;
  if (!t)
    return;
  const [e, n] = t.pageSize;
  return `${i(e)} × ${i(n)} ${a.pageUnits}`;
}
function d(a, t) {
  const { label: e, layout: n, layoutItem: o } = a, r = n && !o && t[n] ? t[n] : null;
  return r || ((e ?? n ?? o?.id)?.replaceAll("_", " ") ?? t.untitled);
}
function g(a) {
  return p.get(a);
}
const b = /* @__PURE__ */ new Map([
  ["AIX", "aix"],
  ["EPS", "eps"],
  ["GIF", "gif"],
  ["JPG", "jpg"],
  ["PDF", "pdf"],
  ["PNG32", "png32"],
  ["PNG8", "png8"],
  ["SVG", "svg"],
  ["SVGZ", "svgz"],
  ["TIFF", "tiff"]
]), s = "map-only";
function m(a) {
  return a?.toLowerCase() === s;
}
export {
  f as a,
  g as b,
  b as f,
  d as g,
  m as i,
  u as r
};
