{{> "systems/pf2e/templates/items/partials/ability-activation.hbs"}}

{{#if item.isFeat}}
    <div class="form-group">
        <label for="{{fieldIdPrefix}}max-takable">{{localize "PF2E.Item.Feat.TakeMultiple.Label"}}</label>
        <div class="form-fields">
            <select
                {{#unless mandatoryTakeOnce}} name="system.maxTakable"{{/unless}}
                id="{{fieldIdPrefix}}max-takable"
                data-dtype="Number"
                {{disabled mandatoryTakeOnce}}
            >
                {{#select data.maxTakable}}
                    <option value="1">{{localize "No"}}</option>
                    <option value="2">{{localize "PF2E.Item.Feat.TakeMultiple.Two"}}</option>
                    <option value="3">{{localize "PF2E.Item.Feat.TakeMultiple.Three"}}</option>
                    <option value="4">{{localize "PF2E.Item.Feat.TakeMultiple.Four"}}</option>
                    <option value="5">{{localize "PF2E.Item.Feat.TakeMultiple.Five"}}</option>
                    <option value="Infinity">{{localize "PF2E.Item.Feat.TakeMultiple.NoLimit"}}</option>
                {{/select}}
            </select>
            {{#if mandatoryTakeOnce}}<input type="hidden" name="system.maxTakable" value="1" data-dtype="Number" />{{/if}}
        </div>
    </div>

    {{#if (eq item.level 1)}}
        <div class="form-group">
            <label for="{{fieldIdPrefix}}only-level-1">{{localize "PF2E.Item.Feat.OnlyLevel1"}}</label>
            <div class="form-fields">
                <input
                    type="checkbox"
                    name="system.onlyLevel1"
                    id="{{fieldIdPrefix}}only-level-1"
                    {{checked (or data.onlyLevel1 hasLineageTrait)}} {{disabled hasLineageTrait}}
                />
            </div>
        </div>
    {{/if}}
{{/if}}

<div class="form-group stacked">
    <label for="{{fieldIdPrefix}}prerequisites">{{localize "PF2E.FeatPrereqLabel"}}</label>
    <div class="form-fields">
        <input
            class="pf2e-tagify"
            type="text"
            name="system.prerequisites.value"
            id="{{fieldIdPrefix}}prerequisites"
            value="{{json item.system.prerequisites.value}}"
            data-dtype="JSON"
        />
    </div>
</div>

{{#unless (eq item.system.actionType.value "passive")}}
    {{> "systems/pf2e/templates/items/partials/self-applied-effect.hbs"}}
{{/unless}}

{{#if canHaveKeyOptions}}
    <div class="form-group stacked">
        <label for="{{fieldIdPrefix}}key-options">{{localize "PF2E.Item.Feat.KeyAbilityOptions.Label"}}</label>
        <div class="form-fields">
            <input class="pf2e-tagify"
                type="text"
                name="system.subfeatures.keyOptions"
                id="{{fieldIdPrefix}}key-options"
                value="{{json item.system.subfeatures.keyOptions}}"
                data-dtype="JSON"
            />
        </div>
        <p class="hint">{{localize "PF2E.Item.Feat.KeyAbilityOptions.Hint"}}</p>
    </div>
{{/if}}

{{> "systems/pf2e/templates/items/partials/other-tags.hbs"}}
