<div class="coc7 chat-card san-loss-card" data-san-loss="{{sanLoss}}" data-san-loss-fail="{{sanLossFail}}" data-actor-id="{{actorId}}" data-total-san-loss="{{totalSanLoss}}" data-applied="{{applied}}" data-is-blind="{{isBlind}}" data-difficulty="{{difficulty}}" data-modifier="{{modifier}}" {{#if tokenKey}}data-token-id="{{actorId}}" {{/if}}>
  <div class='roll-result'></div>
  <div class='san-roll'></div>
  {{#if isSanLossRolled}}
    {{#if sanLost}}
      <h4 class="san-result loss">{{ localize 'CoC7.SANLoss' }} : {{totalSanLoss}}</h4>
      {{#unless applied}}
        <div class='card-buttons gm-only'>
          <button data-action="apply-san-loss">{{ localize 'CoC7.Apply' }}</button>
        </div>
      {{/unless}}
    {{else}}
      <h4 class="san-result resist">{{ localize 'CoC7.NoSanLoss' }}</h4>
    {{/if}}
  {{else}}
    {{#if isBlind}}
      {{#if isRolled}}
        <div class='card-buttons gm-visible-only'>
          <button data-action="reveal-san-check">{{ localize 'CoC7.RevealSanLoss'}}</button>
        </div>
      {{else}}
        <div class='card-buttons owner-only'>
          <button data-action="roll-san-check">{{ localize 'CoC7.SanityCheck' }} ({{actor.system.attribs.san.value}}%)</button>
        </div>
      {{/if}}
    {{else}}
      <div class='card-buttons owner-only'>
        {{#if isRolled}}
          <button data-action="roll-san-loss">{{ localize 'CoC7.SANLoss' }} : {{sanLossFormula}}</button>
        {{else}}
          <button data-action="roll-san-check">{{ localize 'CoC7.SanityCheck' }} ({{actor.system.attribs.san.value}}%)</button>
        {{/if}}
      </div>
    {{/if}}
  {{/if}}
</div>