<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Label"}}</label>
    <div class="form-fields">
        <input type="text" name="{{basePath}}.label" value="{{rule.label}}" placeholder="{{object.label}}" />
        <label>
            {{localize "PF2E.RuleEditor.FlatModifier.HideIfDisabled"}}
            <input type="checkbox" name="{{basePath}}.hideIfDisabled" {{checked rule.hideIfDisabled}}>
        </label>
    </div>
</div>

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Selector"}}</label>
    <div class="attached-input">
        <button type="button" class="attachment" data-action="toggle-selector">
            {{#if selectorIsArray}}Multiple{{else}}Single{{/if}}
        </button>
        {{#if selectorIsArray}}
            <input type="text" class="pf2e-tagify selector-list" name="{{basePath}}.selector" value="{{json rule.selector}}" data-dtype="JSON" />
        {{else}}
            <input type="text" name="{{basePath}}.selector" value="{{rule.selector}}" />
        {{/if}}
    </div>
</div>

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Value"}}</label>
    <div class="form-fields">
        {{#if (eq rule.type "ability")}}
            <select name="{{basePath}}.ability">
                {{#select rule.ability}}
                    {{#each abilities as |label key|}}
                        <option value="{{key}}">{{localize label}}</option>
                    {{/each}}
                {{/select}}
            </select>
        {{else}}
            {{{form.resolvableValue "value" hideButton=true}}}
        {{/if}}
        <select name="{{basePath}}.type" class="short">
            {{#select rule.type}}
                {{#each types as |label slug|}}
                    <option value="{{slug}}">{{label}}</option>
                {{/each}}
            {{/select}}
        </select>

        {{{form.resolvableAddBracket "value"}}}
    </div>
</div>

{{{form.resolvableBrackets "value"}}}

{{#if isDamage}}
<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.DamageType"}}</label>
    <div class="form-fields">
        <input type="text" class="pf2e-tagify damage-type" name="{{basePath}}.damageType" value="{{rule.damageType}}"/>
        <select name="{{basePath}}.damageCategory" class="short">
            {{#select rule.damageCategory}}
                <option value=""></option>
                {{#each damageCategories as |label key|}}
                    <option value="{{key}}">{{localize label}}</option>
                {{/each}}
            {{/select}}
        </select>
        <select name="{{basePath}}.critical" class="short">
            {{#select rule.critical}}
                <option value="">{{localize "PF2E.RuleEditor.General.CriticalBehavior.null"}}</option>
                <option value="false">{{localize "PF2E.RuleEditor.General.CriticalBehavior.false"}}</option>
                <option value="true">{{localize "PF2E.RuleEditor.General.CriticalBehavior.true"}}</option>
            {{/select}}
        </select>
    </div>
</div>
{{/if}}

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Predicate"}}</label>
    <input type="text" name="{{basePath}}.predicate" value="{{json rule.predicate}}" />
</div>
