/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import { a as addParams } from "./helpers.js";
import "@esri/solution-common";
import "@arcgis/core/identity/IdentityManager.js";
import "@arcgis/core/identity/OAuthInfo.js";
import "@arcgis/core/portal/Portal.js";
function getItemUrl(id, auth) {
  const orgUrl = _getOrgUrl(auth);
  const params = addParams([{ k: "id", v: id }]) || "";
  return orgUrl ? `${orgUrl}/home/item.html${params}` : "";
}
function getItemResourceUrl(id, name, auth, orgUrl) {
  const _orgUrl = orgUrl || _getOrgUrl(auth);
  return _orgUrl ? `${_orgUrl}/sharing/rest/content/items/${id}/resources/${name}` : "";
}
function _getOrgUrl(auth) {
  return auth?.PortalSubset?.orgUrl || auth?.PortalUrl || "";
}
export {
  getItemResourceUrl as a,
  getItemUrl as g
};
