<section class="tab mid-qol-{{ tab.id }} {{ tab.cssClass }}" data-tab="{{ tab.id }}" data-group="{{ tab.group }}">
  <fieldset>
    <legend>{{localize "midi-qol.SHARED.use-condition.header"}}</legend>
    {{ formField fields.useConditionText value=source.useConditionText }}
    {{ formField fields.useConditionReason value=source.useConditionReason }}
    {{ formField fields.effectConditionText value=source.effectConditionText }}
    {{ formField fields.midiProperties.fields.chooseEffects value=source.midiProperties.chooseEffects }}
    {{ formField fields.midiProperties.fields.toggleEffect value=source.midiProperties.toggleEffect }}
  </fieldset>
  <fieldset>
    {{#with fields.midiProperties.fields as |fields|}}
    {{ formField fields.rollMode value=../source.midiProperties.rollMode options=../RollModeOptions}}
    {{ formField fields.displayActivityName value=../source.midiProperties.displayActivityName }}
    {{ formField fields.identifier value=../source.midiProperties.identifier placeholder=../placeholderIdentifier }}
    {{ formField fields.forceDialog value=../source.midiProperties.forceDialog }}
    {{ formField fields.confirmTargets value=../source.midiProperties.confirmTargets options=../ConfirmTargetOptions}}
    {{#if ../hasAreaTarget}}
    {{ formField fields.autoTargetType value=../source.midiProperties.autoTargetType options=../AutoTargetTypeOptions}}
    {{ formField fields.autoTargetAction value=../source.midiProperties.autoTargetAction
    options=../AutoTargetActionOptions}}
    {{/if}}
    {{ formField fields.automationOnly value=../source.midiProperties.automationOnly }}
    {{#if ../possibleOtherActivity}}
    {{ formField fields.otherActivityCompatible value=../source.midiProperties.otherActivityCompatible }}
    {{/if}}
    {{ formField fields.ignoreFullCover value=../source.midiProperties.ignoreFullCover}}
    {{ formField fields.ignoreTraits value=../source.midiProperties.ignoreTraits options=../ignoreTraitsOptions
    label="midi-qol.SHARED.ignore.header" localize=true classes="multi-select"}}
    {{/with}}
  </fieldset>
  {{#if (ne fields.otherActivityId undefined)}}
  <fieldset>
    {{ formField fields.otherActivityId value=source.otherActivityId options=otherActivityOptions}}
  </fieldset>
  {{/if}}
  <fieldset>
    {{#with fields.midiProperties.fields as |fields|}}
    {{ formField fields.triggeredActivityId value=../source.midiProperties.triggeredActivityId
    options=../triggeredActivityOptions}}
    {{#if (ne ../source.midiProperties.triggeredActivityId "none")}}
    {{ formField fields.triggeredActivityConditionText value=../source.midiProperties.triggeredActivityConditionText }}
    {{ formField fields.triggeredActivityTargets value=../source.midiProperties.triggeredActivityTargets
    options=../triggeredActivityTargetOptions}}
    {{ formField fields.triggeredActivityRollAs value=../source.midiProperties.triggeredActivityRollAs
    options=../triggeredActivityRollAsOptions}}
    {{/if}}
    {{/with}}
  </fieldset>
  <fieldset>
    <legend> {{ localize "midi-qol.OVERTIME.extras.header" }} </legend>
    {{ formField fields.isOverTimeFlag value=source.isOverTimeFlag}}
    {{#if source.isOverTimeFlag}}
    {{#with fields.overTimeProperties.fields as |fields|}}
    {{ formField fields.turnChoice value=../source.overTimeProperties.turnChoice options=../turnChoiceOptions }}
    {{ formField fields.saveRemoves value=../source.overTimeProperties.saveRemoves }}
    {{ formField fields.preRemoveConditionText value=../source.overTimeProperties.preRemoveConditionText}}
    {{ formField fields.postRemoveConditionText value=../source.overTimeProperties.postRemoveConditionText}}
    {{/with}}
    {{/if}}
  </fieldset>
  <fieldset>
    <label> {{ localize 'midi-qol.SHARED.FIELDS.ActivityMacro.label' }}
      <button type="button" class="unbutton control-button" data-action="addMacro"
        data-tooltip="midi-qol.SHARED.FIELDS.ActivityMacro.hint"
        aria-label="{{ localize 'midi-qol.SHARED.FIELDS.ActivityMacro.label' }}">
        <i class="fas fa-file-pen" inert></i>
      </button>
    </label>
  </fieldset>
</section>