<section class="location-relationship-summary" aria-label="Location relationships">
    {{#if ownership}}
    <button type="button" class="location-relationship-pill is-owner {{#if ownership.color}}has-owner-color{{/if}}" {{#if ownership.color}}style="--owner-color: {{ownership.color}}"{{/if}} data-action="openLocationOwner" title="Open {{ownership.owner.name}}">
        <span class="location-relationship-pill-icon location-relationship-owner-emblem">
            {{#if ownership.owner.imageSrc}}<img src="{{ownership.owner.imageSrc}}" alt="">{{else}}<i class="{{ownership.owner.icon}}"></i>{{/if}}
        </span>
        <span class="location-relationship-owner-label"><em>Owned by</em><strong>{{ownership.owner.name}}</strong></span>
    </button>
    {{/if}}
    {{#if leadership}}
    <button type="button" class="location-relationship-pill is-location-leader" data-action="openLocationLeader" title="Open {{leadership.leader.name}}">
        <span class="location-relationship-pill-icon">
            {{#if leadership.leader.imageSrc}}<img src="{{leadership.leader.imageSrc}}" alt="">{{else}}<i class="{{leadership.presentation.icon}}"></i>{{/if}}
        </span>
        <span><em>{{leadership.presentation.label}}</em><strong>{{leadership.leader.name}}</strong></span>
    </button>
    {{/if}}
    {{#if tradingCenter}}
    <button type="button" class="location-relationship-pill is-trading-center" data-action="openLocationTradingCenter" title="Open {{tradingCenter.center.name}}">
        <span class="location-relationship-pill-icon">
            {{#if tradingCenter.center.imageSrc}}<img src="{{tradingCenter.center.imageSrc}}" alt="">{{else}}<i class="{{tradingCenter.center.icon}}"></i>{{/if}}
        </span>
        <span><em>Trades through</em><strong>{{tradingCenter.center.name}}</strong></span>
    </button>
    {{#if tradingCenter.hasFlows}}
    <button type="button" class="location-relationship-pill is-trade-flow" data-action="openLocationTradingCenter" title="Open the trade route to {{tradingCenter.center.name}}">
        {{#if tradingCenter.sends.length}}
        <span class="location-relationship-flow">
            <em>Sends to {{tradingCenter.center.name}}</em>
            <span class="location-relationship-resources">{{#each tradingCenter.sends}}{{#if imageSrc}}<img src="{{imageSrc}}" alt="{{label}}" title="{{label}}">{{else}}<i class="fas fa-box" title="{{label}}"></i>{{/if}}{{/each}}</span>
        </span>
        {{/if}}
        {{#if tradingCenter.receives.length}}
        <span class="location-relationship-flow">
            <em>Receives from {{tradingCenter.center.name}}</em>
            <span class="location-relationship-resources">{{#each tradingCenter.receives}}{{#if imageSrc}}<img src="{{imageSrc}}" alt="{{label}}" title="{{label}}">{{else}}<i class="fas fa-box" title="{{label}}"></i>{{/if}}{{/each}}</span>
        </span>
        {{/if}}
    </button>
    {{/if}}
    {{/if}}
</section>
