<div class="form-group row" style="margin: 15px">
  <div class="col-lg-12 col-md-12 col-sm-12">
    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_NAME' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">{{data.fullName}}</div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_OCCUPATION' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">{{data.gptOverallSumOccupation}}</div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_AGE' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">{{data.gptOverallSumAge}}</div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_LOCATION' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">{{data.gptOverallSumLocation}}</div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_SUMMARY' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">{{data.gptOverallSumSummary}}</div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_ALLEGATIONS_AI' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <ul style="padding-inline-start: 15px">
          <li ng-repeat="allegation in data.gptAllegations track by $index">
            {{ allegation }}
          </li>
        </ul>
      </div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_EVIDENCE_AI' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <ul style="padding-inline-start: 15px">
          <li ng-repeat="evidence in data.gptEvidence track by $index">
            {{ evidence }}
          </li>
        </ul>
      </div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_POTENTIAL_RISKS_AI' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <ul style="padding-inline-start: 15px">
          <li
            ng-repeat="potentialRisk in data.gptPotentialRisks track by $index"
          >
            {{ potentialRisk }}
          </li>
        </ul>
      </div>
    </div>

    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_MITIGATION_FACTORS' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <ul style="padding-inline-start: 15px">
          <li
            ng-repeat="mitigationFactor in data.gptMitigationFactors track by $index"
          >
            {{ mitigationFactor }}
          </li>
        </ul>
      </div>
    </div>

    <br />

    <uib-accordion close-others="false">
      <div
        uib-accordion-group
        is-open="false"
        class="panel-warning"
        style="margin: 5px"
      >
        <uib-accordion-heading>
          {{ 'MEDIA_SEARCH_POTENTIAL_CLIENT_RISKS_OVERVIEW' | translate }}
        </uib-accordion-heading>

        <div class="form-group row" style="margin: 15px">
          <div class="col-lg-2 col-md-3">
            <label>{{ 'MEDIA_SEARCH_CONCLUSION_AI' | translate }}:</label>
          </div>
          <div class="col-lg-10 col-md-9">{{data.gptConclusion}}</div>
        </div>

        <br />

        <div class="form-group row" style="margin: 15px">
          <div class="col-lg-2 col-md-3">
            <label>{{ 'MEDIA_SEARCH_RISK_EVALUATION' | translate }}:</label>
          </div>
          <div class="col-lg-10 col-md-9">
            <span>{{data.gptGeneralRiskAssScore}}&nbsp;</span
            ><span ng-if="data.gptGeneralRiskAssExplanation"
              >({{data.gptGeneralRiskAssExplanation}})</span
            >
          </div>
        </div>
      </div>
    </uib-accordion>

    <br />
    <br />

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RELATED_PERSONS' | translate }}:</label>
      </div>

      <div class="col-lg-10 col-md-9">
        <!-- если список персон был загружен для старой версии класса  -->
        <div
          ng-if="data.gptMostImportantEntitiesPersons && data.gptMostImportantEntitiesPersons.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mostImportantPerson in data.gptMostImportantEntitiesPersons | limitTo: data.topGptRelatedEntitiesPersonsCount"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mostImportantPerson, itemid, data.id, null)"
                  >{{mostImportantPerson}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.gptMostImportantEntitiesPersons.length || data.topGptRelatedEntitiesPersonsCount >= data.gptMostImportantEntitiesPersons.length"
              ng-click="vm.showMoreGptRelatedEntities($event, data, 'persons')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>

        <!-- если список персон был загружен для новой версии класса  -->
        <div
          ng-if="!(data.gptMostImportantEntitiesPersons && data.gptMostImportantEntitiesPersons.length) &&
                   data.gptRelatedItems && data.gptRelatedItems.persons && data.gptRelatedItems.persons.items && data.gptRelatedItems.persons.items.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mostImportantPerson in data.gptRelatedItems.persons.items | limitTo: data.gptRelatedItems.persons.topCnt"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mostImportantPerson, itemid, data.id, null)"
                  >{{mostImportantPerson}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.gptRelatedItems.persons.items.length || data.gptRelatedItems.persons.topCnt >= data.gptRelatedItems.persons.items.length"
              ng-click="vm.showMoreGptRelatedEntities($event, data, 'persons')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>

        <!-- если список персон не был загружен с помощью MediaPyGPT - показываем те, которые были загружены с помощью MediaPy -->
        <div
          ng-if="!(data.gptMostImportantEntitiesPersons && data.gptMostImportantEntitiesPersons.length) &&
                 !(data.gptRelatedItems && data.gptRelatedItems.persons && data.gptRelatedItems.persons.items && data.gptRelatedItems.persons.items.length) &&
                   data.mostCommonMentionedPersons"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mentionedPerson in data.mostCommonMentionedPersons | limitTo: data.topMentionedPersonsCount"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedPerson, itemid, data.id, null)"
                  >{{mentionedPerson}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.mostCommonMentionedPersons.length || data.topMentionedPersonsCount >= data.mostCommonMentionedPersons.length"
              ng-click="vm.showMoreAssociatedItems($event, data, 'persons')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RISK_PERSONS' | translate }}:</label>
      </div>

      <div class="col-lg-10 col-md-9">
        <!-- если список персон был загружен для старой версии класса  -->
        <div
          ng-if="data.mostCommonRiskPersons && data.mostCommonRiskPersons.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="riskPerson in data.mostCommonRiskPersons"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', riskPerson.name, itemid, data.id, null)"
                  >{{riskPerson.name}}</a
                >
                <a
                  class="no-link-link"
                  ng-if="riskPerson.db_id && (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.length : riskPerson.db_id !== -1)"
                  ng-click="vm.openListItemModalInfo('google', riskPerson.db_id)"
                  title="{{ 'ID: ' + (Array.isArray(riskPerson.db_id) ? riskOrg.db_id.join(', ') : riskPerson.db_id) }}"
                >
                  <i class="material-icons" style="font-size: 20px"
                    >info_outline</i
                  >
                </a>
              </div>
              <span ng-show="!$last">,</span>
            </div>
          </div>
        </div>

        <!-- если список персон был загружен для новой версии класса  -->
        <div
          ng-if="!(data.mostCommonRiskPersons && data.mostCommonRiskPersons.length) &&
                   data.mostCommonItems && data.mostCommonItems.riskPersons && data.mostCommonItems.riskPersons.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="riskPerson in data.mostCommonItems.riskPersons"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', riskPerson.name, itemid, data.id, null)"
                  >{{riskPerson.name}}</a
                >
                <a
                  class="no-link-link"
                  ng-if="riskPerson.db_id && (Array.isArray(riskPerson.db_id) ? riskPerson.db_id.length : riskPerson.db_id !== -1)"
                  ng-click="vm.openListItemModalInfo('google', riskPerson.db_id)"
                  title="{{ 'ID: ' + (Array.isArray(riskPerson.db_id) ? riskOrg.db_id.join(', ') : riskPerson.db_id) }}"
                >
                  <i class="material-icons" style="font-size: 20px"
                    >info_outline</i
                  >
                </a>
              </div>
              <span ng-show="!$last">,</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RELATED_ORGS' | translate }}:</label>
      </div>

      <div class="col-lg-10 col-md-9">
        <!-- если список организаций был загружен для старой версии класса  -->
        <div
          ng-if="data.gptMostImportantEntitiesOrgs && data.gptMostImportantEntitiesOrgs.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mostImportantOrg in data.gptMostImportantEntitiesOrgs | limitTo: data.topGptRelatedEntitiesOrgsCount"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mostImportantOrg, itemid, data.id, null)"
                  >{{mostImportantOrg}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.gptMostImportantEntitiesOrgs.length || data.topGptRelatedEntitiesOrgsCount >= data.gptMostImportantEntitiesOrgs.length"
              ng-click="vm.showMoreGptRelatedEntities($event, data, 'orgs')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>

        <!-- если список организаций был загружен для старой версии класса  -->
        <div
          ng-if="!(data.gptMostImportantEntitiesOrgs && data.gptMostImportantEntitiesOrgs.length) &&
                   data.gptRelatedItems && data.gptRelatedItems.orgs && data.gptRelatedItems.orgs.items && data.gptRelatedItems.orgs.items.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mentionedOrg in data.gptRelatedItems.orgs.items | limitTo: data.gptRelatedItems.orgs.topCnt"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedOrg, itemid, data.id, null)"
                  >{{mentionedOrg}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.gptRelatedItems.orgs.items.length || data.gptRelatedItems.orgs.topCnt >= data.gptRelatedItems.orgs.items.length"
              ng-click="vm.showMoreGptRelatedEntities($event, data, 'orgs')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>

        <!-- если список организаций не был загружен с помощью MediaPyGPT - показываем те, которые были загружены с помощью MediaPy -->
        <div
          ng-if="!(data.gptMostImportantEntitiesOrgs && data.gptMostImportantEntitiesOrgs.length) &&
                 !(data.gptRelatedItems && data.gptRelatedItems.orgs && data.gptRelatedItems.orgs.items && data.gptRelatedItems.orgs.items.length) &&
                   data.mostCommonMentionedOrgs"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mentionedOrg in data.mostCommonMentionedOrgs | limitTo: data.topMentionedOrgsCount"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', mentionedOrg, itemid, data.id, null)"
                  >{{mentionedOrg}}</a
                >
              </div>
              <span ng-show="!$last">,</span>
            </div>
            <span
              ng-hide="!data.mostCommonMentionedOrgs.length || data.topMentionedOrgsCount >= data.mostCommonMentionedOrgs.length"
              ng-click="vm.showMoreAssociatedItems($event, data, 'orgs')"
              class="show-more"
            >
              ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
            </span>
          </div>
        </div>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RISK_ORGS' | translate }}:</label>
      </div>

      <div class="col-lg-10 col-md-9">
        <!-- если список персон был загружен для старой версии класса  -->
        <div
          ng-if="data.mostCommonRiskOrgs && data.mostCommonRiskOrgs.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="riskOrg in data.mostCommonRiskOrgs"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', riskOrg.name, itemid, data.id, null)"
                  >{{riskOrg.name}}</a
                >
                <a
                  class="no-link-link"
                  ng-if="riskOrg.db_id && (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.length : riskOrg.db_id !== -1)"
                  ng-click="vm.openListItemModalInfo('google', riskOrg.db_id)"
                  title="{{ 'ID: ' + (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.join(', ') : riskOrg.db_id) }}"
                >
                  <i class="material-icons" style="font-size: 20px"
                    >info_outline</i
                  >
                </a>
              </div>
              <span ng-show="!$last">,</span>
            </div>
          </div>
        </div>

        <!-- если список персон был загружен для новой версии класса  -->
        <div
          ng-if="!(data.mostCommonRiskOrgs && data.mostCommonRiskOrgs.length) &&
                   data.mostCommonItems && data.mostCommonItems.riskOrgs.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="riskOrg in data.mostCommonItems.riskOrgs"
              style="display: inline"
            >
              <div class="list-item">
                <a
                  class="no-link-link"
                  ng-click="vm.openNamecheckMediaSearchTabs('google', riskOrg.name, itemid, data.id, null)"
                  >{{riskOrg.name}}</a
                >
                <a
                  class="no-link-link"
                  ng-if="riskOrg.db_id && (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.length : riskOrg.db_id !== -1)"
                  ng-click="vm.openListItemModalInfo('google', riskOrg.db_id)"
                  title="{{ 'ID: ' + (Array.isArray(riskOrg.db_id) ? riskOrg.db_id.join(', ') : riskOrg.db_id) }}"
                >
                  <i class="material-icons" style="font-size: 20px"
                    >info_outline</i
                  >
                </a>
              </div>
              <span ng-show="!$last">,</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    <br />

    <div class="row" style="margin-bottom: 10px">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RELATED_TOPICS' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <ul style="padding-inline-start: 15px; margin-bottom: 5px">
          <li
            ng-repeat="relatedTopic in data.gptRelatedTopics | limitTo: data.topGptRelatedTopicsCount"
          >
            {{ relatedTopic }}
          </li>
        </ul>

        <span
          ng-hide="!data.gptRelatedTopics.length || data.topGptRelatedTopicsCount >= data.gptRelatedTopics.length"
          ng-click="vm.showMoreGptRelatedEntities($event, data, 'topics')"
          class="show-more"
        >
          ({{ 'MEDIA_SEARCH_SHOW_MORE' | translate}}..)
        </span>
      </div>
    </div>

    <div class="row">
      <div class="col-lg-2 col-md-3">
        <label>{{ 'MEDIA_SEARCH_RELATED_KEYWORDS' | translate }}:</label>
      </div>
      <div class="col-lg-10 col-md-9">
        <div
          ng-if="data.gptMostImportantKeywords && data.gptMostImportantKeywords.length"
          class="items-container"
        >
          <div class="list-items-container">
            <div
              ng-repeat="mostImportantKeyword in data.gptMostImportantKeywords"
              style="display: inline"
            >
              <div class="list-item">
                <span class="keyword">{{mostImportantKeyword}}</span>
              </div>
              <!-- <span ng-show="!$last">,</span> -->
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
