import { formatNumber as r } from "@geoscene/core/intl.js";
/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
const s = /* @__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 d(a) {
  const t = a?.closest("[dir]");
  return t !== null && t instanceof HTMLElement && t.dir === "rtl" || document.dir === "rtl";
}
function f(a) {
  if (!a)
    return;
  const t = a.layoutTemplateInfo;
  if (!t)
    return;
  const [e, n] = t.pageSize;
  return `${r(e)} × ${r(n)} ${a.pageUnits}`;
}
function m(a, t) {
  const { label: e, layout: n, layoutItem: o, type: i } = a;
  return i === "print-service-template" && t[n] ? t[n] : (e ?? n ?? o?.id)?.replaceAll("_", " ") ?? t.untitled;
}
function g(a) {
  return s.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"]
]), l = "map-only";
function L(a) {
  return a?.toLowerCase() === l;
}
export {
  m as a,
  g as b,
  d as c,
  b as f,
  f as g,
  L as i,
  u as r
};