{
  "definitions": [
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "presentation/widgets/surface.widget.ts",
          "name": "scriptOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/tree#file-presentation-widgets-surface-widget-ts",
            "json": "https://banes-lab.com/json/source/tree/presentation/widgets/surface.widget.ts",
            "label": "presentation/widgets/surface.widget.ts",
            "markdown": "https://banes-lab.com/source/tree/presentation/widgets/surface.widget.ts.md",
            "ref": "anatomy:file-presentation-widgets-surface-widget-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 56,
      "name": "editSegments",
      "signature": "const editSegments = function editSegments(edit: LineEdit, venue: VenuePane): Segment[] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "presentation/widgets/surface.widget.ts",
          "name": "editSegments",
          "source": {
            "href": "https://banes-lab.com/anatomy/tree#file-presentation-widgets-surface-widget-ts",
            "json": "https://banes-lab.com/json/source/tree/presentation/widgets/surface.widget.ts",
            "label": "presentation/widgets/surface.widget.ts",
            "markdown": "https://banes-lab.com/source/tree/presentation/widgets/surface.widget.ts.md",
            "ref": "anatomy:file-presentation-widgets-surface-widget-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 80,
      "name": "scriptOf",
      "signature": "const scriptOf = function scriptOf(recording: SurfaceRecording, shell: ShellPane, venue: VenuePane): SurfaceScript {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 20,
      "name": "prefersStill",
      "signature": "const prefersStill = function prefersStill(): boolean {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 24,
      "name": "typingSegment",
      "signature": "const typingSegment = function typingSegment("
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 39,
      "name": "commandSegments",
      "signature": "const commandSegments = function commandSegments(command: string, shell: ShellPane): Segment[] {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 40,
      "name": "typing",
      "signature": "const typing = typingSegment("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 57,
      "name": "removals",
      "signature": "const removals = Array.from({ length: edit.removed }, (_, step): Segment => ({"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 63,
      "name": "insertions",
      "signature": "const insertions = edit.inserted.map((line, offset) => {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 64,
      "name": "at",
      "signature": "const at = edit.at + offset;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 65,
      "name": "indent",
      "signature": "const indent = indentOf(line.text);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 81,
      "name": "{ frames, opening }",
      "signature": "const { frames, opening } = recording;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 82,
      "name": "outputs",
      "signature": "const outputs = new Map<string, string>();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 83,
      "name": "first",
      "signature": "const first = frames.at(0);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 84,
      "name": "openingFocus",
      "signature": "const openingFocus = first === undefined ? 0 : lineEdit(opening, first.lines).at;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 85,
      "name": "lines",
      "signature": "let lines = opening;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 86,
      "name": "body",
      "signature": "const body = frames.flatMap((frame): Segment[] => {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 87,
      "name": "rest",
      "signature": "const rest = outputRest(outputs.get(frame.command), frame.output);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 88,
      "name": "edit",
      "signature": "const edit = lineEdit(lines, frame.lines);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 89,
      "name": "firstChanged",
      "signature": "const firstChanged = frame.lines.findIndex((line) => line.changed);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 92,
      "name": "lead",
      "signature": "const lead: Segment[] ="
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 103,
      "name": "output",
      "signature": "const output = outputLines(rest ?? frame.output).map((line): Segment => ({"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 109,
      "name": "hold",
      "signature": "const hold: Segment = {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 139,
      "name": "rewind",
      "signature": "const rewind: Segment = {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 146,
      "name": "back",
      "signature": "const back = lineEdit("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "class_declaration",
      "line": 156,
      "name": "SurfacePlayer",
      "signature": "export class SurfacePlayer {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 157,
      "name": "parts",
      "signature": "private readonly parts: PlayerParts;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 158,
      "name": "timer",
      "signature": "private readonly timer: SurfaceTimer;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 159,
      "name": "settled",
      "signature": "private readonly settled: number;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 160,
      "name": "still",
      "signature": "private readonly still = prefersStill();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 161,
      "name": "paused",
      "signature": "private paused: boolean;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 162,
      "name": "visible",
      "signature": "private visible = false;"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 164,
      "name": "constructor",
      "signature": "public constructor(parts: PlayerParts, recording: SurfaceRecording) {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 165,
      "name": "shell",
      "signature": "const shell = new ShellPane();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 166,
      "name": "venue",
      "signature": "const venue = new VenuePane(recording.frames.at(0)?.surface ?? \"\");"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 168,
      "name": "script",
      "signature": "const script = scriptOf(recording, shell, venue);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 175,
      "name": "start",
      "signature": "public start(): Disposer {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 177,
      "name": "observer",
      "signature": "const observer = new IntersectionObserver((entries) => {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 189,
      "name": "sync",
      "signature": "private sync(): void {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 197,
      "name": "toggle",
      "signature": "private toggle(): void {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 203,
      "name": "renderControls",
      "signature": "private renderControls(): void {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 204,
      "name": "button",
      "signature": "const button = createPlaybackButton(this.paused, () => {"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/tree#file-presentation-widgets-surface-widget-ts",
  "language": "typescript",
  "layer": "product",
  "name": "surface.widget.ts",
  "path": "presentation/widgets/surface.widget.ts",
  "ref": "anatomy:file-presentation-widgets-surface-widget-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/tree#folder-presentation-widgets",
          "json": "https://banes-lab.com/json/anatomy/tree/folder-presentation-widgets",
          "label": "presentation/widgets",
          "markdown": "https://banes-lab.com/anatomy/tree/folder-presentation-widgets.md",
          "ref": "chapter:/anatomy/tree#folder-presentation-widgets"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/tree#folder-presentation-widgets",
          "json": "https://banes-lab.com/json/anatomy/tree/folder-presentation-widgets",
          "label": "presentation/widgets",
          "markdown": "https://banes-lab.com/anatomy/tree/folder-presentation-widgets.md",
          "ref": "chapter:/anatomy/tree#folder-presentation-widgets"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "widget",
    "subject": "surface",
    "variant": null
  },
  "stats": {
    "bytes": 6760,
    "callable": 10,
    "definitions": 41,
    "edges": 1,
    "exported": 17,
    "files": 1,
    "findings": {},
    "flows": {
      "leaf": 1,
      "entry": 1,
      "isolated": 39
    },
    "lines": {
      "blank": 11,
      "code": 198,
      "total": 209
    }
  },
  "summary": "198 lines of code and 41 definitions.",
  "text": "https://banes-lab.com/source/tree/presentation/widgets/surface.widget.ts.txt",
  "tree": "tree",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/tree#file-presentation-widgets-tab-widget-ts",
      "json": "https://banes-lab.com/json/source/tree/presentation/widgets/tab.widget.ts",
      "label": "presentation/widgets/tab.widget.ts",
      "markdown": "https://banes-lab.com/source/tree/presentation/widgets/tab.widget.ts.md",
      "ref": "anatomy:file-presentation-widgets-tab-widget-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/tree#file-presentation-widgets-site-widget-ts",
      "json": "https://banes-lab.com/json/source/tree/presentation/widgets/site.widget.ts",
      "label": "presentation/widgets/site.widget.ts",
      "markdown": "https://banes-lab.com/source/tree/presentation/widgets/site.widget.ts.md",
      "ref": "anatomy:file-presentation-widgets-site-widget-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/tree/presentation/widgets",
    "label": "presentation/widgets",
    "markdown": "https://banes-lab.com/api/source/tree/presentation/widgets.md",
    "ref": "api:source/tree/presentation/widgets"
  }
}
