<form class="{{cssClass}}" autocomplete="off">

  {{!-- Sheet Header --}}
  <header class="sheet-header">
    <div class="header-fields">
      <h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
      <div class="flexrow">
        <img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
        <div class="flexcol">

          <div class="flexrow">
            <div class="stat-item">
              <ul>
                {{#each data.statistics as |stat key|}}
                {{#if (eq stat.col 1)}}
                {{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
                {{/if}}
                {{/each}}
              </ul>
            </div>

            <div class="stat-item">
              <ul>
                {{#each data.statistics as |stat key|}}
                {{#if (eq stat.col 2)}}
                {{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
                {{/if}}
                {{/each}}
              </ul>
            </div>

            <div class="stat-item">
              <ul>
                {{#each data.statistics as |stat key|}}
                {{#if (eq stat.col 3)}}
                {{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-stat-block.html stat=stat key=key}}
                {{/if}}
                {{/each}}
              </ul>
            </div>

          </div>
        </div>
      </div>
    </div>
  </header>

  {{!-- Sheet Tab Navigation --}}
  <nav class="sheet-tabs tabs" data-group="primary">
    <a class="item" data-tab="combat">Combat</a>
    <a class="item" data-tab="modules">Vehicle Modules</a>
    <a class="item" data-tab="crew">Crew</a>
    <a class="item" data-tab="cargo">Cargo Hold</a>
    <a class="item" data-tab="details">Vehicle Details</a>
  </nav>

  {{!-- Sheet Body --}}
  <section class="sheet-body">

    {{!-- Combat Tab --}}
    <div class="tab fight" data-group="primary" data-tab="combat">
      <div class="flexcol">

        <div class="flexrow">
          
          <div class="stat-item">
            <ul class="stat-list alternate-list">
              <li class="item flexrow list-item color-class-melee"><a class="combat-button attack-melee flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/COM.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Melee Attack</span>
                </a>
              </li>
              <li class="item flexrow list-item color-class-meleedmg"><a class="combat-button damage-melee flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/STR.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Melee/Thrown Damage</span>
                </a>
              </li>
            </ul>
          </div>

          <div class="stat-item">
            <ul class="stat-list alternate-list">
              <li class="item flexrow list-item color-class-ranged-attack"><a class="combat-button attack-ranged flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/AGI.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Ranged Attack</span>
                </a>
              </li>
              <li class="item flexrow list-item color-class-ranged-damage"><a class="combat-button damage-ranged flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/PER.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Ranged Damage</span>
                </a>
              </li>
            </ul>
          </div>

          <div class="stat-item">
            <ul class="stat-list alternate-list">
              <li class="item flexrow list-item color-class-defence"><a class="combat-button defense-roll flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/DEF.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Defence</span>
                </a>
              </li>
              <li class="item flexrow list-item color-class-dmgres"><a class="combat-button damage-resistance flexrow">
                  <span class="combat-icon flexrow">
                    <img class="combat-icon" src="systems/fvtt-pegasus-rpg/images/icons/PHY.webp">
                  </span>
                  <span class="generic-label combat-margin stat-text-white">Damage Resistance</span>
                </a>
              </li>
            </ul>
          </div>


          <div class="stat-item">
            <span class="flexrow">
              <h3>Stun</h3>
              <span class="status-small-label no-grow">
                <a class="vehicle-stun-plus plus-minus-button">+</a>
                <a class="vehicle-stun-minus plus-minus-button">&nbsp;-</a>
              </span>        
            </span>
            <ul class="stat-list alternate-list">
              <li class="item stat flexrow list-item">
                <span class="generic-label small-label">Current</span>
                <input type="text" class="" name="system.combat.stunlevel" value="{{data.combat.stunlevel}}"
                  data-dtype="Number" />
                <span class="generic-label small-label">Threshold</span>
                <input type="text" class="" name="system.combat.stunthreshold" value="{{data.combat.stunthreshold}}"
                  data-dtype="Number" />
              </li>
            </ul>
          </div>

        </div>

        <div class="flexrow">

          <span class="item-name-label-header-long">
            <label class="items-title-text">Direction of travel</label>
            <select type="text" name="system.secondary.traveldirection" value="{{data.secondary.traveldirection}}" data-dtype="String">
              {{#select data.secondary.traveldirection}}
                {{#each data.arcs as |arc idx|}}
                <option value="{{idx}}">{{arc.label}}</option>
                {{/each}}
              {{/select}}
              </select>
          </span>

          <span class="item-name-label-header-long">
            <label class="items-title-text">Move range</label>
            <select type="text" name="system.secondary.moverange" value="{{data.secondary.moverange}}" data-dtype="String">
              {{#select data.secondary.moverange}}
                <option value="nomovement">No Movement</option>
                <option value="threatzone">Threat zone</option>
                <option value="close">Close</option>
                <option value="medium">Medium</option>
                <option value="long">Long</option>
                <option value="extreme">Extreme</option>
              {{/select}}
              </select>
          </span>
        </div>

        <div class="flexrow">

          <span class="item-name-label-header-long">
            <label class="items-title-text">Using 3D combat</label>
            <label class="attribute-value checkbox"><input type="checkbox" name="system.secondary.is3Dcombat" {{checked
              data.secondary.is3Dcombat}} /></label>
          </span>
          
          {{#if data.secondary.is3Dcombat}}
            <span class="item-name-label-header-long">
              <label class="items-title-text">Elevation</label>
              <input type="text" class="input-numeric-short padd-right" name="system.secondary.elevation" value="{{data.secondary.elevation}}" data-dtype="Number"/>
            </span>

            <span class="item-name-label-header-long">
              <label class="items-title-text">Angle</label>
              <select type="text" name="system.secondary.angle" value="{{data.secondary.angle}}" data-dtype="String">
                {{#select data.secondary.angle}}
                  <option value="level">Level</option>
                  <option value="angled">Angled</option>
                  <option value="Vertical">Vertical</option>
                {{/select}}
              </select>
            </span>
          {{/if}}

        </div>

        <div>
          {{#each data.arcs as |arc idx|}}
            {{#if arc.is3D}}  
              {{#if @root.data.secondary.is3Dcombat}} 
                {{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-arc.html idx=idx  arc=arc}}
              {{/if}}
            {{else}}
              {{> systems/fvtt-pegasus-rpg/templates/partial-vehicle-arc.html idx=idx arc=arc}}
            {{/if}}
          {{/each}}
        </div>

        <ul class="stat-list alternate-list">
          <li class="item flexrow list-item items-title-bg">
            <span class="item-name-label-header-long2">
              <h3><label class="items-title-text">Effects</label></h3>
            </span>
            <span class="item-field-label-short">
              <label class="short-label">Level</label>
            </span>
            <span class="item-field-label-short">
              <label class="short-label">Type</label>
            </span>
            <span class="item-field-label-short">
              <label class="short-label">P/N</label>
            </span>
            <span class="item-field-label-long">
              <label class="short-label">Stat</label>
            </span>
          </li>

          {{#each effects as |effect key|}}
          <li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}"
            data-item-id="{{effect._id}}">
            <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
                src="{{effect.img}}" /></a>
            <span class="item-name-label-long2">{{effect.name}}</span>
            <span class="item-field-label-short">{{effect.system.effectlevel}}</span>
            <span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
            <span class="item-field-label-short">{{upperFirst effect.datsystema.genre}}</span>
            <span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
            <div class="item-filler">&nbsp;</div>
            <div class="item-controls item-controls-fixed">
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>
      </div>
    </div>

    {{!-- Modules Tab --}}
    <div class="tab items" data-group="primary" data-tab="modules">

      <div class="stat-item">
        <ul class="stat-list alternate-list">
          <li class="item stat flexrow list-item">
            <span class="generic-label small-label "><strong>VDP</strong></span>
            <input type="text" class="input-numeric-short padd-right" name="system.modules.vdp" value="{{data.modules.vdp}}"
              data-dtype="Number" />              
            <span class="generic-label small-label"><strong>Vehicle Value</strong></span>
              <input type="text" class="input-numeric-short" name="system.modules.vehiculevalue" value="{{data.modules.vehiculevalue}}"
                data-dtype="Number" />
                <span class="generic-label small-label"><strong>Total cost</strong></span>
                <input type="text" class="" value="{{totalCost}}"
                  data-dtype="Number" disabled />
            <span class="generic-label small-label "><strong>VMS</strong></span>
            <span class="generic-label small-label">Total</span>
            <input type="text" class="input-numeric-short" name="system.modules.totalvms" value="{{data.modules.totalvms}}"
              data-dtype="Number" disabled />              
            <span class="generic-label small-label">Available</span>
              <input type="text" class="input-numeric-short" value="{{vmsAvailable}}"
                data-dtype="Number" disabled />
            <span class="generic-label small-label">Used</span>
            <input type="text" class="input-numeric-short" name="system.modules.vmsused" value="{{data.modules.vmsused}}"
              data-dtype="Number" disabled />
          </li>
        </ul>
      </div>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">1 - Hull</label></h3>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Size</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Hull Type</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">HR</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">MAN</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">VMS</label>
          </span>
        </li>
        {{#each vehicleHull as |hull key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{hull._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{hull.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{hull.name}}</a></span>
          <span class="item-field-label-short">{{hull.system.size}}</span>
          <span class="item-field-label-medium">{{hull.system.hulltype}}</span>
          <span class="item-field-label-short">{{hull.system.hr}}</span>
          <span class="item-field-label-short">{{hull.system.man}}</span>
          <span class="item-field-label-short">{{hull.system.vms}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">2 - Power core</label></h3>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Type</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">PC</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">NRG</label>
          </span>
        </li>
        {{#each powerCoreModules as |powercore key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{powercore._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{powercore.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{powercore.name}}</a></span>
          <span class="item-field-label-medium">{{powercore.system.coretype}}</span>
          <span class="item-field-label-short">{{powercore.system.pc}}</span>
          <span class="item-field-label-short">{{powercore.system.nrg}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">3 -Mobility</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Vehicle Category</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Quality</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">MR</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">TS:F</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">TS:S</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">TS:R</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">MAN Adj.</label>
          </span>
        </li>
        {{#each mobilityModules as |mobility key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{mobility._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{mobility.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{mobility.name}}</a></span>
          <span class="item-field-label-long">{{mobility.system.vehiclecategory}}</span>
          <span class="item-field-label-medium">{{mobility.system.quality}}</span>
          <span class="item-field-label-short">{{mobility.system.mr}}</span>
          <span class="item-field-label-short">{{mobility.system.ts_f}}</span>
          <span class="item-field-label-short">{{mobility.system.ts_s}}</span>
          <span class="item-field-label-short">{{mobility.system.ts_r}}</span>
          <span class="item-field-label-medium">{{mobility.system.man}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">4 - Propulsion</label></h3>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Quality</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">A/D</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">TS:F Adj.</label>
          </span>
        </li>
        {{#each propulsionModules as |propulsion key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{propulsion._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{propulsion.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{propulsion.name}}</a></span>
          <span class="item-field-label-medium">{{propulsion.system.quality}}</span>
          <span class="item-field-label-short">{{propulsion.system.ad}}</span>
          <span class="item-field-label-short">{{propulsion.system.topspeed}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">5 - Combat</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Quality</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">FC</label>
          </span>
        </li>
        {{#each combatModules as |combat key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{combat._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{combat.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{combat.name}}</a></span>
          <span class="item-field-label-long">{{combat.system.combattype}}</span>
          <span class="item-field-label-short">{{combat.system.fc}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">Vehicles modules</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Category</label>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Location</label>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Security</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">NRG</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Range</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">IDR</label>
          </span>
        </li>
        {{#each vehicleModules as |vehiclemod key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{vehiclemod._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{vehiclemod.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{vehiclemod.name}}</a></span>
          <span class="item-field-label-long">{{vehiclemod.system.category}}</span>
          <span class="item-field-label-long">{{vehiclemod.system.location}}</span>
          <span class="item-field-label-long">{{vehiclemod.system.security}}</span>
          <span class="item-field-label-short">{{vehiclemod.system.nrg}}</span>
          <span class="item-field-label-medium">{{vehiclemod.system.range}}</span>
          <span class="item-field-label-short">{{vehiclemod.system.idr}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control vehicle-module-activate" title="Activated">{{#if vehiclemod.system.activated}}<i
              class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>          
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="stat-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header-long">
            <h3><label class="items-title-text">Vehicles weapons</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Site</label>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Location</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">DMG</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">AoE</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Turret</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">NRG</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">IDR</label>
          </span>
        </li>
        {{#each vehicleWeaponModules as |weapon key|}}
        <li class="item stat flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{weapon.img}}" /></a>
          <span class="item-name-label-long"><a class="roll-spec">{{weapon.name}}</a></span>
          <span class="item-field-label-long">{{weapon.system.site}}</span>
          <span class="item-field-label-long">{{weapon.system.location}}</span>
          <span class="item-field-label-short">{{weapon.system.dmg}}</span>
          <span class="item-field-label-medium">{{weapon.system.aoe}}</span>
          <span class="item-field-label-medium">{{weapon.system.turrent}}</span>
          <span class="item-field-label-short">{{weapon.system.nrg}}</span>
          <span class="item-field-label-short">{{weapon.system.idr}}</span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control vehicle-weapon-activate" title="Activated">{{#if weapon.system.activated}}<i
                class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>


    </div>

    {{!-- Crew Tab --}}
    <div class="tab items" data-group="primary" data-tab="crew">

      <div class="stat-item">
        <ul class="stat-list alternate-list">
          <li class="item stat flexrow list-item">
            <span class="generic-label small-label "><strong>Maximum Crew Capacity</strong></span>
            <input type="text" class="input-numeric-short padd-right" name="system.crewmax" value="{{data.crewmax}}"
              data-dtype="Number" />              
            <span class="generic-label small-label"><strong>Minimum Crew Required</strong></span>
              <input type="text" class="input-numeric-short" name="system.crewmin" value="{{data.crewmin}}"
                data-dtype="Number" />
          </li>
        </ul>
      </div>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Crew</label></h3>
          </span>
          <div class="item-filler">&nbsp;</div>
        </li>
        {{#each crewList as |member key|}}
        <li class="item flexrow list-item list-item-shadow" data-actor-id="{{member.id}}">
          <a class="member-view item-name-img" title="View Actor"><img class="sheet-competence-img"
              src="{{member.img}}" /></a>
          <span class="item-name-label">{{member.name}}</span>

          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control member-delete" title="Delete Member"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>
    </div>

    {{!-- Cargo Tab --}}
    <div class="tab equipment" data-group="primary" data-tab="cargo">

      <div class="stat-item">
        <ul class="stat-list alternate-list">
          <li class="item stat flexrow list-item">
            <span class="generic-label small-label "><strong>Cargo Capacity</strong></span>
            <input type="text" class="input-numeric-short padd-right" name="system.cargocapacity" value="{{data.cargocapacity}}"
              data-dtype="Number" />              
            <span class="generic-label small-label"><strong>Total Cargo Capacity</strong></span>
              <input type="text" class="input-numeric-short" value="{{cargoCurrent}}"
                data-dtype="Number" />
          </li>
        </ul>
      </div>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Money</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Qty</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Weight</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">IDR</label>
          </span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-add" data-type="money" title="Create Item"><i class="fas fa-plus"></i></a>
          </div>
        </li>
        {{#each moneys as |money key|}}
        <li class="item flexrow list-item list-item-shadow" data-item-id="{{money._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{money.img}}" /></a>
          <span class="item-name-label">{{money.name}}</span>

          <span class="item-field-label-long"><label>
              {{money.system.quantity}}
              (<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
            </label>
          </span>
          <span class="item-field-label-medium">
            <label>{{money.system.weight}}</label>
          </span>
          <span class="item-field-label-medium">
            {{#if money.system.idrDice}}
            <a class="roll-idr" data-dice-value="{{money.system.idrDice}}">{{money.system.idrDice}}</a>
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>

          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Weapons</label></h3>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Attack</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Damage</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">DMG</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">DMGT</label>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Ammo</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Act/Deact</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Weight</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">IDR</label>
          </span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
          </div>
        </li>
        {{#each weapons as |weapon key|}}
        <li class="item flexrow list-item list-item-shadow" data-item-id="{{weapon._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{weapon.img}}" /></a>
          <span class="item-name-label">{{weapon.name}}</span>
          <span class="item-field-label-short"><label>{{upper weapon.system.statistic}}</label></span>
          <span class="item-field-label-short"><label>{{upper weapon.system.damagestatistic}}</label></span>
          <span class="item-field-label-short"><label>{{weapon.system.damageDice}}</label></span>
          <span class="item-field-label-medium"><label>{{weapon.system.damagetype}} ({{weapon.system.damagetypelevel}})</label></span>

          {{#if (gt weapon.system.ammomax 0)}}
          <span class="item-field-label-long"><label>{{weapon.system.ammocurrent}}/{{weapon.system.ammomax}}
              (<a class="ammo-minus plus-minus-button"> -</a>/<a class="ammo-plus plus-minus-button">+</a>)
            </label></span>
          {{else}}
          <span class="item-field-label-long"><label>-</label>
          </span>
          {{/if}}

          <span class="item-field-label-medium">
            {{#if (count weapon.system.effects)}}
            {{#if weapon.system.activated}}
            <a class="equip-deactivate">Deactivate</a>
            {{else}}
            <a class="equip-activate">Activate</a>
            {{/if}}
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>
          <span class="item-field-label-short"><label>{{weapon.system.weight}}</label></span>

          <span class="item-field-label-medium">
            {{#if weapon.system.idrDice}}
            <a class="roll-idr" data-dice-value="{{weapon.system.idrDice}}">{{weapon.system.idrDice}}</a>
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>

          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Armors</label></h3>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Stat</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">DMG RES</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Loc</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Act/Deact</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Weight</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">IDR</label>
          </span>

          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-add" data-type="armor" title="Create Item"><i class="fas fa-plus"></i></a>
          </div>
        </li>
        {{#each armors as |armor key|}}
        <li class="item list-item flexrow list-item-shadow" data-item-id="{{armor._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{armor.img}}" /></a>
          <span class="item-name-label">{{armor.name}}</span>
          <span class="item-field-label-short">{{upper armor.system.statistic}}</span>
          <span class="item-field-label-short">{{armor.system.resistanceDice}}</span>
          <span class="item-field-label-medium">{{armor.system.locationprotected}}</span>

          <span class="item-field-label-medium">
            {{#if (count armor.system.effects)}}
            {{#if armor.system.activated}}
            <a class="equip-deactivate">Deactivate</a>
            {{else}}
            <a class="equip-activate">Activate</a>
            {{/if}}
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>

          <span class="item-field-label-short">{{armor.system.weight}}</span>
          <span class="item-field-label-medium">
            {{#if armor.system.idrDice}}
            <a class="roll-idr" data-dice-value="{{armor.system.idrDice}}">{{armor.system.idrDice}}</a>
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>

          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Shields</label></h3>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Dice</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Act/Deact</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Weight</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">IDR</label>
          </span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-add" data-type="shield" title="Create Item"><i class="fas fa-plus"></i></a>
          </div>
        </li>
        {{#each shields as |shield key|}}
        <li class="item flexrow list-item list-item-shadow" data-item-id="{{shield._id}}">
          <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
              src="{{shield.img}}" /></a>
          <span class="item-name-label">{{shield.name}}</span>
          <span class="item-field-label-short">{{shield.system.levelDice}}</span>

          <span class="item-field-label-medium">
            {{#if (count shield.system.effects)}}
            {{#if shield.system.activated}}
            <a class="equip-deactivate">Deactivate</a>
            {{else}}
            <a class="equip-activate">Activate</a>
            {{/if}}
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>

          <span class="item-field-label-short">{{shield.system.weight}}</span>
          <span class="item-field-label-medium">
            {{#if shield.system.idrDice}}
            <a class="roll-idr" data-dice-value="{{shield.system.idrDice}}">{{shield.system.idrDice}}</a>
            {{else}}
            &nbsp;-&nbsp;
            {{/if}}
          </span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>

      <ul class="item-list alternate-list">
        <li class="item flexrow list-item items-title-bg">
          <span class="item-name-label-header">
            <h3><label class="items-title-text">Equipment</label></h3>
          </span>
          <span class="item-field-label-long">
            <label class="short-label">Quantity</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">Act/Deact</label>
          </span>
          <span class="item-field-label-short">
            <label class="short-label">Weight</label>
          </span>
          <span class="item-field-label-medium">
            <label class="short-label">IDR</label>
          </span>
          <div class="item-filler">&nbsp;</div>
          <div class="item-controls item-controls-fixed">
            <a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
          </div>

        </li>
        {{#each equipments as |equip key|}}
        {{> systems/fvtt-pegasus-rpg/templates/partial-actor-equipment.html equip=equip level=1 canequip=false}}
        {{/each}}
      </ul>

      <hr>
      <h3>Cargo information : </h3>
      <div class="form-group editor">
        {{editor data.cargo.cargoinformation target="system.cargo.cargoinformation" button=true owner=owner
        editable=editable}}
      </div>

      <hr>

    </div>

    {{!-- Details Tab --}}
    <div class="tab biodata" data-group="primary" data-tab="details">
      <hr>
      <h3>Description : </h3>
      <div class="form-group editor">
        {{editor data.biodata.description target="system.biodata.description" button=true owner=owner
        editable=editable}}
      </div>
      <hr>
      <h3>Notes : </h3>
      <div class="form-group editor">
        {{editor data.biodata.notes target="system.biodata.notes" button=true owner=owner editable=editable}}
      </div>
      <hr>
      </article>
    </div>

  </section>
</form>