{{ liveMessage() }}

@if (isLoading()) {
{{ loadingProgress() }}%

{{ tr().loading }}

}

{{ tr().planning.title }}

@if (planningOutcome()?.kind === 'InvalidInput') { } @else if (planningOutcome()?.kind === 'PlanningConflict') { } @else if (planningOutcome()?.kind === 'PlanningIncomplete') {

{{ hasPlannerError() ? tr().planning.error : tr().planning.incomplete }}

} @else if (planningOutcome()?.kind === 'Plan') {

{{ tr().planning.complete }}

}
@if (planningOutcome(); as outcome) { @if (outcome.kind === 'InvalidInput') { } } @if (planningExplanation(); as outcomeExplanation) { @if (outcomeExplanation.kind === 'ConflictExplanation') {

{{ tr().planning.conflictDetails }}

{{ tr().planning.conflictingRules }}:

{{ tr().planning.bottleneck }}: {{ outcomeExplanation.bottleneck.message }}

} @else if (outcomeExplanation.kind === 'IncompleteExplanation') {

{{ tr().planning.incompleteDetails }}

{{ outcomeExplanation.reason.message }}

{{ tr().planning.completedStages }}
{{ outcomeExplanation.completedStages.length ? outcomeExplanation.completedStages.join(', ') : tr().planning.none }}
{{ tr().planning.uncompletedStages }}
{{ outcomeExplanation.uncompletedStages.length ? outcomeExplanation.uncompletedStages.join(', ') : tr().planning.none }}
} } @if (displayedPlan(); as plan) {
{{ tr().planning.daysPlaced }}
{{ plan.placements.length }}
{{ tr().planning.daysGained }}
{{ plan.metrics.nonWorkingDayGain }}
{{ tr().planning.longestWorkSequence }}
{{ plan.metrics.longestWorkSequence }}
} @if (selectedExplanation(); as selected) {
{{ tr().planning.whyPlacement }}

{{ selected.placement.date }} · {{ balanceLabel(selected) }}

@if (planExplanation()!.incomplete; as interrupted) {
{{ tr().planning.incumbentExplanation }}

{{ interrupted.reason.message }}

{{ tr().planning.completedStages }}: {{ interrupted.completedStages.length ? interrupted.completedStages.join(', ') : tr().planning.none }}

{{ tr().planning.uncompletedStages }}: {{ interrupted.uncompletedStages.length ? interrupted.uncompletedStages.join(', ') : tr().planning.none }}

}
{{ tr().planning.balance }}
{{ balanceLabel(selected) }} {{ selected.placement.balanceId }} @if (selected.balance) {
{{ planningDate(selected.balance.availableFrom) }} – {{ planningDate(selected.balance.expiryDate) }} }
{{ tr().planning.rules }}
@if (selected.ruleIds.length) { @for (ruleId of selected.ruleIds; track ruleId; let last = $last) { {{ ruleLabel(ruleId) }} {{ ruleId }}{{ last ? '' : ', ' }} } } @else { {{ tr().planning.noRules }} }
{{ tr().planning.supporting }}
{{ selected.supporting ? tr().planning.yes : tr().planning.no }}
{{ tr().planning.remaining }}
{{ selected.remainingQuantity }} @if (selected.remainingBalance) {
{{ formatIdentifier(selected.remainingBalance.classification) }} · {{ selected.remainingBalance.reason.message }} }
@if (selected.timeOffPeriod; as period) {
{{ tr().planning.timeOffPeriod }}
{{ period.start }} – {{ period.end }} ({{ period.duration }})
} @if (selected.firstDecisiveObjective; as decisive) {
{{ tr().planning.firstDecisive }}
{{ formatIdentifier(decisive) }}
}

{{ tr().planning.contributions }}

    @for ( contribution of selected.contributions; track contribution.kind + contribution.code ) {
  • {{ contribution.label }} @if (contribution.value !== undefined) { · {{ contribution.value }} } @if (contribution.dates?.length) { · {{ contribution.dates!.join(', ') }} }
  • }

{{ tr().planning.objectiveVector }}

    @for ( objective of selected.objectiveVector.objectives; track objective.id ) {
  1. {{ objectiveLabel(objective) }} {{ objective.value }} {{ formatIdentifier(objective.direction) }}
  2. }

{{ tr().planning.finalMetrics }}

{{ tr().planning.unplacedAtRisk }}
{{ selected.finalMetrics.unplacedAtRisk }}
{{ tr().planning.holidayWeekValue }}
{{ selected.finalMetrics.holidayWeekValue }}
{{ tr().planning.daysGained }}
{{ selected.finalMetrics.nonWorkingDayGain }}
{{ tr().planning.longestWorkSequence }}
{{ selected.finalMetrics.longestWorkSequence }}
{{ tr().planning.shortSequenceDeficit }}
{{ selected.finalMetrics.shortSequenceDeficit }}
{{ tr().planning.supportingPlacements }}
{{ selected.finalMetrics.supportingPlacements }}
{{ tr().planning.preferenceSatisfaction }}
{{ selected.finalMetrics.preferenceSatisfaction.join(', ') || tr().planning.none }}
{{ tr().planning.removedRestoredComparison }}

{{ tr().planning.comparisonHelp }}

    @for (delta of selected.comparison.delta; track delta.id) {
  • {{ formatIdentifier(delta.id) }}: {{ delta.value }}
  • }

{{ tr().planning.counterfactual }}

{{ tr().planning.hypothetical }}

@if (counterfactual(); as analysis) {

{{ analysis.placement.date }} · {{ analysis.placement.balanceId }}

} @if (counterfactualLoading()) {

{{ tr().planning.counterfactualLoading }}

} @else if (counterfactualError()) { } @else if (selectedCounterfactualResult(); as result) {
{{ result.date }}

{{ result.status === 'eligible' ? tr().planning.eligible : tr().planning.ineligible }}

@if (result.historicalStatus) {

{{ tr().planning.historical }}: {{ traceStatusLabel(result.historicalStatus) }}

} @if (result.reason) {

{{ tr().planning.reason }}: {{ result.reason.message }}

} @if (result.comparison; as comparison) {

{{ tr().planning.firstDecisive }}: {{ comparison.firstDecisiveObjective ? formatIdentifier(comparison.firstDecisiveObjective) : tr().planning.none }}

    @for (delta of comparison.delta; track delta.id) {
  • {{ formatIdentifier(delta.id) }}: {{ delta.value }}
  • }
{{ tr().planning.fullComparison }}
{{ tr().planning.before }}
    @for ( objective of comparison.before.objectives; track objective.id ) {
  1. {{ objectiveLabel(objective) }}: {{ objective.value }}
  2. }
{{ tr().planning.after }}
    @for ( objective of comparison.after.objectives; track objective.id ) {
  1. {{ objectiveLabel(objective) }}: {{ objective.value }}
  2. }
}
}
} @else if (explanationError()) { }
{{ tr().planning.legend }}
@for (month of months(); track month.year + '-' + month.monthIndex) { }
@if (planningOutcome() && planningOutcome()?.kind !== 'InvalidInput') {
{{ tr().planning.traceTitle }} @if (traceLoading()) {

{{ tr().planning.traceLoading }}

} @else if (planningTrace(); as trace) { @if (trace.error) { }
@if (selectedTracePhase(); as phase) {

{{ formatIdentifier(phase.name) }}

@if (phase.decisions.length) { @if (selectedTraceDecision(); as decision) {

{{ tr().planning.dates }}: {{ decision.dates.length ? decision.dates.join(', ') : tr().planning.none }}

@if (decision.reason) {

{{ tr().planning.reason }}: {{ decision.reason.message }}

}

{{ tr().planning.candidates }}

@if (decision.candidates.length > 50) { }
@for (candidate of visibleTraceCandidates(); track $index) {
{{ traceStatusLabel(candidate.status) }} · @if ( candidate.sourceDate && candidate.sourceDate !== candidate.date ) { {{ candidate.sourceDate }} → } {{ candidate.dates?.join(', ') || candidate.date || tr().planning.none }} @if (candidate.reason) {

{{ candidate.reason.message }}

} @if (candidate.comparison?.firstDecisiveObjective) {

{{ tr().planning.firstDecisive }}: {{ formatIdentifier( candidate.comparison! .firstDecisiveObjective! ) }}

} @if (candidate.comparison; as comparison) { @if (comparison.tieBreak) {

{{ tr().planning.tieBreak }}: {{ formatIdentifier( comparison.tieBreak ) }}

}
    @for ( delta of comparison.delta; track delta.id ) {
  • {{ formatIdentifier(delta.id) }}: {{ delta.value }}
  • }
{{ tr().planning.before }}
    @for ( objective of comparison.before .objectives; track objective.id ) {
  1. {{ objectiveLabel( objective ) }}: {{ objective.value }}
  2. }
{{ tr().planning.after }}
    @for ( objective of comparison.after .objectives; track objective.id ) {
  1. {{ objectiveLabel( objective ) }}: {{ objective.value }}
  2. }
} @if (candidate.placement) { }
}

{{ tr().planning.deltas }}

    @for (delta of decision.deltas; track $index) {
  • {{ formatIdentifier(delta.kind) }} @if (delta.fromDate || delta.date) { · {{ delta.fromDate || delta.date }} } @if (delta.toDate) { → {{ delta.toDate }} } @if (delta.balanceId) { · {{ delta.balanceId }} } @if (delta.remainingAfter !== undefined) { · {{ delta.remainingBefore }} → {{ delta.remainingAfter }} }
  • }
@if (traceState(); as state) {

{{ traceMoment() === 'before' ? tr().planning.before : tr().planning.after }}: {{ state.placements.length }} {{ tr().planning.placements }}, {{ state.earnedActivations.length }} {{ tr().planning.activations }}

} } } @else {

{{ tr().planning.noDecisions }}

}
}
} @else if (traceResolved()) {

{{ tr().planning.traceUnavailable }}

}
}