import { IPortal } from "@esri/arcgis-rest-portal" ; param { String } subdomain param { Object } portal export function getPortalSiteHostname ( subdomain , portal ) { let port ; if ( portal . allSSL ) { port = portal . httpsPort !== 443 ? `:${ portal . httpsPort }` : "" ; } else { port = portal . httpPort !== 80 ? `:${ portal . httpPort }` : "" ; } const parts = portal . portalHostname . split ( "/" ) ; const host = parts [ 0 ] ; let adaptor = "/" ; if ( parts [ 1 ] ) { adaptor = `/${ parts [ 1 ] }/` ; } return `${ host }${ port }${ adaptor }apps/sites/#/${ subdomain }` ; }