/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{tsx as t}from"../../support/widget.js";import{getAssociationTitle as e}from"../../support/UtilityNetworkAssociations/utils/getAssociationTitle.js";import{getFeatureTitle as r}from"../../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";function o(t){const{feature:r,association:o,associationType:i,messages:n}=t,{attachment:s,connectivity:c,container:a,content:u,structure:l}=n,f=r.sourceLayer;if(!o&&!i)return;if(!o)switch(i){case"attachment":return s;case"container":return a;case"connectivity":return c;case"content":return u;case"structure":return l}if(!f)return;const m=r.attributes[f.globalIdField]===o.fromNetworkElement.globalId?"from":"to";return e(o,m,n)}function i(e){const{feature:i,heading:n}=e,s=n||r(i),c=o(e)??"";return t("calcite-block",{description:c,heading:s})}export{i as AssociationDetails};
