:: Main [nobr jump-to-safe jump-from-safe]

/* make sure the first thing that happens is the error check */
<<set _errors = App.MainView.errors()>>
<span id="errors"></span>
<<script>>
	$(document).one(':passagerender', event => {
		event.content.prepend(State.temporary.errors);
	});
<</script>>

<<if $tabChoice.SlaveInteract != 'Description'>>
	<<set $tabChoice.SlaveInteract = 'Description'>>
<</if>>

<<run penthouseCensus()>>

<<set $nextButton = "END WEEK", $nextLink = "End Week", $encyclopedia = "How to Play">>
<<set $costs = Math.trunc(calculateCosts.predict())>>

<<set $currentRule = $defaultRules[0]>>

<<run SlaveSort.slaves($slaves)>>

<<if $newModelUI == 1>>
	<span id="building"></span>
	<<script>>
		$(document).one(':passageend', () => {
			$('#building').append(
				V.building.render(),
			);
		});
	<</script>>
<</if>>

<<if $seeArcology == 1>>
	<div id="arcDesc"></div>
	<<script>>
		$(document).one(':passageend', () => {
			$('#arcDesc').append(
				App.Desc.playerArcology(App.UI.DOM.combineNodes("| ",
					App.UI.DOM.passageLink("Hide", "Main", () => {V.seeArcology = 0})))
			);
		});
	<</script>>
<</if>>

<<if $seeDesk == 1>>
	<<include "Office Description">>
	[[Hide|Main][$seeDesk = 0]]
<</if>>

<<includeDOM App.MainView.full()>>

<<set $activeSlave = $slaves.random()>>
<<if $activeSlave && ($activeSlave.assignment != "please you") && ($activeSlave.assignment != "guard you")>>
	<br>//<span id="walk"><<= walkPast($activeSlave)>></span>//
<</if>>
<<if ($debugMode == 1)>>
	//| [[Show all walk past scenes|Walk Past List]]//
<</if>>

<<run App.UI.SlaveList.ScrollPosition.restore()>>

src/uncategorized/main.tw