= 9}
class:is-active={isActive}
>
{#if item}
{#snippet trigger()}
{#key item?.id ?? position}
= 9}
class:editable={ctx?.canEdit()}
onclick={() => viewDetails()}
>
{#if awakeningImage}

{/if}
{#each axSkillImages as skill}

{/each}
{#each weaponKeyImages as skill}

{/each}
{/key}
{/snippet}
{#snippet contextMenu()}
{/snippet}
{#snippet dropdownMenu()}
{/snippet}
{:else}
{#key `empty-${position}`}
= 9}
class:editable={ctx?.canEdit()}
onclick={() =>
ctx?.canEdit() && ctx?.openPicker && ctx.openPicker({ type: 'weapon', position, item })}
>

{#if ctx?.canEdit()}
{/if}
{/key}
{/if}
{#if item}
{
if (!item?.id || !ctx) return
try {
const editKey = ctx.getEditKey()
const updated = await ctx.services.gridService.updateWeaponUncap(
item.id,
level,
undefined,
editKey || undefined
)
if (updated) {
ctx.updateParty(updated)
}
} catch (err) {
console.error('Failed to update weapon uncap:', err)
// TODO: Show user-friendly error notification
}
}}
updateTranscendence={async (stage) => {
if (!item?.id || !ctx) return
try {
const editKey = ctx.getEditKey()
// When setting transcendence > 0, also set uncap to max (6)
const maxUncap = stage > 0 ? 6 : undefined
const updated = await ctx.services.gridService.updateWeaponUncap(
item.id,
maxUncap,
stage,
editKey || undefined
)
if (updated) {
ctx.updateParty(updated)
}
} catch (err) {
console.error('Failed to update weapon transcendence:', err)
// TODO: Show user-friendly error notification
}
}}
/>
{/if}
{item ? displayName(item?.weapon) : ''}