<div class="midi-qol-tab">

  {{#if allowUseMacro}}
  <div class="form-group">
    <h3 class="form-header">{{localize "midi-qol.onUseMacroLabel"}}
      <a class="macro-control damage-control edit-macro"><i class="fas fa-file-pen"></i></a>
      <a class="macro-control damage-control add-macro"><i class="fas fa-plus"></i></a>
    </h3>
  </div>
  <div class="form-group">
    <ol class="damage-parts onusemacro-group form-group">
      {{#each onUseMacroParts.items as |macroItem index|}}
      <li class="damage-part flexrow" data-midiqol-macro-part="{{index}}">
        <input class="midi-onuse-macro-name" type="text" name="flags.midi-qol.onUseMacroParts.items.{{index}}.macroName"
          value="{{macroItem.macroName}}" />
        <select name="flags.midi-qol.onUseMacroParts.items.{{index}}.option" data-dtype="String">
          {{selectOptions ../MacroPassOptions selected=[macroItem].option}}
        </select>
        <a class="macro-control damage-control delete-macro" style="text-align: right;"><i class="fas fa-minus"></i></a>
      </li>
      {{/each}}
    </ol>
  </div>
  {{/if}}
  {{#if showHeader}}
  <h3 class="form-header">Midi Qol Fields</h3>
  {{/if}}
  {{#if item.hasAttack}}
  <div class="form-group">
    <label>{{localize "midi-qol.FumbleThreshold"}}</label>
    <input type="Number" name="flags.midi-qol.fumbleThreshold" value="{{item.flags.midi-qol.fumbleThreshold}}" />
  </div>
  {{/if}}
  <!--
  <div class="form-group">
    <label>{{localize "midi-qol.AoETargetTypeIncludeSelf.Name"}}</label>
    <input type="checkbox" name="flags.midi-qol.AoETargetTypeIncludeSelf" data-dtype="Boolean" {{checked
      item.flags.midi-qol.AoETargetTypeIncludeSelf}} />
  </div>
  -->
  {{#if true}}
  <div class="form-group">
    <label>{{ localize "midi-qol.AttackPerTarget.Name"}}</label>
    <select name="flags.midi-qol.rollAttackPerTarget" data-dtype="String">
      {{selectOptions ConfirmTargetOptions selected=item.flags.midi-qol.rollAttackPerTarget}} </select>
  </div>
  <div class="form-group">
    <label>{{ localize "midi-qol.RemoveButtons.Name"}}</label>
    <select name="flags.midi-qol.removeAttackDamageButtons" data-dtype="String">
      {{selectOptions RemoveAttackDamageButtonsOptions selected=item.flags.midi-qol.removeAttackDamageButtons}}
    </select>
  </div>
  {{/if}}

  {{#if showCEOff}}
  <div class="form-group">
    <label>{{localize "midi-qol.convenientEffectsOff"}}</label>
    <input type="checkbox" name="flags.midi-qol.forceCEOff" data-dtype="Boolean" {{checked
      item.flags.midi-qol.forceCEOff}}>
  </div>
  {{/if}}
  {{#if showCEOn}}
  <div class="form-group">
    <label>{{localize "midi-qol.convenientEffectsOn"}}</label>
    <input type="checkbox" name="flags.midi-qol.forceCEOn" data-dtype="Boolean" {{checked
      item.flags.midi-qol.forceCEOn}}>
  </div>
  {{/if}}

  <div class="form-group stacked weapon-properties midi-properties">
    {{#each flags.midiProperties as |value key|}}
    {{#unless (or (eq key "saveDamage") (eq key "bonusSaveDamage") (eq key
    "otherSaveDamage") (eq key "confirmTargets") (eq key "grpact") )}}
    <label class="checkbox">
      <input type="checkbox" name="flags.midiProperties.{{key}}" {{checked value}} />
      {{lookup ../midiPropertyLabels key}}
    </label>
    {{/unless}}
    {{/each}}
  </div>
  <div class="midi-activation-conditions">
    <h3>{{localize "midi-qol.ConditionHeader"}}</h3>
    <div>
      <label>{{localize "midi-qol.ItemActivationCondition.Name"}}</label>
      <textarea name="flags.midi-qol.itemCondition">{{item.flags.midi-qol.itemCondition}}</textarea>
    </div>
    {{#if hasReaction}}
    <div>
      <label>{{localize "midi-qol.ReactionActivationCondition.Name"}}</label>
      <textarea name="flags.midi-qol.reactionCondition">{{item.flags.midi-qol.reactionCondition}}</textarea>
    </div>
    {{/if}}
    {{#if hasOtherDamage}}
    <div>
      <label>{{localize "midi-qol.OtherActivationCondition.Name"}}</label>
      <textarea name="flags.midi-qol.otherCondition">{{item.flags.midi-qol.otherCondition}}</textarea>
    </div>
    {{/if}}
    <div>
      <label>{{localize "midi-qol.EffectActivationCondition.Name"}}</label>
      <textarea name="flags.midi-qol.effectCondition">{{item.flags.midi-qol.effectCondition}}</textarea>
    </div>
  </div>
</div>