{{#with entry as |entry|}}
    {{!-- Add section for each slot group --}} {{#each entry.groups as |group|}} {{#if (or (gt group.active.length 0) entry.showSlotlessRanks)}}
  1. {{localize group.label}}

    {{#if (and (eq group.id "cantrips") (not group.uses))}} / {{else if (and entry.isFocusPool (not (eq @root.actor.type "character")))}}
    /
    {{else if (and group.uses (not entry.isFocusPool))}} {{#if group.uses.value includeZero=true}} / {{/if}} {{#if group.uses.value includeZero=true}} {{#if @root.editable}} {{/if}} {{/if}} {{/if}}
    {{localize "PF2E.Item.Spell.Defense.Label"}}
    {{~#if entry.isInnate~}}
    {{localize "PF2E.SpellUsesLabel"}}
    {{~else~}}
    {{localize "PF2E.TraitRange"}}
    {{~/if~}} {{#if @root.editable}} {{!-- This button will get removed by the stylesheet, and only exists for sizing reasons (localization) --}}
    {{#unless (or entry.isPrepared (eq entry.category "items"))}} {{#unless entry.isRitual}} {{/unless}} {{/unless}}
    {{/if}}
  2. {{!-- Add spell items for each spell level --}} {{#each group.active as |slot index|}} {{#if slot.spell}}
  3. {{spell.name}} {{{actionGlyph spell.system.time.value}}}

    {{spell.defense.label}}
    {{#if entry.isInnate}}
    {{#if slot.uses}} / {{#if @root.editable}} {{/if}} {{else}} {{/if}}
    {{else}}
    {{spell.system.range.value}}
    {{/if}} {{#if (eq spell.parentItem.isEquipped false)}} {{else}} {{/if}}
    {{#if @root.editable}} {{#if (and entry.isSpontaneous (ne group.id "cantrips"))}} {{/if}} {{#unless slot.virtual}} {{#if entry.isPrepared}} {{#unless (eq group.id "cantrips")}} {{/unless}} {{else if (ne entry.category "items")}} {{/if}} {{/unless}} {{/if}}
  4. {{else if (ne entry.category "items")}}
  5. {{localize "PF2E.SpellSlotEmpty"}}

  6. {{/if}} {{/each}} {{/if}} {{/each}} {{#if (and (eq entry.groups.length 0) (not entry.isEphemeral) @root.editable)}}
  7. {{localize "PF2E.SpellSlotEmpty"}}

  8. {{/if}}
{{/with}}