<div id='ranged' class='gga-table with-notes'>
  <div class='itemmenu header' readonly></div>
  <div class='desc header'>
    <div class='headermenu'>
      <span>{{localize 'GURPS.rangedWeapons'}}</span>
      <i class='fas fa-caret-square-down'></i>
    </div>
  </div>
  <div class='usage header'>{{localize 'GURPS.usage'}}</div>
  <div class='level header'>{{localize 'GURPS.level'}}</div>
  <div class='acc header'>{{localize 'GURPS.acc'}}</div>
  <div class='damage header'>{{localize 'GURPS.damage'}}</div>
  <div class='range header'>{{localize 'GURPS.range'}}</div>
  <div class='rof header'>{{localize 'GURPS.rof'}}</div>
  <div class='shots header'>{{localize 'GURPS.shots'}}</div>
  <div class='bulk header'>{{localize 'GURPS.bulk'}}</div>
  <div class='rcl header'>{{localize 'GURPS.rcl'}}</div>
  <div class='st header'>{{localize 'GURPS.attributesST'}}</div>

  {{#each (attackflatlist system.ranged)}}
    {{#if ../isEditing}}
      <div class='itemmenu rangedmenu' data-key='system.ranged.{{@key}}'>
        <i class='fas fa-times'></i>
      </div>

      <div class='desc indent{{indent}}'>
        <input name='system.ranged.{{@key}}.name' class='gcs-input-25' type='text' value='{{this.name}}' />
        <div class='list_note'>
          <input name='system.ranged.{{@key}}.notes' class='gcs-input-25' type='text' value='{{this.notes}}' />
        </div>
      </div>

      <div class='usage'>
        <input name='system.ranged.{{@key}}.mode' class='gcs-input' type='text' value='{{this.mode}}' />
      </div>
      <div class='level'>
        <input name='system.ranged.{{@key}}.import' class='gcs-input-sm2' type='text' value='{{this.import}}' />
      </div>
      <div class='acc'>
        <input name='system.ranged.{{@key}}.acc' class='gcs-input-sm2' type='text' value='{{this.acc}}' />
      </div>
      <div class='damage'>
        <input name='system.ranged.{{@key}}.damage' class='gcs-input-5' type='text' value='{{this.damage}}' />
      </div>
      <div class='range'>
        <input name='system.ranged.{{@key}}.range' class='gcs-input-sm5' type='text' value='{{this.range}}' />
      </div>
      <div class='rof'>
        <input name='system.ranged.{{@key}}.rof' class='gcs-input-sm2' type='text' value='{{this.rof}}' />
      </div>
      <div class='shots'>
        <input name='system.ranged.{{@key}}.shots' class='gcs-input-sm2' type='text' value='{{this.shots}}' />
      </div>
      <div class='bulk'>
        <input name='system.ranged.{{@key}}.bulk' class='gcs-input-sm2' type='text' value='{{this.bulk}}' />
      </div>
      <div class='rcl'>
        <input name='system.ranged.{{@key}}.rcl' class='gcs-input-sm2' type='text' value='{{this.rcl}}' />
      </div>
      <div class='st'>
        <input name='system.ranged.{{@key}}.st' class='gcs-input-sm2' type='text' value='{{this.st}}' />
      </div>
    {{else}}
      {{#unless isCollapsed}}
        <div class='itemmenu' readonly></div>

        <div class='rangeddraggable' data-key='system.ranged.{{@key}}'>
          <div class='desc dblclkedit indent{{indent}}'>
            <div class='gga-desc-text'>
              <div>
                {{#if hasContains}}<i class='fas fa-caret-down expandcollapseicon'></i>{{/if}}
                {{#if hasCollapsed}}<i class='fas fa-caret-right expandcollapseicon'></i>{{/if}}
              </div>
              <div class='tooltip gga-manual'>
                {{{gurpslink this.name}}}
                {{#if (displayItemHover this)}}
                  <div class='tooltiptext gga-manual'><img src='{{this.img}}' /></div>
                {{/if}}
              </div>
              <div>
                {{#if (isFoundryItem this)}}
                  <i class='far fas fa-star tooltip gga-item'>
                    <span class='tooltiptext'>{{localize 'GURPS.equipmentFoundryItem'}}</span>
                  </i>
                {{/if}}
              </div>
            </div>
            <div class='list_note'>{{{gurpslink this.notes}}}</div>
          </div>
        </div>

        <div
          class='usage rollable flex-center'
          data-name='{{name}} ({{mode}})'
          data-key='system.ranged.{{@key}}'
          data-otf='{{quotedAttackName 'R' this}}'
        >{{mode}}</div>
        <div
          class='level rollable flex-center'
          data-name='{{this.name}} ({{this.mode}})'
          data-key='system.ranged.{{@key}}'
          data-otf='{{quotedAttackName 'R' this}}'
        >{{this.level}}</div>
        <div
          class='acc gga-right {{gmod this.acc}}'
          data-name='Acc for {{this.name}}'
          data-otf='{{{displayNumber this.acc}}} Acc'
        >
          {{{displayNumber this.acc showPlus=false}}}
        </div>
        <div class='damage flex-center rollable' data-damage data-otf='{{this.damage}}'>{{this.damage}}</div>
        <div class='range flex-center'>{{this.range}}</div>
        <div class='rof gga-right'>{{this.rof}}</div>
        <div class='shots flex-center'>{{this.shots}}</div>
        <div
          class='bulk gga-right {{gmod this.bulk}}'
          data-name='Bulk for {{this.name}}'
          data-otf='{{this.bulk}} Bulk'
        >{{{displayNumber this.bulk}}}
        </div>
        <div class='rcl gga-right'>{{this.rcl}}</div>
        <div class='st flex-center'>{{this.st}}</div>
      {{/unless}}
    {{/if}}
  {{/each}}
</div>