<form class="summarized" autocomplete="off" data-actor-id="{{actor.id}}" {{#if tokenId}}data-token-id="{{tokenId}}" {{/if}}>
  <div class="container">
    <div class="header flexrow-coc7" style="flex-wrap: nowrap;">
      <div class="flexrow-coc7 attribute" data-attrib="lck" style="flex-wrap: nowrap;">
        <label class="attribute-label rollable">{{localize 'CoC7.Luck'}}</label>
        <div class="current-value">
          <input class="attribute-value" type="text" name="system.attribs.lck.value" value="{{data.system.attribs.lck.value}}" data-dtype="Number" />
        </div>
        <div class="separator">/</div>
        <div class="max-value">
          {{#if data.system.attribs.lck.auto}}
            <input type="text" name="system.attribs.lck.max" value="{{data.system.attribs.lck.max}}" data-dtype="Number" readonly />
          {{else}}
            <input type="text" name="system.attribs.lck.max" value="{{data.system.attribs.lck.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
          {{/if}}
        </div>
      </div>

      <div class="flexrow-coc7" data-attrib="hp" style="flex-wrap: nowrap;">
        <label class="attribute-label">{{localize 'CoC7.HitPoints'}}</label>
        <div class="current-value">
          <input class="attribute-value" type="text" name="system.attribs.hp.value" value="{{data.system.attribs.hp.value}}" data-dtype="Number" />
        </div>
        <div class="separator">/</div>
        <div class="max-value">
          {{#if data.system.attribs.hp.auto}}
            <input type="text" name="system.attribs.hp.max" value="{{data.system.attribs.hp.max}}" data-dtype="Number" readonly />
          {{else}}
            <input type="text" name="system.attribs.hp.max" value="{{data.system.attribs.hp.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
          {{/if}}
        </div>
      </div>

      <div class="status" style="flex: 0 0 7em;">
        <a class="condition-monitor {{#if data.system.status.prone.value}}status-on{{/if}}" title="{{localize 'CoC7.Prone'}}" data-condition="prone"><i class="game-icon game-icon-falling"></i></a>
        <a class="condition-monitor {{#if data.system.status.unconscious.value}}status-on{{/if}}" title="{{localize 'CoC7.Unconsious'}}" data-condition="unconscious"><i class="game-icon game-icon-knocked-out-stars"></i></a>
        <a class="condition-monitor {{#if data.system.status.criticalWounds.value}}status-on{{/if}}" title="{{localize 'CoC7.CriticalWounds'}}" data-condition="criticalWounds"><i class="game-icon game-icon-arm-sling"></i></a>
        <a class="condition-monitor {{#if data.system.status.dying.value}}status-on{{/if}}" title="{{localize 'CoC7.Dying'}}" data-condition="dying"><i class="game-icon game-icon-heart-beats"></i></a>
        {{#if data.system.status.dead.value}}
          <a class="condition-monitor status-on" title="{{localize 'CoC7.Dead'}}" data-condition="dead"><i class="game-icon game-icon-tombstone"></i></a>
        {{else}}
          <a class="{{#if data.system.status.dying.value}}condition-monitor dying-check{{else}}inative-status{{/if}}" title="{{#if data.system.status.dying.value}}{{localize 'CoC7.DyingCheck'}}{{/if}}"><i class="game-icon game-icon-d10"></i></a>
        {{/if}}
      </div>

      <div class="flexrow-coc7 attribute" data-attrib="san" style="flex-wrap: nowrap;">
        <label class="attribute-label rollable">{{localize 'CoC7.Sanity'}}</label>
        <div class="current-value">
          <input class="attribute-value" type="text" name="system.attribs.san.value" value="{{data.system.attribs.san.value}}" data-dtype="Number" />
        </div>
        <div class="separator">/</div>
        <div class="max-value">
          {{#if data.system.attribs.san.auto}}
            <input type="text" name="system.attribs.san.max" value="{{data.system.attribs.san.max}}" data-dtype="Number" readonly />
          {{else}}
            <input type="text" name="system.attribs.san.max" value="{{data.system.attribs.san.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
          {{/if}}
        </div>
      </div>

      <div class="status" style="flex: 0 0 3em;">
        <div class="invisible">
          <input class="locked" type="text" name="system.attribs.san.dailyLoss" value="{{data.system.attribs.san.dailyLoss}}" data-dtype="Number" readonly />
          <input class="locked" type="text" name="system.attribs.san.dailyLimit" value="{{data.system.attribs.san.dailyLimit}}" data-dtype="Number" readonly />
        </div>
        <a class="condition-monitor {{#if data.system.conditions.tempoInsane.value}}status-on{{/if}}" title="{{localize 'CoC7.BoutOfMadness'}}{{#if actor.getTempoInsaneDurationText}}: {{actor.getTempoInsaneDurationText}}{{/if}}" data-condition="tempoInsane"><i class="game-icon game-icon-hanging-spider"></i></a>
        <a class="condition-monitor {{#if data.system.conditions.indefInsane.value}}status-on{{/if}}" title="{{#if data.system.conditions.indefInsane.value}}{{localize 'CoC7.UnderlyingInsanity'}}{{else}}{{localize 'CoC7.IndefiniteInsanity'}}{{/if}}" data-condition="indefInsane"><i class="game-icon game-icon-tentacles-skull"></i></a>
      </div>

      <div class="flexrow-coc7" data-attrib="mp" style="flex-wrap: nowrap;">
        <label class="attribute-label">{{localize 'CoC7.MagicPoints'}}</label>
        <div class="current-value">
          <input class="attribute-value" type="text" name="system.attribs.mp.value" value="{{data.system.attribs.mp.value}}" data-dtype="Number" />
        </div>
        <div class="separator">/</div>
        <div class="max-value">
          {{#if data.system.attribs.mp.auto}}
            <input type="text" name="system.attribs.mp.max" value="{{data.system.attribs.mp.max}}" data-dtype="Number" readonly />
          {{else}}
            <input type="text" name="system.attribs.mp.max" value="{{data.system.attribs.mp.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
          {{/if}}
        </div>
      </div>

    </div>
    <div class="characteristics">
      <div class="char-boxes">
        {{#each actor.characteristics as |characteristic key|}}
          <div class="char-box" data-characteristic="{{key}}" draggable="true">
            <div class="roll-icon"><i class="game-icon game-icon-d10"></i></div>
            <div class="charac-name characteristic-label rollable" draggable="true">{{characteristic.shortName}}</div>
            <div class="charac-score">
              <div class="main-score">
                <input class="characteristic-score" type="text" name="system.characteristics.{{key}}.value" value="{{characteristic.value}}" data-dtype="Number" />
              </div>
              <div class="half-score">{{characteristic.hard}}</div>
              <div class="fith-score">{{characteristic.extreme}}</div>
            </div>
          </div>
        {{/each}}
      </div>
      <div class="footer">
        {{#if data.system.flags.locked}}
          <div class="attribute">
            <div class="attribute-label">
              <h2>{{localize 'CoC7.Mov'}}:</h2>
            </div>
            <div class="attribute-value">{{data.system.attribs.mov.value}}</div>
          </div>
          <div class="attribute">
            <div class="attribute-label">
              <h2>{{localize 'CoC7.Build'}}:</h2>
            </div>
            <div class="attribute-value">{{data.system.attribs.build.value}}</div>
          </div>
          <div class="attribute" data-attrib="db" data-roll-formula="{{data.system.attribs.db.value}}">
            <div class="attribute-label rollable">
              <h2>{{localize 'CoC7.DB'}}:</h2>
            </div>
            <div class="attribute-value">{{data.system.attribs.db.value}}</div>
          </div>
          <div class="attribute">
            <div class="attribute-label">
              <h2>{{localize 'CoC7.Armor'}}:</h2>
            </div>
            <div class="attribute-value">{{data.system.attribs.armor.value}}</div>
          </div>
        {{/if}}
      </div>
    </div>
    <div class="skills">
      {{#if showIconsOnly}}
        <ol class="item-list icons">
          {{#each skillsByValue as |skill|}}
            <li class="item" data-skill-id="{{skill._id}}" data-item-id="{{skill._id}}">
              <div class="item-image skill-name item-name rollable" title="{{skill.name}}" style="background-image: url('{{skill.img}}')"></div>
            </li>
          {{/each}}
        </ol>
      {{else}}
        <ol class="item-list">
          {{#each topSkills as |skill|}}
            <li class="item itemV2" data-skill-id="{{skill._id}}" data-item-id="{{skill._id}}">
              <div class="item-image" style="background-image: url('{{skill.img}}')"></div>
              <div class="item-name skill-name rollable">{{skill.name}}</div>
              <div class="item-score">{{skill.system.value}}</div>
              <div class="item-controls">
                {{#unless skill.system.properties.noxpgain}}
                  {{#if skill.system.flags.developement}}
                    <a class="item-control development-flag active" title="{{localize 'CoC7.SkillUnflagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                  {{else}}
                    <a class="item-control development-flag" title="{{localize 'CoC7.SkillFlagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                  {{/if}}
                {{/unless}}
              </div>
            </li>
          {{/each}}
        </ol>
      {{/if}}
    </div>
    <div class="other">
      <ol>
        {{#each topWeapons as |weapon|}}
          {{#if weapon.system.properties.melee}}
            <li class="weapon-row item weapon {{#unless weapon.skillSet}}error{{/unless}}" data-item-id="{{weapon._id}}" title="{{#unless weapon.skillSet}}{{localize 'CoC7.NoSkill'}}{{/unless}}">
              <div class="weapon-image" style="background-image: url('{{weapon.img}}')"></div>
              <div class="flexrow-coc7">
                <div class="weapon-name combat {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}">{{weapon.name}}</div>
                {{#if weapon.system.properties.thrown}}
                  <a class="weapon-name combat alternativ-skill {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}" title="Throw"><i class="game-icon game-icon-thrown-knife"></i></a>
                {{/if}}
              </div>
              <div class="weapon-damage">
                {{weapon.system.range.normal.damage}}
              </div>
              <div class="weapon-control">
                {{#if weapon.system.properties.addb}}<span class="tag" title="Add DB">{{localize 'CoC7.WeaponAddb'}}</span>{{/if}}
                {{#if weapon.system.properties.ahdb}}<span class="tag" title="Add DB">{{localize 'CoC7.WeaponAhdb'}}</span>{{/if}}
              </div>
            </li>
          {{else}}
            <li class="weapon-row item weapon {{#unless weapon.skillSet}}error{{/unless}}" data-item-id="{{weapon._id}}" title="{{#unless weapon.skillSet}}{{localize 'CoC7.NoSkill'}}{{/unless}}">
              <div class="weapon-image" style="background-image: url('{{weapon.img}}')"></div>
              <div class="flexrow-coc7">
                <div class="weapon-name combat {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}">{{weapon.name}}</div>
                {{#if weapon.usesAlternateSkill}}
                  <a class="weapon-name combat alternativ-skill {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}" title="{{localize 'CoC7.AutomaticFire'}}"><i class="game-icon game-icon-machine-gun-magazine"></i></a>
                {{/if}}
              </div>
              <div class="weapon-damage">
                {{weapon.system.range.normal.damage}}
              </div>
              <div class="weapon-controls">
                <div class="ammo">
                  <span class="tag">{{weapon.system.ammo}}</span>
                </div>
                <div class="control">
                  <a class="reload-weapon" title="{{localize 'CoC7.Reload'}}"><i class="game-icon game-icon-chaingun"></i></a>
                </div>
              </div>
            </li>
          {{/if}}
        {{/each}}
      </ol>
      <div class="flexrow-coc7 cash-row">
        <label>{{localize 'CoC7.MonetarySpendingLevel'}}</label>
        {{#if data.system.flags.manualCredit}}
          <input type="text" name="system.monetary.spendingLevel" value="{{data.system.monetary.spendingLevel}}">
        {{else}}
          <span>{{monetary.spendingLevel}}</span>
        {{/if}}
      </div>
      <div class="flexrow-coc7 cash-row">
        <label>{{localize 'CoC7.MonetaryCash'}}</label>
        {{#if data.system.flags.manualCredit}}
          <input type="text" name="system.monetary.cash" value="{{data.system.monetary.cash}}">
        {{else}}
          <span>{{monetary.cash}}</span>
        {{/if}}
        <label>{{localize 'CoC7.MonetarySpent'}}</label><input type="text" name="system.monetary.spent" value="{{data.system.monetary.spent}}">
      </div>
    </div>
  </div>
</form>