Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

feat(device): add fast ASCII octopus companion and touch workflows (#403)

Dee6c2210dab146
diff --git a/cli/scripts/device-release-check.mts b/cli/scripts/device-release-check.mts
new file mode 100644
index 000000000..2e99be5fe
--- /dev/null
+++ b/cli/scripts/device-release-check.mts
@@ -0,0 +1,182 @@
+/** Offline checks of the exact built/installed bridge. Never imports its CLI entry point. */
+import fs from 'node:fs'
+import path from 'node:path'
+import vm from 'node:vm'
+import crypto from 'node:crypto'
+import assert from 'node:assert/strict'
+import ts from 'typescript'
+import { CableDecoder, CableType, encodeCableFrame } from '../src/cable/cableFrame.js'
+
+const args=process.argv.slice(2), option=(key:string)=>{const i=args.indexOf(key);return i<0?undefined:args[i+1]}
+const bundle=option('--bundle'), out=option('--out')
+if(!bundle || !out) throw new Error('Usage: tsx scripts/device-release-check.mts --bundle <cli.js> --out <directory>')
+fs.mkdirSync(out,{recursive:true})
+const code=fs.readFileSync(bundle,'utf8'), hash=crypto.createHash('sha256').update(code).digest('hex')
+const ast=ts.createSourceFile(bundle,code,ts.ScriptTarget.Latest,true,ts.ScriptKind.JS), nodes:ts.Node[]=[]
+const walk=(n:ts.Node)=>{nodes.push(n);ts.forEachChild(n,walk)};walk(ast)
+const classes=nodes.filter((n):n is ts.ClassExpression=>ts.isClassExpression(n)&&n.members.some(m=>ts.isMethodDeclaration(m)&&m.name.getText(ast)==='turnStarted'&&m.getText(ast).includes('turn.started'))&&n.members.some(m=>ts.isMethodDeclaration(m)&&m.name.getText(ast)==='onBytes'))
+assert.equal(classes.length,1,'Identify the actual CableSession implementation unambiguously')
+const klass=classes[0]
+const method=(name:string)=>klass.members.find((n):n is ts.MethodDeclaration=>ts.isMethodDeclaration(n)&&n.name.getText(ast)===name)
+const decoder=klass.members.find(n=>ts.isPropertyDeclaration(n)&&n.name.getText(ast)==='decoder') as ts.PropertyDeclaration
+assert(decoder?.initializer && ts.isNewExpression(decoder.initializer))
+const decoderName=decoder.initializer.expression.getText(ast)
+const send=method('send');assert(send)
+const calls:ts.CallExpression[]=[]
+const scan=(n:ts.Node)=>{if(ts.isCallExpression(n))calls.push(n);ts.forEachChild(n,scan)};scan(send)
+const encode=calls.find(n=>n.arguments.some(x=>ts.isPropertyAccessExpression(x)&&x.name.text==='Json'));assert(encode)
+const kind=encode.arguments.find(x=>ts.isPropertyAccessExpression(x)&&x.name.text==='Json') as ts.PropertyAccessExpression
+let now=100000
+const context:any={Buffer,console,Map,Set,Promise,JSON,Math,Uint8Array,TextDecoder,TextEncoder,
+ setTimeout,clearTimeout,setInterval,clearInterval,
+ Date:class extends Date {static now(){return now}},a:(fn:any)=>fn}
+// Literal bundle constants only. No CLI top-level code or environment initialization executes.
+for(const statement of ast.statements) if(ts.isVariableStatement(statement)) for(const d of statement.declarationList.declarations) {
+ if(!ts.isIdentifier(d.name)||!d.initializer)continue
+ const raw=d.initializer.getText(ast)
+ if(ts.isStringLiteral(d.initializer))context[d.name.text]=d.initializer.text
+ else if(/^(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[\da-f]+)$/i.test(raw))context[d.name.text]=Number(raw)
+}
+const encoderNode=nodes.find((n):n is ts.FunctionDeclaration=>ts.isFunctionDeclaration(n)&&n.name?.getText(ast)===encode.expression.getText(ast));assert(encoderNode)
+const decoderNode=nodes.find((n):n is ts.VariableDeclaration=>ts.isVariableDeclaration(n)&&n.name.getText(ast)===decoderName);assert(decoderNode?.initializer)
+const kindNode=nodes.find((n):n is ts.VariableDeclaration=>ts.isVariableDeclaration(n)&&n.name.getText(ast)===kind.expression.getText(ast));assert(kindNode?.initializer)
+const codecCalls:ts.CallExpression[]=[]
+const scanCodec=(n:ts.Node)=>{if(ts.isCallExpression(n)&&ts.isIdentifier(n.expression))codecCalls.push(n);ts.forEachChild(n,scanCodec)};scanCodec(encoderNode)
+const codecHelpers=[...new Set(codecCalls.map(n=>n.expression.getText(ast)))].map(name=>{
+ const fn=nodes.find((n):n is ts.FunctionDeclaration=>ts.isFunctionDeclaration(n)&&n.name?.getText(ast)===name);assert(fn,`Unknown codec dependency ${name}`);return fn
+})
+// Import only the standalone status parser referenced by this built artifact.
+for(const node of ast.statements) if(ts.isImportDeclaration(node)&&ts.isStringLiteral(node.moduleSpecifier)&&node.importClause?.namedBindings&&ts.isNamedImports(node.importClause.namedBindings)) {
+ const wanted=node.importClause.namedBindings.elements.filter(e=>(e.propertyName??e.name).text==='terminalActivity')
+ if(wanted.length){assert(node.moduleSpecifier.text.startsWith('./device-activity'))
+ const helper=await import(new URL(node.moduleSpecifier.text,`file://${path.resolve(bundle)}`).href)
+ for(const e of wanted)context[e.name.text]=helper.terminalActivity
+ }
+}
+const sandbox=vm.createContext(context)
+for (const statement of ast.statements) if (ts.isVariableStatement(statement)) {
+ for (const declaration of statement.declarationList.declarations) {
+ if (ts.isIdentifier(declaration.name) && declaration.initializer?.kind === ts.SyntaxKind.RegularExpressionLiteral) {
+ context[declaration.name.text] = vm.runInContext(declaration.initializer.getText(ast), sandbox)
+ }
+ }
+}
+// Function declarations are inert until invoked. Register the built functions so
+// inlined pure helpers (activity parsing and recap cleanup) use the same bytes as
+// the release, without executing any CLI startup statements or loading I/O imports.
+for (const statement of ast.statements) if (ts.isFunctionDeclaration(statement) && statement.name) {
+ const name = statement.name.text
+ if (Object.hasOwn(context, name)) continue
+ Object.defineProperty(context, name, { configurable: true, enumerable: true,
+ get() {
+ const value = vm.runInContext(`(${statement.getText(ast)})`, sandbox)
+ Object.defineProperty(context, name, { value, writable: true, configurable: true, enumerable: true })
+ return value
+ },
+ set(value) { Object.defineProperty(context, name, { value, writable: true, configurable: true, enumerable: true }) },
+ })
+}
+// These bounded state holders are constructed by newer CableSession bundles.
+// Only their class definitions run here; all host actions remain fixture wiring.
+for (const name of ['PassageCarry', 'VoiceDraft', 'QuestionInbox']) {
+ const found = nodes.filter((n): n is ts.VariableDeclaration => ts.isVariableDeclaration(n) &&
+ !!n.initializer && ts.isClassExpression(n.initializer) &&
+ n.initializer.members.some(m => ts.isClassStaticBlockDeclaration(m) &&
+ m.getText(ast).includes(JSON.stringify(name))))
+ assert(found.length <= 1, `Ambiguous built ${name} implementation`)
+ for (const declaration of found) {
+ context[declaration.name.getText(ast)] = vm.runInContext(`(${declaration.initializer!.getText(ast)})`, sandbox)
+ }
+}
+for(const fn of codecHelpers)context[fn.name!.text]=vm.runInContext(`(${fn.getText(ast)})`,sandbox)
+context[decoderName]=vm.runInContext(`(${decoderNode.initializer.getText(ast)})`,sandbox)
+context[encode.expression.getText(ast)]=vm.runInContext(`(${encoderNode.getText(ast)})`,sandbox)
+context[kind.expression.getText(ast)]=vm.runInContext(`(${kindNode.initializer.getText(ast)})`,sandbox)
+const Session=vm.runInContext(`(${klass.getText(ast)})`,sandbox)
+const providerNodes=nodes.filter(n=>ts.isPropertyAssignment(n)&&n.name.getText(ast)==='activityText') as ts.PropertyAssignment[]
+const localMethod=nodes.find(n=>ts.isMethodDeclaration(n)&&n.name.getText(ast)==='activityText'&&n.getText(ast).includes('this.isLocalAgent')) as ts.MethodDeclaration|undefined
+const results:any[]=[], traces:any[]=[]
+const check=async(id:string,fn:()=>Promise<void>|void)=>{try{await fn();results.push({id,status:'passed'})}catch(e){results.push({id,status:'failed',error:String(e)})}}
+const plain=(x:any)=>JSON.parse(JSON.stringify(x))
+const settle=()=>new Promise(r=>setTimeout(r,0))
+const until=async(f:()=>boolean)=>{for(let i=0;i<1000&&!f();i++)await new Promise(r=>setTimeout(r,1));assert(f(),'Expected protocol response did not arrive')}
+function setup(){
+ const sent:any[]=[],frames:Buffer[]=[],logs:string[]=[],turns:any[]=[],scrolls:any[]=[]
+ let selected='tab-a',rows=[{id:'a',name:'Fixture Codex',engine:'codex'}]
+ const host:any={appName:()=> 'harness',localMachine:()=>({id:'local',name:'Fixture'}),selectedMachine:()=> 'local',voiceLang:()=> 'en',
+ listMachines:async()=>({machines:[],source:'backend'}),listSwarms:()=>({selected,swarms:[{id:'tab-a',name:'A',agents:1,panes:1},{id:'tab-b',name:'B',agents:0,panes:0}],tiles:[]}),
+ selectSwarm:(id:string)=>{selected=id;rows=id==='tab-a'?[{id:'a',name:'Fixture Codex',engine:'codex'}]:[]},
+ listAgents:async()=>rows,agentTotal:()=>1,activeSwarm:()=>selected,recentSummaries:async()=>[],listUnread:()=>[],describe:()=>({name:'Fixture Codex',engine:'codex',machine:'Fixture'}),
+ log:(s:string)=>logs.push(s),sendTurn:async(...x:any[])=>turns.push(x),transcribe:async()=> 'Fixture request.',route:async()=>({agentId:'a',confidence:1}),
+ focus:async()=>{},openAgent:async()=>{},scrolled:(...x:any[])=>scrolls.push(x),listModels:async()=>[],selectMachine:async()=>({ok:true})}
+ const dial={daemon:()=>{},device:()=>{},greeted:()=>{},tick:()=>{}}
+ const session=new Session(host,dial,async()=>{throw new Error('Real port opening is forbidden in this test')})
+ const peer=new CableDecoder()
+ const port={path:'/dev/fixture',isOpen:true,write:async(bytes:Uint8Array)=>{frames.push(Buffer.from(bytes));peer.feed(bytes,(f:any)=>{if(f.type===CableType.Json)sent.push(JSON.parse(Buffer.from(f.payload).toString()))})},close:async()=>{port.isOpen=false;session.onClosed('fixture disconnect')}}
+ session.link=port;session.greetedMac='fixture';session.greetedFw='fixture';session.desiredFocus='a'
+ const feed=async(message:any,chunk=7)=>{const frame=encodeCableFrame(CableType.Json,Buffer.from(JSON.stringify(message)));for(let i=0;i<frame.length;i+=chunk)session.onBytes(frame.subarray(i,i+chunk));await settle()}
+ return {session,host,port,sent,frames,logs,turns,scrolls,feed}
+}
+await check('built-wire-codec-compatibility',()=>{
+ const make=context[encode.expression.getText(ast)],Decoder=context[decoderName]
+ for(const len of [0,1,2,319,320,1024,8192]){
+ const bytes=Buffer.from(Array.from({length:len},(_,i)=>i&255)),wire=make(CableType.Pcm,bytes)
+ assert.deepEqual(Buffer.from(wire),Buffer.from(encodeCableFrame(CableType.Pcm,bytes)))
+ for(const chunk of [1,7,512,8200]){const d=new Decoder();let seen=0;for(let i=0;i<wire.length;i+=chunk)d.feed(wire.subarray(i,i+chunk),(f:any)=>{seen++;assert.equal(f.type,CableType.Pcm);assert.deepEqual(Buffer.from(f.payload),bytes)});assert.equal(seen,1)}
+ }
+})
+await check('artifact-status-wiring' ,()=>{
+ assert(method('refreshFocusedActivity'),'Installed bridge lacks focused activity delivery')
+ assert(method('tick')?.getText(ast).includes('refreshFocusedActivity'),'Activity recovery is never scheduled')
+ assert.equal(providerNodes.length,1,'Exactly one live activity capture must be wired')
+ assert(localMethod,'Host activity provider must reject remote capture')
+})
+await check('built-capture-is-local-visible-only',async()=>{
+ assert.equal(providerNodes.length,1);assert(localMethod)
+ const expr=providerNodes[0].initializer.getText(ast),resolve=expr.match(/(\w+)\.resolve\(/),capture=expr.match(/(\w+)\.capture\(/);assert(resolve&&capture)
+ let calls=0;context[resolve[1]]={resolve:(id:string)=>id==='missing'?null:{engine:id==='claude'?'claude':id==='shell'?'terminal':'codex'}}
+ context[capture[1]]={capture:async(_session:any,options:any)=>{calls++;assert.deepEqual(plain(options),{mode:'visible',ansi:false});return{state:'succeeded',value:'◦ Working (2s • esc to interrupt)'}}}
+ // context is the contextified object; no eager read of unrelated bundle getters.
+ const provider=vm.runInContext(`(${expr})`,sandbox)
+ const wrapper=vm.runInContext(`(class {${localMethod.getText(ast)}})`,sandbox),host=new wrapper()
+ host.isLocalAgent=(id:string)=>id!=='remote';host.wiring={activityText:provider}
+ assert.equal(await host.activityText('a'),'Working');assert.equal(calls,1)
+ for(const id of ['missing','shell','remote'])assert.equal(await host.activityText(id),null)
+ assert.equal(calls,1)
+})
+for(const [id,label] of [['codex-working','Working'],['claude-activity','Coalescing...']])await check(id,async()=>{
+ const x=setup();x.host.activityText=async()=>label
+ await x.session.refreshFocusedActivity()
+ assert.deepEqual(plain(x.sent).map((m:any)=>[m.t,m.text]),[['turn.started',label],['turn.activity',label]])
+ traces.push({id,frames:x.frames.map(b=>b.toString('hex')),expect:{status:label.replace(/\.\.\.$/,''),busy:true,recap:false}})
+})
+await check('focused-status-throttle',async()=>{const x=setup();let reads=0;x.host.activityText=async()=>{reads++;return'Working'};await x.session.refreshFocusedActivity();await x.session.refreshFocusedActivity();assert.equal(reads,1);now+=3001;await x.session.refreshFocusedActivity();assert.equal(reads,2)})
+for(const end of ['done','summary','error','focus','disconnect'])await check(`late-status-after-${end}`,async()=>{
+ const x=setup();let finish:(s:string)=>void=()=>{};x.host.activityText=()=>new Promise(r=>finish=r)
+ const work=x.session.refreshFocusedActivity();await settle()
+ if(end==='done')await x.session.turnDone('a');if(end==='summary')await x.session.summary('a','Completed.','Completed. Fixture text.')
+ if(end==='error')await x.session.turnError('a','Stopped');if(end==='focus')await x.session.focusAgent('b');if(end==='disconnect')await x.port.close()
+ const count=x.sent.length;finish('Stale...');await work;assert.equal(x.sent.length,count)
+})
+await check('native-footer-clears-when-absent',async()=>{const x=setup();x.host.activityText=async()=>null;await x.session.refreshFocusedActivity();assert.deepEqual(plain(x.sent),[{t:'turn.activity',agentId:'a',text:''}])})
+await check('capture-failure-is-not-completion',async()=>{const x=setup();x.host.activityText=async()=>{throw new Error('capture unavailable')};await x.session.refreshFocusedActivity();assert.deepEqual(plain(x.sent),[])})
+await check('working-to-result-and-next-turn',async()=>{
+ const x=setup();x.host.activityText=async()=> 'Working';await x.session.refreshFocusedActivity()
+ await x.session.turnDone('a');await x.session.summary('a','The fixture passed.','The fixture passed. Full result.')
+ traces.push({id:'completed',frames:x.frames.map(b=>b.toString('hex')),expect:{status:'',busy:false,recap:true}})
+ x.frames.length=0;await x.session.turnStarted('a');assert(x.sent.at(-1).text==='Working')
+ traces.push({id:'next-turn',frames:x.frames.map(b=>b.toString('hex')),expect:{status:'Working',busy:true,recap:false}})
+})
+for(const chunk of [1,7,4096])await check(`tab-roundtrip-fragments-${chunk}`,async()=>{
+ const x=setup();await x.feed({t:'swarm.select',swarmId:'tab-b'},chunk);await x.feed({t:'agents.list'},chunk)
+ await until(()=>x.sent.some(m=>m.t==='agents.end'))
+ assert.equal(x.sent.find(m=>m.t==='swarms').selected,'tab-b');assert.equal(x.sent.find(m=>m.t==='agents.end').tab,'tab-b');assert.equal(x.sent.filter(m=>m.t==='agent').length,0)
+ await x.feed({t:'swarm.select',swarmId:'tab-a'},chunk);x.sent.length=0;await x.feed({t:'agents.list'},chunk)
+ await until(()=>x.sent.some(m=>m.t==='agents.end'));assert.equal(x.sent.find(m=>m.t==='agent').id,'a');assert.equal(x.sent.find(m=>m.t==='agents.end').tab,'tab-a')
+})
+await check('reconnect-and-repeated-hello',async()=>{const x=setup();x.session.greetedMac=null;await x.feed({t:'hello',product:'harness',mac:'fixture',fw:'fixture',proto:3});await until(()=>x.sent.some(m=>m.t==='agents.end'));const count=x.sent.filter(m=>m.t==='agents.end').length;await x.feed({t:'hello',product:'harness',mac:'fixture',fw:'fixture',proto:3});await settle();assert.equal(x.sent.filter(m=>m.t==='agents.end').length,count);assert.equal(x.sent.filter(m=>m.t==='welcome').length,2)})
+const report={artifact:path.resolve(bundle),sha256:hash,bytes:Buffer.byteLength(code),scope:'Exact built CableSession class and activity wiring, real wire encoder/decoder, isolated app/terminal fixtures; no real app actions, microphone or network.',cases:results,passed:results.filter(r=>r.status==='passed').length,total:results.length}
+fs.writeFileSync(path.join(out,'bridge-report.json'),JSON.stringify(report,null,2)+'\n')
+fs.writeFileSync(path.join(out,'firmware-traces.json'),JSON.stringify(traces,null,2)+'\n')
+console.log(JSON.stringify(report,null,2))
+if(report.passed!==report.total)process.exitCode=1
diff --git a/cli/src/cable/cableHost.spec.ts b/cli/src/cable/cableHost.spec.ts
index 4f5dd73e9..1f19d71e1 100644
--- a/cli/src/cable/cableHost.spec.ts
+++ b/cli/src/cable/cableHost.spec.ts
@@ -357,6 +357,25 @@ describe('DaemonCableHost.listAgentsFlat across machines, and the tab the dial g
expect(host.activeSwarm()).toBe('')
})
+ it('takes workspace identity and pane membership from one desktop announcement', async () => {
+ AGENTS.length = 0
+ for (const agentId of ['old-pane', 'new-pane'])
+ AGENTS.push({ agentId, registeredAt: 1, active: true, terminalAvailable: true, engine: 'claude' })
+ const host = new DaemonCableHost(wiring())
+ onTab(host, ['old-pane'], 'old-tab')
+ host.setDesk(['new-pane']) // app_panes arrives before its matching app_swarms.
+ expect((await host.listAgents()).map(a => a.id)).toEqual(['old-pane'])
+ host.setSwarms({ active: 'new-tab', tiles: [], swarms: [{ id: 'new-tab', name: 'New', agentIds: ['new-pane'], panes: 1 }] })
+ const snapshot = await host.listAgentSnapshot()
+ expect(snapshot.tab).toBe('new-tab')
+ expect(snapshot.agents.map(a => a.id)).toEqual(['new-pane'])
+ expect(snapshot.total).toBe(2)
+ onTab(host, [], 'empty-tab')
+ expect(snapshot.tab).toBe('new-tab')
+ expect(snapshot.agents.map(a => a.id)).toEqual(['new-pane'])
+ expect(await host.listAgentSnapshot()).toMatchObject({ tab: 'empty-tab', agents: [] })
+ })
+
it('names the machine, and routes an open, for an agent heard from before it was listed', async () => {
// A remote machine's question can arrive before its agent list has ever been read. The card still has
// to say where it came from, and a tap on it has to open — "ignored open for unknown agent" was a
@@ -660,3 +679,56 @@ describe('cableEventFor', () => {
expect(cableEventFor({ ...base, payload: { kind: 'tool', text: 'Bash' } })).toBeNull()
})
})
+
+
+describe('reviewed device answer receipts', () => {
+ const answer = { agentId: 'review-local', requestId: 'question-1',
+ questions: [{ key: 'scope', q: 'Which scope?', options: ['File', 'Project'], multi: false }],
+ answers: { scope: 'File' }, selections: { scope: ['File'] } }
+ it('reports the local terminal driver result without invoking the legacy answer path', async () => {
+ AGENTS.length = 0
+ AGENTS.push({ agentId: answer.agentId, registeredAt: 1, active: true, terminalAvailable: true, engine: 'claude' })
+ const reviewed = vi.fn(async () => true), legacy = vi.fn()
+ const host = new DaemonCableHost(wiring({ answerReviewed: reviewed, answer: legacy }))
+ expect(await host.answerReviewed(answer)).toEqual({ ok: true })
+ reviewed.mockResolvedValue(false)
+ expect((await host.answerReviewed(answer)).ok).toBe(false)
+ expect(legacy).not.toHaveBeenCalled()
+ })
+ it('distinguishes remote handoff from completion and refuses unreachable or ambiguous answers', async () => {
+ AGENTS.length = 0
+ const fleet = fleetOf([REMOTE]); fleet.answerReviewed = vi.fn()
+ const host = new DaemonCableHost(wiring(), fleet); host.noteAgent('other','review-remote')
+ const remote = { ...answer, agentId: 'review-remote' }
+ expect(await host.answerReviewed(remote)).toEqual({ ok: true, pending: true })
+ expect(fleet.answerReviewed).toHaveBeenCalledTimes(1)
+ fleet.reachable = () => ({ ok: false, at: Date.now() })
+ expect((await host.answerReviewed(remote)).ok).toBe(false)
+ fleet.reachable = () => ({ ok: true, at: Date.now() })
+ expect((await host.answerReviewed({ ...remote, questions: [{ ...remote.questions[0], multi: true }],
+ selections: { scope: ['CSV, UTF-8'] } })).ok).toBe(false)
+ expect(fleet.answerReviewed).toHaveBeenCalledTimes(1)
+ })
+})
+
+describe('spoken question capability', () => {
+ it('offers speech only for a known local receiver and never forwards text to an older remote driver', async () => {
+ AGENTS.length = 0
+ AGENTS.push({ agentId: 'spoken-local', registeredAt: 1, active: true, terminalAvailable: true, engine: 'claude' })
+ const answerReviewed = vi.fn(async () => true), fleet = fleetOf([REMOTE])
+ fleet.answerReviewed = vi.fn()
+ const host = new DaemonCableHost(wiring({ answerReviewed }), fleet)
+ host.noteAgent('mine','spoken-local'); host.noteAgent('other','spoken-remote')
+ await host.listAgentsFlat()
+ expect(host.canSpeakQuestion('spoken-local')).toBe(true)
+ expect(host.canSpeakQuestion('spoken-remote')).toBe(false)
+ expect(host.canSpeakQuestion('unknown')).toBe(false)
+ const answer = { requestId: 'q', agentId: 'spoken-local',
+ questions: [{ key: 'scope', q: 'Which scope?', options: ['File'], multi: false, canText: true }],
+ answers: { scope: 'Just the parser' }, selections: { scope: [] }, freeTextKeys: ['scope'] }
+ expect(await host.answerReviewed(answer)).toEqual({ ok: true })
+ expect((await host.answerReviewed({ ...answer, agentId: 'spoken-remote' })).ok).toBe(false)
+ expect(fleet.answer).not.toHaveBeenCalled(); expect(fleet.answerReviewed).not.toHaveBeenCalled()
+ expect(answerReviewed).toHaveBeenCalledTimes(1)
+ })
+})
diff --git a/cli/src/cable/cableHost.ts b/cli/src/cable/cableHost.ts
index ccaa791b9..161398f89 100644
--- a/cli/src/cable/cableHost.ts
+++ b/cli/src/cable/cableHost.ts
@@ -15,10 +15,15 @@ import { registry, projectDisplayName, type RegisteredSession } from '../lib/reg
import { fetchRelease, loadImage, otaKeyForBoard, shouldOffer } from './fwPush.js'
import { routeVoiceTask, type RouterAgent, type RouterContinuity } from '../lib/voiceRouter.js'
import { env } from '../config/env.js'
+import { extendShortRecap } from '../lib/deviceRecap.js'
import type { AppSwarms, CableAgent, CableHost, CableMachine, CableMachineSource, CableSwarm, CableTile, DialStatus, OpenReason, RouteDecision } from './cableSession.js'
import type { WindowRoute } from './windowRoute.js'
+import type { SelectionCommand, SelectionResult } from './windowSelection.js'
+import type { VisitCommand, VisitResult } from './windowVisit.js'
+import type { FormCommand, FormResult } from './windowForm.js'
import { FleetError, type FleetMachine, type MachineFleet } from './machineFleet.js'
+import type { ReviewedAnswer, AnswerReceipt } from './questionInbox.js'
/** One completed turn's recap, as the mirror keeps them. */
@@ -30,6 +35,8 @@ export interface RecentTurn {
}
export interface CableHostWiring {
+ /** Exact live terminal footer for a local agent; absent when no footer is visible. */
+ activityText?: (agentId: string) => Promise<string | null>
/** The person's own last questions to a LOCAL agent, newest first. */
recentAsks: (agentId: string) => string[]
machineName: () => string
@@ -44,6 +51,7 @@ export interface CableHostWiring {
sendTurn: (agentId: string, text: string) => void
stopTurn: (agentId: string) => void
answer: (agentId: string, requestId: string, answers: Record<string, string>) => void
+ answerReviewed?: (answer: ReviewedAnswer) => Promise<boolean>
/** Recaps of an agent's last `n` completed turns — for routing, and for redrawing a reattached dial. */
recent: (agentId: string, n: number) => RecentTurn[]
/** The opaque runtime-v1 profile, which is where the dial's Model/Effort chips come from. */
@@ -70,6 +78,12 @@ export interface CableHostWiring {
dialStatus?: (status: DialStatus) => void
/** Offer a spoken task to the desktop window's palette. Omitted when there is no window plumbing. */
routeInWindow?: (text: string, cmd?: string) => Promise<WindowRoute>
+ selectPassage?: (command: SelectionCommand) => Promise<SelectionResult>
+ clearSelection?: () => void
+ visit?: (command: VisitCommand) => Promise<VisitResult>
+ clearVisit?: () => void
+ form?: (command: FormCommand) => Promise<FormResult>
+ clearForm?: () => void
log: (line: string) => void
}
@@ -259,6 +273,9 @@ export class DaemonCableHost implements CableHost {
* a screen that is not there.
*/
onDialGone(): void {
+ this.wiring.clearSelection?.()
+ this.wiring.clearVisit?.()
+ this.wiring.clearForm?.()
this.fleet?.release(true)
}
@@ -277,6 +294,10 @@ export class DaemonCableHost implements CableHost {
return this.dialStatusNow
}
+ selectPassage(command: SelectionCommand): Promise<SelectionResult> {
+ return this.wiring.selectPassage?.(command) ?? Promise.resolve({ ok: false, error: 'Update Harness to select text.' })
+ }
+
machineName(): string {
return this.wiring.machineName()
}
@@ -428,21 +449,29 @@ export class DaemonCableHost implements CableHost {
* is held from `knownAgents` (see listAgentsFlat).
*/
async listAgents(): Promise<CableAgent[]> {
+ return (await this.listAgentSnapshot()).agents
+ }
+
+ async listAgentSnapshot(): Promise<{ agents: CableAgent[]; tab: string; total: number }> {
const flat = await this.listAgentsFlat()
const byId = new Map(flat.map((a) => [a.id, a]))
- const out = this.swarms === null
- ? []
- : this.desk.map((id) => byId.get(id)).filter((a): a is CableAgent => !!a)
+ // app_panes and app_swarms are separate messages. Never label the new panes
+ // with the previous tab (or vice versa) between those two arrivals. The
+ // swarm announcement already contains membership in the same tile order.
+ const app = this.swarms
+ const tab = app?.active ?? ''
+ const ids = app?.swarms.find(s => s.id === tab)?.agentIds ?? []
+ const out = ids.map(id => byId.get(id)).filter((a): a is CableAgent => !!a)
// One line per CHANGE. The failure this catches is silent by nature: tiles whose ids this daemon does
// not know drop out of the list, which looks exactly like the window never having opened them.
- const shape = this.swarms === null
+ const shape = app === null
? '(no window)'
: out.length ? out.map((a) => a.id.slice(0, 4)).join(' ') : '(empty tab)'
if (shape !== this.deskShape) {
this.deskShape = shape
this.wiring.log(`cable: tab ${shape} · ${flat.length} in all`)
}
- return out
+ return { agents: out, tab, total: this.flatCount }
}
/** How many agents the account has across every machine — the overview's number, sent beside the
@@ -473,6 +502,11 @@ export class DaemonCableHost implements CableHost {
return machineId ? { name: '', engine: '', machine } : undefined
}
+ async activityText(agentId: string): Promise<string | null> {
+ if (!this.isLocalAgent(agentId)) return null
+ return await this.wiring.activityText?.(agentId) ?? null
+ }
+
/**
* A card arrived from a machine for an agent. Remembered so a `question` or `summary` about an agent
* this daemon has never LISTED — a remote machine's, before its list was read, or one on a tab the
@@ -570,6 +604,17 @@ export class DaemonCableHost implements CableHost {
this.wiring.opened?.(machineId, agentId, reason)
}
+ form(command: FormCommand): Promise<FormResult> {
+ return this.wiring.form?.(command) ?? Promise.resolve({ ok: false, active: false, error: 'Update Harness for New Harness.' })
+ }
+
+ visit(command: VisitCommand): Promise<VisitResult> {
+ const machineId = command.agentId ? this.machineOf(command.agentId) : undefined
+ if ((command.op === 'open' || command.op === 'latest') && !machineId) return Promise.resolve({ ok: false, active: false, error: 'That agent is no longer available.' })
+ return this.wiring.visit?.({ ...command, machineId }) ??
+ Promise.resolve({ ok: false, active: false, error: 'Update Harness to visit an alert.' })
+ }
+
/**
* Fork an agent from the dial: the same `agent_fork` the window sends, on the agent's own machine, and
* then an `open` for the new agent so the window gives it a tile — the fork's whole point on the dial
@@ -732,6 +777,33 @@ export class DaemonCableHost implements CableHost {
this.wiring.stopTurn(agentId)
}
+ canSpeakQuestion(agentId: string): boolean {
+ // Remote receiver capabilities are not negotiated yet; no free-text fallback.
+ return this.knows(agentId) && this.isLocalAgent(agentId) && !!this.wiring.answerReviewed
+ }
+
+ async answerReviewed(answer: ReviewedAnswer): Promise<AnswerReceipt> {
+ if (answer.freeTextKeys?.length && !this.canSpeakQuestion(answer.agentId))
+ return { ok: false, error: 'Use the terminal to type this answer.' }
+ if (!this.isLocalAgent(answer.agentId)) {
+ const machineId = this.machineOf(answer.agentId)
+ if (!machineId || !this.fleet || this.fleet.reachable?.(machineId)?.ok === false) {
+ return { ok: false, error: 'That machine is unavailable. Check its connection.' }
+ }
+ // Older remote drivers split multi-select labels on commas. Do not lose
+ // a selected label when that receiver cannot prove support for exact arrays.
+ if (answer.questions.some(q => q.multi && answer.selections[q.key]?.some(label => label.includes(',')))) {
+ return { ok: false, error: 'Use the terminal for this multi-select answer.' }
+ }
+ if (this.fleet.answerReviewed) this.fleet.answerReviewed(machineId, answer)
+ else this.fleet.answer(machineId, answer.agentId, answer.requestId, answer.answers)
+ return { ok: true, pending: true } // Handoff only; the dialog's close is authoritative.
+ }
+ if (!this.wiring.answerReviewed) return { ok: false, error: 'Update Harness to answer this question.' }
+ const ok = await this.wiring.answerReviewed(answer)
+ return ok ? { ok: true } : { ok: false, error: 'Could not confirm the answer. Check the terminal.' }
+ }
+
answer(agentId: string, requestId: string, answers: Record<string, string>): void {
if (!this.isLocalAgent(agentId)) { this.fleet!.answer(this.machineOf(agentId), agentId, requestId, answers); return }
this.wiring.answer(agentId, requestId, answers)
@@ -803,7 +875,7 @@ export class DaemonCableHost implements CableHost {
? this.wiring.recent(agentId, 3)
: await this.fleet!.recentSummaries(this.machineOf(agentId), agentId)
return raw
- .map((r) => ({ recap: r?.recap ?? '', text: r?.text ?? '', ask: r?.ask ?? '' }))
+ .map((r) => ({ recap: extendShortRecap(r?.recap ?? '', r?.text ?? ''), text: r?.text ?? '', ask: r?.ask ?? '' }))
.filter((s) => s.recap || s.text || s.ask)
}
@@ -955,10 +1027,17 @@ export class DaemonCableHost implements CableHost {
// `failedToken` is what makes this one refresh rather than a loop: the manager only refreshes when
// the token that failed is still the current one, so two callers racing a stale token do not each
// burn a refresh.
- token = await auth.accessToken({ failedToken: token })
+ await res.body?.cancel()
+ token = await auth.accessToken({ force: true, failedToken: token })
res = await post(token)
}
- if (!res.ok) throw new Error(`Transcription failed (HTTP ${res.status})`)
+ if (!res.ok) {
+ const failure = await transcriptionFailure(res)
+ // Keep the backend error category and edge request id, never the audio, transcript, token or raw
+ // response. A bare 403 previously disappeared into a device toast with no way to diagnose it.
+ this.wiring.log(`cable: stt HTTP ${res.status} code=${failure.code} kind=${failure.kind} request=${failure.request}`)
+ throw new Error(failure.message)
+ }
const json = (await res.json()) as { success?: boolean; data?: { transcript?: string }; error?: { message?: string } }
if (!json.success) throw new Error(json.error?.message ?? 'Transcription failed')
@@ -975,6 +1054,33 @@ export class DaemonCableHost implements CableHost {
}
}
+/** Turn known service failures into short device instructions without reflecting response contents. */
+async function transcriptionFailure(res: Response): Promise<{ message: string; code: string; kind: string; request: string }> {
+ const contentType = res.headers.get('content-type') ?? ''
+ const kind = res.headers.get('cf-mitigated') === 'challenge' ? 'challenge'
+ : contentType.includes('application/json') ? 'json' : contentType.includes('text/html') ? 'html' : 'other'
+ let code = 'unknown'
+ if (contentType.includes('application/json')) {
+ const body = await res.json().catch(() => null) as { error?: { code?: unknown } } | null
+ const candidate = body?.error?.code
+ if (typeof candidate === 'string' && [
+ 'AUTONOMOUS_ENV_MISMATCH', 'AUTONOMOUS_ENV_NOT_ALLOWED', 'UNAUTHORIZED',
+ 'AUTH_SERVICE_UNAVAILABLE', 'STT_FAILED', 'BAD_REQUEST',
+ ].includes(candidate)) code = candidate
+ } else {
+ await res.body?.cancel()
+ }
+ const ray = res.headers.get('cf-ray') ?? ''
+ const request = /^[a-f0-9]{16}-[A-Z]{3,8}$/.test(ray) ? ray : 'unknown'
+ const message = res.status === 401 || code === 'AUTONOMOUS_ENV_MISMATCH' || code === 'AUTONOMOUS_ENV_NOT_ALLOWED'
+ ? 'Sign in again on your computer to use voice'
+ : res.status === 403 ? 'Voice service rejected upload (403). Try again'
+ : res.status === 429 ? 'Voice service busy. Try again shortly'
+ : res.status >= 500 ? 'Voice service unavailable. Try again'
+ : `Transcription failed (HTTP ${res.status})`
+ return { message, code, kind, request }
+}
+
/**
* Wrap raw 16-bit little-endian mono PCM in a WAV header.
*
diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.ts
index a3ee9ab92..899699302 100644
--- a/cli/src/cable/cableSession.spec.ts
+++ b/cli/src/cable/cableSession.spec.ts
@@ -128,6 +128,385 @@ async function connect(host: CableHost = makeHost(), log = tmpLog()) {
const settle = () => new Promise((r) => setTimeout(r, 0))
describe('cable session', () => {
+ it('recovers the selected terminal footer without a transcript start event and bounds captures', async () => {
+ const activityText = vi.fn(async () => 'Coalescing...')
+ const { session, port } = await connect(makeHost({ activityText }))
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
+ await session.focusAgent('a1')
+ port.sent.length = 0
+ await session['refreshFocusedActivity']()
+ expect(port.sent).toEqual([
+ { t: 'turn.started', agentId: 'a1', text: 'Coalescing...' },
+ { t: 'turn.activity', agentId: 'a1', text: 'Coalescing...' },
+ ])
+ await session['refreshFocusedActivity']()
+ expect(activityText).toHaveBeenCalledTimes(1)
+ // A different selected pane is checked immediately, without forwarding the old word.
+ activityText.mockResolvedValueOnce('Working')
+ await session.focusAgent('a2')
+ await session['refreshFocusedActivity']()
+ expect(port.sent.at(-1)).toEqual({ t: 'turn.activity', agentId: 'a2', text: 'Working' })
+ } finally { await session.stop() }
+ })
+
+ it.each(['done', 'summary', 'error', 'focus', 'disconnect'])(
+ 'does not recover stale work if %s happens during a footer capture', async end => {
+ let finish!: (text: string | null) => void
+ const activityText = vi.fn(() => new Promise<string | null>(resolve => { finish = resolve }))
+ const { session, port } = await connect(makeHost({ activityText }))
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
+ await session.focusAgent('a1')
+ port.sent.length = 0
+ const pending = session['refreshFocusedActivity'](); await settle()
+ await session['refreshFocusedActivity']()
+ expect(activityText).toHaveBeenCalledTimes(1)
+ if (end === 'done') await session.turnDone('a1')
+ else if (end === 'summary') await session.summary('a1', 'Completed.', 'Completed. All checks passed.')
+ else if (end === 'error') await session.turnError('a1', 'Stopped')
+ else if (end === 'focus') await session.focusAgent('a2')
+ else await session.stop()
+ finish('Coalescing...'); await pending
+ expect(port.types()).not.toContain('turn.activity')
+ expect(port.types()).not.toContain('turn.started')
+ if (end === 'done' || end === 'summary' || end === 'error') {
+ await session['refreshFocusedActivity']()
+ expect(activityText).toHaveBeenCalledTimes(1)
+ }
+ } finally { await session.stop() }
+ })
+
+ it('does not read before connection or invent liveness when no native footer exists', async () => {
+ const activityText = vi.fn(async () => null)
+ const { session, port } = await connect(makeHost({ activityText }))
+ try {
+ await session.focusAgent('a1')
+ await session['refreshFocusedActivity']()
+ expect(activityText).not.toHaveBeenCalled()
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
+ port.sent.length = 0
+ await session['refreshFocusedActivity']()
+ expect(port.sent).toEqual([{ t: 'turn.activity', agentId: 'a1', text: '' }])
+ } finally { await session.stop() }
+ })
+
+ it('sends the exact terminal activity without delaying turn liveness', async () => {
+ let finish!: (text: string | null) => void
+ const { session, port } = await connect(makeHost({ activityText: () => new Promise(resolve => { finish = resolve }) }))
+ try {
+ const pending = session.turnStarted('a1', 'Processing'); await settle()
+ expect(port.sent).toEqual([{ t: 'turn.started', agentId: 'a1', text: 'Processing' }])
+ finish('Coalescing...'); await pending
+ expect(port.sent.at(-1)).toEqual({ t: 'turn.activity', agentId: 'a1', text: 'Coalescing...' })
+ } finally { await session.stop() }
+ })
+
+ it.each(['done', 'summary', 'error', 'disconnect'])(
+ 'drops a terminal activity read arriving after %s', async end => {
+ let finish!: (text: string | null) => void
+ const { session, port } = await connect(makeHost({ activityText: () => new Promise(resolve => { finish = resolve }) }))
+ try {
+ const pending = session.turnStarted('a1', 'Processing'); await settle()
+ if (end === 'done') await session.turnDone('a1')
+ else if (end === 'summary') await session.summary('a1', 'Done.', 'Done. All checks passed.')
+ else if (end === 'error') await session.turnError('a1', 'Stopped')
+ else await session.stop()
+ finish('Coalescing...'); await pending
+ expect(port.sent.some(message => message.t === 'turn.activity')).toBe(false)
+ } finally { await session.stop() }
+ })
+
+ it('keeps a newer activity read and clears a disappeared footer without inventing a label', async () => {
+ const finishes: Array<(text: string | null) => void> = []
+ const { session, port } = await connect(makeHost({ activityText: () => new Promise(resolve => finishes.push(resolve)) }))
+ try {
+ const older = session.turnStarted('a1', 'Processing'); await settle()
+ const newer = session.turnStarted('a1', 'Processing'); await settle()
+ finishes[1]('Boogieing...'); await newer
+ finishes[0]('Coalescing...'); await older
+ expect(port.sent.filter(message => message.t === 'turn.activity').map(message => message.text)).toEqual(['Boogieing...'])
+ const cleared = session.turnStarted('a1', 'Processing'); await settle()
+ finishes[2](null); await cleared
+ expect(port.sent.at(-1)).toEqual({ t: 'turn.activity', agentId: 'a1', text: '' })
+ } finally { await session.stop() }
+ })
+
+ it('extends a live short recap from the supplied body', async () => {
+ const { session, port } = await connect()
+ try {
+ await session.summary('a1', 'Yes.', 'Yes. The fix is installed.')
+ expect(port.sent.at(-1)).toMatchObject({ t: 'summary', recap: 'Yes. The fix is installed.', text: 'Yes. The fix is installed.' })
+ } finally { await session.stop() }
+ })
+ it('does not restore an old inbox after a newer empty snapshot', async () => {
+ let finish!: (value: Array<{ recap: string; text: string }>) => void
+ const history = new Promise<Array<{ recap: string; text: string }>>(resolve => { finish = resolve })
+ const { session, port } = await connect(makeHost({ recentSummaries: () => history }))
+ try {
+ const older = session.replaceNotifications([{ agentId: 'a1', machineId: 'mac-local', question: false, text: '' }])
+ await session.replaceNotifications([])
+ finish([{ recap: 'Old result.', text: 'Old result.' }]); await older
+ expect(port.sent).toEqual([{ t: 'notif.replace', items: [] }])
+ } finally { await session.stop() }
+ })
+
+ it('keeps a completion seen during a slow restore cleared without losing other questions', async () => {
+ let finish!: (value: Array<{ recap: string; text: string }>) => void
+ const history = new Promise<Array<{ recap: string; text: string }>>(resolve => { finish = resolve })
+ const { session, port } = await connect(makeHost({ recentSummaries: () => history }))
+ try {
+ const older = session.replaceNotifications([
+ { agentId: 'a1', machineId: 'mac-local', question: false, text: '' },
+ { agentId: 'a2', machineId: 'mac-local', question: true, text: 'Which branch?' },
+ ])
+ await session.agentSeen('a1')
+ await session.agentSeen('a2')
+ finish([{ recap: 'Old result.', text: 'Old result.' }]); await older
+ expect(port.sent.at(-1)).toMatchObject({ t: 'notif.replace', items: [
+ { agentId: 'a2', question: true, summary: 'Which branch?' },
+ ] })
+ // A later completion for the same agent is new news, not permanently suppressed.
+ await session.replaceNotifications([{ agentId: 'a1', machineId: 'mac-local', question: false, text: 'New result.' }])
+ expect(port.sent.at(-1)).toMatchObject({ t: 'notif.replace', items: [
+ { agentId: 'a1', question: false, summary: 'New result.' },
+ ] })
+ } finally { await session.stop() }
+ })
+
+ it('fetches the chosen agent question and submits its reviewed token once', async () => {
+ const answerReviewed = vi.fn<NonNullable<CableHost['answerReviewed']>>(async () => ({ ok: true as const }))
+ const { session, port } = await connect(makeHost({ answerReviewed }))
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ const questions = [{ key: 'scope', q: 'Which scope?', options: ['File', 'Project'], multi: false }]
+ await session.question('a1', 'first', questions)
+ await session.question('a2', 'second', questions)
+ port.say({ t: 'question.read', agentId: 'a1', requestId: 'read-1' })
+ await vi.waitFor(() => expect(port.types()).toContain('question.state'))
+ const state = port.sent.find(m => m.t === 'question.state')!
+ expect(state).toMatchObject({ ok: true, agentId: 'a1', id: 'first', requestId: 'read-1' })
+ const submit = { t: 'answer.reviewed', agentId: 'a1', requestId: 'send-1', token: state.token, choices: [2] }
+ port.say(submit); port.say(submit)
+ await vi.waitFor(() => expect(port.types().filter(t => t === 'answer.receipt')).toHaveLength(2))
+ expect(answerReviewed).toHaveBeenCalledTimes(1)
+ expect(answerReviewed.mock.calls[0][0]).toMatchObject({ agentId: 'a1', requestId: 'first', answers: { scope: 'Project' } })
+ await session.questionClose('a1', 'first')
+ port.say(submit); await settle()
+ expect(answerReviewed).toHaveBeenCalledTimes(1)
+ } finally { await session.stop() }
+ })
+
+ it('carries exact text to another explicit recipient, and consumes it only when sending', async () => {
+ const selectPassage = vi.fn<NonNullable<CableHost['selectPassage']>>(async command => command.op === 'pin'
+ ? { ok: true, selectionId: 'pick-1', revision: 4, rows: 2, extending: true,
+ excerpt: 'source output', text: ' source line\nsecond line' }
+ : { ok: false, error: 'Closed' })
+ const host = makeHost({ selectPassage, transcribe: vi.fn(async () => 'Compare this with your plan.'), route: vi.fn() })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'carry.prepare', carryId: 'carry-1', requestId: 'carry-request', agentId: 'a1', selectionId: 'pick-1', revision: 3 })
+ await vi.waitFor(() => expect(port.types()).toContain('carry.state'))
+ expect(port.sent.find(x => x.t === 'carry.state')).toMatchObject({ active: true, carryId: 'carry-1', rows: 2 })
+ expect(port.sent.find(x => x.t === 'carry.state')).not.toHaveProperty('text')
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ port.say({ t: 'voice.begin', uploadId: 'carried', agentId: 'a2', carryId: 'carry-1' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(host.sendTurn).toHaveBeenCalledOnce())
+ const sent = vi.mocked(host.sendTurn).mock.calls[0]!
+ expect(sent[0]).toBe('a2')
+ expect(sent[1]).toContain('Compare this with your plan.\n\nContext I selected from harness ')
+ expect(sent[1]).toContain('> source line\n> second line')
+ expect(host.route).not.toHaveBeenCalled()
+ expect(port.sent.find(x => x.t === 'voice.transcript')).toMatchObject({ carryId: 'carry-1', agentId: 'a2' })
+ port.say({ t: 'voice.begin', uploadId: 'duplicate', agentId: 'a2', carryId: 'carry-1' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.sent.some(x => x.t === 'voice.error' && x.uploadId === 'duplicate')).toBe(true))
+ expect(host.sendTurn).toHaveBeenCalledOnce()
+ } finally { await session.stop() }
+ })
+
+ it.each([{}, { carryId: null }, { carryId: 'expired', agentId: 'a2' },
+ { carryId: 'expired', formId: 'f', formRevision: 1 }, { carryId: 'expired', agentId: 'a2', selectionId: 'pick' }])(
+ 'invalid carried voice never falls back to bare words or inferred routing: %j', async fields => {
+ const host = makeHost({ transcribe: vi.fn(), route: vi.fn(), routeInWindow: vi.fn() })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'voice.begin', uploadId: 'invalid-carry', carryId: 'missing', ...fields })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(host.transcribe).not.toHaveBeenCalled()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.route).not.toHaveBeenCalled()
+ expect(host.routeInWindow).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+
+ it('dropping carried text during transcription prevents later delivery', async () => {
+ let finish!: (s: string) => void
+ const host = makeHost({
+ selectPassage: async command => command.op === 'pin'
+ ? { ok: true, selectionId: 'p', revision: 2, rows: 1, extending: false, excerpt: 'source', text: 'source' }
+ : { ok: false, error: 'Closed' },
+ transcribe: vi.fn(() => new Promise<string>(resolve => { finish = resolve })),
+ })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'carry.prepare', carryId: 'carry-drop', requestId: 'r', agentId: 'a1', selectionId: 'p', revision: 1 })
+ await vi.waitFor(() => expect(port.types()).toContain('carry.state'))
+ port.say({ t: 'voice.begin', uploadId: 'drop', agentId: 'a2', carryId: 'carry-drop' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(host.transcribe).toHaveBeenCalledOnce())
+ port.say({ t: 'carry.cancel', carryId: 'carry-drop' }); await settle()
+ finish('Explain this'); await settle()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(port.types()).not.toContain('voice.transcript')
+ } finally { await session.stop() }
+ })
+
+ it('a refused recipient keeps the passage for an explicit retry', async () => {
+ const host = makeHost({
+ selectPassage: async command => command.op === 'pin'
+ ? { ok: true, selectionId: 'p', revision: 2, rows: 1, extending: false, excerpt: 'source', text: 'source' }
+ : { ok: false, error: 'Closed' },
+ sendTurn: vi.fn().mockReturnValueOnce({ ok: false, reason: 'offline' }).mockReturnValue({ ok: true }),
+ })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'carry.prepare', carryId: 'carry-retry', requestId: 'r', agentId: 'a1', selectionId: 'p', revision: 1 })
+ await vi.waitFor(() => expect(port.types()).toContain('carry.state'))
+ port.say({ t: 'voice.begin', uploadId: 'refused', agentId: 'a2', carryId: 'carry-retry' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(port.types()).not.toContain('voice.transcript')
+ expect(host.sendTurn).toHaveBeenCalledOnce()
+ port.say({ t: 'voice.begin', uploadId: 'retry', agentId: 'a2', carryId: 'carry-retry' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.transcript'))
+ expect(host.sendTurn).toHaveBeenCalledTimes(2)
+ expect(vi.mocked(host.sendTurn).mock.calls[1]![1]).toContain('> source')
+ } finally { await session.stop() }
+ })
+
+ it('routes form choices without terminal input and acknowledges the exact device request', async () => {
+ const form = vi.fn<NonNullable<CableHost['form']>>(async () => ({
+ ok: true, active: true, revision: 2, label: 'Codex', position: 1, total: 3, busy: false, enabled: true }))
+ const host = makeHost({ form }), { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'form', op: 'move', formId: 'form-one', requestId: 'form-2', revision: 1, delta: 1 })
+ await vi.waitFor(() => expect(port.sent.some(x => x.t === 'form.state')).toBe(true))
+ expect(form).toHaveBeenCalledExactlyOnceWith({ op: 'move', formId: 'form-one', revision: 1, delta: 1 })
+ expect(port.sent.find(x => x.t === 'form.state')).toMatchObject({ requestId: 'form-2', formId: 'form-one', label: 'Codex' })
+ expect(host.openAgent).not.toHaveBeenCalled()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.answer).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+
+ it('visits and returns with correlated acknowledgements and no terminal actions', async () => {
+ const visit = vi.fn<NonNullable<CableHost['visit']>>(async command => ({
+ ok: true, active: command.op === 'open', agentId: command.op === 'open' ? 'a2' : 'a1', label: 'My work' }))
+ const host = makeHost({ visit })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'visit', op: 'open', visitId: 'visit-one', requestId: 'open-one', agentId: 'a2' })
+ await vi.waitFor(() => expect(port.sent.some(x => x.t === 'visit.state')).toBe(true))
+ expect(port.sent.find(x => x.t === 'visit.state')).toMatchObject({ requestId: 'open-one', visitId: 'visit-one', active: true, agentId: 'a2' })
+ port.say({ t: 'visit', op: 'back', visitId: 'visit-one', requestId: 'back-one' }); await settle()
+ expect(port.sent.find(x => x.requestId === 'back-one')).toMatchObject({ active: false, agentId: 'a1' })
+ expect(host.openAgent).not.toHaveBeenCalled()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.answer).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+
+ it('latest-output requests use the visit receipt and never become agent input', async () => {
+ const visit = vi.fn<NonNullable<CableHost['visit']>>(async () => ({
+ ok: true, active: true, agentId: 'a1', label: 'Your reading' }))
+ const host = makeHost({ visit })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ port.say({ t: 'visit', op: 'latest', visitId: 'visit-reading', requestId: 'reading-1', agentId: 'a1' })
+ await vi.waitFor(() => expect(port.sent.some(x => x.t === 'visit.state')).toBe(true))
+ expect(visit).toHaveBeenCalledExactlyOnceWith({ op: 'latest', visitId: 'visit-reading', agentId: 'a1' })
+ expect(port.sent.find(x => x.t === 'visit.state')).toMatchObject({
+ requestId: 'reading-1', visitId: 'visit-reading', active: true, agentId: 'a1' })
+ expect(host.openAgent).not.toHaveBeenCalled()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.answer).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+
+ it('pins selected terminal text at voice start and sends it with the spoken instruction', async () => {
+ const selectPassage = vi.fn<CableHost['selectPassage'] & {}>(async command => command.op === 'pin'
+ ? { ok: true, selectionId: 'selection-1', revision: 4, rows: 2, extending: true,
+ excerpt: 'quoted output', text: ' first line\nsecond line' }
+ : { ok: false, error: 'Selection closed.' })
+ const host = makeHost({ selectPassage, transcribe: vi.fn(async () => 'Explain this.') })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await settle()
+ port.say({ t: 'voice.begin', uploadId: 'quoted', agentId: 'a2', selectionId: 'selection-1', selectionRevision: 3 })
+ await settle()
+ expect(selectPassage).toHaveBeenCalledWith({ op: 'pin', agentId: 'a2', selectionId: 'selection-1', revision: 3 })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(host.sendTurn).toHaveBeenCalledOnce())
+ expect(host.sendTurn).toHaveBeenCalledWith('a2', 'Explain this.\n\nContext I selected from this agent\'s terminal:\n> first line\n> second line')
+ expect(port.sent.find(x => x.t === 'voice.transcript')).toMatchObject({ text: 'Explain this.', uploadId: 'quoted' })
+ } finally { await session.stop() }
+ })
+
+ it('refuses quoted voice when the selected text changed, without submitting bare words', async () => {
+ const host = makeHost({ selectPassage: vi.fn(async () => ({ ok: false as const, error: 'That text changed. Choose it again.' })),
+ transcribe: vi.fn(async () => 'explain this') })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await settle()
+ port.say({ t: 'voice.begin', uploadId: 'changed', agentId: 'a2', selectionId: 'old', selectionRevision: 1 })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.transcribe).not.toHaveBeenCalled()
+ expect(port.sent.find(x => x.t === 'voice.error')).toMatchObject({ uploadId: 'changed', message: 'That text changed. Choose it again.' })
+ } finally { await session.stop() }
+ })
+
+ it('discard during a pending text pin cannot send or revive the recording', async () => {
+ let pin!: (result: import('./windowSelection.js').SelectionResult) => void
+ const host = makeHost({ selectPassage: command => command.op === 'pin'
+ ? new Promise(resolve => { pin = resolve }) : Promise.resolve({ ok: false, error: 'Closed' }),
+ transcribe: vi.fn(async () => 'explain') })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await settle()
+ port.say({ t: 'voice.begin', uploadId: 'cancelled-quote', agentId: 'a1', selectionId: 'selected', selectionRevision: 1 })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await settle()
+ port.say({ t: 'voice.abort', uploadId: 'cancelled-quote' })
+ pin({ ok: true, selectionId: 'selected', revision: 2, rows: 1, excerpt: 'a', extending: false, text: 'a' })
+ await settle()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(host.transcribe).not.toHaveBeenCalled()
+ expect(port.types()).not.toContain('voice.transcript')
+ } finally { await session.stop() }
+ })
+
it('answers hello with welcome and pushes the agent list once', async () => {
const { session, port } = await connect()
port.say({ t: 'hello', product: 'harness', fw: '0.1.0', proto: 1, mac: 'aa:bb' })
@@ -151,6 +530,25 @@ describe('cable session', () => {
await session.stop()
})
+ it('advertises only the optional device controls this host implements', async () => {
+ const core = await connect()
+ core.port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(core.port.types()).toContain('welcome'))
+ expect(core.port.sent[0].features).toEqual(['voice.draft', 'agents.refresh'])
+ await core.session.stop()
+
+ const advanced = await connect(makeHost({
+ form: async () => ({ ok: false, active: false, error: 'test' }),
+ visit: async () => ({ ok: false, active: false, error: 'test' }),
+ selectPassage: async () => ({ ok: false, error: 'test' }),
+ answerReviewed: async () => ({ ok: false, error: 'test' }),
+ }))
+ advanced.port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(advanced.port.types()).toContain('welcome'))
+ expect(advanced.port.sent[0].features).toEqual(['voice.draft', 'agents.refresh', 'form', 'selection', 'visit', 'question.review'])
+ await advanced.session.stop()
+ })
+
it('answers a repeat hello WITHOUT re-pushing the list', async () => {
const { session, port } = await connect()
port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
@@ -729,6 +1127,125 @@ describe('cable session', () => {
await session.stop()
})
+ it('forwards Finder as a distinct surface without focusing or typing into an agent', async () => {
+ const form = vi.fn(async () => ({ ok: true, active: true, title: 'Find Harness', revision: 1 }))
+ const host = makeHost({ form }), { session, port } = await connect(host)
+ try {
+ port.say({ t: 'form', formId: 'find-one', requestId: 'request-one', op: 'open', surface: 'find' })
+ await vi.waitFor(() => expect(port.types()).toContain('form.state'))
+ expect(form).toHaveBeenCalledWith({ formId: 'find-one', op: 'open', surface: 'find', revision: undefined, delta: undefined })
+ expect(host.focus).not.toHaveBeenCalled(); expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(port.sent.at(-1)).toMatchObject({ formId: 'find-one', requestId: 'request-one', title: 'Find Harness' })
+ } finally { await session.stop() }
+ })
+
+ it('uses spoken form text only as a pinned query, never a task', async () => {
+ const form = vi.fn(async (c: import('./windowForm.js').FormCommand) => ({
+ ok: true, active: true, canQuery: true, queryId: c.queryId, revision: 2,
+ }))
+ const route = vi.fn(), routeInWindow = vi.fn()
+ const host = makeHost({ form, route, routeInWindow, transcribe: async () => 'Codex.' })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', formId: 'form-one', formRevision: 2, uploadId: 'speech' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.form'))
+ expect(form.mock.calls.map(([c]) => c.op)).toEqual(['query.begin', 'query', 'query.cancel'])
+ expect(form).toHaveBeenCalledWith({ op: 'query', formId: 'form-one', revision: 2, queryId: 'speech', text: 'Codex.' })
+ expect(host.sendTurn).not.toHaveBeenCalled(); expect(route).not.toHaveBeenCalled(); expect(routeInWindow).not.toHaveBeenCalled()
+ expect(port.sent.at(-1)).toMatchObject({ t: 'voice.form', uploadId: 'speech', formId: 'form-one' })
+ } finally { await session.stop() }
+ })
+
+ it.each([{ formId: 17 }, { formId: 'form-one', formRevision: 2, agentId: 'a1' },
+ { formId: 'form-one', formRevision: -1 }, { formRevision: 2 }])('malformed form voice cannot fall back to routing: %j', async metadata => {
+ const transcribe = vi.fn(), route = vi.fn(), routeInWindow = vi.fn()
+ const host = makeHost({ transcribe, route, routeInWindow })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', uploadId: 'speech', ...metadata })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(transcribe).not.toHaveBeenCalled(); expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(route).not.toHaveBeenCalled(); expect(routeInWindow).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+
+ it('discard during transcription releases its field and ignores the late words', async () => {
+ let complete!: (s: string) => void
+ const transcribe = vi.fn(() => new Promise<string>(resolve => { complete = resolve }))
+ const form = vi.fn(async (c: import('./windowForm.js').FormCommand) => ({ ok: true, active: true, canQuery: true, queryId: c.queryId }))
+ const host = makeHost({ form, transcribe })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', formId: 'form-one', formRevision: 2, uploadId: 'speech' })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(transcribe).toHaveBeenCalled())
+ port.say({ t: 'voice.abort', uploadId: 'speech' }); await settle()
+ complete('Codex'); await settle()
+ expect(form.mock.calls.map(([c]) => c.op)).toEqual(['query.begin', 'query.cancel'])
+ expect(host.sendTurn).not.toHaveBeenCalled(); expect(port.types()).not.toContain('voice.form')
+ } finally { await session.stop() }
+ })
+
+ it.each(['cancelled', 'abandoned', 'sent'] as const)('ignores a discarded home route that later replies %s', async (outcome) => {
+ let complete!: (value: { t: 'cancelled' } | { t: 'abandoned' } | { t: 'sent'; agentId: string }) => void
+ const routeInWindow = vi.fn(() => new Promise<{ t: 'cancelled' } | { t: 'abandoned' } | { t: 'sent'; agentId: string }>((resolve) => { complete = resolve }))
+ const host = makeHost({ routeInWindow })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', uploadId: 'old' })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(routeInWindow).toHaveBeenCalled())
+ port.say({ t: 'voice.abort', uploadId: 'old' })
+ port.say({ t: 'voice.begin', uploadId: 'new', agentId: 'a1' })
+ port.pcm(Buffer.alloc(3200))
+ // This can arrive after the replacement starts: it still belongs to the old turn.
+ port.say({ t: 'voice.abort', uploadId: 'old' })
+ complete(outcome === 'sent' ? { t: 'sent', agentId: 'a2' } : { t: outcome })
+ await settle()
+ expect(port.sent.filter((m) => String(m.t).startsWith('voice.'))).toEqual([])
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(host.sendTurn).toHaveBeenCalledWith('a1', 'fix the login screen'))
+ expect(host.sendTurn).toHaveBeenCalledTimes(1)
+ expect(port.sent.filter((m) => String(m.t).startsWith('voice.'))).toEqual([
+ expect.objectContaining({ t: 'voice.transcript', uploadId: 'new', agentId: 'a1' }),
+ ])
+ } finally { await session.stop() }
+ })
+
+ it('does not route or submit a recording discarded during transcription', async () => {
+ let complete!: (text: string) => void
+ const transcribe = vi.fn(() => new Promise<string>((resolve) => { complete = resolve }))
+ const routeInWindow = vi.fn()
+ const host = makeHost({ transcribe, routeInWindow })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', uploadId: 'discarded' })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(transcribe).toHaveBeenCalled())
+ port.say({ t: 'voice.abort', uploadId: 'discarded' })
+ complete('discard this instruction')
+ await settle()
+ expect(routeInWindow).not.toHaveBeenCalled()
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ expect(port.sent.filter((m) => String(m.t).startsWith('voice.'))).toEqual([])
+ } finally { await session.stop() }
+ })
+
+ it('tags transcription errors with the recording id', async () => {
+ const host = makeHost({ transcribe: async () => { throw new Error('retry voice') } })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', uploadId: 'failed' })
+ port.pcm(Buffer.alloc(3200))
+ port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.sent).toContainEqual({ t: 'voice.error', uploadId: 'failed', message: 'retry voice' }))
+ } finally { await session.stop() }
+ })
+
it('routes a voice turn that names no agent', async () => {
const host = makeHost()
const { session, port } = await connect(host)
@@ -954,6 +1471,42 @@ describe('cable session', () => {
await session.stop()
})
+ it('keeps streamed pane rows and their workspace metadata in the same snapshot', async () => {
+ let tab = 'old-tab', total = 2
+ const { session, port } = await connect(makeHost({ activeSwarm: () => tab, agentTotal: () => total }))
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('notif.replace'))
+ port.sent.length = 0
+ const write = port.write.bind(port)
+ port.write = async bytes => {
+ await write(bytes)
+ if (port.sent.at(-1)?.t === 'agent') { tab = 'new-tab'; total = 99 }
+ }
+ await session.syncAgents(true)
+ expect(port.sent.find(m => m.t === 'agents.end')).toMatchObject({ tab: 'old-tab', total: 2 })
+ expect(port.sent.filter(m => m.t === 'agent').map(m => m.id)).toEqual(['a1', 'a2'])
+ } finally { await session.stop() }
+ })
+
+ it.each(['agents.refresh', 'agents.list'])('acknowledges an empty-workspace refresh via %s', async command => {
+ let tab = 'empty-a'
+ const { session, port } = await connect(makeHost({ activeSwarm: () => tab, listAgents: async () => [] }))
+ try {
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await vi.waitFor(() => expect(port.types()).toContain('notif.replace'))
+ port.sent.length = 0
+ tab = 'empty-b'; await session.syncAgents()
+ expect(port.sent).toEqual([]) // Unchanged rows are normally deduplicated.
+ port.say({ t: command })
+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))
+ if (command === 'agents.refresh') expect(port.types()).toEqual(['agents.begin', 'agents.end'])
+ else expect(port.types()).toContain('swarms') // Legacy full state push is still a valid receipt.
+ expect(port.sent.find(m => m.t === 'agents.end')).toMatchObject({ total: 2, tab: 'empty-b' })
+ expect(port.types()).not.toContain('voice.transcript')
+ } finally { await session.stop() }
+ })
+
it('forks on the dial\'s agent.fork and toasts only a refusal', async () => {
const forkAgent = vi.fn(async (id: string) => id === 'a1'
? { ok: true as const, agentId: 'a1-fork' }
@@ -1052,6 +1605,22 @@ describe('cable session', () => {
await session.stop()
})
+ it('echoes bounded model request serials and preserves legacy replies', async () => {
+ const { session, port } = await connect(makeHost({ listModels: async () => ['test-model'] }))
+ port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' })
+ await settle()
+ for (const request of [1, 0x7fffffff, undefined, 0, -1, 1.5, 0x80000000, '12', { value: 1 }]) {
+ port.sent.length = 0
+ port.say({ t: 'models.list', agentId: 'a1', request })
+ await vi.waitFor(() => expect(port.types()).toContain('models'))
+ const reply = port.sent.find((m) => m.t === 'models')!
+ expect(reply).toMatchObject({ agentId: 'a1', items: [{ id: 'test-model' }] })
+ if (request === 1 || request === 0x7fffffff) expect(reply.request).toBe(request)
+ else expect(reply).not.toHaveProperty('request')
+ }
+ await session.stop()
+ })
+
it('names the board a dial greets with, and lives without it', async () => {
// Two dials ship on one image; the firmware says which it is in `hw`. A firmware from before the
// field greets without it, and that is not an error — only a shorter line.
@@ -1326,17 +1895,25 @@ describe('cable session', () => {
port.say({ t: 'agents.list' })
await vi.waitFor(() => {
expect(port.sent.filter((m) => m.t === 'machines.end').length).toBeGreaterThanOrEqual(3)
+ expect(port.sent.filter((m) => m.t === 'agents.end').length).toBeGreaterThanOrEqual(2)
+ expect(port.sent.filter((m) => m.t === 'notif.replace').length).toBeGreaterThanOrEqual(2)
})
// Walk the wire: a `begin` may never open inside another, and each pair must hold the rows of ONE list.
- let open = false
+ let open = ''
let seen = 0
for (const m of port.sent) {
- if (m.t === 'machines.begin') { expect(open, 'a begin arrived inside another begin').toBe(false); open = true; seen = 0 }
- else if (m.t === 'machine') { expect(open, 'a row arrived outside a begin/end pair').toBe(true); seen++ }
- else if (m.t === 'machines.end') { expect(open).toBe(true); expect(seen).toBe(rows.length); open = false }
+ if (m.t === 'machines.begin' || m.t === 'agents.begin') {
+ expect(open, 'a begin arrived inside another begin').toBe('')
+ open = m.t === 'machines.begin' ? 'machine' : 'agent'; seen = 0
+ } else if (m.t === 'machine' || m.t === 'agent') {
+ expect(open, 'a row arrived outside its own begin/end pair').toBe(m.t); seen++
+ } else if (m.t === 'machines.end' || m.t === 'agents.end') {
+ expect(open).toBe(m.t === 'machines.end' ? 'machine' : 'agent')
+ expect(seen).toBe(open === 'machine' ? rows.length : AGENTS.length); open = ''
+ }
}
- expect(open, 'a begin was never closed').toBe(false)
+ expect(open, 'a begin was never closed').toBe('')
await session.stop()
})
it('tells the host when the dial arrives and when it goes', async () => {
@@ -1360,3 +1937,244 @@ describe('cable session', () => {
expect(host.onDialGone).toHaveBeenCalled()
})
})
+
+describe('speak an answer, then review', () => {
+ const qs = [{ key: 'scope', q: 'Which scope?', options: ['File', 'Project'], multi: false, canText: true }]
+ async function prepare(over: Partial<CableHost> = {}) {
+ const answerReviewed = vi.fn<NonNullable<CableHost['answerReviewed']>>(async () => ({ ok: true }))
+ const host = makeHost({ answerReviewed, canSpeakQuestion: () => true, transcribe: async () => 'Only the parser, please.', ...over })
+ const c = await connect(host)
+ c.port.say({ t: 'hello', product: 'harness', mac: 'aa:bb' }); await settle()
+ await c.session.question('a1', 'q-speak', qs)
+ c.port.say({ t: 'question.read', agentId: 'a1', requestId: 'read' })
+ await vi.waitFor(() => expect(c.port.types()).toContain('question.state'))
+ const token = c.port.sent.find(m => m.t === 'question.state')!.token
+ return { ...c, token, answerReviewed }
+ }
+ it('returns recognized words for review with no agent input, then delivers the exact approved draft once', async () => {
+ const { session, port, host, token, answerReviewed } = await prepare()
+ try {
+ port.say({ t: 'voice.begin', agentId: 'a1', questionToken: token, questionIndex: 0, uploadId: 'speech-q' })
+ port.pcm(Buffer.alloc(640)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.question'))
+ const draft = port.sent.find(m => m.t === 'voice.question')!
+ expect(draft).toMatchObject({ agentId: 'a1', token, questionIndex: 0, text: 'Only the parser, please.', uploadId: 'speech-q' })
+ expect(answerReviewed).not.toHaveBeenCalled(); expect(host.sendTurn).not.toHaveBeenCalled()
+ const submit = { t: 'answer.reviewed', agentId: 'a1', requestId: 'send', token, choices: [0], drafts: [draft.draftId] }
+ port.say(submit); port.say(submit)
+ await vi.waitFor(() => expect(answerReviewed).toHaveBeenCalledTimes(1))
+ expect(answerReviewed.mock.calls[0][0]).toMatchObject({ freeTextKeys: ['scope'], answers: { scope: 'Only the parser, please.' } })
+ } finally { await session.stop() }
+ })
+ it.each(['discard', 'close', 'replace', 'disconnect'] as const)('drops a late transcript after %s', async reason => {
+ let resolve!: (s: string) => void
+ const transcribe = vi.fn(() => new Promise<string>(r => { resolve = r }))
+ const { session, port, host, token, answerReviewed } = await prepare({ transcribe })
+ try {
+ port.say({ t: 'voice.begin', agentId: 'a1', questionToken: token, questionIndex: 0, uploadId: 'speech-q' })
+ port.pcm(Buffer.alloc(640)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(transcribe).toHaveBeenCalled())
+ if (reason === 'discard') port.say({ t: 'voice.abort', uploadId: 'speech-q' })
+ if (reason === 'close') await session.questionClose('a1', 'q-speak')
+ if (reason === 'replace') await session.question('a1', 'q-new', qs)
+ if (reason === 'disconnect') await port.close()
+ resolve('This must not send'); await settle(); await settle()
+ expect(port.types()).not.toContain('voice.question')
+ expect(answerReviewed).not.toHaveBeenCalled(); expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it.each([{ questionIndex: 0 }, { questionToken: 'wrong', questionIndex: 0 },
+ { questionToken: 'bad', questionIndex: -1 }, { questionToken: null }])('never routes malformed question voice: %j', async metadata => {
+ const transcribe = vi.fn(async () => 'wrong'), route = vi.fn()
+ const { session, port, host, answerReviewed } = await prepare({ transcribe, route })
+ try {
+ port.say({ t: 'voice.begin', agentId: 'a1', ...metadata, uploadId: 'speech-q' })
+ port.pcm(Buffer.alloc(640)); port.say({ t: 'voice.end' })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(transcribe).not.toHaveBeenCalled(); expect(route).not.toHaveBeenCalled()
+ expect(answerReviewed).not.toHaveBeenCalled(); expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it('does not offer speech without a capable local receiver', async () => {
+ const { session, port } = await prepare({ canSpeakQuestion: () => false })
+ try {
+ const state = port.sent.find(m => m.t === 'question.state')!
+ expect(state.questions).toMatchObject([{ canText: false }])
+ } finally { await session.stop() }
+ })
+})
+
+describe('task voice draft over the cable', () => {
+ async function recorded(port: LoopbackPort, fields: Record<string, unknown> = {}, review = true) {
+ const uploadId = `draft-${port.sent.length}`
+ port.say({ t: 'voice.begin', uploadId, ...fields }); port.pcm(Buffer.alloc(320))
+ port.say({ t: 'voice.end', uploadId, review })
+ await vi.waitFor(() => expect(port.sent.some(m => m.uploadId === uploadId && ['voice.draft','voice.error','voice.transcript'].includes(m.t as string))).toBe(true))
+ return port.sent.find(m => m.uploadId === uploadId && m.t !== 'voice.quota')!
+ }
+ async function command(port: LoopbackPort, page: Record<string,unknown>, op: string, fields:Record<string,unknown>={}) {
+ const requestId=`draft-cmd-${port.sent.length}`
+ port.say({ t:'draft.command', draftId:page.id, revision:page.revision, requestId, op, ...fields })
+ await vi.waitFor(()=>expect(port.sent.some(m=>m.requestId===requestId)).toBe(true))
+ return port.sent.find(m=>m.requestId===requestId)!
+ }
+ it('reviews, replaces a section, appends, undoes, and sends once to the original recipient', async () => {
+ const transcribe=vi.fn().mockResolvedValueOnce('First idea.').mockResolvedValueOnce('Better idea.').mockResolvedValueOnce('Keep the tests.')
+ const host=makeHost({transcribe}), {session,port}=await connect(host)
+ try {
+ let p=await recorded(port,{agentId:'a2'})
+ expect(p).toMatchObject({ t:'voice.draft', agentId:'a2', text:'First idea.', active:true })
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ p=await recorded(port,{draftId:p.id,draftRevision:p.revision,draftOp:'replace'},false)
+ expect(p.text).toBe('Better idea.')
+ p=await recorded(port,{draftId:p.id,draftRevision:p.revision,draftOp:'append'},false)
+ expect(p.text).toBe('Better idea.\n\nKeep the tests.')
+ p=await command(port,p,'undo'); expect(p.text).toBe('Better idea.')
+ const receipt=await command(port,p,'send'); expect(receipt.sent).toBe(true)
+ await command(port,p,'send')
+ expect(host.sendTurn).toHaveBeenCalledExactlyOnceWith('a2','Better idea.')
+ expect(host.focus).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it('keeps selected text frozen through re-speaking and sending', async () => {
+ const selectPassage=vi.fn<NonNullable<CableHost['selectPassage']>>(async () => ({ok:true,selectionId:'sel',revision:2,text:'const answer = 42;',excerpt:'const answer = 42;',rows:1,extending:false}))
+ const transcribe=vi.fn().mockResolvedValueOnce('Explain.').mockResolvedValueOnce('Simplify this.')
+ const host=makeHost({selectPassage,transcribe}), {session,port}=await connect(host)
+ try {
+ let p=await recorded(port,{agentId:'a2',selectionId:'sel',selectionRevision:2})
+ expect(p.context).toBe('With selected text')
+ p=await recorded(port,{draftId:p.id,draftRevision:p.revision,draftOp:'replace'},false)
+ await command(port,p,'send')
+ expect(host.sendTurn).toHaveBeenCalledTimes(1)
+ const args=vi.mocked(host.sendTurn).mock.calls[0]
+ expect(args[0]).toBe('a2'); expect(args[1]).toContain('Simplify this.'); expect(args[1]).toContain('const answer = 42;')
+ } finally { await session.stop() }
+ })
+ it('discarding an unseen creation releases the next recording', async () => {
+ const {host,session,port}=await connect()
+ try {
+ const p=await recorded(port,{agentId:'a1'})
+ port.say({t:'voice.abort',uploadId:p.uploadId}); await settle()
+ expect((await recorded(port,{agentId:'a2'})).t).toBe('voice.draft')
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it.each([{draftId:'missing',draftRevision:1,draftOp:'replace'}, {draftId:null},
+ {draftId:'id',draftRevision:1,draftOp:'append',agentId:'a2'},
+ {draftId:'id',draftRevision:1,draftOp:'replace',formId:'form'}])('never routes malformed draft speech %j', async fields => {
+ const host=makeHost({transcribe:vi.fn(async()=> 'No fallback')}), {session,port}=await connect(host)
+ try {
+ expect((await recorded(port,fields,false)).t).toBe('voice.error')
+ expect(host.sendTurn).not.toHaveBeenCalled(); expect(host.transcribe).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it('requires a named recipient for initial review', async () => {
+ const host=makeHost({route:vi.fn(),routeInWindow:vi.fn()}),{session,port}=await connect(host)
+ try {
+ expect((await recorded(port)).t).toBe('voice.error')
+ expect(host.route).not.toHaveBeenCalled();expect(host.routeInWindow).not.toHaveBeenCalled();expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it('ignores an old voice.end and keeps the new capture alive', async () => {
+ const {host,session,port}=await connect()
+ try {
+ port.say({t:'voice.begin',agentId:'a1',uploadId:'new'});port.pcm(Buffer.alloc(320))
+ port.say({t:'voice.end',uploadId:'old',review:true});await settle()
+ expect(port.types()).not.toContain('voice.draft');expect(host.sendTurn).not.toHaveBeenCalled()
+ port.say({t:'voice.end',uploadId:'new',review:true})
+ await vi.waitFor(()=>expect(port.types()).toContain('voice.draft'))
+ } finally { await session.stop() }
+ })
+ it('does not apply late transcription after the draft was discarded', async () => {
+ let resolve!:(v:string)=>void
+ const transcribe=vi.fn().mockResolvedValueOnce('Keep me.').mockImplementationOnce(()=>new Promise<string>(r=>{resolve=r}))
+ const host=makeHost({transcribe}),{session,port}=await connect(host)
+ try {
+ const p=await recorded(port,{agentId:'a1'})
+ port.say({t:'voice.begin',draftId:p.id,draftRevision:p.revision,draftOp:'replace',uploadId:'late'});port.pcm(Buffer.alloc(320));port.say({t:'voice.end',uploadId:'late'})
+ await vi.waitFor(()=>expect(transcribe).toHaveBeenCalledTimes(2));await command(port,p,'discard')
+ resolve('Too late.');await settle();await settle()
+ expect(port.sent.some(m=>m.t==='voice.draft' && m.uploadId==='late')).toBe(false)
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally {await session.stop()}
+ })
+ it('keeps a carried quote through discard and consumes only the accepted send', async () => {
+ const selectPassage=vi.fn<NonNullable<CableHost['selectPassage']>>(async()=>({ok:true,selectionId:'sel',revision:2,text:' original\nsource',excerpt:'original source',rows:2,extending:true}))
+ const host=makeHost({selectPassage}),{session,port}=await connect(host)
+ try {
+ port.say({t:'carry.prepare',carryId:'quote',requestId:'prepare',agentId:'a1',selectionId:'sel',revision:2})
+ await vi.waitFor(()=>expect(port.types()).toContain('carry.state'))
+ let p=await recorded(port,{agentId:'a2',carryId:'quote'})
+ expect(p.context).toContain('Fix login screen');expect(host.sendTurn).not.toHaveBeenCalled()
+ await command(port,p,'discard')
+ p=await recorded(port,{agentId:'a2',carryId:'quote'})
+ expect(p.t).toBe('voice.draft')
+ expect(await command(port,p,'send')).toMatchObject({sent:true,carryId:'quote'})
+ expect(vi.mocked(host.sendTurn).mock.calls[0][1]).toContain('> original\n> source')
+ expect((await recorded(port,{agentId:'a2',carryId:'quote'})).t).toBe('voice.error')
+ expect(host.sendTurn).toHaveBeenCalledTimes(1)
+ } finally {await session.stop()}
+ })
+ it('preserves the draft when cancelling an edit whose reply already arrived', async () => {
+ const host=makeHost({transcribe:vi.fn().mockResolvedValueOnce('Original.').mockResolvedValueOnce('Edited.')}),{session,port}=await connect(host)
+ try {
+ let p=await recorded(port,{agentId:'a1'})
+ p=await recorded(port,{draftId:p.id,draftRevision:p.revision,draftOp:'replace'},false)
+ port.say({t:'voice.abort',uploadId:p.uploadId});await settle()
+ expect(await command(port,p,'state')).toMatchObject({active:true,text:'Edited.'})
+ expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally {await session.stop()}
+ })
+
+})
+
+
+describe('spoken output search purpose', () => {
+ const metadata = { agentId: 'a2', searchId: 'search-one', searchRevision: 3 }
+ const read = { ok: true as const, selectionId: 'search-one', revision: 3, rows: 1, excerpt: 'line', extending: false }
+ it.each([0, 2])('returns %i matches without routing, delivering, or drafting', async matches => {
+ const selectPassage = vi.fn<NonNullable<CableHost['selectPassage']>>(async c => c.op === 'read' ? read : {
+ ...read, revision: 4, query: c.query, match: matches ? 1 : 0, matches, rows: matches ? 1 : 0, excerpt: matches ? 'ERROR [x]' : '',
+ })
+ const route = vi.fn(), routeInWindow = vi.fn()
+ const host = makeHost({ selectPassage, route, routeInWindow, transcribe: async () => 'error [x].' })
+ const { session, port } = await connect(host)
+ try {
+ port.say({ t: 'voice.begin', uploadId: 'search-voice', ...metadata })
+ port.pcm(Buffer.alloc(3200)); port.say({ t: 'voice.end', review: true })
+ await vi.waitFor(() => expect(port.types()).toContain('voice.search'))
+ expect(selectPassage.mock.calls.map(([c]) => c.op)).toEqual(['read', 'search'])
+ expect(selectPassage).toHaveBeenLastCalledWith({ op: 'search', agentId: 'a2', selectionId: 'search-one', revision: 3, query: 'error [x]' })
+ expect(port.sent.at(-1)).toMatchObject({ t: 'voice.search', uploadId: 'search-voice', agentId: 'a2', matches })
+ expect(host.sendTurn).not.toHaveBeenCalled(); expect(route).not.toHaveBeenCalled(); expect(routeInWindow).not.toHaveBeenCalled()
+ expect(port.types()).not.toContain('voice.draft')
+ } finally { await session.stop() }
+ })
+ it.each([{searchId:17}, {searchRevision:3}, {searchId:'bad id'}, {searchRevision:0}, {searchRevision:0x80000000},
+ {cmd:''}, {formId:'f'}, {selectionId:'s'}, {carryId:'c'}, {draftId:'d'}, {questionToken:'q'}])(
+ 'malformed or mixed metadata never falls back to task input: %j', async extra => {
+ const transcribe = vi.fn(), route = vi.fn(), selectPassage = vi.fn()
+ const host = makeHost({ transcribe, route, selectPassage }), { session, port } = await connect(host)
+ try {
+ port.say({ t:'voice.begin', uploadId:'bad-search', ...metadata, ...extra,
+ ...(Object.keys(extra).length === 1 && 'searchRevision' in extra && extra.searchRevision === 3 ? {searchId:undefined} : {}) })
+ port.pcm(Buffer.alloc(3200)); port.say({t:'voice.end'})
+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))
+ expect(host.sendTurn).not.toHaveBeenCalled(); expect(transcribe).not.toHaveBeenCalled(); expect(route).not.toHaveBeenCalled()
+ } finally { await session.stop() }
+ })
+ it('discard during transcription cancels only the original cursor', async () => {
+ let finish!: (s:string)=>void
+ const transcribe=vi.fn(()=>new Promise<string>(r=>{finish=r}))
+ const selectPassage=vi.fn<NonNullable<CableHost['selectPassage']>>(async()=>read)
+ const host=makeHost({selectPassage,transcribe}), {session,port}=await connect(host)
+ try {
+ port.say({t:'voice.begin',uploadId:'cancel-search',...metadata}); port.pcm(Buffer.alloc(3200)); port.say({t:'voice.end'})
+ await vi.waitFor(()=>expect(transcribe).toHaveBeenCalled())
+ port.say({t:'voice.abort',uploadId:'cancel-search'}); await settle(); finish('late phrase'); await settle()
+ expect(selectPassage.mock.calls.map(([c])=>c.op)).toEqual(['read','cancel'])
+ expect(selectPassage).toHaveBeenLastCalledWith({op:'cancel',agentId:'a2',selectionId:'search-one',revision:3})
+ expect(port.types()).not.toContain('voice.search'); expect(host.sendTurn).not.toHaveBeenCalled()
+ } finally {await session.stop()}
+ })
+})
diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.ts
index 3ef3f2f61..67154e833 100644
--- a/cli/src/cable/cableSession.ts
+++ b/cli/src/cable/cableSession.ts
@@ -25,6 +25,9 @@ import { CableDecoder, CableType, encodeCableFrame } from './cableFrame.js'
import { DialLog } from './dialLog.js'
import { FirmwareTransfer } from './fwPush.js'
import { SerialLink, findDialPort } from './serial.js'
+import { PassageCarry, withCarriedPassage, type CarryRead } from './passageCarry.js'
+import { VoiceDraft, type DraftPin } from './voiceDraft.js'
+import { QuestionInbox, type ReviewedAnswer, type AnswerReceipt, type QuestionSpeech } from './questionInbox.js'
/** Bumped when the VOCABULARY changes. Separate from the frame version, which is the envelope. */
export const CABLE_PROTO_VERSION = 3 // 3: + question.close (a question answered on another client)
@@ -211,6 +214,10 @@ export type OpenReason = 'question'
export type { WindowRoute } from './windowRoute.js'
import type { WindowRoute } from './windowRoute.js'
+import { withSelectedPassage, type SelectionCommand, type SelectionResult } from './windowSelection.js'
+import type { VisitCommand, VisitResult } from './windowVisit.js'
+import type { FormCommand, FormResult } from './windowForm.js'
+import { extendShortRecap } from '../lib/deviceRecap.js'
export interface RouteDecision {
agentId: string
@@ -244,13 +251,16 @@ export interface CableHost {
voiceLang(): string
/** The active tab's agents, in tile order — and nothing else. Empty with no window or an empty tab. */
listAgents(): Promise<CableAgent[]>
+ /** Pane rows and workspace identity from the same desktop announcement. */
+ listAgentSnapshot?(): Promise<{ agents: CableAgent[]; tab: string; total: number }>
/** Every agent across the account — the overview's number. The dial gets the count, never the rows. */
agentTotal(): number
/** The active tab's id, or '' with no window: what lets the dial tell an empty tab from a shut app. */
activeSwarm(): string
/** Who an agent is, for a card about one the dial does not hold. Undefined for an id never listed. */
describe(agentId: string): { name: string; engine: string; machine: string } | undefined
- sendTurn(agentId: string, text: string): void
+ activityText?(agentId: string): Promise<string | null>
+ sendTurn(agentId: string, text: string): void | { ok: true } | { ok: false; machine?: string; reason?: string }
stopTurn(agentId: string): void
/**
* The user answered a `question`. `answers` is keyed by the QUESTION keys the daemon itself asked with
@@ -258,6 +268,8 @@ export interface CableHost {
* becomes an answer nobody gave.
*/
answer(agentId: string, requestId: string, answers: Record<string, string>): void
+ answerReviewed?(answer: ReviewedAnswer): Promise<AnswerReceipt>
+ canSpeakQuestion?(agentId: string): boolean
focus(agentId: string): void
/**
* "Put this one in front of me" — a NOTIFICATION was tapped.
@@ -299,6 +311,9 @@ export interface CableHost {
* Optional: a host with no window to ask simply omits it, and voice behaves exactly as it always has.
*/
routeInWindow?(text: string, cmd?: string): Promise<WindowRoute>
+ selectPassage?(command: SelectionCommand): Promise<SelectionResult>
+ visit?(command: VisitCommand): Promise<VisitResult>
+ form?(command: FormCommand): Promise<FormResult>
/** The runtime model/effort catalog for one agent, as opaque profile ids the dial groups and shows. */
listModels(agentId: string): Promise<string[]>
/** One agent's last turn summaries, newest first — what a reattached dial needs to redraw its tiles. */
@@ -420,6 +435,8 @@ export class CableSession {
private lastMachinesKey = ''
/** Throttle for the machine list, which costs an HTTP read where the agent list costs a map lookup. */
private machinesAt = 0
+ /** A recap lookup must not replay an older inbox over a newer clear. */
+ private notificationReplay?: { seen: Set<string> }
/**
* Serialises every STREAMED push (begin / rows / end).
*
@@ -447,7 +464,26 @@ export class CableSession {
private offered = new Set<string>()
/** Voice capture in flight: PCM chunks as they arrive, plus what `voice.begin` said about them. */
- private voice: { agentId?: string; cmd?: string; lang: string; rate: number; chunks: Buffer[]; bytes: number } | null = null
+ private voice: { agentId?: string; cmd?: string; lang: string; rate: number; chunks: Buffer[]; bytes: number;
+ selectionId?: string; selection?: Promise<SelectionResult>;
+ carry?: CarryRead;
+ question?: { pin?: QuestionSpeech };
+ draft?: { pin?: DraftPin };
+ search?: { command?: SelectionCommand; pin: Promise<SelectionResult> };
+ form?: { command?: FormCommand; pin: Promise<FormResult> } } | null = null
+ private voiceSearch?: SelectionCommand
+ private voiceForm?: FormCommand
+ private voiceCarryId?: string
+ private readonly passageCarry = new PassageCarry({
+ select: command => this.host.selectPassage?.(command) ??
+ Promise.resolve({ ok: false, error: 'Update Harness to carry text.' }),
+ name: async id => (await this.host.listAgents()).find(a => a.id === id)?.name ?? 'Harness',
+ })
+ private readonly voiceDraft = new VoiceDraft()
+ private voiceDraftCreation?: { uploadId: string; id: string }
+ private readonly questionInbox = new QuestionInbox()
+ private voiceGeneration = 0
+ private voiceUploadId = ''
constructor(
private readonly host: CableHost,
@@ -544,6 +580,7 @@ export class CableSession {
// the tab should not lag the tiles that belong to it.
await this.syncSwarms()
await this.syncAgents()
+ void this.refreshFocusedActivity()
}
}
@@ -653,7 +690,17 @@ export class CableSession {
private onClosed(why: string): void {
this.log(`cable: closed (${why})`)
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
+ this.passageCarry.clear()
+ this.voiceDraft.clear()
+ this.voiceDraftCreation = undefined
+ this.voiceCarryId = undefined
this.host.onDialGone?.()
+ this.activityReads.clear()
+ this.activityRefreshAt = 0
+ this.activityRefreshAgent = ''
+ this.activityLabels.clear()
this.host.onDialStatus?.({ attached: false })
this.link = null
this.greetedMac = null
@@ -664,6 +711,7 @@ export class CableSession {
this.lastAgentsKey = ''
this.lastMachinesKey = ''
this.voice = null
+ this.voiceGeneration++
// The dial keeps its running image; the half-written slot is erased again by the next accepted offer.
this.transfer?.finish('interrupted by the port closing')
this.transfer = null
@@ -739,6 +787,16 @@ export class CableSession {
// matters after a dial reboot that lands mid-session on a remote selection.
selected: this.host.selectedMachine(),
voiceLang: this.host.voiceLang(),
+ // Optional controls must be advertised: a new dial can remain useful
+ // with an older daemon instead of waiting on commands it ignores.
+ features: [
+ 'voice.draft',
+ 'agents.refresh',
+ ...(this.host.form ? ['form'] : []),
+ ...(this.host.selectPassage ? ['selection'] : []),
+ ...(this.host.visit ? ['visit'] : []),
+ ...(this.host.answerReviewed ? ['question.review'] : []),
+ ],
})
// Log a dial that is new OR that came back running something else. The version half of that test
// is not decoration: a dial reboots into its new image after an update and greets with the SAME
@@ -774,6 +832,10 @@ export class CableSession {
case 'agents.list':
await this.pushAgents()
return
+ case 'agents.refresh':
+ // A workspace receipt needs the roster, not machines, notices and history.
+ await this.syncAgents(true)
+ return
case 'machines.list':
await this.syncMachines(true)
return
@@ -801,7 +863,15 @@ export class CableSession {
}
// Answered either way. An empty catalog closes the dial's picker cleanly; silence strands it on a
// spinner until its own timeout, which reads as a hang rather than "this engine has no choices".
- await this.send({ t: 'models', agentId, items: items.map((id) => ({ id })) })
+ // Additive correlation: older firmware ignores this and older hosts
+ // still identify replies by agentId. Never echo an unbounded value.
+ const serial = msg.request
+ const request = typeof serial === 'number' && Number.isInteger(serial)
+ && serial > 0 && serial <= 0x7fffffff ? serial : undefined
+ await this.send({
+ t: 'models', agentId, ...(request === undefined ? {} : { request }),
+ items: items.map((id) => ({ id })),
+ })
return
}
case 'focus':
@@ -871,12 +941,96 @@ export class CableSession {
this.host.scrolled(phase, dy, v)
return
}
+ case 'selection': {
+ const agentId = str('agentId')
+ const op = str('op')
+ const requestId = str('requestId')
+ if (!agentId || !requestId || requestId.length > 64 || !op || !['begin', 'step', 'extend', 'cancel', 'match', 'lines'].includes(op)) return
+ const command: SelectionCommand = { agentId, op: op as SelectionCommand['op'],
+ selectionId: str('selectionId'), revision: typeof msg.revision === 'number' ? msg.revision : undefined,
+ delta: typeof msg.delta === 'number' ? msg.delta : undefined, extend: typeof msg.extend === 'boolean' ? msg.extend : undefined }
+ const link = this.link
+ const result = await (this.host.selectPassage?.(command) ?? Promise.resolve({ ok: false as const, error: 'Update Harness to select text.' }))
+ if (this.link === link) await this.send({ t: 'selection.state', requestId, ...result })
+ return
+ }
+ case 'carry.prepare': {
+ const id = str('carryId') ?? '', requestId = str('requestId')
+ if (!requestId || requestId.length > 64) return
+ const link = this.link
+ const result = await this.passageCarry.prepare(id, { op: 'pin', agentId: str('agentId') ?? '',
+ selectionId: str('selectionId'), revision: typeof msg.revision === 'number' ? msg.revision : undefined })
+ if (this.link === link) await this.send({ t: 'carry.state', requestId, carryId: id, ...result })
+ return
+ }
+ case 'carry.cancel': {
+ const id = str('carryId')
+ if (!id) return
+ this.passageCarry.clear(id)
+ if (this.voiceCarryId === id) {
+ this.voiceGeneration++
+ this.voice = null
+ this.voiceCarryId = undefined
+ }
+ return
+ }
+ case 'form': {
+ const op = str('op'), formId = str('formId'), requestId = str('requestId')
+ if (!formId || !requestId || requestId.length > 64 || !op ||
+ !['open', 'state', 'move', 'activate', 'back', 'close'].includes(op)) return
+ const link = this.link
+ const result = await (this.host.form?.({ op: op as FormCommand['op'], formId,
+ ...(msg.surface !== undefined ? { surface: msg.surface as FormCommand['surface'] } : {}),
+ revision: typeof msg.revision === 'number' ? msg.revision : undefined,
+ delta: typeof msg.delta === 'number' ? msg.delta : undefined }) ??
+ Promise.resolve({ ok: false, active: false, error: 'Update Harness for New Harness.' }))
+ if (this.link === link) await this.send({ t: 'form.state', requestId, formId, ...result })
+ return
+ }
+ case 'visit': {
+ const op = str('op'), visitId = str('visitId'), requestId = str('requestId')
+ if (!visitId || !requestId || requestId.length > 64 || !op ||
+ !['open', 'latest', 'back', 'cancel'].includes(op)) return
+ const link = this.link
+ const result = await (this.host.visit?.({ op: op as VisitCommand['op'], visitId, agentId: str('agentId') }) ??
+ Promise.resolve({ ok: false, active: false, error: 'Update Harness to visit an alert.' }))
+ if (this.link === link) await this.send({ t: 'visit.state', requestId, visitId, ...result })
+ return
+ }
case 'turn.send':
if (str('agentId') && str('text')) this.host.sendTurn(str('agentId')!, str('text')!)
return
case 'turn.stop':
if (str('agentId')) this.host.stopTurn(str('agentId')!)
return
+ case 'draft.command': {
+ const id = str('draftId'), requestId = str('requestId'), op = str('op'), revision = msg.revision
+ if (!id || !requestId || requestId.length > 64 || !op || !Number.isSafeInteger(revision)) return
+ const link = this.link
+ const state = await this.voiceDraft.command(id, revision as number, op,
+ typeof msg.delta === 'number' ? msg.delta : 0)
+ if (this.link === link) await this.send({ t: 'draft.state', requestId, ...state })
+ return
+ }
+ case 'question.read': {
+ const agentId = str('agentId'), requestId = str('requestId')
+ if (!agentId || !requestId || requestId.length > 64) return
+ const state = this.questionInbox.read(agentId)
+ if (state.ok && !this.host.canSpeakQuestion?.(agentId))
+ state.questions = state.questions.map(q => ({ ...q, canText: false }))
+ await this.send({ t: 'question.state', agentId, requestId, ...this.whoIs(agentId), ...state })
+ return
+ }
+ case 'answer.reviewed': {
+ const agentId = str('agentId'), token = str('token'), requestId = str('requestId')
+ if (!agentId || !token || !requestId || requestId.length > 64) return
+ const link = this.link
+ const receipt = await this.questionInbox.submit(agentId, token, msg.choices,
+ answer => this.host.answerReviewed?.(answer) ?? Promise.resolve({ ok: false,
+ error: 'Update Harness to answer this question.' }), msg.drafts)
+ if (this.link === link) await this.send({ t: 'answer.receipt', agentId, token, requestId, ...receipt })
+ return
+ }
case 'answer': {
// `answers` is the dial's own object, one entry per question, keyed by the keys WE asked with. It
// travels verbatim. Until proto 2 this case demanded `{id, optionId}` — a shape the dial has never
@@ -896,7 +1050,66 @@ export class CableSession {
case 'agent.update':
if (str('agentId')) this.host.updateAgent(str('agentId')!, str('model'), str('effort'))
return
- case 'voice.begin':
+ case 'voice.begin': {
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
+ this.voiceDraftCreation = undefined
+ this.voiceGeneration++
+ this.voiceUploadId = str('uploadId') ?? ''
+ this.voiceCarryId = str('carryId')
+ // Presence, even malformed, selects this purpose. It can never fall back
+ // to task routing or an agent's terminal.
+ const formVoice = 'formId' in msg || 'formRevision' in msg
+ const searchVoice = 'searchId' in msg || 'searchRevision' in msg
+ const draftVoice = 'draftId' in msg || 'draftRevision' in msg || 'draftOp' in msg
+ const questionVoice = 'questionToken' in msg || 'questionIndex' in msg
+ const carryVoice = 'carryId' in msg
+ const carry: CarryRead | undefined = !formVoice && !questionVoice && !draftVoice && !searchVoice && carryVoice
+ ? (typeof msg.carryId === 'string' && str('agentId') && !('cmd' in msg) && !('selectionId' in msg)
+ ? this.passageCarry.read(msg.carryId)
+ : { ok: false, error: 'Choose the carried text and its recipient again.' }) : undefined
+ let draft: { pin?: DraftPin } | undefined
+ if (draftVoice) {
+ const id = str('draftId'), revision = msg.draftRevision
+ draft = { pin: id && Number.isSafeInteger(revision) &&
+ !formVoice && !questionVoice && !carryVoice && !searchVoice && !('agentId' in msg) && !('cmd' in msg) && !('selectionId' in msg)
+ ? this.voiceDraft.pin(id, revision as number, msg.draftOp) : undefined }
+ }
+ let question: { pin?: QuestionSpeech } | undefined
+ if (questionVoice) {
+ const agentId = str('agentId'), token = str('questionToken'), index = msg.questionIndex
+ const pin = agentId && token && Number.isInteger(index) &&
+ !formVoice && !carryVoice && !draftVoice && !searchVoice && !('cmd' in msg) && !('selectionId' in msg)
+ ? { agentId, token, index: index as number } : undefined
+ question = { pin: pin && this.host.canSpeakQuestion?.(pin.agentId) &&
+ this.questionInbox.canSpeak(pin) ? pin : undefined }
+ }
+ let form: { command?: FormCommand; pin: Promise<FormResult> } | undefined
+ if (formVoice) {
+ const formId = str('formId'), revision = msg.formRevision, queryId = this.voiceUploadId
+ const valid = formId && /^[a-zA-Z0-9-]{1,48}$/.test(formId) &&
+ /^[a-zA-Z0-9-]{1,64}$/.test(queryId) && Number.isSafeInteger(revision) &&
+ (revision as number) >= 0 && !('agentId' in msg) && !('selectionId' in msg) && !('cmd' in msg) && !carryVoice && !questionVoice && !draftVoice && !searchVoice
+ const command: FormCommand | undefined = valid
+ ? { formId, op: 'query.begin', revision: revision as number, queryId } : undefined
+ this.voiceForm = command
+ form = { command, pin: (command && this.host.form ? this.host.form(command)
+ : Promise.resolve({ ok: false, active: false, error: 'Open a field and say its name again.' }))
+ .catch(() => ({ ok: false, active: false, error: 'Could not open voice search. Try again.' })) }
+ }
+ let search: { command?: SelectionCommand; pin: Promise<SelectionResult> } | undefined
+ if (searchVoice) {
+ const selectionId = str('searchId'), revision = msg.searchRevision, agentId = str('agentId')
+ const valid = selectionId && /^[a-zA-Z0-9-]{1,48}$/.test(selectionId) && agentId && agentId.length <= 200 &&
+ /^[a-zA-Z0-9-]{1,64}$/.test(this.voiceUploadId) && Number.isSafeInteger(revision) &&
+ (revision as number) > 0 && (revision as number) <= 0x7fffffff &&
+ !formVoice && !questionVoice && !draftVoice && !carryVoice && !('selectionId' in msg) && !('cmd' in msg)
+ const command: SelectionCommand | undefined = valid ? { op: 'read', selectionId, revision: revision as number, agentId } : undefined
+ this.voiceSearch = command
+ search = { command, pin: (command && this.host.selectPassage ? this.host.selectPassage(command)
+ : Promise.resolve({ ok: false, error: 'Choose a passage before searching.' } as const))
+ .catch(() => ({ ok: false, error: 'Could not open output search. Try again.' })) }
+ }
this.voice = {
agentId: str('agentId'),
cmd: str('cmd'),
@@ -907,13 +1120,40 @@ export class CableSession {
rate: typeof msg.sr === 'number' && msg.sr > 0 ? msg.sr : DEFAULT_VOICE_RATE,
chunks: [],
bytes: 0,
+ form,
+ carry,
+ question,
+ draft,
+ search,
+ ...(!formVoice && !carryVoice && !questionVoice && !draftVoice && !searchVoice && str('selectionId') ? {
+ selectionId: str('selectionId'),
+ selection: (str('agentId') && this.host.selectPassage
+ ? this.host.selectPassage({ op: 'pin', agentId: str('agentId')!, selectionId: str('selectionId'),
+ revision: typeof msg.selectionRevision === 'number' ? msg.selectionRevision : undefined })
+ : Promise.resolve({ ok: false as const, error: 'Choose the text again.' }))
+ .catch(() => ({ ok: false as const, error: 'Could not attach that text. Choose it again.' })),
+ } : {}),
}
return
+ }
case 'voice.abort':
+ // An abort queued for the previous recording must not cancel its replacement.
+ if (str('uploadId') && str('uploadId') !== this.voiceUploadId) return
+ if (this.voiceDraftCreation?.uploadId === this.voiceUploadId) {
+ this.voiceDraft.cancelCreation(this.voiceDraftCreation.id)
+ this.voiceDraftCreation = undefined
+ }
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
+ if (this.voice?.selectionId && this.voice.agentId) void this.host.selectPassage?.({
+ op: 'cancel', agentId: this.voice.agentId, selectionId: this.voice.selectionId })
+ this.voiceGeneration++
this.voice = null
+ this.voiceCarryId = undefined
return
case 'voice.end':
- await this.finishVoice()
+ if (str('uploadId') && str('uploadId') !== this.voiceUploadId) return
+ await this.finishVoice(msg.review === true)
return
case 'voice.confirm':
if (str('routeId') && str('agentId')) this.host.focus(str('agentId')!)
@@ -1019,17 +1259,60 @@ export class CableSession {
this.voice.bytes += chunk.length
if (this.voice.bytes > VOICE_MAX_BYTES) {
this.log('cable: voice over the length cap, dropped')
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
this.voice = null
return
}
this.voice.chunks.push(chunk)
}
- private async finishVoice(): Promise<void> {
+ private async finishVoice(review = false): Promise<void> {
const turn = this.voice
+ const generation = this.voiceGeneration
+ const uploadId = this.voiceUploadId
+ const current = () => generation === this.voiceGeneration
+ const reply = (message: Message) => current()
+ ? this.send({ ...message, ...(uploadId ? { uploadId } : {}) })
+ : Promise.resolve(false)
this.voice = null
+ if (turn?.draft && (!turn.draft.pin || !this.voiceDraft.current(turn.draft.pin))) {
+ await reply({ t: 'voice.error', message: 'That draft changed. Review it again.' }); return
+ }
+ if (turn?.question && (!turn.question.pin || !this.questionInbox.canSpeak(turn.question.pin) ||
+ !this.host.canSpeakQuestion?.(turn.question.pin.agentId))) {
+ await reply({ t: 'voice.error', message: 'This question changed. Open it again.' })
+ return
+ }
+ if (turn?.carry && !turn.carry.ok) {
+ await reply({ t: 'voice.error', message: turn.carry.error })
+ return
+ }
+ const searchPin = await turn?.search?.pin
+ if (!current()) return
+ if (turn?.search && (!searchPin?.ok || !turn.search.command)) {
+ this.cancelSearchVoice()
+ await reply({ t: 'voice.error', message: searchPin && !searchPin.ok ? searchPin.error : 'Choose the passage again.' }); return
+ }
+ const formPin = await turn?.form?.pin
+ if (!current()) return
+ if (formPin && (!formPin.ok || !formPin.active || !formPin.canQuery)) {
+ this.cancelFormVoice()
+ await reply({ t: 'voice.error', message: formPin.error || 'Open the field and try again.' })
+ return
+ }
+ const selection = await turn?.selection
+ if (turn?.selectionId && turn.agentId) void this.host.selectPassage?.({
+ op: 'cancel', agentId: turn.agentId, selectionId: turn.selectionId })
+ if (!current()) return
+ if (selection && (!selection.ok || !selection.text)) {
+ await reply({ t: 'voice.error', message: selection.ok ? 'Choose the text again.' : selection.error })
+ return
+ }
if (!turn || turn.bytes === 0) {
- await this.send({ t: 'voice.error', message: "Didn't catch that" })
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
+ await reply({ t: 'voice.error', message: "Didn't catch that" })
return
}
@@ -1040,11 +1323,60 @@ export class CableSession {
try {
transcript = (await this.host.transcribe(Buffer.concat(turn.chunks), turn.rate, turn.lang)).trim()
} catch (err) {
- await this.send({ t: 'voice.error', message: (err as Error).message })
+ if (current()) { this.cancelFormVoice(); this.cancelSearchVoice() }
+ await reply({ t: 'voice.error', message: (err as Error).message })
return
}
+ if (!current()) return
if (!transcript) {
- await this.send({ t: 'voice.error', message: "Didn't catch that" })
+ this.cancelFormVoice()
+ this.cancelSearchVoice()
+ await reply({ t: 'voice.error', message: "Didn't catch that" })
+ return
+ }
+
+ if (turn.search) {
+ // Speech service punctuation is not part of a remembered phrase. Preserve
+ // all internal punctuation (paths, identifiers, and code) literally.
+ const query = transcript.replace(/[.!?]$/, '').trim()
+ if (!query || Buffer.byteLength(query, 'utf8') > 120 || /[\x00-\x1f\x7f-\x9f]/.test(query)) {
+ this.cancelSearchVoice()
+ await reply({ t: 'voice.error', message: 'Say a short phrase to find.' }); return
+ }
+ const result = await this.host.selectPassage!({ ...turn.search.command!, op: 'search', query })
+ .catch(() => ({ ok: false, error: 'Search did not finish. Try again.' } as const))
+ if (!current()) return
+ if (!result.ok) { this.cancelSearchVoice(); await reply({ t: 'voice.error', message: result.error }); return }
+ this.voiceSearch = undefined
+ await reply({ t: 'voice.search', agentId: turn.search.command!.agentId, ...result }); return
+ }
+ if (turn.draft) {
+ const state = this.voiceDraft.edit(turn.draft.pin!, transcript)
+ if (!state.ok) { await reply({ t: 'voice.error', message: state.error }); return }
+ await reply({ t: 'voice.draft', ...state }); return
+ }
+ if (turn.question) {
+ const pin = turn.question.pin!
+ const draft = this.host.canSpeakQuestion?.(pin.agentId) ? this.questionInbox.draft(pin, transcript)
+ : { ok: false as const, error: 'Use the terminal to answer this question.' }
+ if (!draft.ok) { await reply({ t: 'voice.error', message: draft.error }); return }
+ await reply({ t: 'voice.question', agentId: pin.agentId, token: pin.token,
+ questionIndex: pin.index, draftId: draft.draftId, text: draft.text })
+ return
+ }
+
+ if (turn.form) {
+ const command = turn.form.command
+ if (!command || transcript.length > 240) {
+ this.cancelFormVoice()
+ await reply({ t: 'voice.error', message: 'Say a short agent or project name.' })
+ return
+ }
+ const result = await this.host.form!({ ...command, op: 'query', text: transcript })
+ .catch(() => ({ ok: false, active: false, error: 'Search did not finish. Try again.' }))
+ if (!current()) return
+ this.cancelFormVoice()
+ await reply({ t: 'voice.form', formId: command.formId, ...result })
return
}
@@ -1052,6 +1384,10 @@ export class CableSession {
let agentId = turn.agentId
let agentName = ''
const agents = await this.host.listAgents()
+ if (!current()) return
+ if (review && !agentId) {
+ await reply({ t: 'voice.error', message: 'Choose a recipient before drafting.' }); return
+ }
if (!agentId) {
// NOBODY NAMED, SO THE WINDOW DECIDES. It opens its palette with these words already in the field
// and runs the route a typed task would have run — the same fifteen candidates, the same trimmed
@@ -1062,9 +1398,10 @@ export class CableSession {
const inWindow = this.host.routeInWindow
? await this.host.routeInWindow(transcript, turn.cmd)
: ({ t: 'unavailable' } as const)
+ if (!current()) return
if (inWindow.t === 'sent') {
this.log(`cable: the window routed the spoken task → ${inWindow.agentId.slice(0, 8)}`)
- await this.send({
+ await reply({
t: 'voice.transcript',
routeId: '',
text: transcript,
@@ -1080,33 +1417,88 @@ export class CableSession {
if (inWindow.t === 'cancelled') {
// A person closed the palette. Nothing was sent and nothing should be — but the dial is still
// showing the sending overlay, so it has to be told, or it sits there until its own watchdog.
- await this.send({ t: 'voice.error', message: 'Cancelled in the window' })
+ await reply({ t: 'voice.error', message: 'Cancelled in the window' })
return
}
if (inWindow.t === 'abandoned') {
// It took the words and went quiet. Routing here now would race a pick that may still be coming,
// and two turns from one sentence is worse than none — so say where the words went instead.
- await this.send({ t: 'voice.error', message: 'Still waiting on the window' })
+ await reply({ t: 'voice.error', message: 'Still waiting on the window' })
return
}
try {
const decision = await this.host.route(transcript, agents)
+ if (!current()) return
agentId = decision.agentId
this.log(`cable: routed → ${agentId} (${decision.reason})`)
} catch (err) {
- await this.send({ t: 'voice.error', message: (err as Error).message })
+ await reply({ t: 'voice.error', message: (err as Error).message })
return
}
}
agentName = agents.find((a) => a.id === agentId)?.name ?? ''
if (!agentId) {
- await this.send({ t: 'voice.error', message: 'No agent to send that to' })
+ await reply({ t: 'voice.error', message: 'No agent to send that to' })
+ return
+ }
+ const instruction = turn.cmd ? `/${turn.cmd} ${transcript}` : transcript
+ const carried = turn.carry?.ok ? turn.carry.passage : undefined
+ // An explicit target that vanished never becomes an inferred recipient.
+ if (carried && !agents.some(a => a.id === agentId)) {
+ await reply({ t: 'voice.error', message: 'That recipient is no longer available. Choose it again.' })
+ return
+ }
+ if (review) {
+ const recipient = agentId
+ const state = this.voiceDraft.create({ agentId: recipient, name: agentName || 'Harness', text: transcript,
+ context: carried ? `With text from ${carried.sourceName}` : selection?.ok && selection.text ? 'With selected text' : '',
+ carryId: carried?.id,
+ submit: async words => {
+ const edited = turn.cmd ? `/${turn.cmd} ${words}` : words
+ const text = carried ? withCarriedPassage(edited, carried)
+ : selection?.ok && selection.text ? withSelectedPassage(edited, selection.text) : edited
+ const result = this.host.sendTurn(recipient, text)
+ if (result && !result.ok) return { ok: false, error: 'Could not reach that harness. Check its connection.' }
+ if (carried) this.passageCarry.clear(carried.id)
+ return { ok: true }
+ } })
+ if (!state.ok) { await reply({ t: 'voice.error', message: state.error }); return }
+ this.voiceDraftCreation = { uploadId, id: state.id }
+ await reply({ t: 'voice.draft', ...state }); return
+ }
+ const text = carried ? withCarriedPassage(instruction, carried)
+ : selection?.ok && selection.text ? withSelectedPassage(instruction, selection.text) : instruction
+ try {
+ const submitted = this.host.sendTurn(agentId, text)
+ if (submitted && !submitted.ok) {
+ await reply({ t: 'voice.error', message: carried
+ ? 'Could not reach that harness. Your carried text is still here.'
+ : 'Could not reach that harness. Check its connection and try again.' })
+ return
+ }
+ } catch (_) {
+ await reply({ t: 'voice.error', message: 'Could not send. Check the terminal before trying again.' })
return
}
- const text = turn.cmd ? `/${turn.cmd} ${transcript}` : transcript
- this.host.sendTurn(agentId, text)
- await this.send({ t: 'voice.transcript', routeId: '', text: transcript, agentId, agentName, needsConfirm: false })
+ if (carried) {
+ this.passageCarry.clear(carried.id)
+ this.voiceCarryId = undefined
+ }
+ await reply({ t: 'voice.transcript', routeId: '', text: transcript, agentId, agentName, needsConfirm: false,
+ ...(carried ? { carryId: carried.id } : {}) })
+ }
+
+ private cancelSearchVoice(): void {
+ const command = this.voiceSearch
+ this.voiceSearch = undefined
+ if (command) void this.host.selectPassage?.({ ...command, op: 'cancel' }).catch(() => {})
+ }
+
+ private cancelFormVoice(): void {
+ const command = this.voiceForm
+ this.voiceForm = undefined
+ if (command) void this.host.form?.({ ...command, op: 'query.cancel' }).catch(() => {})
}
// ── outbound ──────────────────────────────────────────────────────────────────────────────────────
@@ -1150,17 +1542,20 @@ export class CableSession {
}
private async syncAgentsNow(force: boolean): Promise<void> {
- const agents = await this.host.listAgents()
+ const snapshot = this.host.listAgentSnapshot ? await this.host.listAgentSnapshot() : {
+ agents: await this.host.listAgents(), tab: this.host.activeSwarm(), total: this.host.agentTotal(),
+ }
+ const { agents, tab, total } = snapshot
// WHETHER there is a window is in the key, not WHICH tab: an empty tab after the window shut sends the
// same zero rows and draws a different screen, so that flip has to push. The tab's id does not — the
// dial names the tab from the `swarms` frame — and keying on it made every tab switch push twice,
// once when `app_swarms` named the new tab over the old panes and again when `app_panes` arrived.
- const key = `${this.host.activeSwarm() ? 'window' : ''}|${CableSession.agentsKey(agents)}`
+ const key = `${tab ? 'window' : ''}|${CableSession.agentsKey(agents)}`
if (!force && key === this.lastAgentsKey) return
this.lastAgentsKey = key
// Every push, and only pushes. The dial showing a different number from the daemon is a question this
// line answers in one look: either the daemon never said it, or it said it and the dial disagreed.
- this.log(`cable: agents → ${agents.length} of ${this.host.agentTotal()}${force ? ' (attach)' : ''}`)
+ this.log(`cable: agents → ${agents.length} of ${total}${force ? ' (requested)' : ''}`)
await this.send({ t: 'agents.begin' })
for (const a of agents) {
@@ -1181,7 +1576,7 @@ export class CableSession {
// Every agent sent is walked. What travels beside them: `total`, the account-wide count the overview
// prints (the rows behind it stay here), and `tab`, the active tab's id — '' with no window, which is
// how the dial tells "the app is shut" from "this tab is empty" when both send zero agents.
- await this.send({ t: 'agents.end', total: this.host.agentTotal(), tab: this.host.activeSwarm() })
+ await this.send({ t: 'agents.end', total, tab })
// The list just changed shape under the dial, so say again which agent both screens are on.
//
@@ -1418,9 +1813,62 @@ export class CableSession {
* a turn is live and shows the user nothing that says so.
*/
async turnStarted(agentId: string, text = ''): Promise<void> {
+ this.activityEndedAt.delete(agentId)
+ const read = {}
+ this.activityReads.set(agentId, read)
await this.send({ t: 'turn.started', agentId, text })
+ if (!this.link?.isOpen || !this.host.activityText) { this.activityReads.delete(agentId); return }
+ let activity: string | null = null
+ try { activity = await this.host.activityText(agentId) } catch { /* unavailable is not a status */ }
+ // A terminal capture must never revive a completed turn or overwrite a newer heartbeat.
+ if (this.activityReads.get(agentId) !== read) return
+ this.activityReads.delete(agentId)
+ await this.send({ t: 'turn.activity', agentId, text: activity ?? '' })
+ }
+ private readonly activityReads = new Map<string, object>()
+ private readonly activityEndedAt = new Map<string, number>()
+ private readonly activityLabels = new Map<string, string>()
+ private activityRefreshAt = 0
+ private activityRefreshAgent = ''
+ private activityRefreshPending = false
+
+ /** A turn may predate this bridge, or continue through a transcript compaction. */
+ private async refreshFocusedActivity(): Promise<void> {
+ const agentId = this.desiredFocus
+ const link = this.link
+ const now = Date.now()
+ if (this.stopped || !this.isConnected || !agentId || !this.host.activityText
+ || this.activityRefreshPending || this.activityReads.has(agentId)
+ || now - (this.activityEndedAt.get(agentId) ?? -Infinity) < 3_000
+ || (this.activityRefreshAgent === agentId && now - this.activityRefreshAt < 3_000)) return
+ this.activityRefreshAt = now
+ this.activityRefreshAgent = agentId
+ this.activityRefreshPending = true
+ const read = {}
+ this.activityReads.set(agentId, read)
+ const current = () => !this.stopped && this.isConnected && this.link === link
+ && this.desiredFocus === agentId && this.activityReads.get(agentId) === read
+ try {
+ const activity = await this.host.activityText(agentId)
+ if (!current()) return
+ // A visible engine footer is direct evidence of work. Recover liveness even
+ // when the transcript's turn.started happened before we attached.
+ if (activity) await this.send({ t: 'turn.started', agentId, text: activity })
+ if (!current()) return
+ await this.send({ t: 'turn.activity', agentId, text: activity ?? '' })
+ if (this.activityLabels.get(agentId) !== (activity ?? '')) {
+ this.activityLabels.set(agentId, activity ?? '')
+ this.log(`cable: terminal activity ${agentId}: ${activity || '(no live footer)'}`)
+ }
+ } catch { /* A capture failure says nothing about whether the turn ended. */ }
+ finally {
+ if (this.activityReads.get(agentId) === read) this.activityReads.delete(agentId)
+ this.activityRefreshPending = false
+ }
}
async turnDone(agentId: string): Promise<void> {
+ this.activityReads.delete(agentId)
+ this.activityEndedAt.set(agentId, Date.now())
await this.send({ t: 'turn.done', agentId })
}
/**
@@ -1434,6 +1882,9 @@ export class CableSession {
* notifies as it always did instead of losing the recap.
*/
async summary(agentId: string, recap: string, text: string, quiet = false, silent = false): Promise<void> {
+ this.activityReads.delete(agentId)
+ this.activityEndedAt.set(agentId, Date.now())
+ recap = extendShortRecap(recap, text)
const who = this.whoIs(agentId)
await this.send({ t: 'summary', agentId, ...who, recap, text, ...(quiet ? { quiet: true } : {}), ...(silent ? { silent: true } : {}) })
}
@@ -1463,18 +1914,29 @@ export class CableSession {
async replaceNotifications(
items: Array<{ agentId: string; machineId: string; question: boolean; text: string }>,
): Promise<void> {
+ const replay = { seen: new Set<string>() }
+ this.notificationReplay = replay
+ const link = this.link
const rows = await Promise.all(items.slice(0, 8).map(async (item) => {
const who = this.whoIs(item.agentId)
// A QUESTION BRINGS ITS OWN WORDS; a finished turn takes the recap this daemon summarised. The
// dial cannot supply either after a reboot, and a row with neither renders as the word its type
// used to assume — "done", on a question nobody has answered.
let summary = item.text
- if (!item.question && !summary) {
- try { summary = (await this.host.recentSummaries(item.agentId))[0]?.recap ?? '' } catch { summary = '' }
+ if (!item.question && summary.trim().length < 20) {
+ try {
+ const saved = (await this.host.recentSummaries(item.agentId))[0]
+ summary = summary ? extendShortRecap(summary, saved?.text ?? '') : saved?.recap ?? ''
+ } catch { /* keep the supplied text if history cannot be read */ }
}
return { agentId: item.agentId, name: who.name, machine: who.machine, summary, question: item.question }
}))
- await this.send({ t: 'notif.replace', items: rows })
+ if (this.notificationReplay !== replay) return
+ this.notificationReplay = undefined
+ if (this.link !== link || this.stopped) return
+ // Seen completion rows stay cleared even if their history arrived late.
+ // Questions still require an answer; looking at one cannot dismiss it.
+ await this.send({ t: 'notif.replace', items: rows.filter(row => row.question || !replay.seen.has(row.agentId)) })
}
/**
@@ -1489,9 +1951,12 @@ export class CableSession {
*/
async agentSeen(agentId: string): Promise<void> {
if (!agentId) return
+ this.notificationReplay?.seen.add(agentId)
await this.send({ t: 'notif.seen', agentId })
}
async turnError(agentId: string, message: string): Promise<void> {
+ this.activityReads.delete(agentId)
+ this.activityEndedAt.set(agentId, Date.now())
await this.send({ t: 'turn.error', agentId, message })
}
/**
@@ -1507,6 +1972,7 @@ export class CableSession {
* came through quiet, no row was ever recorded, and looking away later left nothing behind.
*/
async question(agentId: string, id: string, questions: unknown): Promise<void> {
+ this.questionInbox.set(agentId, id, questions)
await this.send({ t: 'question', agentId, ...this.whoIs(agentId), id, questions })
}
@@ -1518,6 +1984,7 @@ export class CableSession {
* halfway through giving.
*/
async questionClose(agentId: string, id: string): Promise<void> {
+ if (!this.questionInbox.close(agentId, id)) return
await this.send({ t: 'question.close', agentId, id })
}
diff --git a/cli/src/cable/cableVoice.spec.ts b/cli/src/cable/cableVoice.spec.ts
new file mode 100644
index 000000000..307c98a34
--- /dev/null
+++ b/cli/src/cable/cableVoice.spec.ts
@@ -0,0 +1,115 @@
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+const auth = vi.hoisted(() => ({
+ session: { autonomousEnv: 'prod' } as { autonomousEnv: string } | null,
+ accessToken: vi.fn(),
+}))
+vi.mock('../lib/authSession.js', () => ({
+ readAuthSession: () => auth.session,
+ AuthSessionManager: class { accessToken = auth.accessToken },
+}))
+vi.mock('../lib/registry.js', () => ({ registry: {}, projectDisplayName: () => '' }))
+vi.mock('../lib/voiceRouter.js', () => ({ routeVoiceTask: vi.fn() }))
+vi.mock('../config/env.js', () => ({ env: {
+ BACKEND_WS_URL: 'wss://api.example.test/', CABLE_STT_PATH: '/api/voice/stt',
+} }))
+
+import { DaemonCableHost, type CableHostWiring } from './cableHost.js'
+
+const pcm = Buffer.alloc(32_000)
+const ok = () => new Response(JSON.stringify({ success: true, data: { transcript: 'a test sentence' } }), {
+ headers: { 'content-type': 'application/json' },
+})
+const rejected = (status: number, code: string, message = 'private response detail') => new Response(JSON.stringify({
+ success: false, error: { code, message },
+}), { status, headers: { 'content-type': 'application/json', 'cf-ray': '0123456789abcdef-HKG' } })
+
+function setup() {
+ const log = vi.fn()
+ // Transcription needs only log; use the real method to exercise its fetch/retry behavior.
+ const host = new DaemonCableHost({ log } as unknown as CableHostWiring)
+ const fetchMock = vi.fn<typeof fetch>()
+ vi.stubGlobal('fetch', fetchMock)
+ return { host, log, fetchMock }
+}
+
+beforeEach(() => {
+ auth.session = { autonomousEnv: 'prod' }
+ auth.accessToken.mockReset().mockResolvedValue('test-access-token')
+})
+afterEach(() => vi.unstubAllGlobals())
+
+describe('cabled voice transcription', () => {
+ it('uploads a WAV with the signed-in environment and returns the transcript', async () => {
+ const { host, fetchMock } = setup()
+ fetchMock.mockResolvedValue(ok())
+ await expect(host.transcribe(pcm, 16000, 'en')).resolves.toBe('a test sentence')
+ const [url, options] = fetchMock.mock.calls[0]!
+ expect(url).toBe('https://api.example.test/api/voice/stt?lang=en')
+ expect(options?.headers).toMatchObject({ authorization: 'Bearer test-access-token', 'x-autonomous-env': 'prod' })
+ expect((options?.body as Buffer).includes(Buffer.from('RIFF'))).toBe(true)
+ expect((options?.body as Buffer).includes(Buffer.from('WAVE'))).toBe(true)
+ })
+
+ it('forces one refresh after 401 even before the stored expiry, reusing the same audio', async () => {
+ const { host, fetchMock } = setup()
+ auth.accessToken.mockResolvedValueOnce('old-token').mockResolvedValueOnce('new-token')
+ fetchMock.mockResolvedValueOnce(rejected(401, 'UNAUTHORIZED')).mockResolvedValueOnce(ok())
+ await expect(host.transcribe(pcm, 16000, 'en')).resolves.toBe('a test sentence')
+ expect(auth.accessToken.mock.calls).toEqual([[], [{ force: true, failedToken: 'old-token' }]])
+ expect(fetchMock).toHaveBeenCalledTimes(2)
+ expect(fetchMock.mock.calls[1]![1]?.headers).toMatchObject({ authorization: 'Bearer new-token' })
+ expect(fetchMock.mock.calls[1]![1]?.body).toBe(fetchMock.mock.calls[0]![1]?.body)
+ })
+
+ it('stops after the retry and gives a sign-in instruction for another 401', async () => {
+ const { host, fetchMock, log } = setup()
+ fetchMock.mockImplementation(async () => rejected(401, 'UNAUTHORIZED'))
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow('Sign in again on your computer')
+ expect(fetchMock).toHaveBeenCalledTimes(2)
+ expect(log).toHaveBeenCalledWith('cable: stt HTTP 401 code=UNAUTHORIZED kind=json request=0123456789abcdef-HKG')
+ })
+
+ it.each(['AUTONOMOUS_ENV_MISMATCH', 'AUTONOMOUS_ENV_NOT_ALLOWED'])('identifies %s without changing environment or retrying', async (code) => {
+ const { host, fetchMock, log } = setup()
+ fetchMock.mockResolvedValue(rejected(403, code))
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow('Sign in again on your computer')
+ expect(fetchMock).toHaveBeenCalledTimes(1)
+ expect(auth.accessToken).toHaveBeenCalledTimes(1)
+ expect(auth.session?.autonomousEnv).toBe('prod')
+ expect(log.mock.calls[0]![0]).toContain(`code=${code}`)
+ expect(JSON.stringify(log.mock.calls)).not.toContain('private response detail')
+ })
+
+ it('records an edge rejection without logging HTML or retrying access denial', async () => {
+ const { host, fetchMock, log } = setup()
+ fetchMock.mockResolvedValue(new Response('<html>private request echo test-access-token</html>', {
+ status: 403, headers: { 'content-type': 'text/html', 'cf-mitigated': 'challenge', 'cf-ray': '0123456789abcdef-HKG' },
+ }))
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow('Voice service rejected upload (403)')
+ expect(fetchMock).toHaveBeenCalledTimes(1)
+ expect(log).toHaveBeenCalledWith('cable: stt HTTP 403 code=unknown kind=challenge request=0123456789abcdef-HKG')
+ })
+
+ it('does not reflect arbitrary JSON fields or headers into diagnostics', async () => {
+ const { host, fetchMock, log } = setup()
+ fetchMock.mockResolvedValue(new Response(JSON.stringify({ error: { code: 'test-access-token', message: 'private words' } }), {
+ status: 403, headers: { 'content-type': 'application/json', 'cf-ray': 'test-access-token' },
+ }))
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow('(403)')
+ expect(log).toHaveBeenCalledWith('cable: stt HTTP 403 code=unknown kind=json request=unknown')
+ })
+
+ it.each([['{invalid', 403, 'rejected upload'], ['null', 503, 'unavailable']] as const)('handles unreadable error JSON %s', async (body, status, message) => {
+ const { host, fetchMock } = setup()
+ fetchMock.mockResolvedValue(new Response(body, { status, headers: { 'content-type': 'application/json' } }))
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow(message)
+ })
+
+ it('does not start an upload while signed out', async () => {
+ const { host, fetchMock } = setup()
+ auth.session = null
+ await expect(host.transcribe(pcm, 16000, 'en')).rejects.toThrow('Sign in on your computer')
+ expect(fetchMock).not.toHaveBeenCalled()
+ })
+})
diff --git a/cli/src/cable/machineFleet.ts b/cli/src/cable/machineFleet.ts
index 7c6a93822..c4e80ec4c 100644
--- a/cli/src/cable/machineFleet.ts
+++ b/cli/src/cable/machineFleet.ts
@@ -1,3 +1,4 @@
+import type { ReviewedAnswer } from './questionInbox.js'
// The daemon's view of the OTHER machines the owner has, and the one lane that reaches them.
//
// Split out of cableHost.ts so the cable protocol layer never learns the word "relay": everything the dial
@@ -32,6 +33,7 @@ export class FleetError extends Error {
export type FleetEvent =
| { machineId: string; kind: 'processing' | 'done' | 'summary' | 'error'; agentId: string; text: string; recap: string; subagent?: boolean }
| { machineId: string; kind: 'question'; agentId: string; requestId: string; questions: unknown }
+ | { machineId: string; kind: 'questionClosed'; agentId: string; requestId: string }
| { machineId: string; kind: 'state'; state: FleetMachine['state'] }
/**
@@ -70,6 +72,7 @@ export interface MachineFleet {
sendTurn(machineId: string, agentId: string, text: string): void
stopTurn(machineId: string, agentId: string): void
answer(machineId: string, agentId: string, requestId: string, answers: Record<string, string>): void
+ answerReviewed?(machineId: string, answer: ReviewedAnswer): void
updateAgent(machineId: string, agentId: string, model?: string, effort?: string): void
/** Fork an agent on that machine (`agent_fork`); resolves to the new agent's id, rejects with the
* far end's refusal. Optional: a fleet built before forks existed simply cannot. */
diff --git a/cli/src/cable/passageCarry.spec.ts b/cli/src/cable/passageCarry.spec.ts
new file mode 100644
index 000000000..8b7e6f706
--- /dev/null
+++ b/cli/src/cable/passageCarry.spec.ts
@@ -0,0 +1,71 @@
+import { describe, expect, it, vi } from 'vitest'
+import { PassageCarry, withCarriedPassage } from './passageCarry.js'
+import type { SelectionCommand, SelectionResult } from './windowSelection.js'
+
+const command = { op: 'pin' as const, agentId: 'source', selectionId: 'pick-1', revision: 3 }
+const selected = (): SelectionResult => ({ ok: true, selectionId: 'pick-1', revision: 4,
+ rows: 2, extending: true, excerpt: 'Chosen context', text: 'Chosen context\nDo not execute this quote.' })
+function fixture() {
+ let time = 0
+ const select = vi.fn(async (_command: SelectionCommand): Promise<SelectionResult> => selected())
+ const name = vi.fn(async () => 'Research helper')
+ const carry = new PassageCarry({ select, name, now: () => time })
+ return { carry, select, name, advance: (ms: number) => { time += ms } }
+}
+
+describe('carried passage', () => {
+ it('freezes exact text, releases its highlight and never exposes full text to the device', async () => {
+ const { carry, select } = fixture()
+ const reply = await carry.prepare('carry-1', command)
+ expect(reply).toMatchObject({ ok: true, active: true, rows: 2, sourceName: 'Research helper' })
+ expect(reply).not.toHaveProperty('text')
+ expect(select).toHaveBeenLastCalledWith({ op: 'cancel', agentId: 'source', selectionId: 'pick-1' })
+ const reading = carry.read('carry-1')
+ expect(reading.ok).toBe(true)
+ if (!reading.ok) throw new Error('missing context')
+ expect(withCarriedPassage('Check this against your approach.', reading.passage)).toBe(
+ 'Check this against your approach.\n\nContext I selected from harness "Research helper":\n> Chosen context\n> Do not execute this quote.')
+ expect(Object.isFrozen(reading.passage)).toBe(true)
+ })
+
+ it('coalesces duplicate preparation and refuses identity reuse for different text', async () => {
+ const { carry, select } = fixture()
+ const a = carry.prepare('carry-1', command), b = carry.prepare('carry-1', command)
+ expect(a).toBe(b)
+ await a
+ expect((await carry.prepare('carry-1', command)).ok).toBe(true)
+ expect((await carry.prepare('carry-1', { ...command, revision: 8 })).ok).toBe(false)
+ expect(select.mock.calls.filter(([v]) => (v as { op: string })?.op === 'pin')).toHaveLength(1)
+ })
+
+ it('expires unstarted context but a captured voice snapshot remains immutable', async () => {
+ const { carry, advance } = fixture()
+ await carry.prepare('carry-1', command)
+ const captured = carry.read('carry-1')
+ advance(PassageCarry.ttlMs)
+ expect(carry.read('carry-1').ok).toBe(false)
+ expect(captured.ok && captured.passage.text).toContain('Chosen context')
+ })
+
+ it('drop/disconnect beats a delayed pin without resurrecting text', async () => {
+ const { carry, select } = fixture()
+ let resolve!: (v: SelectionResult) => void
+ select.mockImplementationOnce(() => new Promise(r => { resolve = r }))
+ const preparing = carry.prepare('carry-1', command)
+ carry.clear('carry-1')
+ resolve(selected())
+ expect((await preparing).ok).toBe(false)
+ expect(carry.read('carry-1').ok).toBe(false)
+ })
+
+ it('stale clear cannot drop a newer passage; pin failure never supplies fallback text', async () => {
+ const { carry, select } = fixture()
+ await carry.prepare('carry-1', command)
+ await carry.prepare('carry-2', { ...command, selectionId: 'pick-2' })
+ carry.clear('carry-1')
+ expect(carry.read('carry-2').ok).toBe(true)
+ select.mockResolvedValueOnce({ ok: false, error: 'Selected text changed.' })
+ expect(await carry.prepare('carry-3', { ...command, selectionId: 'pick-3' })).toMatchObject({ ok: false })
+ expect(carry.read('carry-3').ok).toBe(false)
+ })
+})
diff --git a/cli/src/cable/passageCarry.ts b/cli/src/cable/passageCarry.ts
new file mode 100644
index 000000000..f4914305b
--- /dev/null
+++ b/cli/src/cable/passageCarry.ts
@@ -0,0 +1,102 @@
+import type { SelectionCommand, SelectionResult } from './windowSelection.js'
+
+export interface CarriedPassage {
+ readonly id: string
+ readonly sourceAgentId: string
+ readonly sourceName: string
+ readonly text: string
+ readonly excerpt: string
+ readonly rows: number
+ readonly expiresAt: number
+}
+export type CarryResult = { ok: false; active: false; error: string } | {
+ ok: true; active: true; carryId: string; sourceName: string
+ excerpt: string; rows: number; ttlMs: number
+}
+export type CarryRead = { ok: true; passage: CarriedPassage } | { ok: false; error: string }
+
+/** One explicitly selected passage, kept in RAM on this cable connection.
+ * Moving to another pane does not change its text. Nothing is delivered until
+ * a voice turn names this identity and a specific recipient. */
+export class PassageCarry {
+ static readonly ttlMs = 5 * 60_000
+ private generation = 0
+ private item?: CarriedPassage & { key: string }
+ private pending?: { id: string; key: string; generation: number; promise: Promise<CarryResult> }
+
+ constructor(private readonly wiring: {
+ select: (command: SelectionCommand) => Promise<SelectionResult>
+ name: (agentId: string) => Promise<string>
+ now?: () => number
+ }) {}
+
+ private now(): number { return this.wiring.now?.() ?? Date.now() }
+ private fail(error: string): CarryResult { return { ok: false, active: false, error } }
+ private state(item: CarriedPassage): CarryResult {
+ return { ok: true, active: true, carryId: item.id, sourceName: item.sourceName,
+ excerpt: item.excerpt, rows: item.rows, ttlMs: Math.max(0, item.expiresAt - this.now()) }
+ }
+
+ prepare(id: string, command: SelectionCommand): Promise<CarryResult> {
+ if (!/^[a-zA-Z0-9-]{1,48}$/.test(id) || command.op !== 'pin' ||
+ !command.agentId || command.agentId.length > 128 ||
+ !/^[a-zA-Z0-9-]{1,48}$/.test(command.selectionId ?? '') ||
+ !Number.isSafeInteger(command.revision) || command.revision! < 0) {
+ return Promise.resolve(this.fail('Choose the text again.'))
+ }
+ const key = JSON.stringify([id, command.agentId, command.selectionId, command.revision])
+ if (this.pending) return this.pending.key === key ? this.pending.promise
+ : Promise.resolve(this.fail('Wait for the selected text.'))
+ if (this.item?.id === id && this.item.expiresAt > this.now()) {
+ return Promise.resolve(this.item.key === key ? this.state(this.item)
+ : this.fail('That carried text has changed. Choose it again.'))
+ }
+ const generation = ++this.generation
+ this.item = undefined
+ const promise = (async (): Promise<CarryResult> => {
+ try {
+ const selection = await this.wiring.select(command)
+ if (generation !== this.generation) return this.fail('Carrying cancelled.')
+ if (!selection.ok) return this.fail(selection.error)
+ if (!selection.text?.trim() || Buffer.byteLength(selection.text, 'utf8') > 4096 ||
+ selection.rows < 1 || selection.rows > 16) return this.fail('Choose a shorter passage.')
+ const name = await this.wiring.name(command.agentId)
+ if (generation !== this.generation) return this.fail('Carrying cancelled.')
+ this.item = Object.freeze({ id, key, sourceAgentId: command.agentId,
+ sourceName: [...name.replace(/[\x00-\x1f\x7f]/g, ' ')].slice(0, 60).join('') || 'Harness',
+ text: selection.text, excerpt: selection.excerpt, rows: selection.rows,
+ expiresAt: this.now() + PassageCarry.ttlMs })
+ return this.state(this.item)
+ } catch (_) {
+ return this.fail('Could not carry that text. Choose it again.')
+ } finally {
+ if (this.pending?.generation === generation) this.pending = undefined
+ void this.wiring.select({ op: 'cancel', agentId: command.agentId,
+ selectionId: command.selectionId }).catch(() => {})
+ }
+ })()
+ this.pending = { id, key, generation, promise }
+ return promise
+ }
+
+ read(id: string): CarryRead {
+ const item = this.item
+ if (!item || item.id !== id || item.expiresAt <= this.now()) {
+ if (item?.expiresAt !== undefined && item.expiresAt <= this.now()) this.item = undefined
+ return { ok: false, error: 'The carried text expired. Choose it again.' }
+ }
+ return { ok: true, passage: item }
+ }
+
+ clear(id?: string): void {
+ if (id !== undefined && id !== this.item?.id && id !== this.pending?.id) return
+ this.generation++
+ this.item = undefined
+ this.pending = undefined
+ }
+}
+
+export function withCarriedPassage(instruction: string, passage: CarriedPassage): string {
+ return `${instruction}\n\nContext I selected from harness ${JSON.stringify(passage.sourceName)}:\n` +
+ passage.text.split(/\r?\n/).map(line => `> ${line}`).join('\n')
+}
diff --git a/cli/src/cable/questionInbox.spec.ts b/cli/src/cable/questionInbox.spec.ts
new file mode 100644
index 000000000..9e9374ddf
--- /dev/null
+++ b/cli/src/cable/questionInbox.spec.ts
@@ -0,0 +1,111 @@
+import { describe, expect, it, vi } from 'vitest'
+import { QuestionInbox, type ReviewedAnswer } from './questionInbox.js'
+
+const question = () => [{ key: 'scope', q: 'Which scope?', options: ['This file', 'Whole project'], multi: false }]
+function read(inbox: QuestionInbox, id = 'a') {
+ const state = inbox.read(id)
+ expect(state.ok).toBe(true)
+ if (!state.ok) throw new Error(state.error)
+ return state
+}
+describe('QuestionInbox', () => {
+ it('retains separate agents and immutable contents without resetting on reannounce', () => {
+ const inbox = new QuestionInbox(), source = question()
+ inbox.set('a', 'qa', source)
+ const a = read(inbox)
+ source[0].options[0] = 'changed'
+ inbox.set('b', 'qb', question())
+ inbox.set('a', 'qa', question())
+ expect(read(inbox).token).toBe(a.token)
+ expect(read(inbox).questions[0].options[0]).toBe('This file')
+ expect(read(inbox, 'b').token).not.toBe(a.token)
+ inbox.close('a', 'old')
+ expect(read(inbox).token).toBe(a.token)
+ inbox.close('a', 'qa')
+ expect(inbox.read('a').ok).toBe(false)
+ })
+ it('refuses replaced tokens, invalid masks and missing choices without input', async () => {
+ const inbox = new QuestionInbox(), send = vi.fn(async () => ({ ok: true as const }))
+ inbox.set('a', 'q', question()); const old = read(inbox)
+ const changed = question(); changed[0].options[1] = 'Everything'
+ inbox.set('a', 'q', changed); const current = read(inbox)
+ expect(current.token).not.toBe(old.token)
+ for (const [token, masks] of [[old.token, [1]], [current.token, []], [current.token, [0]],
+ [current.token, [3]], [current.token, [4]], [current.token, [1.2]]] as const) {
+ expect((await inbox.submit('a', token, masks, send)).ok).toBe(false)
+ }
+ expect(send).not.toHaveBeenCalled()
+ })
+ it('delivers the exact reviewed labels once, including commas, and retains the receipt', async () => {
+ const inbox = new QuestionInbox()
+ inbox.set('a', 'q', [{ key: 'pick', q: 'Pick formats', options: ['CSV, UTF-8', 'JSON', 'XML'], multi: true }])
+ const send = vi.fn(async (_answer: ReviewedAnswer) => ({ ok: true as const })), token = read(inbox).token
+ const one = inbox.submit('a', token, [3], send), duplicate = inbox.submit('a', token, [4], send)
+ expect(duplicate).toBe(one)
+ expect(await one).toEqual({ ok: true })
+ expect(send).toHaveBeenCalledTimes(1)
+ expect(send.mock.calls[0][0]).toMatchObject({ requestId: 'q', selections: { pick: ['CSV, UTF-8', 'JSON'] } })
+ expect(read(inbox).submitted).toBe(true)
+ await inbox.submit('a', token, [1], send)
+ expect(send).toHaveBeenCalledTimes(1)
+ })
+ it('does not retry uncertain input or send after a question closes while queued', async () => {
+ const inbox = new QuestionInbox(), send = vi.fn(async () => { throw new Error('lost receipt') })
+ inbox.set('a', 'q', question()); let token = read(inbox).token
+ const first = await inbox.submit('a', token, [1], send)
+ expect(first.ok).toBe(false)
+ expect(await inbox.submit('a', token, [1], send)).toEqual(first)
+ expect(send).toHaveBeenCalledTimes(1)
+ inbox.set('a', 'q2', question()); token = read(inbox).token
+ const queued = inbox.submit('a', token, [1], send)
+ inbox.close('a', 'q2')
+ expect((await queued).ok).toBe(false)
+ expect(send).toHaveBeenCalledTimes(1)
+ })
+ it('refuses oversized or ambiguous catalogs and bounds the pending set', () => {
+ const inbox = new QuestionInbox()
+ inbox.set('a', 'q', [...question(), ...question()])
+ expect(inbox.read('a').ok).toBe(false)
+ inbox.set('a', 'q', [{ ...question()[0], q: 'x'.repeat(7000) }])
+ expect(inbox.read('a').ok).toBe(false)
+ for (let i = 0; i < 65; i++) inbox.set(`agent-${i}`, 'q', question())
+ expect(inbox.read('agent-0').ok).toBe(false)
+ expect(inbox.read('agent-64').ok).toBe(true)
+ })
+})
+
+describe('spoken answer drafts', () => {
+ const spoken = () => [{ ...question()[0], canText: true }]
+ it('keeps a full draft inert until its exact id is explicitly submitted', async () => {
+ const inbox = new QuestionInbox(), send = vi.fn(async (_a: ReviewedAnswer) => ({ ok: true as const }))
+ inbox.set('a', 'q', spoken()); const token = read(inbox).token
+ const pin = { agentId: 'a', token, index: 0 }
+ expect(inbox.canSpeak(pin)).toBe(true)
+ const draft = inbox.draft(pin, 'This file, but leave the tests alone.')
+ if (!draft.ok) throw new Error(draft.error)
+ expect(send).not.toHaveBeenCalled()
+ for (const [masks, drafts] of [[[1], [draft.draftId]], [[0], ['wrong']], [[0], []]] as const)
+ expect((await inbox.submit('a', token, masks, send, drafts)).ok).toBe(false)
+ expect(send).not.toHaveBeenCalled()
+ expect(await inbox.submit('a', token, [0], send, [draft.draftId])).toEqual({ ok: true })
+ expect(send.mock.calls[0][0]).toMatchObject({ answers: { scope: draft.text }, freeTextKeys: ['scope'] })
+ await inbox.submit('a', token, [0], send, [draft.draftId])
+ expect(send).toHaveBeenCalledTimes(1)
+ })
+ it('rejects superseded drafts, closed questions, unsupported speech and incomplete text', async () => {
+ const inbox = new QuestionInbox(), send = vi.fn(async () => ({ ok: true as const }))
+ inbox.set('a', 'q', spoken()); const token = read(inbox).token, pin = { agentId: 'a', token, index: 0 }
+ for (const text of ['', 'x'.repeat(1201), 'x\u001b[31m', 'x\tEnter']) expect(inbox.draft(pin, text).ok).toBe(false)
+ const first = inbox.draft(pin, 'First'), second = inbox.draft(pin, 'Second')
+ if (!first.ok || !second.ok) throw new Error('draft')
+ expect((await inbox.submit('a', token, [0], send, [first.draftId])).ok).toBe(false)
+ inbox.close('a', 'q')
+ expect(inbox.draft(pin, 'Late').ok).toBe(false)
+ expect((await inbox.submit('a', token, [0], send, [second.draftId])).ok).toBe(false)
+ for (const q of [question()[0], { ...spoken()[0], multi: true }]) {
+ inbox.set('a', 'q2', [q])
+ expect(inbox.canSpeak({ ...pin, token: read(inbox).token })).toBe(false)
+ }
+ expect(send).not.toHaveBeenCalled()
+ })
+})
diff --git a/cli/src/cable/questionInbox.ts b/cli/src/cable/questionInbox.ts
new file mode 100644
index 000000000..7cec062ae
--- /dev/null
+++ b/cli/src/cable/questionInbox.ts
@@ -0,0 +1,122 @@
+import { randomUUID } from 'node:crypto'
+
+export interface ReviewQuestion {
+ key: string
+ q: string
+ options: string[]
+ multi: boolean
+ canText?: boolean
+}
+export interface ReviewedAnswer {
+ agentId: string
+ requestId: string
+ questions: ReviewQuestion[]
+ answers: Record<string, string>
+ selections: Record<string, string[]>
+ freeTextKeys?: string[]
+}
+export type AnswerReceipt = { ok: true; pending?: boolean } | { ok: false; error: string }
+export type QuestionSpeech = { agentId: string; token: string; index: number }
+type Draft = { id: string; text: string }
+type Entry = {
+ agentId: string; id: string; token: string; signature: string; questions: ReviewQuestion[]
+ drafts: Map<number, Draft>
+ submitted?: Promise<AnswerReceipt>
+}
+
+/** The host owns the pending catalog; the dial holds only the question it is reading.
+ * Tokens name immutable contents, not merely the engine's sometimes-reused id. */
+export class QuestionInbox {
+ private readonly entries = new Map<string, Entry>()
+ private readonly latestIds = new Map<string, string>()
+
+ set(agentId: string, id: string, raw: unknown): void {
+ if (this.latestIds.size >= 64 && !this.latestIds.has(agentId)) {
+ const oldest = this.latestIds.keys().next().value!
+ this.latestIds.delete(oldest); this.entries.delete(oldest)
+ }
+ this.latestIds.set(agentId, id)
+ const valid = agentId && id && Array.isArray(raw) && raw.length > 0 && raw.length <= 4 &&
+ raw.every(q => q && typeof q.key === 'string' && q.key && typeof q.q === 'string' && q.q &&
+ Array.isArray(q.options) && q.options.length > 0 && q.options.length <= 6 &&
+ q.options.every((o: unknown) => typeof o === 'string' && o.length > 0)) &&
+ new Set(raw.map(q => q.key)).size === raw.length
+ if (!valid) { this.entries.delete(agentId); return }
+ const questions: ReviewQuestion[] = raw.map(q => ({ key: q.key, q: q.q,
+ options: [...q.options], multi: q.multi === true, ...(q.canText === true ? { canText: true } : {}) }))
+ const signature = JSON.stringify([id, questions])
+ if (Buffer.byteLength(signature, 'utf8') > 6500) { this.entries.delete(agentId); return }
+ if (this.entries.get(agentId)?.signature === signature) return
+ if (this.entries.size >= 64 && !this.entries.has(agentId)) this.entries.delete(this.entries.keys().next().value!)
+ for (const question of questions) { Object.freeze(question.options); Object.freeze(question) }
+ Object.freeze(questions)
+ this.entries.set(agentId, { agentId, id, token: randomUUID(), signature, questions, drafts: new Map() })
+ }
+
+ close(agentId: string, id: string): boolean {
+ const current = this.latestIds.get(agentId)
+ if (current !== undefined && current !== id) return false
+ this.latestIds.delete(agentId); this.entries.delete(agentId)
+ return true
+ }
+
+ read(agentId: string): { ok: true; id: string; token: string; questions: ReviewQuestion[]; submitted: boolean }
+ | { ok: false; error: string } {
+ const entry = this.entries.get(agentId)
+ return entry ? { ok: true, id: entry.id, token: entry.token, questions: entry.questions,
+ submitted: !!entry.submitted } : { ok: false, error: 'No readable question. Check the terminal.' }
+ }
+
+ canSpeak(pin: QuestionSpeech): boolean {
+ const entry = this.entries.get(pin.agentId)
+ return !!entry && entry.token === pin.token && !entry.submitted &&
+ Number.isInteger(pin.index) && pin.index >= 0 &&
+ entry.questions[pin.index]?.canText === true && !entry.questions[pin.index].multi
+ }
+
+ draft(pin: QuestionSpeech, text: string): { ok: true; draftId: string; text: string } | { ok: false; error: string } {
+ if (!this.canSpeak(pin)) return { ok: false, error: 'This question changed. Open it again.' }
+ // Keep the complete answer reviewable on the device; never truncate a submission.
+ if (!text.trim() || Buffer.byteLength(text, 'utf8') > 1200 || /[\x00-\x09\x0b-\x1f\x7f]/.test(text))
+ return { ok: false, error: 'Say a shorter answer, or use the terminal.' }
+ const draft = { id: randomUUID(), text }
+ this.entries.get(pin.agentId)!.drafts.set(pin.index, draft)
+ return { ok: true, draftId: draft.id, text: draft.text }
+ }
+
+ submit(agentId: string, token: string, masks: unknown,
+ send: (answer: ReviewedAnswer) => Promise<AnswerReceipt>, drafts?: unknown): Promise<AnswerReceipt> {
+ const entry = this.entries.get(agentId)
+ const fail = (error: string) => Promise.resolve({ ok: false as const, error })
+ if (!entry || entry.token !== token) return fail('This question changed. Open it again.')
+ // A receipt, including uncertainty after keys may have been sent, never retries input.
+ if (entry.submitted) return entry.submitted
+ if (!Array.isArray(masks) || masks.length !== entry.questions.length) return fail('Review every answer first.')
+ if (drafts !== undefined && (!Array.isArray(drafts) || drafts.length !== masks.length ||
+ drafts.some(id => typeof id !== 'string'))) return fail('Review every answer first.')
+ const freeTextKeys: string[] = []
+ const answers: Record<string, string> = Object.create(null)
+ const selections: Record<string, string[]> = Object.create(null)
+ for (let i = 0; i < masks.length; i++) {
+ const mask = masks[i], q = entry.questions[i]
+ const draftId = Array.isArray(drafts) ? drafts[i] : ''
+ if (draftId) {
+ const draft = entry.drafts.get(i)
+ if (mask !== 0 || !q.canText || q.multi || !draft || draft.id !== draftId)
+ return fail('Review the spoken answer again.')
+ answers[q.key] = draft.text; selections[q.key] = []; freeTextKeys.push(q.key)
+ continue
+ }
+ if (!Number.isInteger(mask) || mask < 1 || mask >= (1 << q.options.length) ||
+ (!q.multi && (mask & (mask - 1)))) return fail('Choose an answer from this question.')
+ selections[q.key] = q.options.filter((_, j) => mask & (1 << j))
+ answers[q.key] = selections[q.key].join(', ')
+ }
+ // Install the receipt before invoking any asynchronous terminal work.
+ entry.submitted = Promise.resolve().then(() => this.entries.get(agentId) === entry
+ ? send({ agentId, requestId: entry.id, questions: entry.questions, answers, selections, ...(freeTextKeys.length ? { freeTextKeys } : {}) })
+ : { ok: false as const, error: 'This question changed. Open it again.' })
+ .catch(() => ({ ok: false as const, error: 'Could not confirm the answer. Check the terminal.' }))
+ return entry.submitted
+ }
+}
diff --git a/cli/src/cable/terminalActivity.spec.ts b/cli/src/cable/terminalActivity.spec.ts
new file mode 100644
index 000000000..0d975b6ae
--- /dev/null
+++ b/cli/src/cable/terminalActivity.spec.ts
@@ -0,0 +1,45 @@
+import { describe, expect, it } from 'vitest'
+import { terminalActivity } from './terminalActivity.js'
+
+describe('terminalActivity', () => {
+ it.each([
+ ['codex', '◦ Working (27m 18s • esc to interrupt)', 'Working'],
+ ['codex', '• Thinking (1s • esc to interrupt)', 'Thinking'],
+ ['claude', '✻ Coalescing… (1m 7s · ↓ 2.2k tokens)', 'Coalescing...'],
+ ['claude', '\x1b[33m✳ Boogieing...\x1b[0m', 'Boogieing...'],
+ ['claude', '✢ Crunching…', 'Crunching...'],
+ ['claude', '✶ Coalescing… (1h 11m 34s · ↓ 31.2k tokens)', 'Coalescing...'],
+ ['claude', '· Compacting conversation… (25s · ↓ 1.3k tokens)', 'Compacting conversation...'],
+ ])('copies the %s footer verbatim, normalizing only the ellipsis glyph', (engine, screen, label) => {
+ expect(terminalActivity(engine, screen)).toBe(label)
+ })
+ it.each([
+ ['claude', '✻ Baked for 1m 41s · done 10:29 AM'],
+ ['codex', 'Working'],
+ ['codex', '◦ Running tmux capture-pane -p -J -t %2'],
+ ['claude', 'Coalescing...'],
+ ['claude', 'The agent says ✻ Coalescing…'],
+ ['terminal', '• Working (1s • esc to interrupt)'],
+ ])('does not turn %s output into a status: %s', (engine, screen) => {
+ expect(terminalActivity(engine, screen)).toBeNull()
+ })
+ it('finds the Claude activity above an expanded agent tree', () => {
+ const screen = [
+ 'tool output', '✶ Wandering… (19m 0s · ↓ 52.6k tokens)',
+ ' Tip: Use /btw for a quick question', '', '──────────────────',
+ '❯\u00a0', '──────────────────',
+ ' ⏵⏵ auto mode on (shift+tab to cycle) · esc to interrupt',
+ ' ◎ /goal active (41m)', '', ' ● main',
+ ...Array.from({length: 12}, (_, i) => ` ◯ general-purpose Task ${i}`), '',
+ ].join('\n')
+ expect(terminalActivity('claude', screen)).toBe('Wandering...')
+ // An old spinner in output cannot replace the live one near the input.
+ expect(terminalActivity('claude', '✻ Coalescing…\n' + screen)).toBe('Wandering...')
+ // Without Claude's actual footer, a quoted prompt does not widen the search.
+ expect(terminalActivity('claude', screen.replace('shift+tab to cycle', 'help').replace('esc to interrupt', ''))).toBeNull()
+ })
+ it('ignores history above the live footer and prefers its last matching row', () => {
+ expect(terminalActivity('claude', '✻ Coalescing…\n' + '\n'.repeat(17))).toBeNull()
+ expect(terminalActivity('codex', '• Thinking (1s • esc to interrupt)\n◦ Working (2s • esc to interrupt)')).toBe('Working')
+ })
+})
diff --git a/cli/src/cable/terminalActivity.ts b/cli/src/cable/terminalActivity.ts
new file mode 100644
index 000000000..18d9f4f6d
--- /dev/null
+++ b/cli/src/cable/terminalActivity.ts
@@ -0,0 +1,27 @@
+/** Read only an engine's live footer. No generated status words or transcript inference. */
+export function terminalActivity(engine: string, screen: string | null): string | null {
+ if (!screen || (engine !== 'claude' && engine !== 'codex')) return null
+ const lines = screen.replace(/\x1b\][^\x07]*(?:\x07|\x1b\\)/g, '')
+ .replace(/\x1b\[[0-?]*[ -/]*[@-~]/g, '').split(/\r?\n/)
+ let end = lines.length
+ if (engine === 'claude') {
+ // The expanded agent tree sits BELOW the prompt and can push the live
+ // spinner out of the last 16 rows. Anchor to the actual input/footer pair,
+ // retaining a short search above it instead of scanning old output.
+ for (let i = lines.length - 1; i >= Math.max(0, lines.length - 64); i--) {
+ if (/^\s*[❯›>](?:\s|$)/u.test(lines[i]) &&
+ lines.slice(i + 1, i + 9).some(line => /shift\+tab to cycle|esc to interrupt/i.test(line))) {
+ end = i
+ break
+ }
+ }
+ }
+ for (let i = end - 1; i >= Math.max(0, end - 16); i--) {
+ const line = lines[i].trim()
+ const match = engine === 'codex'
+ ? /^[•◦⠁-⣿]\s+(.{1,60}?)\s+\([^\n]*\besc to interrupt\b[^\n]*\)\s*$/i.exec(line)
+ : /^[✢✳✶✻✽·*]\s+([\p{L}][\p{L}\p{N} '\u2019-]{0,55}(?:…|\.{3}))(?:\s+\([^\n]*\))?\s*$/u.exec(line)
+ if (match) return match[1].trim().replace(/…/g, '...')
+ }
+ return null
+}
diff --git a/cli/src/cable/voiceDraft.spec.ts b/cli/src/cable/voiceDraft.spec.ts
new file mode 100644
index 000000000..524257be9
--- /dev/null
+++ b/cli/src/cable/voiceDraft.spec.ts
@@ -0,0 +1,118 @@
+import { describe, expect, it, vi } from 'vitest'
+import { VoiceDraft, type DraftState } from './voiceDraft.js'
+
+function setup(text = 'Keep the public API.') {
+ const drafts = new VoiceDraft()
+ const submit = vi.fn(async (_text: string) => ({ ok: true as const }))
+ const page = drafts.create({ agentId: 'original-agent', name: 'Parser', text, submit })
+ return { drafts, submit, page }
+}
+
+describe('voice draft ownership and receipts', () => {
+ it('sends the exact transcript only after explicit Send, with one receipt', async () => {
+ const { drafts, page, submit } = setup('One.\n\n Two. ')
+ expect(submit).not.toHaveBeenCalled()
+ const [a, b] = await Promise.all([drafts.command(page.id, page.revision, 'send'), drafts.command(page.id, page.revision, 'send')])
+ expect(a).toEqual(b); expect(a.sent).toBe(true)
+ expect(submit).toHaveBeenCalledExactlyOnceWith('One.\n\n Two. ')
+ expect(await drafts.command(page.id, 0, 'state')).toEqual(a)
+ })
+ it('pages over UTF-8 without losing whitespace or splitting characters', async () => {
+ const text = ('Café déjà vu.\n\n Keep this spacing! ').repeat(100)
+ const { drafts, submit, page } = setup(text)
+ let p = page, joined = ''
+ for (;;) {
+ expect(Buffer.byteLength(p.text!, 'utf8')).toBeLessThanOrEqual(480)
+ expect(p.text).not.toContain('\ufffd'); joined += p.text
+ if (p.position === p.total) break
+ p = await drafts.command(p.id, p.revision, 'move', 1)
+ }
+ expect(joined).toBe(text)
+ await drafts.command(p.id, p.revision, 'send')
+ expect(submit).toHaveBeenCalledExactlyOnceWith(text)
+ })
+ it('replaces only the pinned part, appends, and undoes exactly one edit', async () => {
+ const { drafts, page, submit } = setup('first '.repeat(100)+'last')
+ const suffix = ('first '.repeat(100)+'last').slice(page.text!.length)
+ const edited = drafts.edit(drafts.pin(page.id, page.revision, 'replace')!, 'A replacement.')
+ expect(edited.canUndo).toBe(true)
+ const appended = drafts.edit(drafts.pin(edited.id, edited.revision, 'append')!, 'And tests.')
+ const undone = await drafts.command(appended.id, appended.revision, 'undo')
+ expect(undone.canUndo).toBe(false)
+ await drafts.command(undone.id, undone.revision, 'send')
+ expect(submit).toHaveBeenCalledExactlyOnceWith('A replacement. '+suffix)
+ })
+ it('refuses a late edit after the reading cursor moved', async () => {
+ const { drafts, page } = setup('part '.repeat(300))
+ const pin = drafts.pin(page.id, page.revision, 'replace')!
+ const next = await drafts.command(page.id, page.revision, 'move', 1)
+ expect(drafts.edit(pin, 'Wrong part').ok).toBe(false)
+ expect((await drafts.command(page.id, next.revision, 'state')).text).toBe(next.text)
+ })
+ it('never retries an uncertain send and blocks discard while delivery is pending', async () => {
+ let reject!: (e: Error) => void
+ const submit = vi.fn(() => new Promise<{ok:true}>((_resolve, r) => { reject = r }))
+ const drafts = new VoiceDraft(), p = drafts.create({ agentId: 'a', name: 'A', text: 'Once.', submit })
+ const sending = drafts.command(p.id, p.revision, 'send'); await Promise.resolve()
+ expect((await drafts.command(p.id, p.revision, 'discard')).active).toBe(true)
+ expect(drafts.pin(p.id, p.revision, 'replace')).toBeUndefined()
+ reject(new Error('timeout'))
+ const receipt = await sending
+ expect(receipt).toMatchObject({ active: true, locked: true, ok: false })
+ expect(await drafts.command(p.id, p.revision, 'send')).toEqual(receipt)
+ expect(submit).toHaveBeenCalledTimes(1)
+ expect((await drafts.command(p.id, p.revision, 'discard')).active).toBe(false)
+ })
+ it('locks a refused send without consuming its pinned context', async () => {
+ const drafts = new VoiceDraft(), submit = vi.fn(async () => ({ ok: false as const, error: 'Offline' }))
+ const p = drafts.create({ agentId: 'a', name: 'A', text: 'Read this.', carryId: 'quote', context: 'From B', submit })
+ expect(await drafts.command(p.id, p.revision, 'send')).toMatchObject({ ok: false, active: true, locked: true, context: 'From B' })
+ await drafts.command(p.id, p.revision, 'send'); expect(submit).toHaveBeenCalledTimes(1)
+ })
+ it('can recover a successful receipt after a lost reply', async () => {
+ const { drafts, page, submit } = setup()
+ await drafts.command(page.id, page.revision, 'send')
+ expect(await drafts.command(page.id, page.revision, 'state')).toMatchObject({ active: false, sent: true })
+ expect(submit).toHaveBeenCalledTimes(1)
+ })
+ it('discards with no submission and invalidates the recording pin', async () => {
+ const { drafts, page, submit } = setup(), pin = drafts.pin(page.id, page.revision, 'replace')!
+ await drafts.command(page.id, page.revision, 'discard')
+ expect(drafts.edit(pin, 'late words').ok).toBe(false); expect(submit).not.toHaveBeenCalled()
+ })
+ it('cancels unseen creation without deleting an edited or submitted draft', async () => {
+ const a = setup(); a.drafts.cancelCreation(a.page.id)
+ expect((await a.drafts.command(a.page.id, 1, 'state')).active).toBe(false)
+ const b = setup(), p = b.drafts.edit(b.drafts.pin(b.page.id, 1, 'append')!, 'More.')
+ b.drafts.cancelCreation(p.id)
+ expect((await b.drafts.command(p.id, p.revision, 'state')).active).toBe(true)
+ await b.drafts.command(p.id, p.revision, 'send'); b.drafts.cancelCreation(p.id)
+ expect((await b.drafts.command(p.id, p.revision, 'state')).sent).toBe(true)
+ })
+ it('allows unsupported characters to be replaced but never sends hidden characters', async () => {
+ const { drafts, page, submit } = setup('Fix “this” please. 🚀')
+ expect(page.canSend).toBe(false)
+ expect((await drafts.command(page.id, 1, 'send')).ok).toBe(false); expect(submit).not.toHaveBeenCalled()
+ const p = drafts.edit(drafts.pin(page.id, 1, 'replace')!, 'Fix this please.')
+ expect(p.canSend).toBe(true)
+ await drafts.command(p.id, p.revision, 'send'); expect(submit).toHaveBeenCalledExactlyOnceWith('Fix this please.')
+ })
+ it.each(['', ' '.repeat(10), 'x'.repeat(16001), 'a\tb', 'a\0b', 'a\x1bb'])('rejects invalid text %#', text => {
+ expect(setup(text).page.ok).toBe(false)
+ })
+ it('bounds cumulative edits and preserves the old draft on failure', async () => {
+ const { drafts, page } = setup('a'.repeat(15900))
+ expect(drafts.edit(drafts.pin(page.id, 1, 'append')!, 'b'.repeat(200)).ok).toBe(false)
+ expect((await drafts.command(page.id, 1, 'state')).revision).toBe(1)
+ })
+ it('does not let a cleared pending receipt describe a new draft', async () => {
+ let resolve!: (v:{ok:true}) => void
+ const drafts = new VoiceDraft()
+ const old = drafts.create({ agentId: 'a', name:'A', text:'Old', submit: () => new Promise(r => {resolve=r}) })
+ const result = drafts.command(old.id, 1, 'send'); await Promise.resolve(); drafts.clear()
+ const next = drafts.create({ agentId:'b', name:'B', text:'New', submit:async()=>({ok:true}) })
+ resolve({ok:true}); const receipt: DraftState = await result
+ expect(receipt.id).toBe(old.id)
+ expect(await drafts.command(next.id, 1, 'state')).toMatchObject({ text:'New', active:true })
+ })
+})
diff --git a/cli/src/cable/voiceDraft.ts b/cli/src/cable/voiceDraft.ts
new file mode 100644
index 000000000..8dab6f843
--- /dev/null
+++ b/cli/src/cable/voiceDraft.ts
@@ -0,0 +1,122 @@
+import { randomUUID } from 'node:crypto'
+
+export type DraftState = {
+ ok: boolean; active: boolean; id: string; revision: number; agentId?: string; name?: string
+ context?: string; text?: string; position?: number; total?: number; canUndo?: boolean
+ locked?: boolean; canSend?: boolean; error?: string; sent?: boolean; carryId?: string
+}
+export type DraftPin = { id: string; revision: number; mode: 'replace' | 'append' }
+type Span = { start: number; end: number }
+type Receipt = { ok: true } | { ok: false; error: string }
+type Entry = {
+ id: string; revision: number; agentId: string; name: string; context: string; text: string; index: number
+ carryId?: string; undo?: { text: string; index: number }; error?: string
+ sent?: boolean; settled?: boolean; receipt?: Promise<DraftState>; submit: (text: string) => Promise<Receipt>
+}
+const MAX_BYTES = 16_000, PART_BYTES = 480
+
+/** Bounded viewports over the exact transcript; joining the spans loses no whitespace. */
+function spans(text: string): Span[] {
+ const out: Span[] = []
+ let start = 0
+ while (start < text.length) {
+ let end = start, bytes = 0, boundary = start
+ for (const cp of text.slice(start)) {
+ const n = Buffer.byteLength(cp, 'utf8')
+ if (bytes + n > PART_BYTES) break
+ end += cp.length; bytes += n
+ if (/\s/.test(cp)) boundary = end
+ }
+ if (end < text.length && boundary > start + (end - start) / 2) end = boundary
+ out.push({ start, end }); start = end
+ }
+ return out
+}
+function valid(text: string): boolean {
+ return !!text.trim() && Buffer.byteLength(text, 'utf8') <= MAX_BYTES &&
+ !/[\x00-\x09\x0b-\x1f\x7f-\x9f]/.test(text)
+}
+export class VoiceDraft {
+ private entry?: Entry
+
+ clear(): void { this.entry = undefined }
+ cancelCreation(id: string): void {
+ const e = this.entry
+ if (e?.id === id && e.revision === 1 && !e.receipt) this.clear()
+ }
+ create(input: { agentId: string; name: string; text: string; context?: string; carryId?: string;
+ submit: Entry['submit'] }): DraftState {
+ if (this.entry && !this.entry.sent) return this.fail('Finish or discard your existing draft.')
+ if (!input.agentId || !valid(input.text)) return this.fail('Record a shorter message to review.')
+ this.entry = { ...input, id: randomUUID(), revision: 1, index: 0, context: input.context ?? '' }
+ return this.state()
+ }
+ pin(id: string, revision: number, mode: unknown): DraftPin | undefined {
+ const e = this.entry
+ return e && e.id === id && e.revision === revision && !e.receipt &&
+ (mode === 'replace' || mode === 'append') ? { id, revision, mode } : undefined
+ }
+ current(pin: DraftPin): boolean { return !!this.pin(pin.id, pin.revision, pin.mode) }
+ edit(pin: DraftPin, words: string): DraftState {
+ if (!this.current(pin)) return this.fail('The draft changed. Open it again.')
+ const e = this.entry!, part = spans(e.text)[e.index]
+ const old = e.text.slice(part.start, part.end)
+ const replacement = (old.match(/^\s*/)?.[0] ?? '') + words.trim() + (old.match(/\s*$/)?.[0] ?? '')
+ const text = pin.mode === 'append' ? `${e.text}\n\n${words.trim()}`
+ : e.text.slice(0, part.start) + replacement + e.text.slice(part.end)
+ if (!words.trim() || !valid(text)) return this.fail('That edit is too long. Try a shorter part.')
+ e.undo = { text: e.text, index: e.index }; e.text = text; e.revision++
+ if (pin.mode === 'append') e.index = spans(text).length - 1
+ else e.index = Math.min(e.index, spans(text).length - 1)
+ e.error = undefined
+ return this.state()
+ }
+ async command(id: string, revision: number, op: string, delta = 0): Promise<DraftState> {
+ const e = this.entry
+ if (!e || e.id !== id) return { ok: false, active: false, id, revision, error: 'This draft is no longer available.' }
+ if (op === 'state') return this.state()
+ if (op === 'send' && e.receipt) return e.receipt
+ if (revision !== e.revision) return this.fail('The draft changed. Review it again.')
+ if (op === 'discard') {
+ if (e.receipt && !e.settled) return this.fail('Sending is still in progress. Check its status.')
+ const state = e.sent ? this.state(e) : { ok: true, active: false, id, revision }
+ this.clear(); return state
+ }
+ if (e.receipt) return this.fail('Check the terminal before trying again.')
+ if (op === 'move' && Number.isInteger(delta) && (delta === -1 || delta === 1)) {
+ e.index = Math.max(0, Math.min(spans(e.text).length - 1, e.index + delta)); e.revision++
+ } else if (op === 'undo' && e.undo) {
+ e.text = e.undo.text; e.index = e.undo.index; e.undo = undefined; e.revision++
+ } else if (op === 'send') {
+ if (!/^[\n\x20-\x7e\u00a0-\u00ff]*$/u.test(e.text))
+ return this.fail('Some words cannot display. Edit them before sending.')
+ // Claim before asynchronous input. An uncertain receipt is never retried automatically.
+ e.receipt = Promise.resolve().then(async () => {
+ if (this.entry !== e) return { ok: false, active: false, id, revision, error: 'Draft discarded.' }
+ try {
+ const result = await e.submit(e.text)
+ if (!result.ok) { e.error = result.error; return this.state(e) }
+ e.sent = true
+ return { ok: true, active: false, id, revision, sent: true, carryId: e.carryId }
+ } catch {
+ e.error = 'Could not confirm sending. Check the terminal before retrying.'
+ return this.state(e)
+ } finally {
+ e.settled = true
+ }
+ })
+ return e.receipt
+ } else return this.fail('Choose an available draft action.')
+ e.error = undefined
+ return this.state()
+ }
+ private fail(error: string): DraftState { return { ...this.state(), ok: false, error } }
+ private state(e = this.entry): DraftState {
+ if (!e) return { ok: false, active: false, id: '', revision: 0 }
+ if (e.sent) return { ok: true, active: false, id: e.id, revision: e.revision, sent: true, carryId: e.carryId }
+ const parts = spans(e.text), part = parts[e.index]
+ return { ok: !e.error, active: true, id: e.id, revision: e.revision, agentId: e.agentId, name: e.name,
+ context: e.context, text: e.text.slice(part.start, part.end), position: e.index + 1, total: parts.length,
+ canUndo: !!e.undo, canSend: /^[\n\x20-\x7e\u00a0-\u00ff]*$/u.test(e.text), locked: !!e.receipt, error: e.error }
+ }
+}
diff --git a/cli/src/cable/windowForm.spec.ts b/cli/src/cable/windowForm.spec.ts
new file mode 100644
index 000000000..49a135dfe
--- /dev/null
+++ b/cli/src/cable/windowForm.spec.ts
@@ -0,0 +1,131 @@
+import { afterEach, expect, it, vi } from 'vitest'
+import { WindowForm } from './windowForm.js'
+
+function fixture() {
+ let focus: { connId: string; machineId: string } | undefined = { connId: 'desk', machineId: 'local' }
+ const frames: { connId: string; payload: Record<string, unknown> }[] = []
+ let writable = true
+ const form = new WindowForm({ focus: () => focus, timeoutMs: 100,
+ send: (connId, payload) => { frames.push({ connId, payload }); return writable } })
+ return { form, frames, focus: (value: typeof focus) => { focus = value }, offline: () => { writable = false },
+ answer: (extra: Record<string, unknown> = {}, connId = 'desk', machineId = 'local') => {
+ const p = frames.at(-1)!.payload
+ form.reply(connId, machineId, { requestId: p.requestId, formId: p.formId,
+ ok: true, active: true, revision: 1, position: 4, total: 4,
+ title: 'New Harness', label: 'New Harness', detail: 'Codex\nM2:~/project',
+ busy: false, enabled: true, action: 'start', ...extra })
+ },
+ }
+}
+const open = { op: 'open' as const, formId: 'form-one' }
+afterEach(() => vi.useRealTimers())
+
+it('pins an empty or populated window; choosing a remote project does not move the route', async () => {
+ const f = fixture(), result = f.form.command(open)
+ f.answer(); expect(await result).toMatchObject({ active: true, label: 'New Harness' })
+ f.focus({ connId: 'other', machineId: 'remote' })
+ const moved = f.form.command({ ...open, op: 'move', revision: 1, delta: 1 })
+ expect(f.frames.at(-1)?.connId).toBe('desk')
+ f.answer({ revision: 2 }); expect(await moved).toMatchObject({ revision: 2 })
+})
+it('ignores another socket, machine, form or request and serializes actions', async () => {
+ const f = fixture(), result = f.form.command(open)
+ f.answer({}, 'other'); f.answer({}, 'desk', 'remote')
+ f.answer({ formId: 'stale' }); f.answer({ requestId: 'stale' })
+ expect(await f.form.command(open)).toMatchObject({ ok: false })
+ expect(f.frames).toHaveLength(1)
+ f.answer(); expect(await result).toMatchObject({ ok: true })
+})
+it('times out without retrying activation or dismissing an uncertain launch', async () => {
+ vi.useFakeTimers()
+ const f = fixture(), opening = f.form.command(open); f.answer(); await opening
+ const launching = f.form.command({ ...open, op: 'activate', revision: 1 })
+ await vi.advanceTimersByTimeAsync(101)
+ expect(await launching).toMatchObject({ ok: false, error: expect.stringContaining('Check') })
+ expect(f.frames.map(f => f.payload.op)).toEqual(['open', 'activate'])
+ const state = f.form.command({ ...open, op: 'state', revision: 1 })
+ f.answer({ action: 'check status' }); expect(await state).toMatchObject({ action: 'check status' })
+})
+it('bounds UTF-8 output and rejects malformed state', async () => {
+ const f = fixture(), p = f.form.command(open)
+ f.answer({ detail: '猫'.repeat(200) })
+ const r = await p
+ expect(Buffer.byteLength(r.detail!)).toBeLessThanOrEqual(383)
+ expect(r.detail).toBe('猫'.repeat(127))
+ const bad = f.form.command({ ...open, op: 'state', revision: 1 })
+ f.answer({ revision: -1 }); expect(await bad).toMatchObject({ ok: false, active: false })
+})
+it('rejects invalid commands and obsolete identities without sending', async () => {
+ const f = fixture()
+ expect(await f.form.command({ ...open, op: 'activate', revision: 1 })).toMatchObject({ ok: false })
+ expect(await f.form.command({ ...open, op: 'move', delta: 0, revision: 1 })).toMatchObject({ ok: false })
+ expect(await f.form.command({ ...open, op: 'move', delta: 100, revision: 1 })).toMatchObject({ ok: false })
+ expect(await f.form.command({ ...open, formId: 'bad/id' })).toMatchObject({ ok: false })
+ expect(f.frames).toHaveLength(0)
+})
+it('handles disconnect and a missing desktop without navigating it', async () => {
+ const f = fixture(), opening = f.form.command(open)
+ f.form.clear(); expect(await opening).toMatchObject({ ok: false })
+ f.answer(); expect(f.frames).toHaveLength(1)
+ f.focus(undefined); expect(await f.form.command(open)).toMatchObject({ ok: false })
+ f.focus({ connId: 'desk', machineId: 'local' }); f.offline()
+ expect(await f.form.command(open)).toMatchObject({ ok: false })
+})
+
+it('settles only the disconnected window and never replays its pending action', async () => {
+ const f = fixture(), opened = f.form.command(open)
+ f.answer(); await opened
+ const activating = f.form.command({ ...open, op: 'activate', revision: 1 })
+ f.form.disconnected('background')
+ f.answer(); expect(await activating).toMatchObject({ ok: true })
+ const pending = f.form.command({ ...open, op: 'activate', revision: 1 })
+ f.form.disconnected('desk')
+ expect(await pending).toMatchObject({ ok: false, active: false, error: expect.stringContaining('disconnected') })
+ f.answer() // A reply already in flight cannot restore the old picker.
+ expect(await f.form.command({ ...open, op: 'state', revision: 1 })).toMatchObject({ ok: false })
+ expect(f.frames.map(frame => frame.payload.op)).toEqual(['open', 'activate', 'activate'])
+ f.focus({ connId: 'replacement', machineId: 'local' })
+ const fresh = f.form.command({ ...open, formId: 'find-reopened', surface: 'find' })
+ expect(f.frames.at(-1)?.connId).toBe('replacement')
+ f.answer({ canQuery: true }, 'replacement')
+ expect(await fresh).toMatchObject({ ok: true, canQuery: true })
+})
+
+it('logs loading and refusal flags without picker contents', async () => {
+ const log = vi.fn(), frames: Record<string, unknown>[] = []
+ const form = new WindowForm({ focus: () => ({ connId: 'desk', machineId: 'local' }), log,
+ send: (_conn, payload) => { frames.push(payload); return true } })
+ const pending = form.command({ ...open, surface: 'find' })
+ form.reply('desk', 'local', { ...frames[0], ok: false, active: false,
+ label: 'private harness name', query: 'private spoken query', error: 'Return to the Harness window first.' })
+ expect(await pending).toMatchObject({ ok: false })
+ expect(log).toHaveBeenCalledExactlyOnceWith('picker open reply ok=0 active=0 query=0 busy=0 reason=foreground-required')
+})
+
+it('pins a voice query to the form and cancels even while its reply is pending', async () => {
+ const f = fixture(), opening = f.form.command(open); f.answer(); await opening
+ const command = { ...open, op: 'query.begin' as const, queryId: 'upload', revision: 1 }
+ const pending = f.form.command(command)
+ f.answer({ canQuery: true, queryId: 'wrong' })
+ expect(await pending).toMatchObject({ ok: false })
+ const pinned = f.form.command(command)
+ f.answer({ canQuery: true, queryId: 'upload' })
+ expect(await pinned).toMatchObject({ ok: true, queryId: 'upload' })
+ const applying = f.form.command({ ...command, op: 'query', text: 'Codex' })
+ await f.form.command({ ...command, op: 'query.cancel' })
+ expect(await applying).toMatchObject({ ok: false })
+ expect(f.frames.at(-1)?.payload).toMatchObject({ op: 'query.cancel', queryId: 'upload' })
+})
+
+it('keeps Finder bound to its window and refuses changing a live surface identity', async () => {
+ const f = fixture(), opening = f.form.command({ ...open, surface: 'find' })
+ expect(f.frames.at(-1)?.payload).toMatchObject({ surface: 'find' })
+ f.answer({ title: 'Find Harness', label: 'Agent 69', action: 'open', canQuery: true })
+ expect(await opening).toMatchObject({ title: 'Find Harness' })
+ f.focus({ connId: 'other', machineId: 'remote' })
+ expect(await f.form.command({ ...open, surface: 'new' })).toMatchObject({ ok: false })
+ expect(f.frames).toHaveLength(1)
+ const state = f.form.command({ ...open, op: 'state', revision: 1 })
+ expect(f.frames.at(-1)?.connId).toBe('desk')
+ f.answer(); expect(await state).toMatchObject({ ok: true })
+})
diff --git a/cli/src/cable/windowForm.ts b/cli/src/cable/windowForm.ts
new file mode 100644
index 000000000..02969016f
--- /dev/null
+++ b/cli/src/cable/windowForm.ts
@@ -0,0 +1,147 @@
+import { randomUUID } from 'node:crypto'
+
+export interface FormCommand {
+ formId: string
+ surface?: 'new' | 'find'
+ op: 'open' | 'state' | 'move' | 'activate' | 'back' | 'close' | 'query.begin' | 'query' | 'query.cancel'
+ revision?: number
+ delta?: number
+ queryId?: string
+ text?: string
+}
+export interface FormResult {
+ ok: boolean; active: boolean; revision?: number
+ title?: string; label?: string; detail?: string; previous?: string; next?: string
+ error?: string; status?: string; action?: string
+ position?: number; total?: number; busy?: boolean; enabled?: boolean
+ canQuery?: boolean; query?: string; queryId?: string
+}
+interface Form { id: string; connId: string; machineId: string; surface: 'new' | 'find' }
+interface Pending { form: Form; requestId: string; command: FormCommand; resolve: (r: FormResult) => void; timer: ReturnType<typeof setTimeout> }
+
+/** The actual Cmd-N form or Cmd-P finder, in one exact desktop window. A timeout never retries
+ * activation: a lost launch reply must be inspected through the form's receipt. */
+export class WindowForm {
+ private form?: Form
+ private pending?: Pending
+ constructor(private readonly wiring: {
+ focus: () => { connId: string; machineId: string } | undefined
+ send: (connId: string, payload: Record<string, unknown>) => boolean
+ timeoutMs?: number
+ log?: (line: string) => void
+ }) {}
+
+ command(command: FormCommand): Promise<FormResult> {
+ const fail = (error: string): FormResult => {
+ // These are fixed product errors, never names, queries or transcripts.
+ this.wiring.log?.(`picker ${command.op} refused: ${error}`)
+ return { ok: false, active: false, error }
+ }
+ if (!/^[a-zA-Z0-9-]{1,48}$/.test(command.formId) ||
+ (command.surface !== undefined && !['new', 'find'].includes(command.surface)) ||
+ !['open', 'state', 'move', 'activate', 'back', 'close', 'query.begin', 'query', 'query.cancel'].includes(command.op) ||
+ (command.op.startsWith('query') && (typeof command.queryId !== 'string' || !/^[a-zA-Z0-9-]{1,64}$/.test(command.queryId))) ||
+ (command.op === 'query' && (typeof command.text !== 'string' || !command.text.trim() || command.text.length > 240)) ||
+ (command.op === 'move' && (!Number.isSafeInteger(command.delta) || !command.delta || Math.abs(command.delta) > 8)) ||
+ (command.op !== 'open' && (!Number.isSafeInteger(command.revision) || command.revision! < 0))) {
+ return Promise.resolve(fail('Invalid form command.'))
+ }
+ if (command.op === 'query.cancel') {
+ const form = this.form
+ if (form?.id === command.formId) {
+ if (this.pending?.command.queryId === command.queryId) this.finish(fail('Voice search cancelled.'))
+ this.wiring.send(form.connId, { ...command, requestId: randomUUID(), expiresAt: Date.now() + 2000 })
+ }
+ return Promise.resolve({ ok: true, active: false })
+ }
+ if (this.pending) return Promise.resolve(fail('Wait for the current choice.'))
+ if (command.op === 'open' && this.form?.id !== command.formId) {
+ const focus = this.wiring.focus()
+ if (!focus) return Promise.resolve(fail('Open Harness on this computer.'))
+ this.form = { id: command.formId, surface: command.surface ?? 'new', ...focus }
+ }
+ const form = this.form
+ if (!form || form.id !== command.formId) return Promise.resolve(fail('Open New Harness again.'))
+ if (command.surface !== undefined && command.surface !== form.surface) {
+ return Promise.resolve(fail('This picker has changed. Open it again.'))
+ }
+ const requestId = randomUUID(), timeout = this.wiring.timeoutMs ?? 2000
+ return new Promise(resolve => {
+ const timer = setTimeout(() => {
+ if (this.pending?.requestId !== requestId) return
+ this.finish(fail('No reply. Check Harness on desktop.'))
+ // Keep the window identity for a read-only state request. Never replay
+ // the action and never automatically dismiss an uncertain creation.
+ }, timeout)
+ this.pending = { form, requestId, command, resolve, timer }
+ if (!this.wiring.send(form.connId, { ...command, requestId, expiresAt: Date.now() + timeout })) {
+ this.finish(fail('Open Harness on this computer.'))
+ }
+ })
+ }
+
+ reply(connId: string, machineId: string, payload: Record<string, unknown>): void {
+ const p = this.pending
+ if (!p || p.form.connId !== connId || p.form.machineId !== machineId ||
+ p.form.id !== payload.formId || p.requestId !== payload.requestId) return
+ const invalid = () => this.finish({ ok: false, active: false, error: 'The app returned an invalid form.' })
+ if (typeof payload.ok !== 'boolean' || typeof payload.active !== 'boolean') return invalid()
+ const r: FormResult = { ok: payload.ok, active: payload.active }
+ // Bounded UTF-8 strings fit the small device without splitting a character.
+ const fields = { title: 79, label: 159, detail: 383, previous: 95, next: 95, error: 179, status: 95, action: 31, query: 239 } as const
+ for (const key of Object.keys(fields) as Array<keyof typeof fields>) {
+ const limit = fields[key]
+ const value = payload[key]
+ if (value !== undefined && typeof value !== 'string') return invalid()
+ if (typeof value === 'string') r[key] = utf8Prefix(value, limit)
+ }
+ if (r.active) {
+ for (const key of ['revision', 'position', 'total'] as const) {
+ const value = payload[key]
+ if (!Number.isSafeInteger(value) || (value as number) < 0 || (value as number) > 2147483647) return invalid()
+ r[key] = value as number
+ }
+ if (typeof payload.busy !== 'boolean' || typeof payload.enabled !== 'boolean') return invalid()
+ r.busy = payload.busy; r.enabled = payload.enabled
+ r.canQuery = payload.canQuery === true
+ }
+ if (p.command.op === 'query.begin' && r.ok) {
+ if (!r.active || !r.canQuery || payload.queryId !== p.command.queryId) return invalid()
+ r.queryId = payload.queryId as string
+ }
+ if (p.command.op !== 'state' || !r.ok) {
+ const reason = r.error === 'Return to the Harness window first.' ? 'foreground-required' :
+ r.error === 'Open the Harness workspace first.' ? 'workspace-required' :
+ r.error === 'Open harness search on desktop first.' ? 'finder-unavailable' : r.ok ? 'ready' : 'desktop-refused'
+ this.wiring.log?.(`picker ${p.command.op} reply ok=${Number(r.ok)} active=${Number(r.active)} query=${Number(r.canQuery === true)} busy=${Number(r.busy === true)} reason=${reason}`)
+ }
+ this.finish(r)
+ }
+
+ disconnected(connId: string): void {
+ if (this.form?.connId !== connId) return
+ this.form = undefined
+ this.finish({ ok: false, active: false, error: 'Harness disconnected. Open the picker again.' })
+ }
+
+ clear(): void {
+ this.form = undefined
+ this.finish({ ok: false, active: false, error: 'Device disconnected.' })
+ }
+
+ private finish(r: FormResult): void {
+ const p = this.pending
+ this.pending = undefined
+ if (p) { clearTimeout(p.timer); p.resolve(r) }
+ }
+}
+
+function utf8Prefix(text: string, cap: number): string {
+ let result = '', used = 0
+ for (const c of text) {
+ const bytes = Buffer.byteLength(c)
+ if (used + bytes > cap) break
+ result += c; used += bytes
+ }
+ return result
+}
diff --git a/cli/src/cable/windowSelection.spec.ts b/cli/src/cable/windowSelection.spec.ts
new file mode 100644
index 000000000..96af5c86b
--- /dev/null
+++ b/cli/src/cable/windowSelection.spec.ts
@@ -0,0 +1,161 @@
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { WindowSelection, withSelectedPassage, type SelectionFocus } from './windowSelection.js'
+
+function fixture() {
+ let focus: SelectionFocus | undefined = { connId: 'window-a', machineId: 'remote', agentId: 'agent-a' }
+ const frames: Array<{ connId: string; payload: Record<string, unknown> }> = []
+ const send = vi.fn((connId: string, payload: Record<string, unknown>) => { frames.push({ connId, payload }); return true })
+ const cursor = new WindowSelection({ focus: () => focus, send, timeoutMs: 100 })
+ const answer = (extra: Record<string, unknown> = {}, index = frames.length - 1, connId = 'window-a', machineId = 'remote') => {
+ cursor.reply(connId, machineId, { ...frames[index]!.payload, ok: true, rows: 1, excerpt: 'chosen line', extending: false, ...extra })
+ }
+ return { cursor, frames, answer, send, focus: (value: SelectionFocus | undefined) => { focus = value } }
+}
+afterEach(() => vi.useRealTimers())
+
+describe('device passage selection', () => {
+ it('uses the exact focused window and pins its selected text once', async () => {
+ const f = fixture()
+ const begin = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ expect(f.frames[0]!.connId).toBe('window-a')
+ f.answer()
+ const first = await begin
+ expect(first.ok).toBe(true)
+ if (!first.ok) return
+ const move = f.cursor.command({ op: 'step', agentId: 'agent-a', selectionId: first.selectionId, revision: first.revision, delta: 2 })
+ f.answer({ excerpt: 'second line' })
+ const moved = await move
+ if (!moved.ok) throw new Error('move failed')
+ const pin = f.cursor.command({ op: 'pin', agentId: 'agent-a', selectionId: moved.selectionId, revision: moved.revision })
+ f.answer({ text: ' 雪 and café\nnext line' })
+ expect(await pin).toMatchObject({ ok: true, text: ' 雪 and café\nnext line' })
+ await expect(f.cursor.command({ op: 'pin', agentId: 'agent-a', selectionId: moved.selectionId, revision: moved.revision + 1 })).resolves.toMatchObject({ ok: false })
+ f.cursor.cancel()
+ })
+
+ it('ignores a forged window, machine, id, revision, and late result', async () => {
+ const f = fixture()
+ const pending = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ const done = vi.fn()
+ void pending.then(done)
+ f.answer({}, 0, 'other-window')
+ f.answer({}, 0, 'window-a', 'other-machine')
+ f.answer({ agentId: 'other-agent' })
+ f.answer({ revision: 999 })
+ f.answer({ requestId: 'old-request' })
+ await Promise.resolve()
+ expect(done).not.toHaveBeenCalled()
+ f.answer()
+ expect((await pending).ok).toBe(true)
+ f.cursor.cancel()
+ f.answer({}, 0)
+ expect(f.frames).toHaveLength(2)
+ })
+
+ it('a changed focus or disconnect invalidates selection instead of retargeting', async () => {
+ for (const focus of [undefined, { connId: 'window-a', machineId: 'remote', agentId: 'agent-b' }]) {
+ const f = fixture()
+ const begin = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ f.focus(focus)
+ f.answer({}, 0)
+ expect(await begin).toMatchObject({ ok: false, error: expect.stringContaining('changed') })
+ expect(f.frames.at(-1)?.payload.op).toBe('cancel')
+ expect(f.frames.at(-1)?.payload.agentId).toBe('agent-a')
+ }
+ })
+
+ it('superseding a cursor releases the old waiter and rejects stale revision', async () => {
+ const f = fixture()
+ const old = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ const current = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ expect((await old).ok).toBe(false)
+ f.answer()
+ const state = await current
+ if (!state.ok) throw new Error('begin failed')
+ expect((await f.cursor.command({ op: 'step', agentId: 'agent-a', selectionId: state.selectionId, revision: 0, delta: 1 })).ok).toBe(false)
+ f.cursor.cancel()
+ })
+
+ it('missing or old desktop times out without retry or agent input', async () => {
+ vi.useFakeTimers()
+ const f = fixture()
+ const result = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ await vi.advanceTimersByTimeAsync(100)
+ expect(await result).toMatchObject({ ok: false, error: expect.stringContaining('did not answer') })
+ expect(f.frames.map(x => x.payload.op)).toEqual(['begin', 'cancel'])
+ })
+
+ it.each([{ rows: 17 }, { excerpt: 'x'.repeat(241) }, { rows: NaN }, { extending: 'yes' }])('bounds malformed desktop state %s', async extra => {
+ const f = fixture()
+ const pending = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ f.answer(extra)
+ expect((await pending).ok).toBe(false)
+ })
+
+ it('a canceled recording cannot cancel a replacement selection', async () => {
+ const f = fixture()
+ const pending = f.cursor.command({ op: 'begin', agentId: 'agent-a' })
+ f.answer()
+ const state = await pending
+ if (!state.ok) throw new Error('begin failed')
+ await f.cursor.command({ op: 'cancel', agentId: 'agent-a', selectionId: 'old' })
+ const move = f.cursor.command({ op: 'step', agentId: 'agent-a', selectionId: state.selectionId, revision: 1, delta: 1 })
+ f.answer()
+ expect((await move).ok).toBe(true)
+ f.cursor.cancel()
+ })
+
+ it('keeps spoken words exact and terminal output visibly quoted', () => {
+ expect(withSelectedPassage('Explain this.', 'first\n</quote>\n next'))
+ .toBe('Explain this.\n\nContext I selected from this agent\'s terminal:\n> first\n> </quote>\n> next')
+ })
+})
+
+
+describe('spoken output search cursor', () => {
+ async function ready() {
+ const f = fixture(), p = f.cursor.command({ op: 'begin', agentId: 'agent-a', selectionId: 'pick' })
+ f.answer(); await p
+ return f
+ }
+ const c = { agentId: 'agent-a', selectionId: 'pick', revision: 1 }
+ it('read locks the exact current cursor without another desktop frame', async () => {
+ const f = await ready()
+ expect(await f.cursor.command({ ...c, op: 'read' })).toMatchObject({ ok: true, revision: 1 })
+ expect(f.frames).toHaveLength(1)
+ expect((await f.cursor.command({ ...c, op: 'read', revision: 0 })).ok).toBe(false)
+ f.cursor.cancel()
+ })
+ it('zero matches remain searchable; matches step and line mode removes the query', async () => {
+ const f = await ready()
+ const p = f.cursor.command({ ...c, op: 'search', query: 'absent' })
+ f.answer({ rows: 0, excerpt: '', match: 0, matches: 0 })
+ expect(await p).toMatchObject({ ok: true, revision: 2, matches: 0 })
+ const retry = f.cursor.command({ ...c, revision: 2, op: 'search', query: 'error [x]' })
+ f.answer({ match: 1, matches: 2 }); expect((await retry).ok).toBe(true)
+ const moved = f.cursor.command({ ...c, revision: 3, op: 'match', delta: -1 })
+ f.answer({ query: 'error [x]', match: 2, matches: 2 }); expect((await moved).ok).toBe(true)
+ expect((await f.cursor.command({ ...c, revision: 4, op: 'step', delta: 1 })).ok).toBe(false)
+ const lines = f.cursor.command({ ...c, revision: 4, op: 'lines' })
+ f.answer(); expect(await lines).toMatchObject({ ok: true, revision: 5 })
+ expect((await f.cursor.command({ ...c, revision: 5, op: 'match', delta: 1 })).ok).toBe(false)
+ f.cursor.cancel()
+ })
+ it.each(['', ' ', 'x'.repeat(121), '雪'.repeat(41), 'unsafe\nline'])('rejects invalid query %j without a frame', async query => {
+ const f = await ready()
+ expect((await f.cursor.command({ ...c, op: 'search', query })).ok).toBe(false)
+ expect(f.frames).toHaveLength(1); f.cursor.cancel()
+ })
+ it.each([{ matches: 0, match: 1 }, { matches: -1, match: 0 }, { matches: 1, match: 2 },
+ { matches: 1.5, match: 1 }, { query: null, matches: 1, match: 1 }, { matches: 0, match: 0, rows: 0 }])(
+ 'rejects malformed match metadata %j', async fields => {
+ const f = await ready(), p = f.cursor.command({ ...c, op: 'search', query: 'word' })
+ f.answer(fields); expect((await p).ok).toBe(false)
+ })
+ it('cancellation and a changed window discard pending search results', async () => {
+ const f = await ready(), p = f.cursor.command({ ...c, op: 'search', query: 'word' })
+ f.focus({ connId: 'another-window', machineId: 'remote', agentId: 'agent-a' })
+ f.answer({ match: 1, matches: 1 }); expect((await p).ok).toBe(false)
+ expect(f.frames.at(-1)?.payload.op).toBe('cancel')
+ })
+})
diff --git a/cli/src/cable/windowSelection.ts b/cli/src/cable/windowSelection.ts
new file mode 100644
index 000000000..012d8970a
--- /dev/null
+++ b/cli/src/cable/windowSelection.ts
@@ -0,0 +1,172 @@
+import { randomUUID } from 'node:crypto'
+
+export interface SelectionFocus { connId: string; machineId: string; agentId: string }
+export interface SelectionCommand {
+ agentId: string
+ op: 'begin' | 'step' | 'extend' | 'pin' | 'cancel' | 'read' | 'search' | 'match' | 'lines'
+ selectionId?: string
+ revision?: number
+ delta?: number
+ extend?: boolean
+ query?: string
+}
+export type SelectionResult = { ok: false; error: string } | {
+ ok: true; selectionId: string; revision: number; excerpt: string; rows: number; extending: boolean
+ text?: string
+ query?: string; match?: number; matches?: number
+}
+
+interface Selection extends SelectionFocus {
+ id: string
+ revision: number
+ pinned: boolean
+ last?: Extract<SelectionResult, { ok: true }>
+}
+interface Pending {
+ selection: Selection
+ requestId: string
+ revision: number
+ op: SelectionCommand['op']
+ resolve: (result: SelectionResult) => void
+ timer: ReturnType<typeof setTimeout>
+}
+
+/** One reading cursor on THIS desk. A request goes to the exact connection
+ * that reported app_focus, including when that socket views a remote machine.
+ * No cloud broadcast, inferred recipient, automatic retry, or terminal input. */
+export class WindowSelection {
+ private selection?: Selection
+ private pending?: Pending
+ constructor(private readonly wiring: {
+ focus: () => SelectionFocus | undefined
+ send: (connId: string, payload: Record<string, unknown>) => boolean
+ timeoutMs?: number
+ }) {}
+
+ async command(command: SelectionCommand): Promise<SelectionResult> {
+ if (command.op === 'cancel') {
+ const current = this.selection
+ if (current && current.id === command.selectionId && current.agentId === command.agentId) this.cancel()
+ return { ok: false, error: 'Selection closed.' }
+ }
+ const focus = this.wiring.focus()
+ if (!focus || focus.agentId !== command.agentId) {
+ this.cancel()
+ return { ok: false, error: 'Select that pane in Harness first.' }
+ }
+ if (command.op === 'begin') {
+ if (command.selectionId !== undefined && !/^[a-zA-Z0-9-]{1,48}$/.test(command.selectionId)) {
+ return { ok: false, error: 'Invalid selection identity.' }
+ }
+ this.cancel()
+ this.selection = { ...focus, id: command.selectionId ?? randomUUID(), revision: 0, pinned: false }
+ }
+ const selection = this.selection
+ if (!selection || !sameFocus(focus, selection) ||
+ (command.op !== 'begin' && (selection.id !== command.selectionId || selection.revision !== command.revision))) {
+ return { ok: false, error: 'That selection expired. Choose the text again.' }
+ }
+ if (this.pending || selection.pinned) return { ok: false, error: 'Wait for the current selection.' }
+ if (command.op === 'read') return selection.last ? { ...selection.last } : { ok: false, error: 'Choose the text again.' }
+ if ((command.op === 'step' || command.op === 'match') && (!Number.isSafeInteger(command.delta) || command.delta === 0 || Math.abs(command.delta!) > 8)) {
+ return { ok: false, error: 'Invalid selection movement.' }
+ }
+ if (selection.last?.query && (command.op === 'step' || command.op === 'extend')) return { ok: false, error: 'Choose Lines to adjust this passage.' }
+ if (command.op === 'match' && !selection.last?.query) return { ok: false, error: 'Say what to find first.' }
+ if (command.op === 'search' && (typeof command.query !== 'string' || !command.query.trim() ||
+ Buffer.byteLength(command.query, 'utf8') > 120 || /[\x00-\x1f\x7f-\x9f]/.test(command.query))) {
+ return { ok: false, error: 'Say a short phrase to find.' }
+ }
+ if (command.op === 'extend' && typeof command.extend !== 'boolean') return { ok: false, error: 'Invalid selection range.' }
+ const requestId = randomUUID()
+ const revision = ++selection.revision
+ return new Promise(resolve => {
+ const timer = setTimeout(() => {
+ if (this.pending?.requestId !== requestId) return
+ this.finish({ ok: false, error: 'The app did not answer. Update or reopen Harness.' })
+ this.cancel()
+ }, this.wiring.timeoutMs ?? 2000)
+ this.pending = { selection, requestId, revision, op: command.op, resolve, timer }
+ const sent = this.wiring.send(focus.connId, {
+ requestId, selectionId: selection.id, revision, agentId: focus.agentId,
+ machineId: focus.machineId, op: command.op,
+ ...(command.op === 'step' || command.op === 'match' ? { delta: command.delta } : {}),
+ ...(command.op === 'extend' ? { extend: command.extend } : {}),
+ ...(command.op === 'search' ? { query: command.query } : {}),
+ })
+ if (!sent) {
+ this.finish({ ok: false, error: 'Open Harness on this computer.' })
+ this.cancel()
+ }
+ })
+ }
+
+ reply(connId: string, machineId: string, payload: Record<string, unknown>): void {
+ const p = this.pending
+ if (!p || connId !== p.selection.connId || machineId !== p.selection.machineId ||
+ payload.requestId !== p.requestId || payload.selectionId !== p.selection.id ||
+ payload.agentId !== p.selection.agentId || payload.machineId !== machineId || payload.revision !== p.revision) return
+ if (!sameFocus(this.wiring.focus(), p.selection)) {
+ this.finish({ ok: false, error: 'The selected pane changed. Choose the text again.' })
+ this.cancel()
+ return
+ }
+ if (payload.ok !== true) {
+ // Errors are product text, bounded independently from any selected content.
+ this.finish({ ok: false, error: typeof payload.error === 'string' ? payload.error.slice(0, 180) : 'Choose the text again.' })
+ this.cancel()
+ return
+ }
+ const { excerpt, rows, extending, text, query, match, matches } = payload
+ const searching = typeof query === 'string' && !!query.trim() && Buffer.byteLength(query, 'utf8') <= 120 &&
+ !/[\x00-\x1f\x7f-\x9f]/.test(query) && Number.isSafeInteger(matches) && (matches as number) >= 0 &&
+ (matches as number) <= 0x7fffffff && Number.isSafeInteger(match) &&
+ ((matches === 0 && match === 0 && rows === 0 && excerpt === '' && extending === false) || ((match as number) >= 1 && (match as number) <= (matches as number)))
+ if (typeof excerpt !== 'string' || excerpt.length > 240 || !Number.isSafeInteger(rows) ||
+ (rows as number) < (searching && matches === 0 ? 0 : 1) || (rows as number) > 16 || typeof extending !== 'boolean' ||
+ ((query !== undefined || p.op === 'search' || p.op === 'match') && !searching) ||
+ (p.op === 'pin' && (typeof text !== 'string' || !text.trim() || Buffer.byteLength(text, 'utf8') > 4096))) {
+ this.finish({ ok: false, error: 'The app returned an invalid selection.' })
+ this.cancel()
+ return
+ }
+ if (p.op === 'pin') p.selection.pinned = true
+ const result: SelectionResult = { ok: true, selectionId: p.selection.id, revision: p.revision,
+ excerpt, rows: rows as number, extending, ...(p.op === 'pin' ? { text: text as string } : {}),
+ ...(searching ? { query: query as string, match: match as number, matches: matches as number } : {}) }
+ p.selection.last = result
+ this.finish(result)
+ }
+
+ cancel(): void {
+ const selection = this.selection
+ this.selection = undefined
+ this.finish({ ok: false, error: 'Selection closed.' })
+ if (selection) this.wiring.send(selection.connId, {
+ requestId: randomUUID(), selectionId: selection.id, revision: selection.revision + 1,
+ machineId: selection.machineId, agentId: selection.agentId, op: 'cancel',
+ })
+ }
+
+ focusChanged(): void {
+ if (this.selection && !sameFocus(this.wiring.focus(), this.selection)) this.cancel()
+ }
+
+ private finish(result: SelectionResult): void {
+ const pending = this.pending
+ this.pending = undefined
+ if (!pending) return
+ clearTimeout(pending.timer)
+ pending.resolve(result)
+ }
+}
+
+function sameFocus(a: SelectionFocus | undefined, b: SelectionFocus): boolean {
+ return !!a && a.connId === b.connId && a.machineId === b.machineId && a.agentId === b.agentId
+}
+
+/** Keep the user's words intact. The selected output is visibly quoted context,
+ * not a command from the device and not an assertion that a file was edited. */
+export function withSelectedPassage(instruction: string, passage: string): string {
+ return `${instruction}\n\nContext I selected from this agent's terminal:\n${passage.split(/\r?\n/).map(line => `> ${line}`).join('\n')}`
+}
diff --git a/cli/src/cable/windowVisit.spec.ts b/cli/src/cable/windowVisit.spec.ts
new file mode 100644
index 000000000..c9d7559ff
--- /dev/null
+++ b/cli/src/cable/windowVisit.spec.ts
@@ -0,0 +1,131 @@
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { WindowVisit } from './windowVisit.js'
+import type { SelectionFocus } from './windowSelection.js'
+
+function fixture() {
+ let focus: SelectionFocus | undefined = { connId: 'first', machineId: 'local', agentId: 'origin' }
+ const frames: { connId: string; payload: Record<string, unknown> }[] = []
+ let writable = true
+ const visit = new WindowVisit({ focus: () => focus, timeoutMs: 100,
+ send: (connId, payload) => { frames.push({ connId, payload }); return writable } })
+ return { visit, frames, focus: (f: SelectionFocus | undefined) => { focus = f }, offline: () => { writable = false },
+ answer: (extra: Record<string, unknown> = {}, connId = 'first', machineId = 'local') => {
+ const p = frames.at(-1)!.payload
+ visit.reply(connId, machineId, { requestId: p.requestId, visitId: p.visitId,
+ ok: true, active: p.op === 'open', agentId: p.op === 'open' ? p.agentId : 'origin', label: 'My work', ...extra })
+ },
+ }
+}
+const open = { op: 'open' as const, visitId: 'visit-one', machineId: 'remote', agentId: 'help' }
+afterEach(() => vi.useRealTimers())
+
+describe('attention visit at this desk', () => {
+ it('latest output is pinned to the focused pane and keeps the original return socket', async () => {
+ const f = fixture()
+ const command = { op: 'latest' as const, visitId: 'visit-reading', machineId: 'local', agentId: 'origin' }
+ const first = f.visit.command(command)
+ expect(f.frames[0]).toMatchObject({ connId: 'first', payload: {
+ op: 'latest', fromMachineId: 'local', fromAgentId: 'origin', machineId: 'local', agentId: 'origin' } })
+ f.answer({ active: true, agentId: 'origin', label: 'Your reading' })
+ expect(await first).toMatchObject({ ok: true, active: true })
+ const detour = f.visit.command({ ...open, visitId: command.visitId })
+ f.answer(); await detour
+ f.focus({ connId: 'remote-socket', machineId: 'remote', agentId: 'help' })
+ const next = f.visit.command({ ...command, machineId: 'remote', agentId: 'help' })
+ expect(f.frames.at(-1)).toMatchObject({ connId: 'first', payload: { op: 'latest', agentId: 'help' } })
+ f.answer({ active: true, agentId: 'help', label: 'Your reading' }); await next
+ const back = f.visit.command({ op: 'back', visitId: command.visitId })
+ expect(f.frames.at(-1)?.connId).toBe('first')
+ f.answer()
+ expect(await back).toMatchObject({ ok: true, agentId: 'origin', active: false })
+ })
+
+ it('a stale Latest request cannot change panes or discard an existing return', async () => {
+ const f = fixture()
+ const command = { op: 'latest' as const, visitId: 'visit-reading', machineId: 'local', agentId: 'origin' }
+ const first = f.visit.command(command)
+ f.answer({ active: true, agentId: 'origin', label: 'Your reading' }); await first
+ const count = f.frames.length
+ expect(await f.visit.command({ ...command, agentId: 'wrong-pane' })).toMatchObject({ ok: false, active: true })
+ expect(f.frames).toHaveLength(count)
+ const back = f.visit.command({ op: 'back', visitId: command.visitId }); f.answer()
+ expect((await back).ok).toBe(true)
+ })
+
+ it('returns through the original window socket after a cross-machine visit', async () => {
+ const f = fixture()
+ const pending = f.visit.command(open)
+ expect(f.frames[0]).toMatchObject({ connId: 'first', payload: {
+ fromMachineId: 'local', fromAgentId: 'origin', machineId: 'remote', agentId: 'help' } })
+ f.answer()
+ expect(await pending).toMatchObject({ ok: true, active: true })
+ f.focus({ connId: 'remote-socket', machineId: 'remote', agentId: 'help' })
+ const back = f.visit.command({ op: 'back', visitId: 'visit-one' })
+ expect(f.frames.at(-1)?.connId).toBe('first')
+ f.answer()
+ expect(await back).toMatchObject({ ok: true, active: false, agentId: 'origin' })
+ expect(f.frames.at(-1)?.payload.op).toBe('cancel')
+ })
+
+ it('ignores replies from another window, machine, request or visit', async () => {
+ const f = fixture()
+ const pending = f.visit.command(open)
+ const finish = vi.fn(); void pending.then(finish)
+ f.answer({}, 'other-window')
+ f.answer({}, 'first', 'remote')
+ f.answer({ requestId: 'old' })
+ f.answer({ visitId: 'old' })
+ await Promise.resolve()
+ expect(finish).not.toHaveBeenCalled()
+ f.answer()
+ expect((await pending).ok).toBe(true)
+ f.visit.cancel()
+ })
+
+ it('keeps a return available when the desktop asks to close a picker', async () => {
+ const f = fixture()
+ const pending = f.visit.command(open); f.answer(); await pending
+ const back = f.visit.command({ op: 'back', visitId: 'visit-one' })
+ f.answer({ ok: false, active: true, error: 'Close the picker.' })
+ expect(await back).toMatchObject({ ok: false, active: true, label: 'My work' })
+ const retry = f.visit.command({ op: 'back', visitId: 'visit-one' }); f.answer()
+ expect((await retry).ok).toBe(true)
+ })
+
+ it('a missing window times out once and cannot be revived by a late reply', async () => {
+ vi.useFakeTimers()
+ const f = fixture()
+ const pending = f.visit.command(open)
+ const frame = f.frames[0].payload
+ await vi.advanceTimersByTimeAsync(101)
+ expect(await pending).toMatchObject({ ok: false, active: false })
+ expect(f.frames.map(f => f.payload.op)).toEqual(['open', 'cancel'])
+ f.visit.reply('first', 'local', { ...frame, ok: true, active: true, label: 'late', agentId: 'help' })
+ expect((await f.visit.command({ op: 'back', visitId: 'visit-one' })).ok).toBe(false)
+ })
+
+ it.each([{ agentId: 'wrong-pane' }, { label: 'x'.repeat(193) }, { active: 'true' }])('rejects malformed app state %s', async extra => {
+ const f = fixture()
+ const pending = f.visit.command(open); f.answer(extra)
+ expect(await pending).toMatchObject({ ok: false, active: false })
+ })
+
+ it('old cancellation cannot close a replacement visit', async () => {
+ const f = fixture()
+ const first = f.visit.command(open); f.answer(); await first
+ const next = f.visit.command({ ...open, visitId: 'visit-two' }); f.answer(); await next
+ await f.visit.command({ op: 'cancel', visitId: 'visit-one' })
+ const back = f.visit.command({ op: 'back', visitId: 'visit-two' }); f.answer()
+ expect((await back).ok).toBe(true)
+ })
+
+ it('disconnect completes the waiter and releases the local bookmark', async () => {
+ const f = fixture()
+ const pending = f.visit.command(open)
+ f.visit.cancel()
+ expect(await pending).toMatchObject({ ok: false, active: false })
+ expect(f.frames.at(-1)?.payload.op).toBe('cancel')
+ f.offline()
+ expect((await f.visit.command(open)).ok).toBe(false)
+ })
+})
diff --git a/cli/src/cable/windowVisit.ts b/cli/src/cable/windowVisit.ts
new file mode 100644
index 000000000..afa607a33
--- /dev/null
+++ b/cli/src/cable/windowVisit.ts
@@ -0,0 +1,112 @@
+import { randomUUID } from 'node:crypto'
+import type { SelectionFocus } from './windowSelection.js'
+
+export interface VisitCommand {
+ op: 'open' | 'latest' | 'back' | 'cancel'
+ visitId: string
+ agentId?: string
+ machineId?: string
+}
+export interface VisitResult { ok: boolean; active: boolean; agentId?: string; label?: string; error?: string; note?: string }
+interface Visit { id: string; connId: string; machineId: string; agentId: string; label: string }
+interface Pending {
+ visit: Visit; requestId: string; agentId: string
+ resolve: (result: VisitResult) => void
+ timer: ReturnType<typeof setTimeout>
+}
+
+/** One attention detour in the window at this desk. Keep the original socket
+ * when the visit crosses machines; never broadcast navigation to other Macs. */
+export class WindowVisit {
+ private visit?: Visit
+ private pending?: Pending
+ constructor(private readonly wiring: {
+ focus: () => SelectionFocus | undefined
+ send: (connId: string, payload: Record<string, unknown>) => boolean
+ timeoutMs?: number
+ }) {}
+
+ async command(command: VisitCommand): Promise<VisitResult> {
+ const fail = (error: string): VisitResult => ({ ok: false, active: false, error })
+ if (!/^[a-zA-Z0-9-]{1,48}$/.test(command.visitId)) return fail('Invalid visit identity.')
+ if (command.op === 'cancel') {
+ if (this.visit?.id === command.visitId) this.cancel()
+ return { ok: true, active: false }
+ }
+ if (this.pending) return { ok: false, active: !!this.visit?.label, label: this.visit?.label, error: 'Wait for the app.' }
+ const focus = this.wiring.focus()
+ const opening = command.op === 'open' || command.op === 'latest'
+ if (opening) {
+ if (!focus || !command.agentId || !command.machineId) return fail('Select a terminal pane in Harness first.')
+ if (command.op === 'latest' && (command.agentId !== focus.agentId || command.machineId !== focus.machineId)) {
+ const active = this.visit?.id === command.visitId && !!this.visit.label
+ return { ok: false, active, ...(active ? { label: this.visit!.label } : {}), error: 'The pane changed. Choose Latest output again.' }
+ }
+ if (this.visit?.id !== command.visitId) {
+ this.cancel()
+ this.visit = { id: command.visitId, connId: focus.connId, machineId: focus.machineId, agentId: focus.agentId, label: '' }
+ }
+ }
+ const visit = this.visit
+ if (!visit || visit.id !== command.visitId) return fail('The previous visit has ended.')
+ const requestId = randomUUID()
+ const timeout = this.wiring.timeoutMs ?? 2000
+ return new Promise(resolve => {
+ const timer = setTimeout(() => {
+ if (this.pending?.requestId !== requestId) return
+ this.finish(fail('The app did not answer. Reopen Harness.'))
+ this.cancel()
+ }, timeout)
+ this.pending = { visit, requestId, timer, resolve, agentId: opening ? command.agentId! : visit.agentId }
+ if (!this.wiring.send(visit.connId, {
+ requestId, visitId: visit.id, op: command.op, expiresAt: Date.now() + timeout,
+ ...(opening ? {
+ fromMachineId: focus!.machineId, fromAgentId: focus!.agentId,
+ machineId: command.machineId, agentId: command.agentId,
+ } : {}),
+ })) {
+ this.finish(fail('Open Harness on this computer.'))
+ this.cancel()
+ }
+ })
+ }
+
+ reply(connId: string, machineId: string, payload: Record<string, unknown>): void {
+ const p = this.pending
+ if (!p || p.visit.connId !== connId || p.visit.machineId !== machineId ||
+ p.visit.id !== payload.visitId || p.requestId !== payload.requestId) return
+ if (typeof payload.ok !== 'boolean' || typeof payload.active !== 'boolean' ||
+ (payload.ok && payload.agentId !== p.agentId) ||
+ (payload.active && payload.ok && (typeof payload.label !== 'string' || payload.label.length > 192))) {
+ this.finish({ ok: false, active: false, error: 'The app returned an invalid visit.' })
+ this.cancel()
+ return
+ }
+ if (typeof payload.label === 'string') p.visit.label = payload.label.slice(0, 192)
+ const active = payload.active
+ this.finish({ ok: payload.ok, active,
+ ...(payload.ok ? { agentId: p.agentId } : {}),
+ ...(active ? { label: p.visit.label } : {}),
+ ...(typeof payload.error === 'string' ? { error: payload.error.slice(0, 180) } : {}),
+ ...(typeof payload.note === 'string' ? { note: payload.note.slice(0, 180) } : {}),
+ })
+ if (!active) this.cancel()
+ }
+
+ cancel(): void {
+ const visit = this.visit
+ this.visit = undefined
+ this.finish({ ok: false, active: false, error: 'Visit closed.' })
+ if (visit) this.wiring.send(visit.connId, {
+ requestId: randomUUID(), visitId: visit.id, op: 'cancel',
+ })
+ }
+
+ private finish(result: VisitResult): void {
+ const p = this.pending
+ this.pending = undefined
+ if (!p) return
+ clearTimeout(p.timer)
+ p.resolve(result)
+ }
+}
diff --git a/cli/src/cli.ts b/cli/src/cli.ts
index fb3147b2a..3dec67d14 100644
--- a/cli/src/cli.ts
+++ b/cli/src/cli.ts
@@ -42,6 +42,7 @@ import { DialLog } from './cable/dialLog.js'
import { buildLogBundle, bundleFileName, redactSecretsInText } from './lib/logBundle.js'
import { CableSession } from './cable/cableSession.js'
import { DaemonCableHost, cableEventFor, cableQuestionFor, cableQuestionCloseFor } from './cable/cableHost.js'
+import { terminalActivity } from './cable/terminalActivity.js'
import { MachineListCache, machineListCachePath, withStaleMarker } from './device/machineList.js'
import { DeviceLink } from './device/deviceLink.js'
@@ -168,6 +169,9 @@ import { autonomousDeviceLocalRequest } from './lib/autonomous-device/localApi.j
import { runAutonomousDeviceCommand } from './lib/autonomous-device/command.js'
import { attachLocalWsServer, LOCAL_WS_PATH, LOCAL_WS_PROTOCOL_VERSION } from './localWsServer.js'
import { createWindowRouter } from './cable/windowRoute.js'
+import { WindowSelection } from './cable/windowSelection.js'
+import { WindowVisit } from './cable/windowVisit.js'
+import { WindowForm } from './cable/windowForm.js'
import { RemoteRelayPool } from './lib/remoteRelay.js'
import { TERMINAL_BINARY_VERSION } from './lib/terminalBinary.js'
import { foldTranscript, lastTurnTextFromRawLines, lineToEvents, newTurnState, type LiveEvent, type TurnState } from './lib/normalize.js'
@@ -1947,6 +1951,7 @@ async function runForeground(session: AuthSession | null): Promise<void> {
let autonomousDeviceDirect: AutonomousDeviceDirect | undefined
let deviceStoreRef: ReturnType<typeof createDeviceStore> | undefined
let autonomousDeviceService: AutonomousDeviceService | undefined
+ let appFormWindow: { machineId: string; connId: string } | undefined
let appVoiceFocus: { machineId: string; agentId: string; connId: string } | undefined
let backendRef: BackendSocket | undefined
let fullReconcile: (announceDevice?: boolean) => Promise<void> = async () => {}
@@ -4163,18 +4168,43 @@ async function runForeground(session: AuthSession | null): Promise<void> {
log: (line) => console.log(`[cable] ${line}`),
})
+ const windowSelection: WindowSelection = new WindowSelection({
+ focus: () => appVoiceFocus,
+ send: (connId, payload) => localWsServer.sendToWindow(connId, { type: 'dial_selection', payload }),
+ })
+ const windowForm = new WindowForm({
+ focus: () => appFormWindow,
+ send: (connId, payload) => localWsServer.sendToWindow(connId, { type: 'dial_form', payload }),
+ log: (line) => console.log(`[cable] ${line}`),
+ })
+ const windowVisit = new WindowVisit({
+ focus: () => appVoiceFocus,
+ send: (connId, payload) => localWsServer.sendToWindow(connId, { type: 'dial_visit', payload }),
+ })
const localWsServer = attachLocalWsServer(hookServer, {
localSocketServer: localSocket?.server ?? null,
shareRelay,
+ onSelectionReply: (connId, machineId, payload) => windowSelection.reply(connId, machineId, payload),
+ onVisitReply: (connId, machineId, payload) => windowVisit.reply(connId, machineId, payload),
+ onFormReply: (connId, machineId, payload) => windowForm.reply(connId, machineId, payload),
+ onAppDisconnect: (machineId, connId) => {
+ if (appFormWindow?.connId === connId) appFormWindow = undefined
+ if (appVoiceFocus?.connId === connId) appVoiceFocus = undefined
+ windowForm.disconnected(connId)
+ windowSelection.focusChanged()
+ autonomousDeviceService?.appFocus(machineId, null, connId)
+ },
// The window and the dial are one desk: opening an agent in the app brings the dial to it, switching
// the dial's machine first when the app moved to another one.
onDevicePrepareOpened: (operationId, agentId) => deviceStoreRef?.acknowledgeReveal(operationId, agentId),
onAppFocusState: (machineId, agentId, connId, expectedRevision) => {
// A delayed automatic selection cannot replace a newer explicit user choice.
if (expectedRevision && autonomousDeviceService?.focusSnapshot().focusRevision !== expectedRevision) return false
+ appFormWindow = { machineId, connId }
if (agentId === null) {
if (appVoiceFocus?.connId === connId) appVoiceFocus = undefined
} else appVoiceFocus = { machineId, agentId, connId }
+ windowSelection.focusChanged()
autonomousDeviceService?.appFocus(machineId, agentId, connId)
},
onAppFocus: (machineId, agentId) => { void cableRef?.followApp(machineId, agentId) },
@@ -6121,6 +6151,12 @@ async function runForeground(session: AuthSession | null): Promise<void> {
})
const cableHost = new DaemonCableHost({
+ activityText: async (agentId) => {
+ const session = registry.resolve(agentId)
+ if (!session || (session.engine !== 'claude' && session.engine !== 'codex')) return null
+ const screen = await terminals.capture(session, { mode: 'visible', ansi: false })
+ return terminalActivity(session.engine, screen.state === 'succeeded' ? screen.value : null)
+ },
machineName: () => { try { return readFileSync(MACHINE_NAME_FILE, 'utf8').trim() || 'This machine' } catch { return 'This machine' } },
machineId: () => backend.machineId,
computerId: () => computerId(),
@@ -6133,6 +6169,8 @@ async function runForeground(session: AuthSession | null): Promise<void> {
// — keyed by the REQUEST id rather than by the question key `onQuestionAnswer` expects, so the answer
// named a question that does not exist.
answer: (agentId, requestId, answers) => { void backend.onQuestionAnswer?.({ agentId, requestId, answers }) },
+ answerReviewed: async answer => (await questions.answer({ agentId: answer.agentId, requestId: answer.requestId,
+ answers: answer.answers, expectedQuestions: answer.questions, selectedLabels: answer.selections, freeTextKeys: answer.freeTextKeys })).ok,
recent: (id, n) => mirror.recent(registry.resolve(id)?.sessionId || id, n),
recentAsks: (id) => mirror.recentAsks(registry.resolve(id)?.sessionId || id),
runtimeProfile: (session) => runtimeProfiles.selectedModel(session),
@@ -6170,6 +6208,12 @@ async function runForeground(session: AuthSession | null): Promise<void> {
dialStatus: (status) => backend.sendLocal({ type: 'dial_status', payload: status }),
// Words spoken on the overview belong to whichever agent the window's palette picks.
routeInWindow: (text, cmd) => windowRouter.ask(text, cmd),
+ selectPassage: command => windowSelection.command(command),
+ clearSelection: () => windowSelection.cancel(),
+ visit: command => windowVisit.command(command),
+ clearVisit: () => windowVisit.cancel(),
+ form: command => windowForm.command(command),
+ clearForm: () => windowForm.clear(),
log: (line) => console.log(`[cable] ${line}`),
}, fleet)
cableHostRef = cableHost
@@ -6296,6 +6340,7 @@ async function runForeground(session: AuthSession | null): Promise<void> {
// the wheel is not pointed at still belongs to a tile the user can see — and dropping it is what a
// tile that never leaves "Working…" looks like from the outside.
+ if (event.kind === 'questionClosed') { void cable.questionClose(event.agentId, event.requestId); return }
if (event.kind === 'question') { void cable.question(event.agentId, event.requestId, event.questions); return }
if (event.kind === 'processing') void cable.turnStarted(event.agentId, event.text)
else if (event.kind === 'done') void cable.turnDone(event.agentId)
diff --git a/cli/src/device/deviceFleet.spec.ts b/cli/src/device/deviceFleet.spec.ts
index 8993b566e..a7bced782 100644
--- a/cli/src/device/deviceFleet.spec.ts
+++ b/cli/src/device/deviceFleet.spec.ts
@@ -47,6 +47,19 @@ function make(over: { rows?: Partial<Listed>[]; linked?: string[]; rpc?: (t: str
}
describe('DeviceFleet', () => {
+ it('preserves reviewed question contents on the remote lane and forwards its matching close', async () => {
+ const { fleet, say, sent } = make()
+ const questions = [{ key: 'scope', q: 'Which scope?', options: ['File'], multi: false }]
+ fleet.answerReviewed('m1', { agentId: 'a1', requestId: 'r1', questions,
+ answers: { scope: 'File' }, selections: { scope: ['File'] } })
+ await vi.waitFor(() => expect(sent).toHaveLength(1))
+ expect(sent[0]).toMatchObject({ type: 'question_response', machineId: 'm1', payload: {
+ requestId: 'r1', expectedQuestions: questions, selectedLabels: { scope: ['File'] } } })
+ const seen: FleetEvent[] = []; fleet.onEvent(event => seen.push(event))
+ say({ type: 'commander_question_close', machineId: 'm1', agentId: 'a1', payload: { requestId: 'r1' } })
+ expect(seen).toEqual([{ machineId: 'm1', kind: 'questionClosed', agentId: 'a1', requestId: 'r1' }])
+ })
+
it('never lists another machine\'s terminal to the dial — the far daemon answers as to an app', async () => {
const { fleet } = make({
rpc: async () => ({ agents: [
diff --git a/cli/src/device/deviceFleet.ts b/cli/src/device/deviceFleet.ts
index 47096da95..6da7feecc 100644
--- a/cli/src/device/deviceFleet.ts
+++ b/cli/src/device/deviceFleet.ts
@@ -1,3 +1,4 @@
+import type { ReviewedAnswer } from '../cable/questionInbox.js'
// `MachineFleet` for real: the REST machine list, plus one device socket to whichever machine the dial is
// currently on.
//
@@ -229,6 +230,12 @@ export class DeviceFleet implements MachineFleet {
this.tagged(machineId, { type: 'question_response', payload: { agentId, requestId, answers } })
}
+ answerReviewed(machineId: string, answer: ReviewedAnswer): void {
+ this.tagged(machineId, { type: 'question_response', payload: { agentId: answer.agentId,
+ requestId: answer.requestId, answers: answer.answers,
+ expectedQuestions: answer.questions, selectedLabels: answer.selections } })
+ }
+
updateAgent(machineId: string, agentId: string, model?: string, effort?: string): void {
if (!model) return
// The far end owns what the profile means; this only reassembles the opaque string it round-trips.
@@ -367,6 +374,10 @@ export class DeviceFleet implements MachineFleet {
})
return
}
+ if (frame.type === 'commander_question_close' && frame.agentId && typeof payload.requestId === 'string') {
+ this.emit({ machineId: from, kind: 'questionClosed', agentId: frame.agentId, requestId: payload.requestId })
+ return
+ }
if (frame.type === 'commander_question' && frame.agentId) {
const requestId = payload.requestId
if (typeof requestId !== 'string' || !Array.isArray(payload.questions)) return
diff --git a/cli/src/lib/askQuestion.spec.ts b/cli/src/lib/askQuestion.spec.ts
index e875085f2..7c5c36f38 100644
--- a/cli/src/lib/askQuestion.spec.ts
+++ b/cli/src/lib/askQuestion.spec.ts
@@ -453,7 +453,7 @@ describe('QuestionWatcher', () => {
await w.tick()
expect(w.seen).toHaveLength(1)
expect(w.seen[0].questions).toEqual([
- { key: 'Which drink would you like?', q: 'Which drink would you like?', options: ['Tea', 'Coffee'], multi: false },
+ { key: 'Which drink would you like?', q: 'Which drink would you like?', options: ['Tea', 'Coffee'], multi: false, canText: true },
])
})
@@ -1240,3 +1240,90 @@ describe('the dialog read is the LAST one on the pane (regression: an answered d
}
})
})
+
+describe('reviewed device answers', () => {
+ const reviewed = [{ key: 'drink', q: 'Which drink would you like?', options: ['Tea', 'Coffee'], multi: false }]
+ it('checks the exact question and choices before pressing a key', async () => {
+ for (const expectedQuestions of [
+ [{ ...reviewed[0], q: 'May I delete the project?' }],
+ [{ ...reviewed[0], options: ['Tea', 'Delete files'] }],
+ [{ ...reviewed[0], multi: true }],
+ ]) {
+ const h = machine([fixture('single')])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: 'Tea' }, expectedQuestions })).toMatchObject({ ok: false })
+ expect(h.keys).toEqual([])
+ expect(h.texts).toEqual([])
+ }
+ })
+ it('uses the exact displayed label and never falls through to free text or review submission', async () => {
+ const h = machine([fixture('single'), CLOSED])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: 'Coffee' }, expectedQuestions: reviewed })).toEqual({ ok: true })
+ expect(h.keys).toEqual(['2'])
+ for (const capture of [fixture('single'), fixture('review')]) {
+ const invalid = machine([capture])
+ expect(await invalid.controller.answer({ agentId: 's1', answers: { drink: 'Cof' }, expectedQuestions: reviewed })).toMatchObject({ ok: false })
+ expect(invalid.keys).toEqual([])
+ expect(invalid.texts).toEqual([])
+ }
+ })
+ it('does not report a complete submission after only part of a reviewed batch', async () => {
+ const h = machine([fixture('single'), CLOSED])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: 'Tea', size: 'S' },
+ expectedQuestions: [...reviewed, { key: 'size', q: 'Which size?', options: ['S', 'M'], multi: false }] })).toMatchObject({ ok: false })
+ expect(h.keys).toEqual(['1'])
+ })
+ it('clears unreviewed checks and keeps comma-containing options intact', async () => {
+ const capture = 'Pick formats\n 1. [ ] CSV, UTF-8\n 2. [✔] JSON\n 3. [ ] XML\nEnter to select · ↑/↓ to navigate · Esc to cancel'
+ const h = machine([capture, CLOSED])
+ expect(await h.controller.answer({ agentId: 's1', answers: { formats: 'CSV, UTF-8' },
+ selectedLabels: { formats: ['CSV, UTF-8'] }, expectedQuestions: [
+ { key: 'formats', q: 'Pick formats', options: ['CSV, UTF-8', 'JSON', 'XML'], multi: true }],
+ })).toEqual({ ok: true })
+ expect(h.keys).toEqual(['1', '2', 'Tab'])
+ expect(h.texts).toEqual([])
+ })
+})
+
+
+describe('reviewed answer input validation', () => {
+ it('refuses malformed review metadata and an unreadable capture before input', async () => {
+ const malformed = machine([fixture('single')])
+ expect(await malformed.controller.answer({ agentId: 's1', answers: { key: 'Tea' }, expectedQuestions: {} as never })).toMatchObject({ ok: false })
+ expect(malformed.keys).toEqual([])
+ const unreadable = machine([null as never])
+ expect(await unreadable.controller.answer({ agentId: 's1', answers: { key: 'Tea' }, expectedQuestions: [
+ { key: 'key', q: 'Which drink would you like?', options: ['Tea','Coffee'], multi: false }],
+ })).toMatchObject({ ok: false })
+ expect(unreadable.keys).toEqual([])
+ })
+})
+
+describe('reviewed spoken answers', () => {
+ const expectedQuestions = [{ key: 'drink', q: 'Which drink would you like?', options: ['Tea','Coffee'], multi: false, canText: true }]
+ it('types the exact draft, including option-like words, through the explicit text editor', async () => {
+ const h = machine([fixture('single'), CLOSED])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: 'Coffee' },
+ expectedQuestions, freeTextKeys: ['drink'] })).toEqual({ ok: true })
+ expect(h.keys).toEqual(['3','Enter']); expect(h.texts).toEqual(['Coffee'])
+ })
+ it('refuses missing editors, changed questions and control bytes without any input', async () => {
+ for (const [capture,text] of [
+ [fixture('single').replace('3. Type something.',''), 'Coffee'],
+ [fixture('single').replace('Which drink would you like?','Allow this command?'),'Coffee'],
+ [fixture('single'),'Coffee\u001b[0m'],
+ ]) {
+ const h = machine([capture])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: text },
+ expectedQuestions, freeTextKeys: ['drink'] })).toMatchObject({ ok: false })
+ expect(h.keys).toEqual([]); expect(h.texts).toEqual([])
+ }
+ })
+ it('never treats unreviewed or malformed text metadata as a normal answer', async () => {
+ for (const extra of [{ freeTextKeys: {} }, { freeTextKeys: ['wrong'] },
+ { freeTextKeys: ['drink'], expectedQuestions: undefined }]) {
+ const h = machine([fixture('single')])
+ expect(await h.controller.answer({ agentId: 's1', answers: { drink: 'Coffee' }, expectedQuestions, ...extra } as never)).toMatchObject({ ok: false })
+ expect(h.keys).toEqual([])
+ }
+ })
+})
diff --git a/cli/src/lib/askQuestion.ts b/cli/src/lib/askQuestion.ts
index 1ce799322..82f3eba00 100644
--- a/cli/src/lib/askQuestion.ts
+++ b/cli/src/lib/askQuestion.ts
@@ -41,6 +41,8 @@ export interface ShapedQuestion {
q: string
options: string[]
multi: boolean
+ /** Observed free-text editor; never inferred for permission prompts. */
+ canText?: boolean
}
export interface QuestionRow {
@@ -702,6 +704,10 @@ export interface AskQuestionDeps {
}
export interface QuestionAnswerPayload {
+ /** Exact contents reviewed on the device; guarded submissions never use positional fallback. */
+ expectedQuestions?: ShapedQuestion[]
+ selectedLabels?: Record<string, string[]>
+ freeTextKeys?: string[]
allowPermissions?: boolean
requestId?: string
sessionId?: string
@@ -728,6 +734,19 @@ export class AskQuestionController {
async answer(payload: QuestionAnswerPayload): Promise<QuestionAnswerResult> {
const requestId = payload.requestId ?? ''
+ if (payload.expectedQuestions !== undefined && (!Array.isArray(payload.expectedQuestions) ||
+ payload.expectedQuestions.length < 1 || payload.expectedQuestions.length > 4 ||
+ payload.expectedQuestions.some(q => !q || typeof q.key !== 'string' || !q.key ||
+ typeof q.q !== 'string' || !q.q || !Array.isArray(q.options) || !q.options.length ||
+ q.options.some(option => typeof option !== 'string' || !option) ||
+ typeof q.multi !== 'boolean' || (q.multi && !Array.isArray(payload.selectedLabels?.[q.key]))))) {
+ return failed('The reviewed question metadata is invalid.')
+ }
+ if (payload.freeTextKeys !== undefined && (!payload.expectedQuestions || !Array.isArray(payload.freeTextKeys) ||
+ payload.freeTextKeys.some(key => typeof key !== 'string' || !payload.expectedQuestions!.some(q =>
+ q.key === key && q.canText === true && !q.multi)))) {
+ return failed('The reviewed text answer metadata is invalid.')
+ }
const remembered = this.pending.get(requestId)
const sessionId = payload.sessionId || payload.agentId || remembered || ''
const answers = payload.answers && typeof payload.answers === 'object' ? payload.answers : null
@@ -758,7 +777,7 @@ export class AskQuestionController {
const owners = [...new Set([remembered, session?.sessionId].filter((id): id is string => !!id))]
this.driving.add(sessionId)
try {
- const result = await this.drive(terminalTarget, answers, this.deps.getSession(sessionId)?.engine ?? 'claude', payload.allowPermissions !== false, { requestId, owners })
+ const result = await this.drive(terminalTarget, answers, this.deps.getSession(sessionId)?.engine ?? 'claude', payload.allowPermissions !== false, { requestId, owners }, payload.expectedQuestions ? payload : undefined)
this.pending.delete(requestId)
const outcome = result.ok ? 'submitted' : result.error === 'STALE_QUESTION' ? 'refused · STALE_QUESTION, nothing typed' : 'FAILED'
console.log(`[question] ${sessionId.slice(0, 8)} answered from device · ${outcome} (req=${requestId || 'none'})`)
@@ -783,9 +802,11 @@ export class AskQuestionController {
engine: AgentEngine,
allowPermissions: boolean,
asked: { requestId: string; owners: string[] },
+ reviewed?: QuestionAnswerPayload,
): Promise<QuestionAnswerResult> {
const wait = this.deps.wait ?? sleep
const used = new Set<string>()
+ const reviewedComplete = () => !reviewed || used.size === reviewed.expectedQuestions!.length
let lastQuestion = ''
let repeats = 0
let blanks = 0
@@ -793,10 +814,11 @@ export class AskQuestionController {
for (let step = 0; step < MAX_STEPS; step++) {
const capture = await this.deps.capture(terminalTarget, CAPTURE_LINES)
+ if (reviewed && capture === null) return failed('The question could not be read.')
const view = parseEngineQuestionPane(engine, capture ?? '')
if (!view) {
// Nothing on screen: either the dialog was already gone, or the last keystroke submitted it.
- return answered > 0 ? { ok: true } : STALE_GONE
+ return answered > 0 && reviewedComplete() ? { ok: true } : STALE_GONE
}
if (!allowPermissions && view.kind === 'question' && view.permission) return failed('Permission prompts cannot be answered from here.')
if (view.kind === 'question' && view.partial) {
@@ -811,12 +833,13 @@ export class AskQuestionController {
// Reached by our own keys, this submits the form. Reached first, it means every question was
// answered somewhere else — submitting would send answers this person never gave.
if (answered === 0) return STALE_GONE
+ if (!reviewedComplete()) return STALE_CHANGED
return await this.deps.sendKey(terminalTarget, view.submitRow) ? { ok: true } : failed('The answers could not be submitted.')
}
// Mid-repaint the question line can read blank for a capture (see parseQuestionPane). Neither its id
// nor its text can be checked against a blank, so look again rather than judge the dialog by it.
if (!view.question) {
- if (++blanks > 2) return answered > 0 ? { ok: true } : failed('The question could not be read.')
+ if (++blanks > 2) return answered > 0 && reviewedComplete() ? { ok: true } : failed('The question could not be read.')
await wait(STEP_MS)
continue
}
@@ -845,18 +868,50 @@ export class AskQuestionController {
// Out of answers with the dialog still up = a multi-QUESTION dialog whose next question the device
// hasn't been shown yet. Leave it open: the watcher pushes that one and the device answers it next.
- const picked = pickAnswer(answers, view.question, used, { positional })
+ const expected = reviewed?.expectedQuestions?.find(q => q.q === view.question)
+ if (reviewed && (!expected || expected.multi !== view.multi ||
+ JSON.stringify(expected.options) !== JSON.stringify(view.rows.map(row => row.label)))) {
+ // A request id proves the initial dialog; every reviewed screen must also match its full choices.
+ return answered > 0 && reviewedComplete() ? { ok: true } : STALE_CHANGED
+ }
+ const picked = expected
+ ? (!used.has(expected.key) && typeof answers[expected.key] === 'string'
+ ? { key: expected.key, value: answers[expected.key] } : null)
+ : pickAnswer(answers, view.question, used, { positional })
if (!picked) {
- if (answered > 0) return { ok: true }
+ if (answered > 0 && reviewedComplete()) return { ok: true }
console.warn(`[question] no answer names "${view.question.slice(0, 60)}" — nothing typed`)
return STALE_CHANGED
}
used.add(picked.key)
answered++
+ if (reviewed?.freeTextKeys?.includes(picked.key)) {
+ // Spoken words are explicitly text, even when they happen to equal an option label.
+ // A permission prompt can never acquire consent through this path.
+ if (!expected?.canText || view.permission || view.multi || !view.typeRow ||
+ !picked.value.trim() || Buffer.byteLength(picked.value, 'utf8') > 1200 ||
+ /[\x00-\x09\x0b-\x1f\x7f]/.test(picked.value)) return failed('The text answer cannot be entered into this question.')
+ if (!await this.typeFreeText(terminalTarget, view.typeRow, picked.value, wait)) return KEYS_FAILED
+ await wait(STEP_MS)
+ continue
+ }
+
if (view.multi) {
// Device joins the selected labels with ", " (q_done_tap).
- const labels = picked.value.split(',').map((s) => s.trim()).filter(Boolean)
+ const labels = reviewed ? reviewed.selectedLabels?.[picked.key] ?? []
+ : picked.value.split(',').map((s) => s.trim()).filter(Boolean)
+ if (reviewed && (!labels.length || labels.some(label => !view.rows.some(row => row.label === label)))) return failed('That answer matches no option.')
+ if (reviewed) {
+ // Set the exact reviewed set, including clearing choices selected in another client.
+ for (const row of view.rows) if (row.checked !== labels.includes(row.label)) {
+ if (!await this.deps.sendKey(terminalTarget, row.number)) return KEYS_FAILED
+ await wait(TEXT_MS)
+ }
+ if (!await this.deps.sendKey(terminalTarget, multiSubmitKey(engine))) return KEYS_FAILED
+ await wait(STEP_MS)
+ continue
+ }
let toggled = 0
for (const label of labels) {
const row = matchRow(view.rows, label)
@@ -872,7 +927,7 @@ export class AskQuestionController {
continue
}
- const row = matchRow(view.rows, picked.value)
+ const row = reviewed ? view.rows.find(row => row.label === picked.value) ?? null : matchRow(view.rows, picked.value)
if (row) {
// One digit selects AND submits — except on Amp, whose rows are unnumbered and reached by
// walking the list, so this is a short sequence rather than a single key.
@@ -883,6 +938,7 @@ export class AskQuestionController {
await wait(STEP_MS)
continue
}
+ if (reviewed) return failed('That answer matches no option.')
if (!view.typeRow) { console.warn(`[question] no option matched "${picked.value.slice(0, 40)}" and no free-text row`); return failed('That answer matches no option.') }
if (!await this.typeFreeText(terminalTarget, view.typeRow, picked.value, wait)) return KEYS_FAILED
await wait(STEP_MS)
@@ -1123,6 +1179,7 @@ export class QuestionWatcher {
q: view.question,
options: view.rows.map((r) => r.label),
multi: view.multi,
+ ...(view.typeRow && !view.multi && !view.permission ? { canText: true } : {}),
}])
}
diff --git a/cli/src/lib/deriveTurnSummary.spec.ts b/cli/src/lib/deriveTurnSummary.spec.ts
index 4c02b9752..3ea9eac76 100644
--- a/cli/src/lib/deriveTurnSummary.spec.ts
+++ b/cli/src/lib/deriveTurnSummary.spec.ts
@@ -27,20 +27,20 @@ describe('deriveTurnSummary', () => {
expect(p.recap.startsWith('Đã cập nhật')).toBe(true)
})
- it('marks a cut with an ellipsis and keeps to the budget', () => {
- const long = 'Đã cập nhật đường retry trong src/api/client.ts, chạy lại toàn bộ test và mọi thứ đều xanh.'
+ it('marks a cut with a plus and keeps to the budget', () => {
+ const long = 'Đã cập nhật đường retry trong src/api/client.ts, chạy lại toàn bộ test và kiểm tra lại các trường hợp ngoại lệ trước khi triển khai bản cập nhật mới cùng các thay đổi về kết nối, trạng thái, thông báo, đầu vào giọng nói và khôi phục sau lỗi trên thiết bị.'
const p = parts(long)!
expect(p.recap.length).toBeLessThanOrEqual(RECAP_MAX_CHARS)
- expect(p.recap.endsWith('…')).toBe(true)
+ expect(p.recap.endsWith(' +')).toBe(true)
// The cut lands between words, not through one.
- expect(p.recap.slice(0, -1)).toBe(p.recap.slice(0, -1).trimEnd())
- expect(long.startsWith(p.recap.slice(0, -1))).toBe(true)
+ expect(p.recap.slice(0, -2)).toBe(p.recap.slice(0, -2).trimEnd())
+ expect(long.startsWith(p.recap.slice(0, -2))).toBe(true)
})
it('leaves something that already fits completely alone', () => {
const p = parts('SJC hôm nay bán ra 149,1 triệu đồng/lượng.')!
expect(p.recap).toBe('SJC hôm nay bán ra 149,1 triệu đồng/lượng.')
- expect(p.recap.endsWith('…')).toBe(false)
+ expect(p.recap.endsWith('+')).toBe(false)
})
it('caps the body too, since the window is where anyone reads the whole thing', () => {
@@ -57,7 +57,7 @@ describe('deriveTurnSummary', () => {
it('does not let one unbroken token collapse the line to nothing', () => {
// A word-boundary cut would leave almost nothing here, so the budget wins over the boundary.
- const p = parts('/Users/example/go/src/github.com/autonomous-ai/autonomous-harness/cli/src/lib/x.ts')!
+ const p = parts('/Users/example/' + 'project/'.repeat(RECAP_MAX_CHARS) + 'x.ts')!
expect(p.recap.length).toBeGreaterThan(RECAP_MAX_CHARS - 5)
})
diff --git a/cli/src/lib/deviceErrors.spec.ts b/cli/src/lib/deviceErrors.spec.ts
index 3f5f81f4c..fe5ac7d8c 100644
--- a/cli/src/lib/deviceErrors.spec.ts
+++ b/cli/src/lib/deviceErrors.spec.ts
@@ -4,7 +4,7 @@ import { deviceErrorText } from './deviceErrors.js'
describe('deviceErrorText', () => {
it('makes Claude submit-verification failures device-friendly', () => {
expect(deviceErrorText('The agent did not accept the message. Please try again.', 'claude'))
- .toBe("Claude didn't start. Check the terminal, then try again.")
+ .toBe("Couldn't confirm delivery to Claude. Check its pane.")
})
it('keeps the generic text for non-Claude engines and unrelated errors', () => {
diff --git a/cli/src/lib/deviceErrors.ts b/cli/src/lib/deviceErrors.ts
index 995e4c7c7..1f7edc548 100644
--- a/cli/src/lib/deviceErrors.ts
+++ b/cli/src/lib/deviceErrors.ts
@@ -24,7 +24,7 @@ const URL_CLAUSE = /\s*(?:visit|see|go to|open)?\s+https?:\/\/\S+/gi
export function deviceErrorText(message: string, engine?: string | null): string {
if (message === AGENT_DID_NOT_ACCEPT && engine === 'claude') {
- return "Claude didn't start. Check the terminal, then try again."
+ return "Couldn't confirm delivery to Claude. Check its pane."
}
if (CODEX_USAGE_LIMIT.test(message)) {
const when = TRY_AGAIN_AT.exec(message)?.[1]?.trim()
diff --git a/cli/src/lib/deviceRecap.spec.ts b/cli/src/lib/deviceRecap.spec.ts
new file mode 100644
index 000000000..b95cd7891
--- /dev/null
+++ b/cli/src/lib/deviceRecap.spec.ts
@@ -0,0 +1,33 @@
+import { describe, expect, it } from 'vitest'
+import { deriveTurnSummary, extendShortRecap } from './deviceRecap.js'
+
+describe('device recap minimum', () => {
+ it.each(['Yes.', 'No.', 'Done.', 'Tests pass.', "It isn't external."])(
+ 'extends %s with the following explanation', opening => {
+ const source = `${opening} The remaining explanation is much longer than the space available below the companion on this display.`
+ const recap = deriveTurnSummary(source)!.split('\n\n')[0]
+ expect(recap.startsWith(opening + ' ')).toBe(true)
+ expect(recap.length).toBeGreaterThanOrEqual(20)
+ expect(recap.length).toBeLessThanOrEqual(180)
+ })
+ it('keeps complete sentences once their combined length is at least 20', () => {
+ const opening = 'Fixed. All tests pass.'
+ expect(deriveTurnSummary(opening + ' ' + 'Additional explanation '.repeat(8))!.split('\n\n')[0]).toBe(opening)
+ })
+ it('does not invent text when the entire answer is short', () => {
+ expect(deriveTurnSummary('Yes.')!.split('\n\n')[0]).toBe('Yes.')
+ })
+ it('uses the larger reading area without cutting a complete sentence', () => {
+ const source = 'The update is installed. Voice input now sends to the selected agent. The new layout keeps the result in the center.'
+ expect(source.length).toBeGreaterThan(80)
+ expect(deriveTurnSummary(source)!.split('\n\n')[0]).toBe(source)
+ expect(extendShortRecap('The update is installed. Voice input now sends to the selected agent.', source)).toBe(source)
+ expect(extendShortRecap('The update is installed. Voice input now sends to the +', source)).toBe(source)
+ expect(extendShortRecap('The update is installed.', 'An unrelated update is installed.')).toBe('The update is installed.')
+ })
+ it('repairs a cached short recap only from its own matching body', () => {
+ expect(extendShortRecap('Yes.', 'Yes. The fix is installed.')).toBe('Yes. The fix is installed.')
+ expect(extendShortRecap('No.', 'Yes. The fix is installed.')).toBe('No.')
+ expect(extendShortRecap('The fix is installed.', 'The fix is installed. All checks passed.')).toBe('The fix is installed. All checks passed.')
+ })
+})
diff --git a/cli/src/lib/deviceRecap.ts b/cli/src/lib/deviceRecap.ts
new file mode 100644
index 000000000..abc53b232
--- /dev/null
+++ b/cli/src/lib/deviceRecap.ts
@@ -0,0 +1,126 @@
+// Pure, local text extraction shared by new turns and old USB recap records.
+/** Seven readable rows below the companion, with room for word wrapping. */
+export const RECAP_MAX_CHARS = 180
+/** Keep enough of the opening to explain a short answer, whenever the source has it. */
+export const RECAP_MIN_CHARS = 20
+/** The body the dial's tap-to-read screen shows. */
+export const BODY_MAX_CHARS = 250
+
+/**
+ * Turn the engine's own final message into the dial's `recap\n\nbody`, with no model in the loop.
+ *
+ * The dial is cabled to a Mac whose window is already showing this text in full, so the recap is a
+ * GLANCE, not a substitute for reading: whoever wants the detail turns their head. That is what buys
+ * the ~9s the one-shot used to cost on every turn. Keep as many opening sentences as fit; only a clipped
+ * sentence ends in " +" to say there is more on the desktop.
+ *
+ * The work is not the cut, it is what gets cut. An engine's last message is markdown: a heading, then
+ * bullets, then maybe a table. `slice(0, 60)` of that yields "## Kết quả\n\n- **SJC**: 149,1 triệu
+ * đồng/lượn" — a markdown heading and a severed word. So the text is flattened to prose first, and the
+ * recap starts at the first line that carries any and stops at the last complete sentence in budget.
+ */
+export function deriveTurnSummary(text: string): string | null {
+ // Markers go, LINE BREAKS STAY. Flattening first merges a label into the sentence under it — "Kết
+ // quả:" and its answer become one run with no boundary left to find, and the recap opens on the
+ // word that says least.
+ const stripped = stripMarkdown(text)
+ const body = stripped.replace(/\s+/g, ' ').trim()
+ if (!body) return null
+ // The answer's OPENING is the headline. The engine-specific turn readers hand this the answer alone —
+ // Codex's `commentary` messages ("I'll check the page", "I'm about to ask") are dropped there, since
+ // a headline taken from those announced the work instead of stating the result.
+ const recap = clip(firstProseOpening(stripped) || body, RECAP_MAX_CHARS, ' +')
+ return `${recap}\n\n${deriveTurnBody(text)}`
+}
+
+/** The `text` under a recap: the answer flattened to one line and clipped — a glance, never a
+ * paraphrase. Shared by both recap writers so the body reads the same whoever wrote the headline. */
+export function deriveTurnBody(text: string): string {
+ return clip(stripMarkdown(text).replace(/\s+/g, ' ').trim(), BODY_MAX_CHARS)
+}
+
+/** Cut to `max` characters on a word boundary, marking the cut. Never mid-word if it can be helped. */
+function clip(text: string, max: number, marker = '…'): string {
+ const t = text.trim()
+ if (t.length <= max) return t
+ const head = t.slice(0, max - marker.length)
+ const space = head.lastIndexOf(' ')
+ // Only honour the word boundary when it is not throwing most of the budget away — a long unbroken
+ // token (a path, a URL) would otherwise collapse the line to nothing.
+ return `${(space > max * 0.6 ? head.slice(0, space) : head).replace(/[\s,;:–—-]+$/, '')}${marker}`
+}
+
+/**
+ * Markdown → one flat run of prose the dial can draw.
+ *
+ * Fenced code and tables go entirely: a tile is 466px of round glass, and half a shell command wrapped
+ * across three lines says less than the sentence next to it.
+ */
+function stripMarkdown(text: string): string {
+ return text
+ .replace(/```[\s\S]*?```/g, '\n') // fenced code
+ .replace(/^\s*\|.*\|\s*$/gm, '') // table rows
+ .replace(/^\s{0,3}#{1,6}\s*/gm, '') // headings — the marker, not the words
+ .replace(/^\s*[-*+]\s+/gm, '') // bullet markers
+ .replace(/^\s*\d+\.\s+/gm, '') // ordered-list markers
+ .replace(/^\s*>\s?/gm, '') // block quotes
+ .replace(/!?\[([^\]]*)\]\([^)]*\)/g, '$1') // links and images → their label
+ .replace(/[*_~`]/g, '') // emphasis and inline code marks
+ .replace(/[ \t]+/g, ' ')
+ .trim()
+}
+
+/**
+ * The longest opening run of complete sentences within the headline budget.
+ *
+ * Skips lead-ins that name the shape of the answer rather than the answer — "Kết quả:", "Here's what I
+ * found:" — because those are exactly what a heading collapses into once its `##` is gone, and a tile
+ * reading "Kết quả" has told the user nothing.
+ */
+function firstProseOpening(stripped: string): string {
+ // Lines first, then sentences within a line: the line is the structure markdown actually carries,
+ // and a label only reads as a label while it still has a line of its own.
+ const candidates: string[] = []
+ for (const line of stripped.split(/\n+/)) {
+ for (const piece of line.split(/(?<=[.!?])\s+/)) {
+ const candidate = piece.trim()
+ if (candidate.length < 3 && !BARE_ACKNOWLEDGMENT.test(candidate)) continue
+ if (/^[^\p{L}\p{N}]+$/u.test(candidate)) continue // punctuation or symbols only
+ candidates.push(candidate)
+ }
+ }
+ // A LABEL is a short line that never finishes a thought — "Kết quả:", and the same words again once
+ // a heading's `##` has been taken off it. Both name the shape of the answer instead of giving it, so
+ // skip past them while there is anything else to say. Alone, a short line IS the answer.
+ const start = Math.max(0, candidates.findIndex((c) =>
+ c.length > LABEL_MAX_CHARS || /[.!?]$/.test(c) || BARE_ACKNOWLEDGMENT.test(c)))
+ const opening = candidates.slice(start)
+ let prefix = ''
+ let complete = ''
+ let useful = false
+ for (const sentence of opening) {
+ const next = prefix ? `${prefix} ${sentence}` : sentence
+ if (next.length > RECAP_MAX_CHARS) break
+ prefix = next
+ useful ||= !BARE_ACKNOWLEDGMENT.test(sentence)
+ if (useful && prefix.length >= RECAP_MIN_CHARS && /[.!?]$/.test(sentence)) complete = prefix
+ }
+ // An opening shorter than 20 characters must not strand its explanation.
+ // Otherwise keep the complete prefix without marking the unselected remainder.
+ // If nothing useful fits, clip the opening normally; never invent a sentence.
+ return complete || opening.join(' ').replace(/:$/, '')
+}
+
+/** Longer than this and a line is saying something, not naming a section. */
+const LABEL_MAX_CHARS = 24
+const BARE_ACKNOWLEDGMENT = /^(?:yes|no|ok|okay|sure|done|right|correct)[.!?]*$/i
+
+/** Repair recaps cached by older hosts using only the same turn's supplied body. */
+export function extendShortRecap(recap: string, body: string): string {
+ const clean = recap.trim().replace(/ \+$/, '')
+ if (clean.length >= RECAP_MAX_CHARS || body.trim().length <= clean.length) return recap
+ const extended = deriveTurnSummary(body)?.split('\n\n')[0] ?? ''
+ // Grow older shorter recaps only when the longer body starts with the
+ // exact same opening. Never replace it with unrelated text or invent length.
+ return extended.startsWith(clean) && extended.length > clean.length ? extended : recap
+}
diff --git a/cli/src/lib/sessionInput.spec.ts b/cli/src/lib/sessionInput.spec.ts
index 97a62d710..527e07e74 100644
--- a/cli/src/lib/sessionInput.spec.ts
+++ b/cli/src/lib/sessionInput.spec.ts
@@ -215,7 +215,8 @@ describe('SessionInputController', () => {
})
controller.submit('s1', 'hello')
- await vi.advanceTimersByTimeAsync(3_100 * 4)
+ // Past the old five-observation cutoff and both blind Enter retries.
+ await vi.advanceTimersByTimeAsync(60_000)
expect(sendKey).not.toHaveBeenCalled()
expect(onError).not.toHaveBeenCalled()
@@ -247,6 +248,43 @@ describe('SessionInputController', () => {
controller.forget('s1')
})
+ it('leaves a fresh Claude draft alone while a submitted voice message waits for background agents', async () => {
+ vi.useFakeTimers()
+ const sendKey = vi.fn(async () => true)
+ const onError = vi.fn()
+ const capture = vi.fn(async () => '❯ What are you working on?\n✻ Waiting for 4 background agents to finish\n────\n❯ a different draft I am still writing\n────')
+ const controller = new SessionInputController({
+ getSession: () => session('claude'), validateRuntime: async () => true,
+ inject: async () => true, sendKey, capture, onError,
+ })
+ controller.submit('s1', 'What are you working on?')
+ await vi.advanceTimersByTimeAsync(30_000)
+ const observations = capture.mock.calls.length
+ await vi.advanceTimersByTimeAsync(60_000)
+ expect(capture).toHaveBeenCalledTimes(observations) // no permanent polling while Claude waits
+ expect(sendKey).not.toHaveBeenCalled() // never submits the unrelated draft
+ expect(onError).not.toHaveBeenCalled()
+ controller.onTurnStarted('s1', 'What are you working on?')
+ controller.onTurnEnded('s1')
+ expect(onError).not.toHaveBeenCalled()
+ controller.forget('s1')
+ })
+
+ it('reports uncertainty without blindly pressing Enter when the terminal shows no composer', async () => {
+ vi.useFakeTimers()
+ const sendKey = vi.fn(async () => true)
+ const onError = vi.fn()
+ const controller = new SessionInputController({
+ getSession: () => session('claude'), validateRuntime: async () => true,
+ inject: async () => true, sendKey, capture: async () => 'Sign in required', onError,
+ })
+ controller.submit('s1', 'hello')
+ await vi.advanceTimersByTimeAsync(60_000)
+ expect(sendKey).not.toHaveBeenCalled()
+ expect(onError).toHaveBeenCalledWith('s1', expect.stringContaining('could not be confirmed'))
+ controller.forget('s1')
+ })
+
it('retries Enter then errors for Claude while the prompt stays in the composer', async () => {
vi.useFakeTimers()
const sendKey = vi.fn(async () => true)
@@ -282,7 +320,7 @@ describe('SessionInputController', () => {
})
controller.submit('s1', 'hello')
- await vi.advanceTimersByTimeAsync(1_600 * 4)
+ await vi.advanceTimersByTimeAsync(60_000)
expect(sendKey).not.toHaveBeenCalled()
expect(onError).not.toHaveBeenCalled()
@@ -513,6 +551,17 @@ describe('delivery correlation', () => {
controller.forget('s1')
})
+ it('does not claim a started receipt or press Enter when only composer clearance was observed', async () => {
+ vi.useFakeTimers()
+ const sendKey = vi.fn(async () => true)
+ const { controller, onDelivery } = setup({ sendKey, capture: async () => '› \n' })
+ controller.submit('s1', 'hello', 'delivery-1')
+ await vi.advanceTimersByTimeAsync(60_000)
+ expect(sendKey).not.toHaveBeenCalled()
+ expect(onDelivery.mock.calls.map(([event]) => event.state)).toEqual(['queued', 'delivered', 'unknown'])
+ controller.forget('s1')
+ })
+
it('buffers a turn observed before the paste promise resolves', async () => {
let release!: (value: boolean) => void
const { controller, onDelivery } = setup({ inject: () => new Promise<boolean>((resolve) => { release = resolve }) })
diff --git a/cli/src/lib/sessionInput.ts b/cli/src/lib/sessionInput.ts
index 8e35c5782..dfb85c816 100644
--- a/cli/src/lib/sessionInput.ts
+++ b/cli/src/lib/sessionInput.ts
@@ -50,8 +50,8 @@ const AGY_SUBMIT_VERIFY_MS = 8_000
const COPILOT_SUBMIT_VERIFY_MS = 6_000
const CURSOR_TURN_SETTLE_MS = 750
const SUBMIT_MAX_RETRIES = 2
-// Non-cursor engines re-observe the pane (instead of erroring) while an accepted-but-not-yet-started
-// prompt is in flight. Bounded so a truly wedged session eventually reverts to the retry/error path.
+// Re-observe briefly while a submitted prompt awaits a transcript event. Reaching this limit is not
+// evidence of rejection: Claude can hold an accepted follow-up while background agents finish.
const SUBMIT_MAX_OBSERVES = 5
// Engines whose own TUI queues a message typed while a turn is running, and runs it when the turn ends.
// For these the daemon types immediately — the follow-up appears in the pane the moment it is spoken,
@@ -580,7 +580,20 @@ export class SessionInputController {
this.failAmbiguousSubmission(sessionId, state)
return
}
- // Pathological: accepted-looking but no turn opened for a while → fall through to retry/error.
+ if (state.deliveryId || !/^\s*[›❯→]/mu.test(visibleTerminal(capture))) {
+ // A receipt promises a correlated turn, which the pane alone cannot prove. Report unknown,
+ // also when no composer is visible. Never retry Enter into a dialog or a new human draft.
+ this.failAmbiguousSubmission(sessionId, state)
+ return
+ }
+ // The paste succeeded and our text left the composer. Stop polling without claiming that the
+ // agent started or failed. Its real turn event can arrive much later; pressing Enter again can
+ // submit somebody else's draft. This was the false "Claude didn't start" on a queued voice turn.
+ console.log(`[inject] ${sid(sessionId)} submit left composer; awaiting agent turn · engine=${session.engine}`)
+ state.awaitingFingerprint = null
+ state.awaitingContent = null
+ state.observes = 0
+ return
}
// capture === null (dep missing / unreadable) → fall through to today's blind retry/error so a
// real delivery failure is never hidden.
diff --git a/cli/src/lib/sessions.spec.ts b/cli/src/lib/sessions.spec.ts
new file mode 100644
index 000000000..f329a6374
--- /dev/null
+++ b/cli/src/lib/sessions.spec.ts
@@ -0,0 +1,38 @@
+import { mkdtemp, writeFile, rm } from 'node:fs/promises'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { afterEach, describe, expect, it } from 'vitest'
+import { tailFile } from './sessions.js'
+
+const directories: string[] = []
+afterEach(async () => { for (const dir of directories.splice(0)) await rm(dir, { recursive: true, force: true }) })
+async function file(content: string) {
+ const dir = await mkdtemp(join(tmpdir(), 'transcript-tail-')); directories.push(dir)
+ const path = join(dir, 'session.jsonl'); await writeFile(path, content); return path
+}
+describe('tailFile', () => {
+ it('returns the same full history across many stream chunks and UTF-8 boundaries', async () => {
+ const lines = Array.from({length: 5000}, (_, i) => JSON.stringify({ i, text: 'é💡' + 'a'.repeat(300) }))
+ const path = await file(lines.join('\n\n') + '\n')
+ expect(await tailFile(path, Infinity)).toEqual(lines)
+ expect(await tailFile(path, 25)).toEqual(lines.slice(-25))
+ })
+ it('counts nonempty lines and handles an unfinished last line', async () => {
+ const path = await file('first\n' + '\n'.repeat(100000) + 'second\n \nthird')
+ expect(await tailFile(path, 2)).toEqual(['second', 'third'])
+ expect(await tailFile(path, 3)).toEqual(['first', 'second', 'third'])
+ })
+ it('keeps a long JSON record whole when it crosses chunk boundaries', async () => {
+ const line = JSON.stringify({ text: '界'.repeat(50000) })
+ const path = await file('old\n' + line + '\nnew\n')
+ expect(await tailFile(path, 2)).toEqual([line, 'new'])
+ })
+ it('handles missing, empty, and zero-line requests', async () => {
+ const path = await file('')
+ expect(await tailFile(path, Infinity)).toEqual([])
+ expect(await tailFile(path, 10)).toEqual([])
+ expect(await tailFile(path, 0)).toEqual([])
+ expect(await tailFile(path + '.missing', Infinity)).toEqual([])
+ expect(await tailFile(await file('one\ntwo'), 0.5)).toEqual([])
+ })
+})
diff --git a/cli/src/lib/sessions.ts b/cli/src/lib/sessions.ts
index 5a6e26a34..1b7b36a51 100644
--- a/cli/src/lib/sessions.ts
+++ b/cli/src/lib/sessions.ts
@@ -6,6 +6,8 @@
*/
import { readdir, readFile, stat, open } from 'fs/promises'
+import { tailFile } from './transcriptTail.js'
+export { tailFile } from './transcriptTail.js'
import { join } from 'path'
import { env } from '../config/env.js'
import { isSessionFile, isCodexPath, sessionIdFromFile } from './paths.js'
@@ -127,19 +129,6 @@ export async function resolveSessionFile(sessionId: string): Promise<string | nu
return null
}
-/** Return the last `n` non-empty raw lines of a specific transcript file. Prefer this over
- * `tailLines` when the caller already holds a trusted, registered `transcriptPath` — it takes no
- * request-controlled id, so there is no path to traverse. */
-export async function tailFile(filePath: string, n = 200): Promise<string[]> {
- try {
- const content = await readFile(filePath, 'utf-8')
- const lines = content.split('\n').filter((l) => l.trim().length > 0)
- return lines.slice(-n)
- } catch {
- return []
- }
-}
-
/** Return the last `n` raw lines of a session file, resolved from a sessionId (guarded — see
* `resolveSessionFile`). Only reads files under CLAUDE_PROJECTS_DIR. */
export async function tailLines(sessionId: string, n = 200): Promise<string[]> {
diff --git a/cli/src/lib/summarize.spec.ts b/cli/src/lib/summarize.spec.ts
index 18b088e47..c4c89df04 100644
--- a/cli/src/lib/summarize.spec.ts
+++ b/cli/src/lib/summarize.spec.ts
@@ -42,7 +42,7 @@ vi.mock('./oneshot.js', () => ({
shutdownOneShotPool: vi.fn(),
}))
-import { deriveTurnBody, summarizeTurnText, syncSummaryPoolSessions, deriveTurnSummary } from './summarize.js'
+import { deriveTurnBody, summarizeTurnText, syncSummaryPoolSessions, deriveTurnSummary, RECAP_MAX_CHARS } from './summarize.js'
beforeEach(() => {
mocks.runClaude.mockReset()
@@ -332,13 +332,91 @@ describe('the body under the headline', () => {
})
describe('deriveTurnSummary (the local recap)', () => {
- it('headlines the opening of the answer', () => {
+ it('keeps complete opening sentences across paragraph boundaries', () => {
const text = 'Blue selected.\n\nAnything else?'
- expect(deriveTurnSummary(text)?.split('\n')[0]).toBe('Blue selected.')
+ expect(deriveTurnSummary(text)?.split('\n')[0]).toBe('Blue selected. Anything else?')
})
it('skips a label at the top', () => {
const text = 'Kết quả:\nĐã sửa xong file cấu hình.'
expect(deriveTurnSummary(text)?.split('\n')[0]).toBe('Đã sửa xong file cấu hình.')
})
+
+ it.each([
+ ['Yes. The fix is installed.', 'Yes. The fix is installed.'],
+ ['No.\n\nThe list only decides who is allowed in.', 'No. The list only decides who is allowed in.'],
+ ['## Result\n\n**No.** It does not send your data to a model.', 'No. It does not send your data to a model.'],
+ ['OK! The checks pass. Here are all the details.', 'OK! The checks pass. Here are all the details.'],
+ ['No\nThe device has no network connection.', 'No The device has no network connection.'],
+ ['Yes. Correct. The fix is installed. More details follow.', 'Yes. Correct. The fix is installed. More details follow.'],
+ ['No.', 'No.'],
+ ])('preserves the opening and its explanation: %s', (text, expected) => {
+ expect(deriveTurnSummary(text)?.split('\n')[0]).toBe(expected)
+ })
+
+ it('includes the explanation instead of stranding a bare acknowledgment', () => {
+ const text = 'Yes. The fix is installed and the device has reconnected successfully to the desktop application.'
+ const result = deriveTurnSummary(text)!
+ expect(result.split('\n\n')[0]).toBe(text)
+ expect(result.split('\n\n')[0].length).toBeLessThanOrEqual(RECAP_MAX_CHARS)
+ expect(result.split('\n\n')[1]).toBe(text)
+ })
+
+ it.each([
+ ["It isn't external. The label is a branch name.", "It isn't external. The label is a branch name."],
+ ['Tests pass. All the details are in the terminal.', 'Tests pass. All the details are in the terminal.'],
+ ['Not approved. The write would overwrite your changes.', 'Not approved. The write would overwrite your changes.'],
+ ['No files changed. This was only a review.', 'No files changed. This was only a review.'],
+ ])('keeps useful short sentences without a word-count threshold: %s', (text, expected) => {
+ expect(deriveTurnSummary(text)?.split('\n')[0]).toBe(expected)
+ })
+
+ it('keeps a sentence exactly at the current budget without a continuation marker', () => {
+ const text = 'A'.repeat(RECAP_MAX_CHARS - 1) + '.'
+ expect(text.length).toBe(RECAP_MAX_CHARS)
+ expect(deriveTurnSummary(`${text} Another sentence.`)?.split('\n')[0]).toBe(text)
+ })
+
+ it('uses the additional room for three complete sentences', () => {
+ const text = 'Fixed the parser. All tests pass. Voice input now sends to the selected agent.'
+ expect(text.length).toBeGreaterThan(60)
+ expect(deriveTurnSummary(`${text} More details follow.`)?.split('\n')[0]).toBe(`${text} More details follow.`)
+ })
+
+ it('keeps the body excerpt unchanged when the headline is shorter', () => {
+ const text = `Tests pass. ${'The details stay in the body. '.repeat(15)}`
+ const [recap, body] = deriveTurnSummary(text)!.split('\n\n')
+ expect(recap).toBe('Tests pass. The details stay in the body. The details stay in the body. The details stay in the body. The details stay in the body. The details stay in the body.')
+ expect(body).toBe(deriveTurnBody(text))
+ expect(body.length).toBeLessThanOrEqual(250)
+ expect(body.endsWith('…')).toBe(true)
+ expect(mocks.runClaude).not.toHaveBeenCalled()
+ expect(mocks.runCodex).not.toHaveBeenCalled()
+ expect(mocks.complete).not.toHaveBeenCalled()
+ })
+
+ it('stops after two complete sentences when the next sentence would overflow', () => {
+ const text = `Fixed the parser. All tests pass. The remaining details include ${'additional verification notes '.repeat(6)}in the terminal.`
+ expect(deriveTurnSummary(text)?.split('\n')[0]).toBe('Fixed the parser. All tests pass.')
+ })
+
+ it('extends a short sentence to at least 20 characters even when the next sentence cannot fit', () => {
+ const text = `Tests pass. The full explanation includes ${'individual test results and measurements '.repeat(6)}in the terminal.`
+ const recap = deriveTurnSummary(text)!.split('\n')[0]
+ expect(recap.length).toBeGreaterThanOrEqual(20)
+ expect(recap.startsWith('Tests pass. The full explanation')).toBe(true)
+ expect(recap.endsWith(' +')).toBe(true)
+ })
+
+ it('keeps following text when a complete opening is shorter than 20 characters', () => {
+ const text = 'It is fixed. The remaining details are'
+ expect(deriveTurnSummary(text)?.split('\n')[0]).toBe(text)
+ })
+
+ it('uses a marked word-boundary excerpt when no complete sentence fits', () => {
+ const text = 'The fix is installed and the device has reconnected successfully to the desktop application and verified the selected agent before sending the complete transcript from the microphone to its terminal pane'
+ const recap = deriveTurnSummary(text)!.split('\n')[0]
+ expect(recap).toBe('The fix is installed and the device has reconnected successfully to the desktop application and verified the selected agent before sending the complete transcript from the +')
+ expect(recap.length).toBeLessThanOrEqual(RECAP_MAX_CHARS)
+ })
})
diff --git a/cli/src/lib/summarize.ts b/cli/src/lib/summarize.ts
index ab7494722..ce8300c83 100644
--- a/cli/src/lib/summarize.ts
+++ b/cli/src/lib/summarize.ts
@@ -10,6 +10,9 @@
* Honors an AbortSignal so a newer turn can supersede a stale recap.
*/
+import { deriveTurnBody } from './deviceRecap.js'
+export { deriveTurnSummary, deriveTurnBody, RECAP_MAX_CHARS, RECAP_MIN_CHARS, BODY_MAX_CHARS } from './deviceRecap.js'
+
import { existsSync, mkdirSync } from 'fs'
import { unlink } from 'fs/promises'
import { homedir } from 'os'
@@ -200,109 +203,12 @@ async function cleanupRecapSession(engine: AgentEngine, scratch: string, session
if (engine === 'cursor') await cleanupCursorOneShotSession(sessionId)
}
-/** The tile headline. */
-export const RECAP_MAX_CHARS = 60
-/** The body the dial's tap-to-read screen shows. */
-export const BODY_MAX_CHARS = 250
-
-/**
- * Turn the engine's own final message into the dial's `recap\n\nbody`, with no model in the loop.
- *
- * The dial is cabled to a Mac whose window is already showing this text in full, so the recap is a
- * GLANCE, not a substitute for reading: whoever wants the detail turns their head. That is what buys
- * the ~9s the one-shot used to cost on every turn, and it is why this truncates with an ellipsis where
- * the model-written recap never did — "…" is honest here precisely because the rest is one glance away.
- *
- * The work is not the cut, it is what gets cut. An engine's last message is markdown: a heading, then
- * bullets, then maybe a table. `slice(0, 60)` of that yields "## Kết quả\n\n- **SJC**: 149,1 triệu
- * đồng/lượn" — a markdown heading and a severed word. So the text is flattened to prose first, and the
- * recap comes from the first line that carries any.
- */
-export function deriveTurnSummary(text: string): string | null {
- // Markers go, LINE BREAKS STAY. Flattening first merges a label into the sentence under it — "Kết
- // quả:" and its answer become one run with no boundary left to find, and the recap opens on the
- // word that says least.
- const stripped = stripMarkdown(text)
- const body = stripped.replace(/\s+/g, ' ').trim()
- if (!body) return null
- // The answer's OPENING is the headline. The engine-specific turn readers hand this the answer alone —
- // Codex's `commentary` messages ("I'll check the page", "I'm about to ask") are dropped there, since
- // a headline taken from those announced the work instead of stating the result.
- const recap = clip(firstProseLine(stripped) || body, RECAP_MAX_CHARS)
- return `${recap}\n\n${deriveTurnBody(text)}`
-}
-
-/** The `text` under a recap: the answer flattened to one line and clipped — a glance, never a
- * paraphrase. Shared by both recap writers so the body reads the same whoever wrote the headline. */
-export function deriveTurnBody(text: string): string {
- return clip(stripMarkdown(text).replace(/\s+/g, ' ').trim(), BODY_MAX_CHARS)
-}
-
/** The headline in a one-shot's output: its first non-empty line. A model that still writes a second
* paragraph is tolerated, not concatenated — and not judged for language drift either. */
function headlineOf(output: string): string {
return output.split('\n').map((line) => line.trim()).find(Boolean) ?? ''
}
-/** Cut to `max` characters on a word boundary, marking the cut. Never mid-word if it can be helped. */
-function clip(text: string, max: number): string {
- const t = text.trim()
- if (t.length <= max) return t
- const head = t.slice(0, max - 1)
- const space = head.lastIndexOf(' ')
- // Only honour the word boundary when it is not throwing most of the budget away — a long unbroken
- // token (a path, a URL) would otherwise collapse the line to nothing.
- return `${(space > max * 0.6 ? head.slice(0, space) : head).replace(/[\s,;:–—-]+$/, '')}…`
-}
-
-/**
- * Markdown → one flat run of prose the dial can draw.
- *
- * Fenced code and tables go entirely: a tile is 466px of round glass, and half a shell command wrapped
- * across three lines says less than the sentence next to it.
- */
-function stripMarkdown(text: string): string {
- return text
- .replace(/```[\s\S]*?```/g, '\n') // fenced code
- .replace(/^\s*\|.*\|\s*$/gm, '') // table rows
- .replace(/^\s{0,3}#{1,6}\s*/gm, '') // headings — the marker, not the words
- .replace(/^\s*[-*+]\s+/gm, '') // bullet markers
- .replace(/^\s*\d+\.\s+/gm, '') // ordered-list markers
- .replace(/^\s*>\s?/gm, '') // block quotes
- .replace(/!?\[([^\]]*)\]\([^)]*\)/g, '$1') // links and images → their label
- .replace(/[*_~`]/g, '') // emphasis and inline code marks
- .replace(/[ \t]+/g, ' ')
- .trim()
-}
-
-/**
- * The first line with real words in it.
- *
- * Skips lead-ins that name the shape of the answer rather than the answer — "Kết quả:", "Here's what I
- * found:" — because those are exactly what a heading collapses into once its `##` is gone, and a tile
- * reading "Kết quả" has told the user nothing.
- */
-function firstProseLine(stripped: string): string {
- // Lines first, then sentences within a line: the line is the structure markdown actually carries,
- // and a label only reads as a label while it still has a line of its own.
- const candidates: string[] = []
- for (const line of stripped.split(/\n+/)) {
- for (const piece of line.split(/(?<=[.!?])\s+/)) {
- const candidate = piece.trim()
- if (candidate.length < 3) continue
- if (/^[^\p{L}\p{N}]+$/u.test(candidate)) continue // punctuation or symbols only
- candidates.push(candidate)
- }
- }
- // A LABEL is a short line that never finishes a thought — "Kết quả:", and the same words again once
- // a heading's `##` has been taken off it. Both name the shape of the answer instead of giving it, so
- // skip past them while there is anything else to say. Alone, a short line IS the answer.
- const answer = candidates.find((c) => c.length > LABEL_MAX_CHARS || /[.!?]$/.test(c)) ?? candidates[0]
- return (answer ?? '').replace(/:$/, '')
-}
-
-/** Longer than this and a line is saying something, not naming a section. */
-const LABEL_MAX_CHARS = 24
/**
* `recap = llm(instruct, previousRecap, userMessage, text)`.
diff --git a/cli/src/lib/tmux.spec.ts b/cli/src/lib/tmux.spec.ts
index 14420b9ef..4aebaf675 100644
--- a/cli/src/lib/tmux.spec.ts
+++ b/cli/src/lib/tmux.spec.ts
@@ -13,6 +13,7 @@ import {
LSTART_MARKER_RE,
liveProcessRows,
parseProcessRow,
+ pasteRawIntoTmux,
resumeSessionId,
sendLiteralToTmux,
sendToTmux,
@@ -465,4 +466,59 @@ fi
rmSync(dir, { recursive: true, force: true })
}
})
+
+ it('brackets every submitted message and sends one separate Enter only after a successful paste', async () => {
+ const dir = mkdtempSync(join(tmpdir(), 'harness-tmux-submit-'))
+ const argsFile = join(dir, 'args')
+ const fakeTmux = join(dir, 'tmux')
+ writeFileSync(fakeTmux, `#!/bin/sh
+printf '%s\\n' "$*" >> "$TMUX_SUBMIT_ARGS"
+if [ "$1" = "load-buffer" ]; then cat > /dev/null; fi
+if [ "$1" = "paste-buffer" ] && [ "$TMUX_SUBMIT_FAIL" = "1" ]; then exit 2; fi
+`)
+ chmodSync(fakeTmux, 0o700)
+ const previous = { path: process.env.PATH, args: process.env.TMUX_SUBMIT_ARGS, fail: process.env.TMUX_SUBMIT_FAIL }
+ const error = vi.spyOn(console, 'error').mockImplementation(() => {})
+ const commands = () => readFileSync(argsFile, 'utf8').trim().split('\n')
+ .map(line => line.replace(/machinemsg-\d+-\d+/g, 'buffer'))
+ try {
+ process.env.PATH = `${dir}:${previous.path ?? ''}`
+ process.env.TMUX_SUBMIT_ARGS = argsFile
+ delete process.env.TMUX_SUBMIT_FAIL
+ for (const message of ['Testing voice.', 'Résumé 日本語.', 'first\nsecond', 'x'.repeat(501)]) {
+ writeFileSync(argsFile, '')
+ expect(await sendToTmux('%7', message)).toBe(true)
+ expect(commands()).toEqual([
+ 'load-buffer -b buffer -',
+ 'paste-buffer -t %7 -b buffer -p -d',
+ 'send-keys -t %7 Enter',
+ ])
+ }
+
+ // A clipboard paste and a live filter edit must remain unsubmitted.
+ writeFileSync(argsFile, '')
+ expect(await pasteRawIntoTmux('%7', 'clipboard')).toBe(true)
+ expect(await sendLiteralToTmux('%7', 'filter')).toBe(true)
+ expect(commands()).toEqual([
+ 'load-buffer -b buffer -', 'paste-buffer -t %7 -b buffer -p -d',
+ 'load-buffer -b buffer -', 'paste-buffer -t %7 -b buffer -d',
+ ])
+
+ writeFileSync(argsFile, '')
+ process.env.TMUX_SUBMIT_FAIL = '1'
+ expect(await sendToTmux('%7', 'must not send')).toBe(false)
+ expect(commands()).toEqual([
+ 'load-buffer -b buffer -', 'paste-buffer -t %7 -b buffer -p -d', 'delete-buffer -b buffer',
+ ])
+ } finally {
+ error.mockRestore()
+ if (previous.path === undefined) delete process.env.PATH
+ else process.env.PATH = previous.path
+ if (previous.args === undefined) delete process.env.TMUX_SUBMIT_ARGS
+ else process.env.TMUX_SUBMIT_ARGS = previous.args
+ if (previous.fail === undefined) delete process.env.TMUX_SUBMIT_FAIL
+ else process.env.TMUX_SUBMIT_FAIL = previous.fail
+ rmSync(dir, { recursive: true, force: true })
+ }
+ })
})
diff --git a/cli/src/lib/tmux.ts b/cli/src/lib/tmux.ts
index 56e921a86..51b33e757 100644
--- a/cli/src/lib/tmux.ts
+++ b/cli/src/lib/tmux.ts
@@ -899,8 +899,8 @@ export async function checkSessionRuntime(session: RegisteredSession): Promise<R
return { state: 'alive' }
}
-// A short single-line message can be pasted without bracketed-paste settling. Anything longer or
-// multi-line uses bracketed paste and waits before Enter (see sendToTmux).
+// Short single-line messages need no settling delay, but still need bracketed-paste boundaries:
+// Codex treats Enter immediately after an unbracketed text burst as a pasted newline, not submit.
const INJECT_FASTPATH_MAXLEN = 500
// Base settle time before the submit Enter; grows with length (Claude needs time to ingest a big paste
// and collapse it to `[Pasted text]` before a clean Enter counts as submit rather than paste content).
@@ -1046,18 +1046,18 @@ async function tmuxPasteText(pane: string, content: string, bracketed: boolean):
* Type a message into a tmux pane and submit it — the web-chat/device → terminal injection point.
*
* All text is loaded into a uniquely named tmux buffer over stdin so prompt bytes never enter argv,
- * environment, logs, or child-process error strings. Short single-line input is pasted literally and
- * submitted immediately.
+ * environment, logs, or child-process error strings. Every message is bracketed-pasted as one unit
+ * (`paste-buffer -p`) so the terminal can distinguish the paste from the separate submit Enter.
+ * Short single-line input is submitted immediately after that explicit paste boundary.
*
- * Long/multiline input is bracketed-pasted as one unit (`paste-buffer -p`), allowed to settle, then
- * submitted with a separate Enter. (Verified: reliably submits up to ~28 KB.)
+ * Long/multiline input is allowed to settle before Enter. (Verified: reliably submits up to ~28 KB.)
*/
export function sendToTmux(pane: string, text: string): Promise<boolean> {
const content = text.replace(/[\r\n]+$/, '') // strip trailing newlines so the submit Enter isn't doubled
return (async () => {
- const bracketed = content.length > INJECT_FASTPATH_MAXLEN || content.includes('\n')
- if (!(await tmuxPasteText(pane, content, bracketed))) return false
- if (bracketed) await sleep(Math.min(1500, INJECT_PASTE_DELAY_BASE_MS + Math.floor(content.length / 60)))
+ const needsSettle = content.length > INJECT_FASTPATH_MAXLEN || content.includes('\n')
+ if (!(await tmuxPasteText(pane, content, true))) return false
+ if (needsSettle) await sleep(Math.min(1500, INJECT_PASTE_DELAY_BASE_MS + Math.floor(content.length / 60)))
return tmuxEnter(pane)
})()
}
diff --git a/cli/src/lib/transcriptTail.ts b/cli/src/lib/transcriptTail.ts
new file mode 100644
index 000000000..f803086ad
--- /dev/null
+++ b/cli/src/lib/transcriptTail.ts
@@ -0,0 +1,49 @@
+import { open } from 'node:fs/promises'
+import { createReadStream } from 'node:fs'
+import { createInterface } from 'node:readline'
+
+/** Return the last `n` non-empty raw lines of a specific transcript file. Prefer this over
+ * `tailLines` when the caller already holds a trusted, registered `transcriptPath` — it takes no
+ * request-controlled id, so there is no path to traverse. */
+export async function tailFile(filePath: string, n = 200): Promise<string[]> {
+ try {
+ if (n === Infinity) {
+ // A long-running session can exceed V8's maximum single-string length.
+ // Keep the full-history contract, without decoding the entire file at once.
+ const lines: string[] = []
+ const input = createReadStream(filePath, { encoding: 'utf8' })
+ const reader = createInterface({ input, crlfDelay: Infinity })
+ try {
+ for await (const line of reader) if (line.trim()) lines.push(line)
+ } finally { reader.close(); input.destroy() }
+ return lines
+ }
+ if (!Number.isFinite(n)) return []
+ n = Math.floor(n)
+ if (n <= 0) return []
+ const handle = await open(filePath, 'r')
+ try {
+ let position = (await handle.stat()).size
+ const chunks: Buffer[] = []
+ let newlines = 0
+ while (position > 0) {
+ const size = Math.min(position, 64 * 1024)
+ position -= size
+ const chunk = Buffer.allocUnsafe(size)
+ const { bytesRead } = await handle.read(chunk, 0, size, position)
+ const read = chunk.subarray(0, bytesRead)
+ chunks.unshift(read)
+ for (const byte of read) if (byte === 10) newlines++
+ if (newlines > n || position === 0) {
+ let text = Buffer.concat(chunks).toString('utf8')
+ if (position > 0) text = text.slice(text.indexOf('\n') + 1)
+ const lines = text.split('\n').filter(line => line.trim())
+ if (lines.length >= n || position === 0) return lines.slice(-n)
+ }
+ }
+ return []
+ } finally { await handle.close() }
+ } catch {
+ return []
+ }
+}
diff --git a/cli/src/localWsServer.spec.ts b/cli/src/localWsServer.spec.ts
index 82f705f7a..2c18dfa13 100644
--- a/cli/src/localWsServer.spec.ts
+++ b/cli/src/localWsServer.spec.ts
@@ -8,6 +8,7 @@ import { encodeTerminalLocal, TerminalBinaryKind, type TerminalBinaryClear } fro
import { listenLocalSocket } from './lib/localSocket.js'
import { mkdtempSync, rmSync } from 'node:fs'
import { join } from 'node:path'
+import { WindowForm } from './cable/windowForm.js'
const machineId = 'machine-123'
const streamId = '00112233-4455-6677-8899-aabbccddeeff'
@@ -123,6 +124,61 @@ describe('local CLI WebSocket', () => {
expect(backend.frames).toEqual([])
ws.close()
})
+
+ it.each(['selection', 'visit', 'form'])('addresses one window for %s and consumes its result locally', async kind => {
+ const backend = new FakeBackend(), reply = vi.fn()
+ const ws = new WebSocket(await start(backend, { [kind === 'form' ? 'onFormReply' : kind === 'visit' ? 'onVisitReply' : 'onSelectionReply']: reply }))
+ await onceOpen(ws)
+ const connected = onceMessage(ws)
+ ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId, localProtocolVersion: 1 } }))
+ await connected
+ expect(local!.sendToWindow('unknown', { type: `dial_${kind}`, payload: {} })).toBe(false)
+ const request = onceMessage(ws)
+ expect(local!.sendToWindow(backend.connId!, { type: `dial_${kind}`, payload: { requestId: 'selection' } })).toBe(true)
+ expect(await request).toEqual({ type: `dial_${kind}`, payload: { requestId: 'selection' } })
+ ws.send(JSON.stringify({ type: `app_${kind}_result`, payload: { text: 'private selected text' } }))
+ await vi.waitFor(() => expect(reply).toHaveBeenCalledWith(backend.connId, machineId, { text: 'private selected text' }))
+ expect(backend.frames).toEqual([])
+ const id = backend.connId!
+ ws.close()
+ await vi.waitFor(() => expect(local!.sendToWindow(id, { type: `dial_${kind}`, payload: {} })).toBe(false))
+ })
+
+ it.each(['selection', 'visit', 'form'])('keeps %s on this desk and ignores upstream gestures', async kind => {
+ const backend = new FakeBackend(), reply = vi.fn(), focus = vi.fn()
+ const relayed: Frame[] = [], received: Frame[] = []
+ let upstream: LocalClientSink | undefined
+ const relayPool = {
+ acquire: async (_id: string, _env: string, _select: Frame, sink: LocalClientSink) => {
+ upstream = sink
+ sink.sendFrame({ type: 'connected', payload: { machineId: 'remote', e2ee: false } })
+ return { send: async (frame: Frame) => { relayed.push(frame) }, sendBinary: async () => {}, detach: () => {} }
+ },
+ acquireIsolated: async () => { throw new Error('unused') }, invalidate: () => {},
+ }
+ const ws = new WebSocket(await start(backend, {
+ autonomousEnv: 'test', [kind === 'form' ? 'onFormReply' : kind === 'visit' ? 'onVisitReply' : 'onSelectionReply']: reply, onAppFocusState: focus,
+ relayPool: relayPool as unknown as NonNullable<LocalWsServerOptions['relayPool']>,
+ }))
+ await onceOpen(ws)
+ const connected = onceMessage(ws)
+ ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId: 'remote', localProtocolVersion: 1 } }))
+ await connected
+ ws.on('message', raw => received.push(JSON.parse(raw.toString())))
+ ws.send(JSON.stringify({ type: 'app_focus', payload: { agentId: 'remote-agent' } }))
+ await vi.waitFor(() => expect(focus).toHaveBeenCalled())
+ const connId = focus.mock.calls[0][2] as string
+ upstream!.sendFrame({ type: `dial_${kind}`, payload: { requestId: 'upstream' } })
+ const selection = onceMessage(ws)
+ expect(local!.sendToWindow(connId, { type: `dial_${kind}`, payload: { requestId: 'from-device' } })).toBe(true)
+ expect((await selection).payload).toEqual({ requestId: 'from-device' })
+ ws.send(JSON.stringify({ type: `app_${kind}_result`, payload: { text: 'quoted remote output' } }))
+ await vi.waitFor(() => expect(reply).toHaveBeenCalledWith(connId, 'remote', { text: 'quoted remote output' }))
+ expect(relayed.some(frame => frame.type === `app_${kind}_result`)).toBe(false)
+ expect(received.filter(frame => frame.type === `dial_${kind}`)).toHaveLength(1)
+ expect(backend.frames).toEqual([])
+ ws.close()
+ })
it('accepts loopback, selects the exact machine, and routes JSON plus HTRL binary', async () => {
const backend = new FakeBackend()
const url = await start(backend)
@@ -335,6 +391,7 @@ describe('local CLI WebSocket', () => {
// And a window that MOVED without opening anything now says so — which is every click on a pane
// that already holds a live session, the case the dial used to miss entirely.
ws.send(JSON.stringify({ type: 'app_focus', payload: { agentId: 'agent-focused' } }))
+ ws.send(JSON.stringify({ type: 'terminal_open', payload: { agentId: 'background-restored' } }))
await new Promise((resolve) => setTimeout(resolve, 20))
expect(moves).toEqual([
@@ -343,17 +400,19 @@ describe('local CLI WebSocket', () => {
])
// Consumed locally: it describes a hand at this desk, and the machine has no use for an unknown
// frame type arriving on every pane click.
- expect(backend.frames.map((frame) => frame.type)).toEqual(['terminal_open'])
+ expect(backend.frames.map((frame) => frame.type)).toEqual(['terminal_open', 'terminal_open'])
ws.close()
})
it('reports only explicit voice focus and clears by originating connection', async () => {
const backend = new FakeBackend()
const states: Array<{ machine: string; agent: string | null; conn: string }> = []
+ const disconnected = vi.fn()
server = http.createServer((_req, res) => { res.statusCode = 404; res.end() })
local = attachLocalWsServer(server, {
machineId, backend,
onAppFocusState: (machine, agent, conn) => states.push({ machine, agent, conn }),
+ onAppDisconnect: disconnected,
})
await new Promise<void>(resolve => server!.listen(0, '127.0.0.1', resolve))
const ws = new WebSocket(`ws://127.0.0.1:${(server.address() as AddressInfo).port}/api/local-ws`)
@@ -371,8 +430,101 @@ describe('local CLI WebSocket', () => {
expect(states[1]).toEqual({ ...states[0], agent: null })
expect(backend.frames.map(frame => frame.type)).toEqual(['terminal_open', 'terminal_open'])
ws.close()
- await vi.waitFor(() => expect(states).toHaveLength(3))
- expect(states[2]).toEqual(states[1])
+ await vi.waitFor(() => expect(disconnected).toHaveBeenCalledExactlyOnceWith(machineId, states[0].conn))
+ expect(states).toHaveLength(2)
+ })
+
+ it('keeps Find on the live desktop when a background or replaced socket closes', async () => {
+ const backend = new FakeBackend(), disconnected = vi.fn()
+ let focused: { machineId: string; connId: string } | undefined
+ const form = new WindowForm({ focus: () => focused,
+ send: (conn, payload) => local!.sendToWindow(conn, { type: 'dial_form', payload }) })
+ const url = await start(backend, {
+ onAppFocusState: (machineId, _agent, connId) => { focused = { machineId, connId } },
+ onAppDisconnect: (machine, conn) => {
+ disconnected(machine, conn)
+ if (focused?.connId === conn) focused = undefined
+ form.disconnected(conn)
+ },
+ onFormReply: (conn, machine, payload) => form.reply(conn, machine, payload),
+ })
+ const connect = async () => {
+ const ws = new WebSocket(url)
+ await onceOpen(ws)
+ const connected = onceMessage(ws)
+ ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId, localProtocolVersion: 1 } }))
+ await connected
+ return { ws, connId: backend.connId! }
+ }
+ const select = async (client: Awaited<ReturnType<typeof connect>>, agentId: string | null) => {
+ client.ws.send(JSON.stringify({ type: 'app_focus', payload: { agentId } }))
+ await vi.waitFor(() => expect(focused?.connId).toBe(client.connId))
+ }
+ const close = async (client: Awaited<ReturnType<typeof connect>>) => {
+ client.ws.close()
+ await vi.waitFor(() => expect(backend.unregisters).toContain(client.connId))
+ }
+ const ready = async (client: Awaited<ReturnType<typeof connect>>, id: string) => {
+ const received = onceMessage(client.ws)
+ const result = form.command({ op: 'open', surface: 'find', formId: id })
+ const frame = await received
+ expect(frame.type).toBe('dial_form')
+ client.ws.send(JSON.stringify({ type: 'app_form_result', payload: {
+ ...(frame.payload as Record<string, unknown>), ok: true, active: true, revision: 1, position: 0, total: 0,
+ busy: false, enabled: false, canQuery: true, title: 'Find Harness', label: 'Say a name',
+ } }))
+ expect(await result).toMatchObject({ ok: true, active: true, canQuery: true })
+ }
+ const desktop = await connect()
+ await select(desktop, null) // An empty workspace can still open Find.
+ const background = await connect()
+ await close(background)
+ expect(focused?.connId).toBe(desktop.connId)
+ await ready(desktop, 'find-after-background-close')
+
+ const replacement = await connect()
+ await select(replacement, 'selected-pane')
+ await close(desktop) // The old connection closes after the new one reports focus.
+ expect(focused?.connId).toBe(replacement.connId)
+ await ready(replacement, 'find-after-reconnect')
+ await close(replacement)
+ expect(focused).toBeUndefined()
+ expect(disconnected).toHaveBeenCalledTimes(3)
+ expect(await form.command({ op: 'open', surface: 'find', formId: 'find-offline' }))
+ .toMatchObject({ ok: false, active: false })
+ expect(backend.frames).toEqual([])
+ expect(backend.binaries).toEqual([])
+ })
+
+ it('keeps background connections from stealing selection and releases compatibility mode on disconnect', async () => {
+ const backend = new FakeBackend(), dial = vi.fn()
+ const url = await start(backend, { onAppFocus: dial })
+ const select = async () => {
+ const ws = new WebSocket(url)
+ await onceOpen(ws)
+ const connected = onceMessage(ws)
+ ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId, localProtocolVersion: 1 } }))
+ await connected
+ return ws
+ }
+ const selected = await select()
+ selected.send(JSON.stringify({ type: 'app_focus', payload: { agentId: 'hn' } }))
+ await vi.waitFor(() => expect(dial).toHaveBeenCalledExactlyOnceWith(machineId, 'hn'))
+
+ const background = await select()
+ background.send(JSON.stringify({ type: 'terminal_open', payload: { agentId: 'firmware' } }))
+ await vi.waitFor(() => expect(backend.frames).toHaveLength(1))
+ expect(dial).toHaveBeenCalledTimes(1)
+ selected.send(JSON.stringify({ type: 'app_focus', payload: { agentId: null } }))
+ selected.send(JSON.stringify({ type: 'terminal_open', payload: { agentId: 'another-background' } }))
+ await vi.waitFor(() => expect(backend.frames).toHaveLength(2))
+ expect(dial).toHaveBeenCalledTimes(1) // a cleared selection must also stay clear
+
+ selected.close()
+ await vi.waitFor(() => expect(backend.unregisters).toHaveLength(1))
+ background.send(JSON.stringify({ type: 'terminal_open', payload: { agentId: 'legacy-window' } }))
+ await vi.waitFor(() => expect(dial).toHaveBeenLastCalledWith(machineId, 'legacy-window'))
+ background.close()
})
it('keeps stale automatic focus off the dial and forwards its revision for validation', async () => {
@@ -387,10 +539,12 @@ describe('local CLI WebSocket', () => {
ws.send(JSON.stringify({ type: 'machine_select', payload: { machineId, localProtocolVersion: 1 } }))
await connected
ws.send(JSON.stringify({ type: 'app_focus', payload: { agentId: 'first', focusRevision: 'old:0' } }))
+ ws.send(JSON.stringify({ type: 'terminal_open', payload: { agentId: 'background' } }))
await vi.waitFor(() => expect(focus).toHaveBeenCalledTimes(1))
+ await vi.waitFor(() => expect(backend.frames).toHaveLength(1))
expect(focus).toHaveBeenCalledWith(machineId, 'first', expect.any(String), 'old:0')
expect(dial).not.toHaveBeenCalled()
- expect(backend.frames).toHaveLength(0)
+ expect(backend.frames.map((frame) => frame.type)).toEqual(['terminal_open'])
ws.close()
})
diff --git a/cli/src/localWsServer.ts b/cli/src/localWsServer.ts
index a02261547..eefd1d344 100644
--- a/cli/src/localWsServer.ts
+++ b/cli/src/localWsServer.ts
@@ -57,8 +57,10 @@ export interface LocalWsServerOptions {
localClient?: () => { kind: string; name: string; machineId?: string } | null
/** The desktop app opened an agent's terminal — which agent, and on which machine. Lets the dial follow
* the window, so the two screens stay one desk. */
- /** Explicit app focus, including clear/disconnect, for voice routing independent of the dial. */
+ /** Explicit app focus, including a live empty workspace, for device routing. */
onAppFocusState?: (machineId: string, agentId: string | null, connId: string, expectedRevision?: string) => unknown
+ /** A registered desktop connection closed. Never interpret this as live empty-workspace focus. */
+ onAppDisconnect?: (machineId: string, connId: string) => void
onDevicePrepareOpened?: (operationId: string, agentId: string) => void
onAppFocus?: (machineId: string, agentId: string) => void
/** Every agent the window currently has a tile for, across all its machines. */
@@ -100,6 +102,9 @@ export interface LocalWsServerOptions {
* separate frame rather than a flag on the answer.
*/
onVoiceRouteReply?: (voiceId: string, reply: WindowVoiceReply) => void
+ onSelectionReply?: (connId: string, machineId: string, payload: Record<string, unknown>) => void
+ onVisitReply?: (connId: string, machineId: string, payload: Record<string, unknown>) => void
+ onFormReply?: (connId: string, machineId: string, payload: Record<string, unknown>) => void
}
/** One candidate, as the window draws it in the picker. */
@@ -143,6 +148,8 @@ export interface RouteAnswer {
export interface LocalWsServer {
close: () => Promise<void>
+ /** Exact local socket, including sockets viewing a remote machine; never relayed. */
+ sendToWindow: (connId: string, frame: Frame) => boolean
}
function isLoopback(address: string | undefined): boolean {
@@ -253,6 +260,10 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
// clients that insist on proposing one; it carries no authority and is never inspected.
handleProtocols: (protocols) => [...protocols][0] ?? false,
})
+ // One desktop can have a connection per machine. Once a live window reports its selected pane,
+ // background terminal attachments on ANY of those connections must not overwrite that selection.
+ const explicitFocusClients = new Set<string>()
+ const windowSinks = new Map<string, LocalClientSink>()
const onUpgrade = (req: http.IncomingMessage, socket: Socket, head: Buffer): void => {
const path = (req.url ?? '').split('?')[0]
@@ -301,6 +312,12 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
try { ws.send(frame, { binary: true }); return true } catch { return false }
},
}
+ // A reading cursor belongs to this physical desk. A terminal's upstream
+ // event feed cannot manufacture device gestures; only sendToWindow can.
+ const terminalSink: LocalClientSink = {
+ ...sink,
+ sendFrame: (frame) => frame.type === 'dial_selection' || frame.type === 'dial_visit' || frame.type === 'dial_form' || sink.sendFrame(frame),
+ }
const close = (code: number, reason: string): void => {
try { ws.close(code, reason) } catch { ws.terminate() }
@@ -323,7 +340,7 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
if (typeof payload.shareId === 'string') {
if (!options.shareRelay) { close(4403, 'Sharing is unavailable'); return }
try {
- relay = await options.shareRelay.acquire(requestedMachineId, payload.shareId, sink, close)
+ relay = await options.shareRelay.acquire(requestedMachineId, payload.shareId, terminalSink, close)
if (ws.readyState !== WebSocket.OPEN) { relay.detach(); return }
selected = true
} catch (error) {
@@ -333,11 +350,12 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
return
}
if (requestedMachineId === options.machineId) {
- if (!options.backend.registerLocalClient(connId, sink)) {
+ if (!options.backend.registerLocalClient(connId, terminalSink)) {
close(1011, 'local registration failed')
return
}
selected = true
+ windowSinks.set(connId, sink)
sink.sendFrame({
type: 'connected',
payload: {
@@ -369,10 +387,11 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
}
try {
relay = payload?.relayIsolation === true
- ? await options.relayPool.acquireIsolated(requestedMachineId, options.autonomousEnv, frame, sink, close)
- : await options.relayPool.acquire(requestedMachineId, options.autonomousEnv, frame, sink, close)
+ ? await options.relayPool.acquireIsolated(requestedMachineId, options.autonomousEnv, frame, terminalSink, close)
+ : await options.relayPool.acquire(requestedMachineId, options.autonomousEnv, frame, terminalSink, close)
if (ws.readyState !== WebSocket.OPEN) { relay.detach(); return }
selected = true
+ windowSinks.set(connId, sink)
} catch (err) {
const noPeerLink = err instanceof RelayConnectError && err.message === 'NO_PEER_LINK'
const code = noPeerLink ? 4404 : err instanceof RelayConnectError && err.closeCode ? err.closeCode : 1011
@@ -387,6 +406,17 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
// to the close at the bottom.
const parsed = isBinary ? null : jsonFrame(raw)
+ // Local reading context must never reach a remote daemon/cloud relay.
+ if (parsed?.type === 'app_selection_result' || parsed?.type === 'app_visit_result' || parsed?.type === 'app_form_result') {
+ const p = parsed.payload
+ if (windowSinks.has(connId) && boundMachineId && p && typeof p === 'object' && !Array.isArray(p)) {
+ const reply = parsed.type === 'app_form_result' ? options.onFormReply :
+ parsed.type === 'app_visit_result' ? options.onVisitReply : options.onSelectionReply
+ reply?.(connId, boundMachineId, p as Record<string, unknown>)
+ }
+ return
+ }
+
// Local desktop acknowledgement only; never forward this through a remote relay.
if (parsed?.type === 'device_prepare_opened') {
const p = parsed.payload as Record<string, unknown> | undefined
@@ -538,6 +568,7 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
const agentId = (parsed?.payload as Record<string, unknown> | undefined)?.agentId
if (parsed?.type === 'app_focus') {
if (agentId === null || (typeof agentId === 'string' && agentId)) {
+ explicitFocusClients.add(connId)
// Ahead of the dial's revision check below: that gate is about which agent the voice
// follows, and a stale one says nothing about which terminal is in front of the person.
// Only this daemon's own streams — a relayed machine's live on that machine's daemon.
@@ -550,8 +581,9 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
// Focus is local desk state and must never be forwarded to a remote machine.
return
}
- // Preserve the old dial fallback; terminal streams never establish voice focus.
- if (parsed?.type === 'terminal_open' && typeof agentId === 'string' && agentId) {
+ // Compatibility for windows that never report selection. A modern window restores every
+ // terminal on reconnect; their attachment order is not the pane the person selected.
+ if (parsed?.type === 'terminal_open' && !explicitFocusClients.size && typeof agentId === 'string' && agentId) {
options.onAppFocus?.(boundMachineId, agentId)
}
}
@@ -592,7 +624,9 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
const cleanup = (): void => {
heartbeat.stop()
- if (boundMachineId) options.onAppFocusState?.(boundMachineId, null, connId)
+ const wasWindow = windowSinks.delete(connId)
+ explicitFocusClients.delete(connId)
+ if (wasWindow && boundMachineId) options.onAppDisconnect?.(boundMachineId, connId)
// A window that went away has no tiles open. Left standing, the roster
// would keep silencing the dial for agents nobody can see any more —
// exactly backwards, and permanently.
@@ -607,6 +641,7 @@ export function attachLocalWsServer(server: http.Server, options: LocalWsServerO
})
return {
+ sendToWindow: (connId, frame) => windowSinks.get(connId)?.sendFrame(frame) ?? false,
close: async () => {
for (const each of servers) each.off('upgrade', onUpgrade)
for (const client of wss.clients) client.close(1001, 'server shutting down')
diff --git a/desktop/integration_test/native_device_e2e_test.dart b/desktop/integration_test/native_device_e2e_test.dart
new file mode 100644
index 000000000..4d35512a8
--- /dev/null
+++ b/desktop/integration_test/native_device_e2e_test.dart
@@ -0,0 +1,17 @@
+// Run the device scenarios in one native process, avoiding repeated app launches.
+// FLUTTER_TEST=1 flutter test -d macos --no-pub integration_test/native_device_e2e_test.dart
+import 'native_device_finder_e2e_test.dart' as finder;
+import 'native_device_form_e2e_test.dart' as form;
+import 'native_device_output_search_e2e_test.dart' as search;
+import 'native_device_passage_e2e_test.dart' as passage;
+import 'native_device_reading_e2e_test.dart' as reading;
+import 'native_device_visit_e2e_test.dart' as visit;
+
+void main() {
+ finder.main();
+ form.main();
+ search.main();
+ passage.main();
+ reading.main();
+ visit.main();
+}
diff --git a/desktop/integration_test/native_device_finder_e2e_test.dart b/desktop/integration_test/native_device_finder_e2e_test.dart
new file mode 100644
index 000000000..1abfea03b
--- /dev/null
+++ b/desktop/integration_test/native_device_finder_e2e_test.dart
@@ -0,0 +1,125 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:xterm/xterm.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/swarm_catalog.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+
+import '../test/device_finder_test.dart' show FinderRemote;
+import '../test/swarm_state_test.dart' show createApp;
+import '../test/swarm_screen_test.dart' show terminal;
+
+void main() {
+ if (!kUnderTest) throw StateError('Finder fixture requires FLUTTER_TEST=1');
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets(
+ 'native spoken Finder opens exact panes and retains reading position',
+ (t) async {
+ final app = createApp(connected: true), input = <TerminalBinaryFrame>[];
+ final a = terminal('a0', input), b = terminal('a69', input);
+ a.terminal.write(
+ List.generate(160, (i) => ' Original reading line $i\r\n').join(),
+ );
+ b.terminal.write(' Different work, found by name.\r\n');
+ final origin = app.adoptSessionForTest(a), originTab = app.activeSwarmId;
+ app.renameSwarm(originTab, 'Reading');
+ app.newSwarm(name: 'Other work');
+ final target = app.adoptSessionForTest(b), targetTab = app.activeSwarmId;
+ app.selectSwarm(originTab);
+ final directory = Directory('/private/tmp/habitat16-native')
+ ..createSync(recursive: true);
+ final boundary = GlobalKey();
+ Future<void> capture(String name) async {
+ final render =
+ boundary.currentContext!.findRenderObject()!
+ as RenderRepaintBoundary;
+ final bitmap = await render.toImage(pixelRatio: 1);
+ final png = await bitmap.toByteData(format: ui.ImageByteFormat.png);
+ await File('${directory.path}/$name.png')
+ .writeAsBytes(png!.buffer.asUint8List());
+ bitmap.dispose();
+ }
+
+ try {
+ await t.pumpWidget(
+ RepaintBoundary(
+ key: boundary,
+ child: MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: SwarmScreen(
+ notifier: app,
+ nativeTabs: false,
+ projectStore: SwarmProjectStore(),
+ ),
+ ),
+ ),
+ );
+ await t.pump(const Duration(milliseconds: 200));
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == a.terminal,
+ );
+ final renderer = t.state(finder), view = t.widget<TerminalView>(finder);
+ view.scrollController!.jumpTo(240);
+ await t.pump();
+ final before = view.scrollController!.offset;
+ final width = a.terminal.viewWidth, height = a.terminal.viewHeight;
+ final r = FinderRemote(t, app);
+ await r.send('open');
+ expect(view.scrollController!.offset, closeTo(before, .01));
+ await capture('find');
+ await r.say('Agent 69.');
+ expect(view.scrollController!.offset, closeTo(before, .01));
+ await capture('named');
+ expect(app.focusedPane, same(origin));
+ expect(a.terminal.viewWidth, width);
+ expect(a.terminal.viewHeight, height);
+ final stale = r.state['revision'] as int;
+ await r.send('activate');
+ await r.send('state');
+ expect(r.state['active'], isFalse);
+ expect(app.activeSwarmId, targetTab);
+ expect(app.focusedPane, same(target));
+ expect(app.paneFocusByUser, isFalse);
+ await capture('opened');
+ await r.send('activate', revision: stale);
+ expect(app.allPanes, hasLength(2));
+ r.id = 'find-return';
+ await r.send('open');
+ await r.say('Agent 0.');
+ await r.send('activate');
+ await r.send('state');
+ expect(app.focusedPane, same(origin));
+ expect(t.state(finder), same(renderer));
+ expect(view.scrollController!.offset, closeTo(before, .01));
+ expect(input, isEmpty);
+ expect(app.allPanes, hasLength(2));
+ await capture('returned');
+ await File('${directory.path}/result.json').writeAsString(
+ jsonEncode({
+ 'fixture': 'native macOS production search and pane activation, synthetic terminals and transcripts',
+ 'voice_only_filters': true,
+ 'duplicate_views_created': 0,
+ 'terminal_input_frames': input.length,
+ 'search_resized_terminal': false,
+ 'reading_offset_before': before,
+ 'reading_offset_after': view.scrollController!.offset,
+ 'same_original_renderer': true,
+ 'passed': true,
+ }),
+ );
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+}
diff --git a/desktop/integration_test/native_device_form_e2e_test.dart b/desktop/integration_test/native_device_form_e2e_test.dart
new file mode 100644
index 000000000..fbaa322ac
--- /dev/null
+++ b/desktop/integration_test/native_device_form_e2e_test.dart
@@ -0,0 +1,209 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/new_harness.dart';
+import 'package:harness/state/swarm_catalog.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:harness/ws/ws_conn.dart';
+
+import '../test/swarm_state_test.dart' show createApp;
+import '../test/swarm_screen_test.dart' show terminal;
+
+class _Daemon extends WsConn {
+ _Daemon()
+ : super(
+ wsBaseUrl: 'ws://fixture.invalid',
+ autonomousEnv: 'test',
+ machineId: 'm',
+ accessTokenProvider: (_, _) async => '',
+ onAuthFailure: (_) {},
+ onEvent: (_) {},
+ onStatus: (_) {},
+ );
+ final creates = <Map<String, dynamic>>[];
+ final requests = <String>[];
+ @override
+ Future<Map<String, dynamic>> request(
+ String type, {
+ Map<String, dynamic> payload = const {},
+ Duration timeout = const Duration(seconds: 20),
+ }) async {
+ requests.add(type);
+ if (type == 'engines_probe') {
+ return {
+ 'engines': [
+ {'engine': 'codex', 'installed': true},
+ {'engine': 'claude', 'installed': true},
+ ],
+ };
+ }
+ if (type == 'dsh_list') return {'dsh': []};
+ if (type == 'git_project_info') return {'isGit': false};
+ if (type == 'agent_create') {
+ creates.add(Map.of(payload));
+ return {
+ 'creationId': payload['creationId'],
+ 'state': 'created',
+ 'agent': {
+ 'id': 'made',
+ 'name': 'New work from the device',
+ 'engine': payload['engine'],
+ 'terminal': {'available': true},
+ },
+ };
+ }
+ return {};
+ }
+}
+
+/// Production form and actual workspace navigation, with an in-memory daemon.
+/// No native keys, external processes, persistent settings or live agent input.
+void main() {
+ if (!kUnderTest) throw StateError('Device fixture requires FLUTTER_TEST=1');
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets(
+ 'device chooses a project and starts exactly one harness through Cmd-N',
+ (t) async {
+ final daemon = _Daemon(),
+ app = createApp(connected: true, connectionForTest: (_) => daemon);
+ app.machineStates['m']!.localOnly = true;
+ app.gitProjectReaderForTest = (_, _) async => {'isGit': false};
+ await app.projectHistory.select('m', '/work/project');
+ final input = <TerminalBinaryFrame>[];
+ app.adoptSessionForTest(terminal('a0', input));
+ final oldBox = newHarnessOpensInBox;
+ newHarnessOpensInBox = true;
+ final boundary = GlobalKey();
+ final directory = Directory('/private/tmp/habitat15-native')
+ ..createSync(recursive: true);
+ var state = <String, dynamic>{};
+ var serial = 0;
+ Future<Map<String, dynamic>> send(
+ String op, {
+ int delta = 0,
+ int? revision,
+ String? queryId,
+ String? text,
+ }) async {
+ Map<String, dynamic>? result;
+ final pending = app
+ .formFromDevice('m', {
+ 'op': op,
+ 'formId': 'native-form',
+ 'requestId': 'native-${++serial}',
+ 'expiresAt': DateTime.now().millisecondsSinceEpoch + 2000,
+ 'revision': revision ?? state['revision'] ?? 0,
+ 'delta': delta,
+ 'queryId': ?queryId,
+ 'text': ?text,
+ })
+ .then((value) => result = value);
+ for (var i = 0; i < 20 && result == null; i++) {
+ await t.pump(const Duration(milliseconds: 20));
+ }
+ await pending;
+ state = result!;
+ await t.pump(const Duration(milliseconds: 100));
+ return state;
+ }
+
+ Future<void> capture(String name) async {
+ final render =
+ boundary.currentContext!.findRenderObject()!
+ as RenderRepaintBoundary;
+ final image = await render.toImage(pixelRatio: 1);
+ final png = await image.toByteData(format: ui.ImageByteFormat.png);
+ await File('${directory.path}/$name.png')
+ .writeAsBytes(png!.buffer.asUint8List());
+ image.dispose();
+ }
+
+ try {
+ await t.pumpWidget(
+ RepaintBoundary(
+ key: boundary,
+ child: MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: SwarmScreen(
+ notifier: app,
+ nativeTabs: false,
+ projectStore: SwarmProjectStore(),
+ ),
+ ),
+ ),
+ );
+ await t.pump(const Duration(milliseconds: 200));
+ expect((await send('open'))['active'], isTrue);
+ await send('state');
+ await capture('form');
+ for (var i = 0; i < 8 && state['label'] != 'Project'; i++) {
+ await send('move', delta: 1);
+ }
+ expect(state['label'], 'Project');
+ await send('activate');
+ await send('state');
+ expect(state['title'], 'Project');
+ await capture('projects');
+ final stale = state['revision'] as int;
+ await send('move', delta: 1);
+ expect((await send('activate', revision: stale))['ok'], isFalse);
+ expect(daemon.creates, isEmpty);
+ await send('query.begin', queryId: 'spoken-project');
+ expect(state['queryId'], 'spoken-project');
+ await send('query', queryId: 'spoken-project', text: 'Project.');
+ expect(state['ok'], isTrue);
+ expect(state['query'], 'Project');
+ expect(daemon.creates, isEmpty);
+ await capture('spoken-project');
+ await send('activate'); // choosing still does not start the harness
+ expect(daemon.creates, isEmpty);
+ for (var i = 0; i < 8 && state['label'] != 'New Harness'; i++) {
+ await send('move', delta: 1);
+ }
+ expect(state['label'], 'New Harness');
+ final launchRevision = state['revision'] as int;
+ await send('activate');
+ await send(
+ 'activate',
+ revision: launchRevision,
+ ); // a duplicate cannot create again
+ await send('state');
+ expect(
+ daemon.creates,
+ hasLength(1),
+ reason: jsonEncode({'state': state, 'requests': daemon.requests}),
+ );
+ expect(app.focusedPane?.agentId, 'made');
+ expect(state['active'], isFalse);
+ expect(input, isEmpty);
+ await capture('created');
+ await File('${directory.path}/result.json').writeAsString(
+ jsonEncode({
+ 'fixture':
+ 'synthetic daemon, native macOS workspace and production Cmd-N',
+ 'voice_query_only_filters': true,
+ 'create_requests': daemon.creates.length,
+ 'terminal_input_frames': input.length,
+ 'stale_choice_refused': true,
+ 'duplicate_launch_refused': true,
+ 'focused_agent': app.focusedPane?.agentId,
+ 'passed': true,
+ }),
+ );
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ newHarnessOpensInBox = oldBox;
+ }
+ },
+ );
+}
diff --git a/desktop/integration_test/native_device_output_search_e2e_test.dart b/desktop/integration_test/native_device_output_search_e2e_test.dart
new file mode 100644
index 000000000..65b1ab63f
--- /dev/null
+++ b/desktop/integration_test/native_device_output_search_e2e_test.dart
@@ -0,0 +1,164 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:xterm/xterm.dart';
+
+import 'package:harness/auth/auth_session.dart';
+import 'package:harness/core/config.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/app_state.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:harness/terminal/terminal_session.dart';
+import 'package:harness/widgets/terminal_panel.dart';
+
+/// Real renderer, synthetic terminal. No daemon connection or agent input.
+void main() {
+ if (!kUnderTest) {
+ throw StateError('Native device fixtures require FLUTTER_TEST=1');
+ }
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets(
+ 'spoken search finds and selects native terminal output without typing',
+ (tester) async {
+ final notifier = AppNotifier(
+ config: AppConfig.dev,
+ authSession: AuthSession(),
+ configStore: null,
+ );
+ final controls = <String>[];
+ final inputs = <TerminalBinaryFrame>[];
+ final session =
+ TerminalSession(
+ machineId: 'fixture-machine',
+ agentId: 'fixture-agent',
+ agentName: 'Find and speak',
+ engineId: 'codex',
+ send: (type, _) async {
+ controls.add(type);
+ return true;
+ },
+ sendBinary: (frame) async {
+ inputs.add(frame);
+ return true;
+ },
+ )
+ ..status = TerminalSessionStatus.controlling
+ ..streamId = '00112233-4455-6677-8899-aabbccddeeff';
+ addTearDown(notifier.dispose);
+ addTearDown(session.dispose);
+ final capture = GlobalKey();
+ await tester.pumpWidget(
+ MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: RepaintBoundary(
+ key: capture,
+ child: Scaffold(
+ body: TerminalPanel(
+ notifier: notifier,
+ session: session,
+ focused: true,
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ session.terminal.write(
+ List.generate(
+ 60,
+ (i) => switch (i % 6) {
+ 0 => ' diff --git a/voice.ts b/voice.ts',
+ 1 => ' + keep the selected terminal passage with this recording',
+ 2 => ' + discard cancels pending delivery',
+ 3 => ' + the original pane stays the recipient',
+ 4 => ' Tests passed. Ready to review.',
+ _ => ' passage $i / use the device to choose a line',
+ },
+ ).join('\r\n'),
+ );
+ await tester.pump();
+ final terminal = session.terminal;
+ final size = (terminal.viewWidth, terminal.viewHeight);
+ controls.clear();
+ var revision = 0;
+ Map<String, dynamic> select(
+ String op, [
+ Map<String, dynamic> extra = const {},
+ ]) => session.selectPassage({
+ 'selectionId': 'native-fixture',
+ 'revision': ++revision,
+ 'op': op,
+ ...extra,
+ });
+ expect(select('begin')['ok'], isTrue);
+ Future<Map<String, dynamic>> search(
+ String op,
+ Map<String, dynamic> extra,
+ ) => session.searchPassage({
+ 'selectionId': 'native-fixture',
+ 'revision': ++revision,
+ 'op': op,
+ ...extra,
+ });
+ final lookup = search('search', {'query': 'discard cancels'});
+ await tester.pumpAndSettle();
+ final found = await lookup;
+ expect(found['ok'], isTrue);
+ expect(found['matches'], 10);
+ final next = search('match', {'delta': 1});
+ await tester.pumpAndSettle();
+ final moved = await next;
+ expect(moved['ok'], isTrue);
+ expect(moved['match'], isNot(found['match']));
+ final view = tester.widget<TerminalView>(find.byType(TerminalView));
+ expect(view.controller!.highlights, isNotEmpty);
+ expect(find.textContaining('Find "discard cancels"'), findsOneWidget);
+ final selected = select('pin');
+ expect(selected['ok'], isTrue);
+ expect(selected['text'], contains('discard cancels pending delivery'));
+ await tester.pump();
+ expect(identical(session.terminal, terminal), isTrue);
+ expect((terminal.viewWidth, terminal.viewHeight), size);
+ expect(inputs.where((f) => f.kind == TerminalBinaryKind.input), isEmpty);
+ expect(
+ controls.where((t) => t == 'terminal_resize' || t == 'terminal_scroll'),
+ isEmpty,
+ );
+ final boundary =
+ capture.currentContext!.findRenderObject() as RenderRepaintBoundary;
+ final image = await boundary.toImage(pixelRatio: 1);
+ final bytes = await image.toByteData(format: ui.ImageByteFormat.png);
+ final output = Directory('/private/tmp/habitat21-native');
+ await output.create(recursive: true);
+ await File('${output.path}/output-search.png')
+ .writeAsBytes(bytes!.buffer.asUint8List());
+ image.dispose();
+ await File('${output.path}/result.json').writeAsString(
+ jsonEncode({
+ 'native_renderer': true,
+ 'synthetic_terminal': true,
+ 'selected_rows': selected['rows'],
+ 'query': found['query'],
+ 'matches': found['matches'],
+ 'match_step_changed_selection': true,
+ 'terminal_recreated': false,
+ 'terminal_resized': false,
+ 'agent_input_frames': 0,
+ 'physical_touch_or_voice_test': false,
+ }),
+ );
+ select('cancel');
+ await tester.pump();
+ expect(view.controller!.highlights, isEmpty);
+ expect(tester.takeException(), isNull);
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+}
diff --git a/desktop/integration_test/native_device_passage_e2e_test.dart b/desktop/integration_test/native_device_passage_e2e_test.dart
new file mode 100644
index 000000000..e10b18582
--- /dev/null
+++ b/desktop/integration_test/native_device_passage_e2e_test.dart
@@ -0,0 +1,146 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:xterm/xterm.dart';
+
+import 'package:harness/auth/auth_session.dart';
+import 'package:harness/core/config.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/app_state.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:harness/terminal/terminal_session.dart';
+import 'package:harness/widgets/terminal_panel.dart';
+
+/// Real renderer, synthetic terminal. No daemon connection or agent input.
+void main() {
+ if (!kUnderTest) {
+ throw StateError('Native device fixtures require FLUTTER_TEST=1');
+ }
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets(
+ 'device selection paints without changing the terminal or typing',
+ (tester) async {
+ final notifier = AppNotifier(
+ config: AppConfig.dev,
+ authSession: AuthSession(),
+ configStore: null,
+ );
+ final controls = <String>[];
+ final inputs = <TerminalBinaryFrame>[];
+ final session =
+ TerminalSession(
+ machineId: 'fixture-machine',
+ agentId: 'fixture-agent',
+ agentName: 'Point and speak',
+ engineId: 'codex',
+ send: (type, _) async {
+ controls.add(type);
+ return true;
+ },
+ sendBinary: (frame) async {
+ inputs.add(frame);
+ return true;
+ },
+ )
+ ..status = TerminalSessionStatus.controlling
+ ..streamId = '00112233-4455-6677-8899-aabbccddeeff';
+ addTearDown(notifier.dispose);
+ addTearDown(session.dispose);
+ final capture = GlobalKey();
+ await tester.pumpWidget(
+ MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: RepaintBoundary(
+ key: capture,
+ child: Scaffold(
+ body: TerminalPanel(
+ notifier: notifier,
+ session: session,
+ focused: true,
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.pump();
+ session.terminal.write(
+ List.generate(
+ 60,
+ (i) => switch (i % 6) {
+ 0 => ' diff --git a/voice.ts b/voice.ts',
+ 1 => ' + keep the selected terminal passage with this recording',
+ 2 => ' + discard cancels pending delivery',
+ 3 => ' + the original pane stays the recipient',
+ 4 => ' Tests passed. Ready to review.',
+ _ => ' passage $i / use the device to choose a line',
+ },
+ ).join('\r\n'),
+ );
+ await tester.pump();
+ final terminal = session.terminal;
+ final size = (terminal.viewWidth, terminal.viewHeight);
+ controls.clear();
+ var revision = 0;
+ Map<String, dynamic> select(
+ String op, [
+ Map<String, dynamic> extra = const {},
+ ]) => session.selectPassage({
+ 'selectionId': 'native-fixture',
+ 'revision': ++revision,
+ 'op': op,
+ ...extra,
+ });
+ expect(select('begin')['ok'], isTrue);
+ expect(select('extend', {'extend': true})['ok'], isTrue);
+ expect(select('step', {'delta': -2})['rows'], 3);
+ await tester.pump();
+ expect(find.text('Device: extend selection'), findsOneWidget);
+ final view = tester.widget<TerminalView>(find.byType(TerminalView));
+ expect(view.controller!.highlights, isNotEmpty);
+ final selected = select('pin');
+ expect(selected['ok'], isTrue);
+ expect((selected['text'] as String).split('\n'), hasLength(3));
+ await tester.pump();
+ expect(find.text('3 lines attached to voice'), findsOneWidget);
+ expect(identical(session.terminal, terminal), isTrue);
+ expect((terminal.viewWidth, terminal.viewHeight), size);
+ expect(inputs.where((f) => f.kind == TerminalBinaryKind.input), isEmpty);
+ expect(
+ controls.where((t) => t == 'terminal_resize' || t == 'terminal_scroll'),
+ isEmpty,
+ );
+ final boundary =
+ capture.currentContext!.findRenderObject() as RenderRepaintBoundary;
+ final image = await boundary.toImage(pixelRatio: 1);
+ final bytes = await image.toByteData(format: ui.ImageByteFormat.png);
+ final output = Directory('/private/tmp/habitat12-native');
+ await output.create(recursive: true);
+ await File('${output.path}/selection.png')
+ .writeAsBytes(bytes!.buffer.asUint8List());
+ image.dispose();
+ await File('${output.path}/result.json').writeAsString(
+ jsonEncode({
+ 'native_renderer': true,
+ 'synthetic_terminal': true,
+ 'selected_rows': selected['rows'],
+ 'terminal_recreated': false,
+ 'terminal_resized': false,
+ 'agent_input_frames': 0,
+ 'physical_touch_or_voice_test': false,
+ }),
+ );
+ select('cancel');
+ await tester.pump();
+ expect(view.controller!.highlights, isEmpty);
+ expect(tester.takeException(), isNull);
+ await tester.pumpWidget(const SizedBox());
+ },
+ );
+}
diff --git a/desktop/integration_test/native_device_reading_e2e_test.dart b/desktop/integration_test/native_device_reading_e2e_test.dart
new file mode 100644
index 000000000..5d015cb7e
--- /dev/null
+++ b/desktop/integration_test/native_device_reading_e2e_test.dart
@@ -0,0 +1,130 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:xterm/xterm.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/swarm_catalog.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+
+import '../test/swarm_state_test.dart' show createApp;
+import '../test/swarm_screen_test.dart' show terminal;
+
+/// Native renderer and actual navigation, with synthetic terminals only.
+void main() {
+ if (!kUnderTest) throw StateError('Device fixtures require FLUTTER_TEST=1');
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets('latest output returns to the same native reading position', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final a = terminal('a0', input);
+ a.terminal.write(
+ List.generate(
+ 180,
+ (i) =>
+ ' Reading line $i: keep this place while checking the latest output.\r\n',
+ ).join(),
+ );
+ final origin = app.adoptSessionForTest(a);
+ final tab = app.activeSwarmId;
+ app.renameSwarm(tab, 'Reading');
+ app.selectSwarm(tab);
+ final boundary = GlobalKey();
+ final directory = Directory('/private/tmp/habitat25-native')
+ ..createSync(recursive: true);
+ Future<void> capture(String name) async {
+ await tester.pump();
+ final render =
+ boundary.currentContext!.findRenderObject()! as RenderRepaintBoundary;
+ final bitmap = await render.toImage(pixelRatio: 1);
+ final png = await bitmap.toByteData(format: ui.ImageByteFormat.png);
+ await File('${directory.path}/$name.png')
+ .writeAsBytes(png!.buffer.asUint8List());
+ bitmap.dispose();
+ }
+
+ try {
+ await tester.pumpWidget(
+ MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: RepaintBoundary(
+ key: boundary,
+ child: SwarmScreen(
+ notifier: app,
+ nativeTabs: false,
+ projectStore: SwarmProjectStore(),
+ ),
+ ),
+ ),
+ );
+ await tester.pump(const Duration(milliseconds: 150));
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == a.terminal,
+ );
+ final renderer = tester.state(finder);
+ final view = tester.widget<TerminalView>(finder);
+ view.scrollController!.jumpTo(360.25);
+ await capture('before');
+ final before = view.scrollController!.offset;
+ Map<String, dynamic> command(String op) => {
+ 'op': op,
+ 'requestId': 'native-$op',
+ 'visitId': 'native-reading',
+ 'expiresAt': DateTime.now().millisecondsSinceEpoch + 2000,
+ 'fromMachineId': 'm',
+ 'fromAgentId': 'a0',
+ 'machineId': 'm',
+ 'agentId': 'a0',
+ };
+ expect(app.visitFromDevice('m', command('latest'))!['ok'], isTrue);
+ await capture('latest');
+ final latest = view.scrollController!.offset;
+ expect(
+ latest,
+ closeTo(view.scrollController!.position.maxScrollExtent, .01),
+ );
+ expect(latest, greaterThan(before));
+ a.terminal.write(
+ ' New output arrived while following the live end.\r\n',
+ );
+ await tester.pump();
+ expect(
+ view.scrollController!.offset,
+ closeTo(view.scrollController!.position.maxScrollExtent, .01),
+ );
+ expect(app.visitFromDevice('m', command('latest'))!['ok'], isTrue);
+ await tester.pump();
+ expect(app.visitFromDevice('m', command('back'))!['ok'], isTrue);
+ await tester.pump();
+ await capture('returned');
+ expect(app.focusedPane, same(origin));
+ expect(tester.state(finder), same(renderer));
+ expect(view.scrollController!.offset, closeTo(before, .01));
+ expect(input, isEmpty);
+ await File('${directory.path}/result.json').writeAsString(
+ jsonEncode({
+ 'fixture': 'synthetic terminals in native macOS renderer',
+ 'reading_offset_before': before,
+ 'latest_offset': latest,
+ 'reading_offset_after': view.scrollController!.offset,
+ 'pane_count': app.allPanes.length,
+ 'same_renderer': identical(tester.state(finder), renderer),
+ 'terminal_input_frames': input.length,
+ 'passed': true,
+ }),
+ );
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+}
diff --git a/desktop/integration_test/native_device_visit_e2e_test.dart b/desktop/integration_test/native_device_visit_e2e_test.dart
new file mode 100644
index 000000000..02c5552db
--- /dev/null
+++ b/desktop/integration_test/native_device_visit_e2e_test.dart
@@ -0,0 +1,118 @@
+import 'dart:convert';
+import 'dart:io';
+import 'dart:ui' as ui;
+
+import 'package:flutter/material.dart';
+import 'package:flutter/rendering.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:integration_test/integration_test.dart';
+import 'package:xterm/xterm.dart';
+import 'package:harness/core/test_run.dart';
+import 'package:harness/screens/swarm_screen.dart';
+import 'package:harness/shared/theme/app_theme.dart' as grid;
+import 'package:harness/state/swarm_catalog.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+
+import '../test/swarm_state_test.dart' show createApp;
+import '../test/swarm_screen_test.dart' show terminal;
+
+/// Native renderer and actual navigation, with synthetic terminals only.
+void main() {
+ if (!kUnderTest) throw StateError('Device fixtures require FLUTTER_TEST=1');
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
+ testWidgets('attention detour returns to the same native reading surface', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final a = terminal('a0', input), b = terminal('a1', input);
+ a.terminal.write(
+ List.generate(
+ 180,
+ (i) =>
+ ' Reading line $i: keep this place while inspecting another agent.\r\n',
+ ).join(),
+ );
+ b.terminal.write(
+ ' Review requested\r\n\r\n The implementation is ready.\r\n Inspect it, then return to your work.\r\n',
+ );
+ final origin = app.adoptSessionForTest(a);
+ final tab = app.activeSwarmId;
+ app.renameSwarm(tab, 'Reading');
+ app.newSwarm(name: 'Needs you');
+ app.adoptSessionForTest(b);
+ app.selectSwarm(tab);
+ final boundary = GlobalKey();
+ final directory = Directory('/private/tmp/habitat13-native')
+ ..createSync(recursive: true);
+ Future<void> capture(String name) async {
+ await tester.pump();
+ final render =
+ boundary.currentContext!.findRenderObject()! as RenderRepaintBoundary;
+ final bitmap = await render.toImage(pixelRatio: 1);
+ final png = await bitmap.toByteData(format: ui.ImageByteFormat.png);
+ await File('${directory.path}/$name.png')
+ .writeAsBytes(png!.buffer.asUint8List());
+ bitmap.dispose();
+ }
+
+ try {
+ await tester.pumpWidget(
+ MaterialApp(
+ debugShowCheckedModeBanner: false,
+ theme: grid.buildAppTheme(brightness: Brightness.dark),
+ home: RepaintBoundary(
+ key: boundary,
+ child: SwarmScreen(
+ notifier: app,
+ nativeTabs: false,
+ projectStore: SwarmProjectStore(),
+ ),
+ ),
+ ),
+ );
+ await tester.pump(const Duration(milliseconds: 150));
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == a.terminal,
+ );
+ final renderer = tester.state(finder);
+ final view = tester.widget<TerminalView>(finder);
+ view.scrollController!.jumpTo(360);
+ await capture('before');
+ final before = view.scrollController!.offset;
+ Map<String, dynamic> command(String op) => {
+ 'op': op,
+ 'requestId': 'native-$op',
+ 'visitId': 'native-visit',
+ 'expiresAt': DateTime.now().millisecondsSinceEpoch + 2000,
+ 'fromMachineId': 'm',
+ 'fromAgentId': 'a0',
+ 'machineId': 'm',
+ 'agentId': 'a1',
+ };
+ expect(app.visitFromDevice('m', command('open'))!['ok'], isTrue);
+ await capture('visiting');
+ a.terminal.write(' New output arrived while you were away.\r\n');
+ expect(app.visitFromDevice('m', command('back'))!['ok'], isTrue);
+ await tester.pump();
+ await capture('returned');
+ expect(app.focusedPane, same(origin));
+ expect(tester.state(finder), same(renderer));
+ expect(view.scrollController!.offset, closeTo(before, .01));
+ expect(input, isEmpty);
+ await File('${directory.path}/result.json').writeAsString(
+ jsonEncode({
+ 'fixture': 'synthetic terminals in native macOS renderer',
+ 'reading_offset_before': before,
+ 'reading_offset_after': view.scrollController!.offset,
+ 'same_renderer': identical(tester.state(finder), renderer),
+ 'terminal_input_frames': input.length,
+ 'passed': true,
+ }),
+ );
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+}
diff --git a/desktop/lib/screens/swarm_screen.dart b/desktop/lib/screens/swarm_screen.dart
index 29eea4542..2e547605d 100644
--- a/desktop/lib/screens/swarm_screen.dart
+++ b/desktop/lib/screens/swarm_screen.dart
@@ -39,6 +39,8 @@ import '../state/app_state.dart';
import '../state/harness_sessions.dart';
import '../state/harness_placement.dart';
import '../state/new_harness.dart';
+import '../state/device_form.dart';
+import '../state/device_finder.dart';
import '../state/pane_arrangement.dart';
import '../terminal/terminal_viewport.dart';
import '../terminal/terminal_text.dart';
@@ -214,11 +216,15 @@ class _SwarmScreenState extends State<SwarmScreen> {
bool _tabRevealScheduled = false;
SwarmSearchController? _search;
OverlayEntry? _searchOverlay;
+ DeviceFinder? _searchDevice;
final _resourcePreviewKey = GlobalKey();
/// New Harness, open in the box. Never open beside the search: they are two
/// modes of one surface, and opening either closes the other.
NewHarnessController? _newHarness;
+ DeviceFormPort? _newHarnessDevicePort, _deviceFormPort;
+ String? _deviceFormId, _deviceFormMachine;
+ String _deviceFormSurface = 'new';
OverlayEntry? _newHarnessOverlay;
/// Escape keeps unfinished work with the machine/project/agent it started
@@ -289,6 +295,8 @@ class _SwarmScreenState extends State<SwarmScreen> {
@override
void initState() {
super.initState();
+ app.deviceNavigationAllowed = _allowDeviceNavigation;
+ app.deviceFormCommand = _deviceFormCommand;
_pullRequest = WorkspacePullRequest(app)..addListener(_statusPrefsChanged);
_keymap.addListener(_keymapChanged);
app.hasNavigationRail = false;
@@ -404,6 +412,12 @@ class _SwarmScreenState extends State<SwarmScreen> {
@override
void dispose() {
+ if (app.deviceNavigationAllowed == _allowDeviceNavigation) {
+ app.deviceNavigationAllowed = null;
+ }
+ if (app.deviceFormCommand == _deviceFormCommand) {
+ app.deviceFormCommand = null;
+ }
app.removeListener(_syncToolbarNotices);
_toolbarNotices.removeListener(_toolbarNoticesChanged);
_toolbarNotices.dispose();
@@ -436,6 +450,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
FocusManager.instance.removeListener(_syncKeyContext);
_searchOverlay?.remove();
_searchOverlay?.dispose();
+ _searchDevice?.close();
_search?.dispose();
_pickerModels?.dispose();
_focusedModelController.dispose();
@@ -516,6 +531,96 @@ class _SwarmScreenState extends State<SwarmScreen> {
bool get _shortcutsEnabled =>
mounted && _routeIsCurrent && !_dialogOpen && !_spokenPaletteOpen;
+ bool _allowDeviceNavigation() =>
+ _shortcutsEnabled &&
+ ModalRoute.of(context)?.isCurrent != false &&
+ _search == null &&
+ !_commandBarOpen &&
+ _newHarnessOverlay == null &&
+ !_modelsVisible &&
+ !_machinesVisible &&
+ !_harnessesVisible;
+
+ Future<Map<String, dynamic>> _deviceFormCommand(
+ String machineId,
+ Map<String, dynamic> command,
+ ) async {
+ final id = command['formId'] as String;
+ final op = command['op'] as String;
+ final surface =
+ command['surface'] as String? ??
+ (op == 'open' ? 'new' : _deviceFormSurface);
+ final finding = surface == 'find';
+ Map<String, dynamic> fail(String error) => {
+ 'ok': false,
+ 'active': false,
+ 'error': error,
+ };
+ if (!_shortcutsEnabled ||
+ ModalRoute.of(context)?.isCurrent == false ||
+ _newHarnessHidden ||
+ _pickingFolder ||
+ _pickerModalDepth > 0 ||
+ _commandBarOpen ||
+ (finding
+ ? _newHarness != null ||
+ _modelsOverlay != null ||
+ _harnessesOverlay != null
+ : _search != null ||
+ _modelsVisible ||
+ _machinesVisible ||
+ _harnessesVisible)) {
+ return fail('Return to the active picker on desktop.');
+ }
+ if (op == 'open' && _deviceFormId != id) {
+ final tab = app.activeSwarmId;
+ if (finding) {
+ if (_search == null) _openSearch();
+ if (_searchDevice?.supported != true) {
+ return fail('Open harness search on desktop first.');
+ }
+ } else if (_newHarness == null) {
+ await _newAgent(
+ stillCurrent: () =>
+ app.inForeground &&
+ _allowDeviceNavigation() &&
+ app.activeSwarmId == tab &&
+ DateTime.now().millisecondsSinceEpoch <
+ (command['expiresAt'] as int),
+ );
+ }
+ // Opening loads remembered choices asynchronously. Never attach this
+ // remote to a form someone else opened while that load was in flight.
+ if (!mounted ||
+ app.activeSwarmId != tab ||
+ (finding ? _searchDevice == null : _newHarnessDevicePort == null) ||
+ DateTime.now().millisecondsSinceEpoch >=
+ (command['expiresAt'] as int)) {
+ return fail('Open the picker again.');
+ }
+ _deviceFormId = id;
+ _deviceFormMachine = machineId;
+ _deviceFormSurface = surface;
+ _deviceFormPort = finding ? _searchDevice!.port : _newHarnessDevicePort;
+ await WidgetsBinding.instance.endOfFrame;
+ }
+ final port = _deviceFormPort;
+ if (id != _deviceFormId ||
+ machineId != _deviceFormMachine ||
+ surface != _deviceFormSurface ||
+ port == null) {
+ return fail('This picker has ended. Open it again.');
+ }
+ if (op == 'open') return port.snapshot();
+ return port.command(
+ op,
+ command['revision'] as int? ?? 0,
+ command['delta'] as int? ?? 0,
+ queryId: command['queryId'] as String?,
+ text: command['text'] as String?,
+ );
+ }
+
void _runShortcut(String id) {
_closeModelsControls(restoreFocus: false);
_closeHarnessControls(restoreFocus: false);
@@ -1808,6 +1913,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
String? task,
HarnessPlacement? placement,
_NewHarnessSource source = _NewHarnessSource.workspace,
+ bool Function()? stillCurrent,
}) async {
final search = source == _NewHarnessSource.workspace ? _search : null;
// A pane never lands in the store tab: New Harness from there goes to
@@ -1852,7 +1958,11 @@ class _SwarmScreenState extends State<SwarmScreen> {
return;
}
await Future.wait([app.agentPreference.load(), app.projectHistory.load()]);
- if (!mounted || app.activeSwarmId != target) return;
+ if (!mounted ||
+ app.activeSwarmId != target ||
+ stillCurrent?.call() == false) {
+ return;
+ }
final initialFolder =
folder ??
paneProject?.cwd ??
@@ -2059,6 +2169,7 @@ class _SwarmScreenState extends State<SwarmScreen> {
);
final content = NewHarnessForm(
controller: box,
+ devicePort: _newHarnessDevicePort = DeviceFormPort(),
onCreated: () {
_closeNewHarness(restoreFocus: false, keepDraft: false);
unawaited(_focusCreatedPane());
@@ -2298,6 +2409,8 @@ class _SwarmScreenState extends State<SwarmScreen> {
_newHarnessOverlay?.dispose();
_newHarnessOverlay = null;
_newHarness = null;
+ _newHarnessDevicePort?.detach();
+ _newHarnessDevicePort = null;
if (keepDraft && _newHarnessContext != null) {
_rememberNewHarnessDraft(_newHarnessContext!, box.draft);
}
@@ -2932,6 +3045,37 @@ class _SwarmScreenState extends State<SwarmScreen> {
: null),
catalog: _searchCatalog,
)..setQuery(query);
+ final deviceSearch = _search!;
+ _searchDevice = DeviceFinder(
+ deviceSearch,
+ isComposing: () =>
+ _searchText.value.composing.isValid &&
+ !_searchText.value.composing.isCollapsed,
+ dismiss: _dismissSearch,
+ choose: (choice) async {
+ if (!identical(_search, deviceSearch)) return false;
+ final target = deviceSearch.targetId;
+ _closeSearch(restoreFocus: false);
+ final destination = choice.destination;
+ _preparePaneFocus();
+ if (destination.hasView ||
+ app.paneOfAgent(destination.machineId!, destination.agentId!) !=
+ null) {
+ return app.revealAgentViewFromDevice(
+ destination.machineId!,
+ destination.agentId!,
+ swarmId: destination.swarmId,
+ paneId: destination.paneId,
+ );
+ }
+ // A missing view follows the desktop's explicit Open/Resume path.
+ await _activateSearch(SwarmSearchSelection(choice.destination), target);
+ final pane = app.focusedPane;
+ return mounted &&
+ pane?.machineId == choice.destination.machineId &&
+ pane?.agentId == choice.destination.agentId;
+ },
+ );
_search!.addListener(_syncSearch);
_searchOverlay = OverlayEntry(builder: _buildSearchOverlay);
Overlay.of(context).insert(_searchOverlay!);
@@ -3080,6 +3224,8 @@ class _SwarmScreenState extends State<SwarmScreen> {
_searchOverlay?.remove();
_searchOverlay?.dispose();
_searchOverlay = null;
+ _searchDevice?.close();
+ _searchDevice = null;
_search!.removeListener(_syncSearch);
_search!.dispose();
_search = null;
diff --git a/desktop/lib/state/app_state.dart b/desktop/lib/state/app_state.dart
index 65a396408..50dd6fbe1 100644
--- a/desktop/lib/state/app_state.dart
+++ b/desktop/lib/state/app_state.dart
@@ -59,6 +59,7 @@ import 'harness_placement.dart';
import 'desk_sync.dart';
import 'pane_layout_store.dart';
import 'terminal_pane.dart';
+import 'device_visit.dart';
import 'swarm.dart';
import '../terminal/terminal_binary.dart';
import '../update/desktop_updater.dart';
@@ -9528,6 +9529,38 @@ class AppNotifier extends ChangeNotifier {
Future<void> selectAgentFromDial(String machineId, String agentId) =>
focusAgentFromDevice(machineId, agentId);
+ /// A device Finder choice names an existing view, sometimes one exact tile.
+ /// Reveal it without retrying a stream or treating device focus as a local
+ /// keyboard/mouse takeover. A vanished tile must not turn into an Add.
+ bool revealAgentViewFromDevice(
+ String machineId,
+ String agentId, {
+ String? swarmId,
+ int? paneId,
+ }) {
+ if (_disposed) return false;
+ if (paneId == null) {
+ return _fromDevice(
+ () => revealAgentView(machineId, agentId, preferredSwarmId: swarmId),
+ );
+ }
+ final owner = swarms.where((s) => s.id == swarmId).firstOrNull;
+ final pane = owner?.panes
+ .where(
+ (p) =>
+ p.id == paneId &&
+ p.machineId == machineId &&
+ p.agentId == agentId,
+ )
+ .firstOrNull;
+ if (owner == null || pane == null) return false;
+ return _fromDevice(() {
+ selectSwarm(owner.id, attachPending: false);
+ focusPane(pane.id, reveal: true);
+ return true;
+ });
+ }
+
/// Bring [agentId]'s tile forward because a device asked — the dial's
/// carousel, the WiFi device's focus. The tab switches, the tile gets the
/// keyboard and `app_focus` goes back to the daemon, exactly as
@@ -11312,6 +11345,352 @@ class AppNotifier extends ChangeNotifier {
machine.agents.any((a) => a.id == pane.agentId && a.terminalAvailable);
}
+ DeviceVisit? _deviceVisit;
+ bool Function()? deviceNavigationAllowed;
+ Future<Map<String, dynamic>> Function(String, Map<String, dynamic>)?
+ deviceFormCommand;
+
+ Future<Map<String, dynamic>?> formFromDevice(
+ String connectionMachineId,
+ Map<String, dynamic> command,
+ ) async {
+ final id = command['formId'], request = command['requestId'];
+ bool identifier(Object? value) =>
+ value is String && RegExp(r'^[a-zA-Z0-9-]{1,64}$').hasMatch(value);
+ if (!identifier(id) ||
+ !identifier(request) ||
+ !const [
+ 'open',
+ 'state',
+ 'move',
+ 'activate',
+ 'back',
+ 'close',
+ 'query.begin',
+ 'query',
+ 'query.cancel',
+ ].contains(command['op']) ||
+ (command['surface'] != null &&
+ !const ['new', 'find'].contains(command['surface'])) ||
+ (command['queryId'] != null && !identifier(command['queryId'])) ||
+ (command['text'] != null &&
+ (command['text'] is! String ||
+ (command['text'] as String).length > 240)) ||
+ (command['revision'] != null && command['revision'] is! int) ||
+ (command['delta'] != null &&
+ (command['delta'] is! int ||
+ (command['delta'] as int).abs() > 8))) {
+ return null;
+ }
+ final reply = <String, dynamic>{'formId': id, 'requestId': request};
+ final expires = command['expiresAt'];
+ if (_disposed ||
+ !inForeground ||
+ viewer != null ||
+ expires is! int ||
+ expires <= DateTime.now().millisecondsSinceEpoch ||
+ stateOf(connectionMachineId)?.machine.isShared != false) {
+ return {
+ ...reply,
+ 'ok': false,
+ 'active': false,
+ 'error': 'Return to the Harness window first.',
+ };
+ }
+ final result =
+ await deviceFormCommand?.call(connectionMachineId, command) ??
+ {
+ 'ok': false,
+ 'active': false,
+ 'error': 'Open the Harness workspace first.',
+ };
+ return {...reply, ...result};
+ }
+
+ /// A hand on this desk visits an alert or the latest output and returns.
+ /// Replies use the original socket, even if the destination is on another
+ /// machine. No command here approves a request or retakes a terminal.
+ Map<String, dynamic>? visitFromDevice(
+ String connectionMachineId,
+ Map<String, dynamic> command,
+ ) {
+ final id = command['visitId'];
+ final request = command['requestId'];
+ final op = command['op'];
+ bool identifier(Object? value) =>
+ value is String && RegExp(r'^[a-zA-Z0-9-]{1,64}$').hasMatch(value);
+ if (!identifier(id) ||
+ !identifier(request) ||
+ !const ['open', 'latest', 'back', 'cancel'].contains(op)) {
+ return null;
+ }
+ final reply = <String, dynamic>{'visitId': id, 'requestId': request};
+ Map<String, dynamic> fail(String text) => {
+ ...reply,
+ 'ok': false,
+ 'error': text,
+ 'active':
+ _deviceVisit?.id == id &&
+ _deviceVisit?.connectionMachineId == connectionMachineId,
+ };
+ void clear() {
+ _deviceVisit?.dispose();
+ _deviceVisit = null;
+ }
+
+ if (op == 'cancel') {
+ if (_deviceVisit?.id == id &&
+ _deviceVisit?.connectionMachineId == connectionMachineId) {
+ clear();
+ }
+ return {
+ ...reply,
+ 'ok': true,
+ 'active': false,
+ 'agentId': focusedPane?.agentId,
+ };
+ }
+ final expires = command['expiresAt'];
+ if (_disposed ||
+ !inForeground ||
+ viewer != null ||
+ expires is! int ||
+ expires <= DateTime.now().millisecondsSinceEpoch ||
+ stateOf(connectionMachineId)?.machine.isShared != false) {
+ return fail('Return to the Harness window first.');
+ }
+ if (deviceNavigationAllowed?.call() != true) {
+ return fail('Close the picker and return to the terminal.');
+ }
+ bool atVisit(DeviceVisit v) =>
+ activeSwarmId == v.visitingSwarm &&
+ identical(focusedPane, v.visiting) &&
+ focusedPane?.machineId == v.visitingMachine &&
+ focusedPane?.agentId == v.visitingAgent;
+ final previous = _deviceVisit;
+ if (op == 'back') {
+ if (previous == null ||
+ previous.id != id ||
+ previous.connectionMachineId != connectionMachineId) {
+ return fail('The previous visit has ended.');
+ }
+ if (!atVisit(previous)) {
+ clear();
+ return fail('The pane changed. Choose your workspace from controls.');
+ }
+ final origin = swarms
+ .where((s) => s.id == previous.originSwarm)
+ .firstOrNull;
+ if (origin == null ||
+ !origin.panes.contains(previous.origin) ||
+ previous.origin.machineId != previous.originMachine ||
+ previous.origin.agentId != previous.originAgent) {
+ clear();
+ return fail('Your previous pane has closed.');
+ }
+ final restored = previous.bookmark.restore();
+ _fromDevice(() {
+ selectSwarm(origin.id, attachPending: false);
+ focusPane(previous.origin.id, reveal: true);
+ });
+ clear();
+ return {
+ ...reply,
+ 'ok': true,
+ 'active': false,
+ 'agentId': focusedPane?.agentId,
+ if (!restored)
+ 'note': 'Returned. The earlier text is no longer available.',
+ };
+ }
+ final fromMachine = command['fromMachineId'];
+ final fromAgent = command['fromAgentId'];
+ final machineId = command['machineId'];
+ final agentId = command['agentId'];
+ final latest = op == 'latest';
+ if (focusedPane?.machineId != fromMachine ||
+ focusedPane?.agentId != fromAgent ||
+ machineId is! String ||
+ agentId is! String ||
+ _dialFocusMachine(command, agentId) != machineId ||
+ (latest && (machineId != fromMachine || agentId != fromAgent)) ||
+ stateOf(machineId)?.machine.isShared != false) {
+ return fail('The pane changed. Choose the action again.');
+ }
+ if (previous != null &&
+ previous.id == id &&
+ (previous.connectionMachineId != connectionMachineId ||
+ !atVisit(previous))) {
+ return fail('The pane changed. Open the alert again.');
+ }
+ // Validate that a picker, composer, or another route does not own input.
+ final bookmark = focusedPane?.session?.bookmarkReading();
+ if (bookmark == null) {
+ return fail('Close the picker and return to the terminal.');
+ }
+ if (latest && focusedPane?.session?.showLatestReading() != true) {
+ bookmark.dispose();
+ return fail(
+ 'Latest output needs local terminal scrollback. Keep scrolling this program.',
+ );
+ }
+ final DeviceVisit visit;
+ if (previous != null && previous.id == id) {
+ bookmark.dispose();
+ visit = previous;
+ } else {
+ clear();
+ final pane = focusedPane!;
+ final agent = stateOf(pane.machineId)?.agents
+ .where((a) => a.id == pane.agentId)
+ .firstOrNull;
+ visit = DeviceVisit(
+ id: id as String,
+ connectionMachineId: connectionMachineId,
+ originSwarm: activeSwarmId,
+ origin: pane,
+ label: latest
+ ? 'Your reading'
+ : (agent?.name ?? activeSwarm.name).characters.take(48).toString(),
+ bookmark: bookmark,
+ );
+ }
+ // Membership and focus change synchronously. A network attachment may
+ // finish later, but must not delay the return token or move focus again.
+ if (!latest) {
+ unawaited(openAgentFromDial(machineId, agentId).catchError((_) {}));
+ }
+ if (focusedPane?.machineId != machineId ||
+ focusedPane?.agentId != agentId) {
+ visit.dispose();
+ _deviceVisit = null;
+ return fail('That agent could not be opened.');
+ }
+ if (!latest &&
+ identical(focusedPane, visit.origin) &&
+ activeSwarmId == visit.originSwarm) {
+ visit.dispose();
+ _deviceVisit = null;
+ return {
+ ...reply,
+ 'ok': true,
+ 'active': false,
+ 'agentId': focusedPane?.agentId,
+ };
+ }
+ visit.visiting = focusedPane;
+ visit.visitingSwarm = activeSwarmId;
+ visit.visitingMachine = machineId;
+ visit.visitingAgent = agentId;
+ _deviceVisit = visit;
+ return {
+ ...reply,
+ 'ok': true,
+ 'active': true,
+ 'label': visit.label,
+ 'agentId': focusedPane?.agentId,
+ };
+ }
+
+ /// Reading context for the physical device. A cancel can clear its old pane;
+ /// all other operations require the named pane to remain visibly focused.
+ ({Map<String, dynamic> reply, TerminalSession? session})?
+ _devicePassageTarget(
+ String connectionMachineId,
+ Map<String, dynamic> command,
+ ) {
+ final id = command['selectionId'];
+ final request = command['requestId'];
+ final agentId = command['agentId'];
+ final machineId = command['machineId'];
+ final revision = command['revision'];
+ final op = command['op'];
+ bool identifier(Object? v) =>
+ v is String && RegExp(r'^[a-zA-Z0-9-]{1,64}$').hasMatch(v);
+ if (!identifier(id) ||
+ !identifier(request) ||
+ agentId is! String ||
+ agentId.isEmpty ||
+ agentId.length > 200 ||
+ machineId != connectionMachineId ||
+ revision is! int ||
+ revision < 1 ||
+ revision > 0x7fffffff ||
+ !const [
+ 'begin',
+ 'step',
+ 'extend',
+ 'pin',
+ 'cancel',
+ 'search',
+ 'match',
+ 'lines',
+ ].contains(op)) {
+ return null;
+ }
+ final reply = <String, dynamic>{
+ 'selectionId': id,
+ 'requestId': request,
+ 'agentId': agentId,
+ 'machineId': machineId,
+ 'revision': revision,
+ };
+ TerminalSession? session;
+ if (op == 'cancel') {
+ session = allPanes
+ .where((p) => p.machineId == machineId && p.agentId == agentId)
+ .map((p) => p.session)
+ .whereType<TerminalSession>()
+ .firstOrNull;
+ } else if (inForeground &&
+ focusedPane?.machineId == machineId &&
+ focusedPane?.agentId == agentId &&
+ focusedPane?.isWeb != true &&
+ stateOf(connectionMachineId)?.machine.isShared != true) {
+ session = focusedPane?.session;
+ }
+ return (reply: reply, session: session);
+ }
+
+ Map<String, dynamic>? selectDevicePassage(
+ String connectionMachineId,
+ Map<String, dynamic> command,
+ ) {
+ if (const ['search', 'match'].contains(command['op'])) return null;
+ final target = _devicePassageTarget(connectionMachineId, command);
+ if (target == null) return null;
+ return {
+ ...target.reply,
+ ...?target.session?.selectPassage(command),
+ if (target.session == null) ...{
+ 'ok': false,
+ 'error': 'Select that terminal pane in Harness first.',
+ },
+ };
+ }
+
+ Future<Map<String, dynamic>?> searchDevicePassage(
+ String connectionMachineId,
+ Map<String, dynamic> command,
+ ) async {
+ if (!const ['search', 'match'].contains(command['op'])) return null;
+ final target = _devicePassageTarget(connectionMachineId, command);
+ if (target == null) return null;
+ final result = await target.session?.searchPassage(command);
+ // Search yields during long scans. The owning window must still be active
+ // when it returns; no result can silently move to a different terminal.
+ final current = _devicePassageTarget(connectionMachineId, command);
+ return {
+ ...target.reply,
+ if (target.session != null && identical(current?.session, target.session))
+ ...?result
+ else ...{
+ 'ok': false,
+ 'error': 'Select that terminal pane in Harness first.',
+ },
+ };
+ }
+
/// Resolve a dial agent to the machine that owns it.
///
/// New CLIs state the machine explicitly. Older CLIs only sent an agent id;
@@ -11417,6 +11796,32 @@ class AppNotifier extends ChangeNotifier {
(payload['velocity'] as num?)?.round() ?? 0,
);
return;
+ case 'dial_selection':
+ final reply = const ['search', 'match'].contains(payload['op'])
+ ? await searchDevicePassage(machineId, payload)
+ : selectDevicePassage(machineId, payload);
+ if (reply != null) {
+ await _pool?[machineId]?.sendTerminalFrame(
+ 'app_selection_result',
+ reply,
+ );
+ }
+ return;
+ case 'dial_visit':
+ final result = visitFromDevice(machineId, payload);
+ if (result != null) {
+ await _pool?[machineId]?.sendTerminalFrame(
+ 'app_visit_result',
+ result,
+ );
+ }
+ return;
+ case 'dial_form':
+ final result = await formFromDevice(machineId, payload);
+ if (result != null) {
+ await _pool?[machineId]?.sendTerminalFrame('app_form_result', result);
+ }
+ return;
case 'device_focus':
unawaited(ensureDeviceFocus(payload));
break;
@@ -11854,6 +12259,7 @@ class AppNotifier extends ChangeNotifier {
@override
void dispose() {
viewer?.auth.dispose();
+ _deviceVisit?.dispose();
_modelManager?.dispose();
_modelsMenu?.dispose();
for (final project in _orchestratorProjects.values) {
diff --git a/desktop/lib/state/device_finder.dart b/desktop/lib/state/device_finder.dart
new file mode 100644
index 000000000..971fb00fe
--- /dev/null
+++ b/desktop/lib/state/device_finder.dart
@@ -0,0 +1,165 @@
+import 'dart:async';
+import 'dart:convert';
+
+import 'device_form.dart';
+import 'swarm_navigation.dart';
+import 'swarm_search.dart';
+
+/// A remote for the real Cmd-P controller. Speech filters; a separate explicit
+/// activation opens one exact existing harness through the normal app route.
+class DeviceFinder {
+ DeviceFinder(
+ this.search, {
+ required this.choose,
+ required this.dismiss,
+ required this.isComposing,
+ }) {
+ port.attach(_read, _act);
+ }
+
+ final SwarmSearchController search;
+ final Future<bool> Function(SwarmSearchSelection) choose;
+ final void Function() dismiss;
+ final bool Function() isComposing;
+ final port = DeviceFormPort(explicitGuard: true);
+ bool _busy = false, _closed = false, _finished = false;
+ String _error = '';
+ Map<String, dynamic> _last = {};
+
+ bool get supported =>
+ search.scopePrefix.isEmpty &&
+ !search.isHelpMode &&
+ !search.isCommandMode &&
+ search.setupLayout &&
+ !search.managing &&
+ search.split == null;
+
+ Map<String, dynamic> _read() {
+ if (_finished) {
+ return {'active': false, 'ok': _error.isEmpty, 'error': _error};
+ }
+ if (_closed && !_busy) return {'active': false};
+ if (_busy) {
+ return {
+ ..._last,
+ 'busy': true,
+ 'enabled': false,
+ 'canQuery': false,
+ 'status': 'Opening...',
+ 'guard': 'opening',
+ };
+ }
+ final row = search.selected;
+ final valid =
+ supported &&
+ row?.agentId != null &&
+ !row!.isCreate &&
+ !row.isCommand &&
+ !row.isModel &&
+ !row.isStoreEntry;
+ final enabled = valid && search.canSubmit(row);
+ final composing = isComposing();
+ String at(int index) => index >= 0 && index < search.rows.length
+ ? search.rows[index].title
+ : '';
+ return _last = {
+ 'active': true, 'title': 'Find Harness',
+ 'label':
+ row?.title ?? (search.rows.isEmpty ? 'No matches' : 'Say a name'),
+ 'detail': row?.terminalDetail ?? row?.detail ?? 'Or drag to browse',
+ 'previous': at(search.cursor - 1), 'next': at(search.cursor + 1),
+ 'position': search.cursor < 0 ? 0 : search.cursor + 1,
+ 'total': search.rows.length, 'busy': false,
+ 'enabled': enabled && !composing, 'canQuery': supported && !composing,
+ 'query': search.query, 'status': '',
+ 'action': search.actionLabel(row) == 'Resume & open' ? 'resume' : 'open',
+ 'error': _error.isNotEmpty
+ ? _error
+ : !supported
+ ? 'Continue this picker on desktop.'
+ : row?.isCreate == true
+ ? 'Use New Harness to start new work.'
+ : valid && !enabled
+ ? search.sessionUnavailable(row) ?? search.unavailableMessage
+ : '',
+ // Status/age/preview refreshes must not cancel a spoken name. Selection,
+ // editing, scope, availability and destination changes must.
+ 'guard': jsonEncode([
+ search.query,
+ search.targetId,
+ search.placement?.name,
+ search.scopePrefix,
+ search.draft.groupScope?.id,
+ search.sessionFilter.name,
+ search.scopedMachineId,
+ search.scopedBranch,
+ row?.id,
+ row?.machineId,
+ row?.agentId,
+ row?.swarmId,
+ row?.paneId,
+ row?.closedId,
+ enabled,
+ supported,
+ composing,
+ ]),
+ };
+ }
+
+ void _act(String op, int delta, String? text) {
+ if (_busy || _closed || _finished || isComposing()) return;
+ _error = '';
+ if (op == 'back') {
+ if (!search.back()) {
+ if (search.query.isNotEmpty) {
+ search.setQuery('');
+ } else {
+ dismiss();
+ }
+ }
+ } else if (op == 'close') {
+ dismiss();
+ } else if (op == 'move' && supported) {
+ search.move(delta);
+ } else if (op == 'query' && supported && text != null) {
+ final name = text
+ .replaceAll(RegExp(r'[\r\n]+'), ' ')
+ .trim()
+ .replaceFirst(RegExp(r'[.!?。!?]+$'), '')
+ .trim();
+ // Names stay in harness search. Prefix commands and management scopes
+ // need their own labeled entry points; STT cannot open them accidentally.
+ if (name.isEmpty || RegExp(r'^[@#:*>?]').hasMatch(name)) {
+ _error = 'Say a harness, project or machine name.';
+ } else {
+ search.setQuery(name);
+ }
+ } else if (op == 'activate' && _read()['enabled'] == true) {
+ final choice = search.submit();
+ if (choice == null) return;
+ _busy = true;
+ unawaited(_open(choice));
+ }
+ }
+
+ Future<void> _open(SwarmSearchSelection choice) async {
+ var opened = false;
+ try {
+ opened = await choose(choice);
+ } catch (_) {
+ /* Report below. */
+ }
+ _busy = false;
+ _finished = true;
+ if (opened) {
+ port.detach();
+ } else {
+ _error = 'Could not open that harness. Check desktop, then retry.';
+ }
+ }
+
+ void close() {
+ _closed = true;
+ if (!_busy) port.detach();
+ }
+}
diff --git a/desktop/lib/state/device_form.dart b/desktop/lib/state/device_form.dart
new file mode 100644
index 000000000..ebdb9753f
--- /dev/null
+++ b/desktop/lib/state/device_form.dart
@@ -0,0 +1,90 @@
+import 'package:flutter/foundation.dart';
+
+/// A small, semantic remote for an existing form. The widget owns all choices
+/// and actions; the device never manufactures keystrokes or creation requests.
+class DeviceFormPort {
+ DeviceFormPort({this.explicitGuard = false});
+
+ /// A live finder may refresh status text while its selected identity stays
+ /// fixed. Its guard includes the actual action target and editing context.
+ final bool explicitGuard;
+ Map<String, dynamic> Function()? _read;
+ void Function(String op, int delta, String? text)? _act;
+ Map<String, dynamic>? _last;
+ int _revision = 0;
+ ({String id, int revision})? _query;
+
+ void attach(
+ Map<String, dynamic> Function() read,
+ void Function(String op, int delta, String? text) act,
+ ) {
+ _read = read;
+ _act = act;
+ }
+
+ void detach() {
+ _read = null;
+ _act = null;
+ _query = null;
+ }
+
+ Map<String, dynamic> snapshot() {
+ final next = _read?.call() ?? {'active': false};
+ final previous = _last ?? const <String, dynamic>{};
+ final changed = explicitGuard
+ ? next['active'] != previous['active'] ||
+ next['guard'] != previous['guard']
+ : !mapEquals(next, _last);
+ if (changed) {
+ _revision++;
+ _query = null;
+ }
+ _last = next;
+ return {'ok': true, ...next, 'revision': _revision}..remove('guard');
+ }
+
+ Map<String, dynamic> command(
+ String op,
+ int revision,
+ int delta, {
+ String? queryId,
+ String? text,
+ }) {
+ final before = snapshot();
+ if (op == 'state' || before['active'] != true) return before;
+ if (op == 'query.cancel') {
+ if (_query?.id == queryId) _query = null;
+ return before;
+ }
+ if (revision != _revision) {
+ return {...before, 'ok': false, 'error': 'Choices changed. Try again.'};
+ }
+ if (op == 'query.begin') {
+ if (before['canQuery'] != true || queryId == null) {
+ return {
+ ...before,
+ 'ok': false,
+ 'error': 'Choose an Agent or Project field to search.',
+ };
+ }
+ _query = (id: queryId, revision: revision);
+ return {...before, 'queryId': queryId};
+ }
+ if (op == 'query') {
+ if (_query?.id != queryId ||
+ _query?.revision != revision ||
+ before['canQuery'] != true ||
+ text == null ||
+ text.trim().isEmpty) {
+ return {
+ ...before,
+ 'ok': false,
+ 'error': 'The voice search ended. Say the name again.',
+ };
+ }
+ _query = null; // single use, including when applying the same query twice
+ }
+ _act?.call(op, delta, text);
+ return snapshot();
+ }
+}
diff --git a/desktop/lib/state/device_visit.dart b/desktop/lib/state/device_visit.dart
new file mode 100644
index 000000000..b1e9d82c4
--- /dev/null
+++ b/desktop/lib/state/device_visit.dart
@@ -0,0 +1,24 @@
+import '../terminal/terminal_viewport.dart';
+import 'terminal_pane.dart';
+
+/// One intentional attention detour, held only in this window's memory.
+/// Keeping pane identity prevents a replaced/closed tile becoming a return
+/// destination; the reading anchor lives in its retained terminal renderer.
+class DeviceVisit {
+ DeviceVisit({
+ required this.id,
+ required this.connectionMachineId,
+ required this.originSwarm,
+ required this.origin,
+ required this.label,
+ required this.bookmark,
+ }) : originMachine = origin.machineId,
+ originAgent = origin.agentId;
+ final String id, connectionMachineId, originSwarm, label, originMachine;
+ final String? originAgent;
+ final TerminalPane origin;
+ final TerminalReadingBookmark bookmark;
+ String? visitingSwarm, visitingMachine, visitingAgent;
+ TerminalPane? visiting;
+ void dispose() => bookmark.dispose();
+}
diff --git a/desktop/lib/terminal/terminal_passage.dart b/desktop/lib/terminal/terminal_passage.dart
new file mode 100644
index 000000000..9f83c8556
--- /dev/null
+++ b/desktop/lib/terminal/terminal_passage.dart
@@ -0,0 +1,123 @@
+import 'dart:convert';
+import 'dart:math' as math;
+
+import 'package:xterm/xterm.dart';
+
+/// A local reading cursor. It never sends keys, scroll reports or terminal input.
+/// Anchors follow retained scrollback; changed text invalidates the selection
+/// instead of silently making "this" refer to a different passage.
+class TerminalPassage {
+ static const maxRows = 16;
+ static const maxBytes = 4096;
+
+ TerminalPassage(this.terminal, int row, {int? lastRow})
+ : _buffer = terminal.buffer {
+ final start = row.clamp(0, _buffer.lines.length - 1);
+ _anchor = _buffer.createAnchor(0, start);
+ _end = _buffer.createAnchor(
+ 0,
+ (lastRow ?? start).clamp(start, _buffer.lines.length - 1),
+ );
+ if (rows > maxRows) {
+ error = 'Choose a shorter passage.';
+ } else {
+ _remember();
+ }
+ }
+
+ final Terminal terminal;
+ final Buffer _buffer;
+ late CellAnchor _anchor, _end;
+ String _text = '';
+ String? error;
+ bool extending = false;
+ bool pinned = false;
+ bool _disposed = false;
+ int? _pinnedRows;
+
+ BufferRangeLine get range {
+ final first = math.min(_anchor.y, _end.y);
+ final last = math.max(_anchor.y, _end.y);
+ return BufferRangeLine(
+ CellOffset(0, first),
+ CellOffset(_buffer.lines[last].length, last),
+ );
+ }
+
+ int get rows => _pinnedRows ?? (_anchor.y - _end.y).abs() + 1;
+ String get text => _text;
+
+ bool get canHighlight =>
+ !_disposed &&
+ identical(terminal.buffer, _buffer) &&
+ _anchor.attached &&
+ _end.attached &&
+ (_anchor.y - _end.y).abs() < maxRows &&
+ _buffer.getText(range).trimRight() == _text;
+
+ bool validate() {
+ if (_disposed || error != null) return false;
+ if (pinned) return true; // immutable snapshot, captured before the mic turn
+ if (!canHighlight) {
+ error = 'That text changed. Choose it again.';
+ return false;
+ }
+ return true;
+ }
+
+ void _remember() {
+ _text = _buffer.getText(range).trimRight();
+ if (utf8.encode(_text).length > maxBytes) {
+ error = 'Choose a shorter passage.';
+ }
+ }
+
+ bool step(int delta) {
+ if (!validate() || pinned || delta == 0) return false;
+ final next = (_end.y + delta.clamp(-8, 8))
+ .clamp(
+ extending ? math.max(0, _anchor.y - maxRows + 1) : 0,
+ extending
+ ? math.min(_buffer.lines.length - 1, _anchor.y + maxRows - 1)
+ : _buffer.lines.length - 1,
+ )
+ .toInt();
+ _end.dispose();
+ _end = _buffer.createAnchor(0, next);
+ if (!extending) {
+ _anchor.dispose();
+ _anchor = _buffer.createAnchor(0, next);
+ }
+ _remember();
+ return error == null;
+ }
+
+ bool setExtending(bool value) {
+ if (!validate() || pinned) return false;
+ if (!value) {
+ _anchor.dispose();
+ _anchor = _buffer.createAnchor(0, _end.y);
+ }
+ extending = value;
+ _remember();
+ return error == null;
+ }
+
+ String? pin() {
+ if (!validate()) return null;
+ if (_text.trim().isEmpty) {
+ error = 'Choose a line with text.';
+ return null;
+ }
+ _pinnedRows = rows;
+ pinned = true;
+ return _text;
+ }
+
+ void dispose() {
+ if (_disposed) return;
+ _disposed = true;
+ _anchor.dispose();
+ _end.dispose();
+ }
+}
diff --git a/desktop/lib/terminal/terminal_session.dart b/desktop/lib/terminal/terminal_session.dart
index 46750faea..5d62885f0 100644
--- a/desktop/lib/terminal/terminal_session.dart
+++ b/desktop/lib/terminal/terminal_session.dart
@@ -1292,8 +1292,37 @@ class TerminalSession extends ChangeNotifier {
void find(TerminalFindAction action) => _viewport?.find(action);
+ Map<String, dynamic> selectPassage(Map<String, dynamic> command) {
+ final viewport = _viewport;
+ return viewport is TerminalPassageViewport
+ ? (viewport as TerminalPassageViewport).selectPassage(command)
+ : {'ok': false, 'error': 'Open the terminal pane first.'};
+ }
+
+ Future<Map<String, dynamic>> searchPassage(
+ Map<String, dynamic> command,
+ ) async {
+ final viewport = _viewport;
+ return viewport is TerminalPassageSearchViewport
+ ? (viewport as TerminalPassageSearchViewport).searchPassage(command)
+ : {'ok': false, 'error': 'Open the terminal pane first.'};
+ }
+
bool focusInput() => _viewport?.focusInput() ?? false;
+ TerminalReadingBookmark? bookmarkReading() {
+ final viewport = _viewport;
+ return viewport is TerminalReadingViewport
+ ? (viewport as TerminalReadingViewport).bookmarkReading()
+ : null;
+ }
+
+ bool showLatestReading() {
+ final viewport = _viewport;
+ return viewport is TerminalLatestViewport &&
+ (viewport as TerminalLatestViewport).showLatestReading();
+ }
+
/// Coalescing windows for the two things the user drives directly.
///
/// Both are leading + trailing: act on the first event, batch the rest. A flat trailing debounce
diff --git a/desktop/lib/terminal/terminal_viewport.dart b/desktop/lib/terminal/terminal_viewport.dart
index 639a7f912..39d1e065e 100644
--- a/desktop/lib/terminal/terminal_viewport.dart
+++ b/desktop/lib/terminal/terminal_viewport.dart
@@ -2,6 +2,34 @@
/// do not travel to the remote tmux pane.
enum TerminalFindAction { open, next, previous }
+/// Optional capability: small device gestures can select local output without
+/// turning them into arrow keys or mouse reports in the running program.
+abstract interface class TerminalPassageViewport {
+ Map<String, dynamic> selectPassage(Map<String, dynamic> command);
+}
+
+/// Spoken lookup shares the local terminal index; scans may yield to rendering.
+abstract interface class TerminalPassageSearchViewport {
+ Future<Map<String, dynamic>> searchPassage(Map<String, dynamic> command);
+}
+
+/// One local reading position. Restoring consumes it, even if the original
+/// buffer has gone away. It never reopens a stream or sends terminal input.
+abstract interface class TerminalReadingBookmark {
+ bool restore();
+ void dispose();
+}
+
+abstract interface class TerminalReadingViewport {
+ TerminalReadingBookmark? bookmarkReading();
+}
+
+/// Show the end of local scrollback without sending keys or mouse input to the
+/// running program. Full-screen applications own their scrolling and refuse.
+abstract interface class TerminalLatestViewport {
+ bool showLatestReading();
+}
+
abstract interface class TerminalViewport {
/// One report from the hardware dial.
///
diff --git a/desktop/lib/widgets/new_harness_form.dart b/desktop/lib/widgets/new_harness_form.dart
index e48d65248..4be27210e 100644
--- a/desktop/lib/widgets/new_harness_form.dart
+++ b/desktop/lib/widgets/new_harness_form.dart
@@ -1,4 +1,5 @@
import 'dart:async';
+import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -12,6 +13,7 @@ import '../terminal/terminal_text.dart';
import '../terminal/terminal_theme.dart';
import '../terminal/terminal_theme_store.dart';
import '../state/new_harness.dart';
+import '../state/device_form.dart';
import 'box_chrome.dart' show kTerminalCornerRadius, terminalPaneBorder;
import 'dsh_install_panel.dart' show describeInstallFailure;
@@ -28,6 +30,7 @@ class NewHarnessForm extends StatefulWidget {
this.onStore,
this.onLinkProfile,
this.onNeedsForm,
+ this.devicePort,
});
final NewHarnessController controller;
@@ -35,6 +38,7 @@ class NewHarnessForm extends StatefulWidget {
final VoidCallback onCreated;
final FutureOr<void> Function()? onBrowse;
final VoidCallback? onStore, onLinkProfile, onNeedsForm;
+ final DeviceFormPort? devicePort;
@override
State<NewHarnessForm> createState() => _NewHarnessFormState();
@@ -91,6 +95,7 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
super.initState();
_observedField = box.field;
box.addListener(_onBox);
+ widget.devicePort?.attach(_deviceSnapshot, _deviceAction);
// The pane colours can change under an open dialog; it wears them too.
terminalThemeStore.addListener(_onBox);
WidgetsBinding.instance.addPostFrameCallback((_) {
@@ -103,6 +108,7 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
@override
void dispose() {
+ widget.devicePort?.detach();
box.removeListener(_onBox);
terminalThemeStore.removeListener(_onBox);
_inputFocus.dispose();
@@ -224,6 +230,125 @@ class _NewHarnessFormState extends State<NewHarnessForm> {
_Row.start => box.checking ? 'Check status' : _label(row),
};
+ // These leave this form for a native sheet, account flow or another route.
+ // Until those surfaces have a semantic remote, keep them explicit on desktop.
+ static const _desktopDoors = {
+ NewHarnessController.browseId,
+ NewHarnessController.linkProfileId,
+ NewHarnessController.storeId,
+ NewHarnessController.manageModelsId,
+ };
+
+ // Names in existing lists, never a shell command, folder path or repository
+ // URL. Speaking filters; choosing and creating remain distinct gestures.
+ static const _voiceSearchFields = {
+ NewHarnessField.harness, NewHarnessField.agent, NewHarnessField.projectMenu,
+ NewHarnessField.machine, NewHarnessField.model, NewHarnessField.branch,
+ NewHarnessField.profile, NewHarnessField.mode,
+ };
+
+ Map<String, dynamic> _deviceSnapshot() {
+ final option = _picking ? box.selected : null;
+ final rows = _rows;
+ final index = _picking ? box.cursor : rows.indexOf(_row);
+ final count = _picking ? box.options.length : rows.length;
+ String at(int i) => i < 0 || i >= count
+ ? ''
+ : _picking
+ ? box.options[i].title
+ : _label(rows[i]);
+ final blocked = _blocked(_row);
+ final desktop = option != null && _desktopDoors.contains(option.id);
+ return {
+ 'active': true,
+ 'title': _picking ? _label(_row) : 'New Harness',
+ 'label': _picking ? option?.title ?? 'No matches' : _label(_row),
+ 'detail': _picking
+ ? option?.detail ?? ''
+ : _row == _Row.start
+ ? '${box.launchAgentLabel}\n${box.launchProjectLabel}'
+ : _value(_row),
+ 'previous': at(index - 1),
+ 'next': at(index + 1),
+ 'position': index < 0 ? 0 : index + 1,
+ 'total': count,
+ 'busy': box.busy || box.linkingProfile,
+ 'canQuery': !box.locked && !_isComposing() && _fieldOf(_row) != null &&
+ blocked == null && _voiceSearchFields.contains(box.field),
+ 'query': box.query,
+ 'enabled':
+ !box.busy &&
+ !box.linkingProfile &&
+ blocked == null &&
+ !desktop &&
+ (!_picking || option?.enabled == true),
+ 'action': _picking
+ ? 'choose'
+ : _row == _Row.start
+ ? box.checking
+ ? 'check status'
+ : 'start'
+ : _row == _Row.worktree || _row == _Row.advanced
+ ? 'toggle'
+ : 'open',
+ 'error':
+ box.error ??
+ (desktop
+ ? 'Continue on desktop for this choice.'
+ : blocked ?? (option?.enabled == false ? option?.why : null)) ??
+ '',
+ 'status': box.status ?? '',
+ // Full identities and launch settings stay in the revision guard. A
+ // short device label cannot authorize a different same-named project.
+ 'guard': jsonEncode([
+ box.field.name,
+ option?.id,
+ option?.machineId,
+ option?.project?.folder,
+ option?.project?.repository?.url,
+ option?.project?.name,
+ box.machineId,
+ box.engine,
+ box.harnessId,
+ box.project.folder,
+ box.project.repository?.url,
+ box.project.name,
+ box.mode,
+ box.model?.id,
+ box.model?.grid,
+ box.model?.node,
+ box.draft.profile?.path,
+ box.branchRef,
+ box.branchRowLabel,
+ box.worktree,
+ box.task,
+ ]),
+ };
+ }
+
+ void _deviceAction(String op, int delta, String? text) {
+ if (!mounted || _isComposing()) return;
+ if (op == 'back') {
+ _cancel();
+ } else if (op == 'close') {
+ if (box.requestDismiss()) widget.onClose();
+ } else if (op == 'move') {
+ if (!box.locked) _picking ? _stepMatch(delta) : _moveRow(delta);
+ } else if (op == 'activate') {
+ if (_deviceSnapshot()['enabled'] == true) _confirm();
+ } else if (op == 'query' && _deviceSnapshot()['canQuery'] == true && text != null) {
+ // A recognizer often adds a final period to a spoken name. Preserve the
+ // name, Unicode and internal punctuation; never interpret it as a command.
+ final query = text.replaceAll(RegExp(r'[\r\n]+'), ' ').trim()
+ .replaceFirst(RegExp(r'[.!?。!?]+$'), '').trim();
+ if (query.isNotEmpty) _onTyped(query);
+ }
+ if (mounted) {
+ _focusEditor();
+ _revealRow();
+ }
+ }
+
/// Focusing a row focuses the field it edits, so the controller's option
/// list — and therefore ← and → — is already the right one.
void _syncField() {
diff --git a/desktop/lib/widgets/terminal_panel.dart b/desktop/lib/widgets/terminal_panel.dart
index cee1f0af2..259fcd151 100644
--- a/desktop/lib/widgets/terminal_panel.dart
+++ b/desktop/lib/widgets/terminal_panel.dart
@@ -3,6 +3,7 @@ import '../shared/theme/prompt_style.dart';
import 'prompt_context.dart';
import 'dart:async';
+import 'dart:convert';
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
@@ -24,6 +25,8 @@ import '../shortcuts/app_keymap.dart';
import '../shortcuts/keymap.dart';
import 'terminal_find_bar.dart';
import '../terminal/terminal_search.dart';
+import '../terminal/terminal_passage.dart';
+import 'terminal_text_action.dart';
import '../terminal/terminal_snapshot.dart';
import '../terminal/terminal_binary.dart';
import '../terminal/terminal_text.dart';
@@ -186,7 +189,12 @@ class TerminalPanel extends StatefulWidget {
class _TerminalPanelState extends State<TerminalPanel>
with WidgetsBindingObserver
- implements TerminalViewport {
+ implements
+ TerminalViewport,
+ TerminalPassageViewport,
+ TerminalPassageSearchViewport,
+ TerminalReadingViewport,
+ TerminalLatestViewport {
static const _dialScale = 2.5;
static const _dialStopVelocity = 40.0;
static const _dialDecayPerSecond = 0.002;
@@ -199,6 +207,8 @@ class _TerminalPanelState extends State<TerminalPanel>
final FocusNode _composerFocus = FocusNode();
final _findBarKey = GlobalKey<TerminalFindBarState>();
TerminalSearch? _find;
+ final Set<_ReadingBookmark> _readingBookmarks = {};
+ _ReadingBookmark? _readingReturn;
String _lastFindQuery = '';
bool _lastFindCaseSensitive = false;
CellAnchor? _lastFindAnchor;
@@ -217,6 +227,13 @@ class _TerminalPanelState extends State<TerminalPanel>
Timer? _cursorBlinkTimer;
ValueListenable<TickerModeData>? _tickerMode;
double _dialVelocity = 0;
+ TerminalPassage? _passage;
+ TerminalSearch? _passageSearch;
+ TerminalHighlight? _passageHighlight;
+ String? _passageId;
+ int _passageRevision = 0;
+ String? _passageStream;
+ bool _passageRefreshPending = false;
bool _cursorBlinkVisible = true;
double _alternateScrollRemainder = 0;
int? _lastInertiaMicros;
@@ -236,7 +253,8 @@ class _TerminalPanelState extends State<TerminalPanel>
Widget? _header;
/// Opens this pane's model picker from outside its header — the model note's "Pick another".
- final GridModelPickerController _pickerController = GridModelPickerController();
+ final GridModelPickerController _pickerController =
+ GridModelPickerController();
/// What this pane's "Starting up…" chip said at the last build, so a change for another agent's
/// pane does not rebuild this one. See [ModelStartWatch].
@@ -266,6 +284,7 @@ class _TerminalPanelState extends State<TerminalPanel>
super.initState();
_viewTerminal = widget.session.terminal;
_viewTerminal.addListener(_scheduleLinkRefresh);
+ _viewTerminal.addListener(_onPassageOutput);
_scrollController.addListener(_onScrollChanged);
_terminalViewKey = GlobalKey<TerminalViewState>();
_linkOpener = widget.linkOpener ?? TerminalLinkOpener();
@@ -355,6 +374,7 @@ class _TerminalPanelState extends State<TerminalPanel>
_startPhase = _startPhaseNow();
_syncNoteLine();
if (!identical(oldWidget.session, widget.session)) {
+ _closePassage(rebuild: false);
_closeFind(restore: false, focus: false, rebuild: false);
_clearLastFind();
_lastFindQuery = '';
@@ -369,8 +389,10 @@ class _TerminalPanelState extends State<TerminalPanel>
_cancelDialInertia();
_controller.clearSelection();
_viewTerminal.removeListener(_scheduleLinkRefresh);
+ _viewTerminal.removeListener(_onPassageOutput);
_viewTerminal = widget.session.terminal;
_viewTerminal.addListener(_scheduleLinkRefresh);
+ _viewTerminal.addListener(_onPassageOutput);
_pressedLink = null;
_hoveredLink = null;
_observeLinkModifiers(false);
@@ -381,6 +403,7 @@ class _TerminalPanelState extends State<TerminalPanel>
_afterTerminalMounted();
}
if (oldWidget.visible && !widget.visible) {
+ _closePassage(rebuild: false);
_rememberFollowTail();
_focusNode.unfocus();
_composerFocus.unfocus();
@@ -392,7 +415,9 @@ class _TerminalPanelState extends State<TerminalPanel>
}
if (widget.visible &&
(!oldWidget.visible || oldWidget.paneLocation != widget.paneLocation)) {
- _afterTerminalMounted();
+ // Device navigation is also a reading gesture. A retained pane keeps
+ // its place; a pane already following output still shows the latest.
+ _afterTerminalMounted(scrollToEnd: widget.focusByUser || _followTail);
}
// Shown again (a tab switched to, a zoom undone) while it is the tile the
// person left focused: they are back on it — unless a device switched the
@@ -422,17 +447,24 @@ class _TerminalPanelState extends State<TerminalPanel>
if (oldWidget.composerVisible != widget.composerVisible) {
_afterTerminalMounted();
}
+ if (oldWidget.focused && !widget.focused) _closePassage(rebuild: false);
_syncCursorBlink();
}
@override
void dispose() {
+ for (final bookmark in _readingBookmarks.toList()) {
+ bookmark.release();
+ }
+ _readingReturn?.release();
+ _closePassage(rebuild: false);
_closeFind(restore: false, focus: false, rebuild: false);
_clearLastFind();
WidgetsBinding.instance.removeObserver(this);
_tickerMode?.removeListener(_syncCursorBlink);
_previewCancellation?.cancel();
_viewTerminal.removeListener(_scheduleLinkRefresh);
+ _viewTerminal.removeListener(_onPassageOutput);
_scrollController.removeListener(_onScrollChanged);
_observeLinkModifiers(false);
widget.session.setCursorBlinkPhase(true);
@@ -565,6 +597,7 @@ class _TerminalPanelState extends State<TerminalPanel>
void _syncTerminal(Terminal terminal) {
if (identical(_viewTerminal, terminal)) return;
+ _closePassage(rebuild: false);
final previous = _viewTerminal.buffer;
final next = terminal.buffer;
@@ -614,8 +647,10 @@ class _TerminalPanelState extends State<TerminalPanel>
// before the TerminalView starts laying out the replacement terminal.
_controller.clearSelection();
_viewTerminal.removeListener(_scheduleLinkRefresh);
+ _viewTerminal.removeListener(_onPassageOutput);
_viewTerminal = terminal;
_viewTerminal.addListener(_scheduleLinkRefresh);
+ _viewTerminal.addListener(_onPassageOutput);
_pressedLink = null;
_hoveredLink = null;
_observeLinkModifiers(false);
@@ -936,6 +971,9 @@ class _TerminalPanelState extends State<TerminalPanel>
bool claimFocus = true,
int retries = 2,
}) {
+ // A deliberate device return preserves reading through visibility/layout
+ // callbacks which ordinarily reveal the newest terminal output.
+ scrollToEnd = scrollToEnd && _readingReturn == null;
// Request alignment before this frame's layout, so even a retained pane's
// first visible paint uses its new size. Keep Find's explicit location.
if (scrollToEnd && _find == null) {
@@ -970,6 +1008,22 @@ class _TerminalPanelState extends State<TerminalPanel>
if (scrollToEnd && _followTail && _find == null) {
view.scrollToBottom();
}
+ final returning = _readingReturn;
+ if (returning != null) {
+ _readingReturn = null;
+ if (returning.valid && _scrollController.hasClients) {
+ final position = _scrollController.position;
+ _followTail = returning.followTail;
+ position.jumpTo(
+ (returning.followTail
+ ? position.maxScrollExtent
+ : (returning.anchor.y + returning.fraction) *
+ renderTerminal.lineHeight)
+ .clamp(position.minScrollExtent, position.maxScrollExtent),
+ );
+ }
+ returning.release();
+ }
// Never over the composer: a rebuild that re-focuses this tile while someone is typing into
// the box would pull the caret out from under them mid-sentence.
if (claimFocus) _claimFocus(view);
@@ -981,6 +1035,7 @@ class _TerminalPanelState extends State<TerminalPanel>
@override
void find(TerminalFindAction action) {
if (!mounted || !widget.visible || !widget.focused) return;
+ _closePassage(rebuild: false);
final wasClosed = _find == null;
if (wasClosed) {
final view = _laidOutTerminalView();
@@ -1148,6 +1203,395 @@ class _TerminalPanelState extends State<TerminalPanel>
if (phase == 2) _startDialInertia(velocity.toDouble());
}
+ @override
+ TerminalReadingBookmark? bookmarkReading() {
+ if (!mounted ||
+ !widget.visible ||
+ !widget.focused ||
+ !_canClaimInput ||
+ !_keyboardIsOursOrIdle ||
+ !(_tickerMode?.value.enabled ?? false) ||
+ !_scrollController.hasClients) {
+ return null;
+ }
+ final render = _laidOutTerminalView()?.renderTerminal;
+ if (render == null || render.lineHeight <= 0) return null;
+ _cancelDialInertia();
+ _readingReturn?.release();
+ final position = _scrollController.position;
+ final row = position.pixels / render.lineHeight;
+ final bookmark = _ReadingBookmark(
+ this,
+ _viewTerminal.buffer,
+ _viewTerminal.buffer.createAnchor(
+ 0,
+ row.floor().clamp(0, _viewTerminal.buffer.lines.length - 1),
+ ),
+ row - row.floor(),
+ position.maxScrollExtent - position.pixels <= 2,
+ widget.session.streamId,
+ );
+ // A chained visit may validate the same pane that owns the original
+ // bookmark. Its short-lived new anchor must not invalidate that origin.
+ _readingBookmarks.add(bookmark);
+ return bookmark;
+ }
+
+ @override
+ bool showLatestReading() {
+ if (!mounted ||
+ !widget.visible ||
+ !widget.focused ||
+ !_canClaimInput ||
+ !_keyboardIsOursOrIdle ||
+ !(_tickerMode?.value.enabled ?? false) ||
+ !_scrollController.hasClients ||
+ _find != null ||
+ _passage != null ||
+ widget.session.terminal.isUsingAltBuffer ||
+ _viewTerminal.isUsingAltBuffer) {
+ return false;
+ }
+ final view = _laidOutTerminalView();
+ if (view == null) return false;
+ _cancelDialInertia();
+ _readingReturn?.release();
+ _followTail = true;
+ view.scrollToBottom();
+ return true;
+ }
+
+ @override
+ Map<String, dynamic> selectPassage(Map<String, dynamic> command) {
+ Map<String, dynamic> fail(String message) => {
+ 'ok': false,
+ 'error': message,
+ };
+ final id = command['selectionId'];
+ final revision = command['revision'];
+ final op = command['op'];
+ if (id is! String || revision is! int) return fail('Invalid selection.');
+ if (op == 'cancel') {
+ if (_passageId == id) _closePassage();
+ return fail('Selection closed.');
+ }
+ if (!mounted ||
+ !widget.visible ||
+ !widget.focused ||
+ widget.readOnly ||
+ widget.session.status != TerminalSessionStatus.controlling) {
+ return fail('Open the live terminal pane first.');
+ }
+ if (!_canClaimInput ||
+ !_keyboardIsOursOrIdle ||
+ !(_tickerMode?.value.enabled ?? false)) {
+ return fail('Close the picker and return to the terminal.');
+ }
+ if (op == 'begin') {
+ _closePassage(rebuild: false);
+ final render = _laidOutTerminalView()?.renderTerminal;
+ if (render == null || !_scrollController.hasClients) {
+ return fail('Wait for the pane to appear.');
+ }
+ _closeFind(restore: false, focus: false, rebuild: false);
+ _cancelDialInertia();
+ final position = _scrollController.position;
+ final buffer = _viewTerminal.buffer;
+ var row =
+ ((position.pixels + position.viewportDimension / 2 - 10) /
+ render.lineHeight)
+ .floor()
+ .clamp(0, buffer.lines.length - 1);
+ // Prefer real text near the eye's resting place over a blank terminal row.
+ final first = (position.pixels / render.lineHeight).floor().clamp(
+ 0,
+ buffer.lines.length - 1,
+ );
+ final last =
+ ((position.pixels + position.viewportDimension) / render.lineHeight)
+ .floor()
+ .clamp(first, buffer.lines.length - 1);
+ for (var distance = 0; distance <= last - first; distance++) {
+ final candidates = [row - distance, row + distance];
+ final found = candidates
+ .where(
+ (y) =>
+ y >= first &&
+ y <= last &&
+ buffer.lines[y].getText().trim().isNotEmpty,
+ )
+ .firstOrNull;
+ if (found != null) {
+ row = found;
+ break;
+ }
+ }
+ _passage = TerminalPassage(_viewTerminal, row);
+ _passageId = id;
+ _passageRevision = revision;
+ _passageStream = widget.session.streamId;
+ } else {
+ if (_passage == null ||
+ _passageId != id ||
+ revision != _passageRevision + 1 ||
+ _passageStream != widget.session.streamId ||
+ !identical(_passage!.terminal, _viewTerminal)) {
+ return fail('That selection expired. Choose the text again.');
+ }
+ _passageRevision = revision;
+ if (op == 'step') {
+ final delta = command['delta'];
+ if (delta is! int || delta == 0 || delta.abs() > 8) {
+ return fail('Invalid movement.');
+ }
+ _passage!.step(delta);
+ } else if (op == 'extend') {
+ final extend = command['extend'];
+ if (extend is! bool) return fail('Invalid range.');
+ _passage!.setExtending(extend);
+ } else if (op == 'pin') {
+ _passage!.pin();
+ // A quote keeps the captured passage, not a changing search index.
+ _passageSearch?.dispose();
+ _passageSearch = null;
+ } else if (op == 'lines') {
+ _passageSearch?.dispose();
+ _passageSearch = null;
+ } else {
+ return fail('Invalid selection action.');
+ }
+ }
+ final passage = _passage!;
+ if (!passage.validate()) {
+ _paintPassage();
+ return fail(passage.error ?? 'Choose the text again.');
+ }
+ _paintPassage();
+ final excerpt = passage.text.replaceAll(RegExp(r'\s+'), ' ').trim();
+ return {
+ 'ok': true,
+ 'excerpt': String.fromCharCodes(excerpt.runes.take(120)),
+ 'rows': passage.rows,
+ 'extending': passage.extending,
+ if (op == 'pin') 'text': passage.text,
+ if (_passageSearch != null) ...{
+ 'query': _passageSearch!.query,
+ 'match': _passageSearch!.selected + 1,
+ 'matches': _passageSearch!.count,
+ },
+ };
+ }
+
+ @override
+ Future<Map<String, dynamic>> searchPassage(
+ Map<String, dynamic> command,
+ ) async {
+ Map<String, dynamic> fail(String message) => {
+ 'ok': false,
+ 'error': message,
+ };
+ final id = command['selectionId'], revision = command['revision'];
+ final terminal = _viewTerminal;
+ final stream = widget.session.streamId;
+ bool visible() =>
+ mounted &&
+ widget.visible &&
+ widget.focused &&
+ !widget.readOnly &&
+ widget.session.status == TerminalSessionStatus.controlling &&
+ _canClaimInput &&
+ _keyboardIsOursOrIdle &&
+ (_tickerMode?.value.enabled ?? false);
+ if (!visible() ||
+ id is! String ||
+ revision is! int ||
+ _passageId != id ||
+ revision != _passageRevision + 1 ||
+ _passageStream != stream ||
+ _passage?.pinned == true) {
+ return fail('Choose that terminal passage again.');
+ }
+ final op = command['op'];
+ if (op == 'search') {
+ final query = command['query'];
+ if (query is! String ||
+ query.trim().isEmpty ||
+ utf8.encode(query).length > 120 ||
+ RegExp(r'[\x00-\x1f\x7f-\x9f]').hasMatch(query)) {
+ return fail('Say a short phrase to find.');
+ }
+ final origin = _passage?.canHighlight == true
+ ? _passage!.range.begin
+ : null;
+ _passageSearch?.dispose();
+ _passageSearch = TerminalSearch(terminal, origin: origin)
+ ..setQuery(query, caseSensitive: false);
+ } else if (op == 'match') {
+ final delta = command['delta'];
+ if (_passageSearch == null ||
+ delta is! int ||
+ delta == 0 ||
+ delta.abs() > 8) {
+ return fail('Say what to find first.');
+ }
+ _passageSearch!.step(delta);
+ } else {
+ return fail('Invalid search action.');
+ }
+ _passageRevision = revision;
+ _clearPassageHighlight();
+ _passage?.dispose();
+ _passage = null;
+ _cancelDialInertia();
+ final search = _passageSearch!;
+ setState(() {});
+ try {
+ await search.settled.timeout(const Duration(milliseconds: 1500));
+ } on TimeoutException {
+ // A live log may never fully settle. A completed, still-valid snapshot
+ // is sufficient; the selected text is checked again before quoting.
+ }
+ if (!visible() ||
+ _passageId != id ||
+ _passageRevision != revision ||
+ !identical(search, _passageSearch) ||
+ !identical(terminal, _viewTerminal) ||
+ _passageStream != stream ||
+ widget.session.streamId != stream) {
+ return fail('The pane changed. Search again.');
+ }
+ if (!search.hasSnapshot) {
+ return fail('Output is still changing. Search again.');
+ }
+ final match = search.match;
+ if (match == null && search.count > 0) {
+ return fail('That text changed. Search again.');
+ }
+ if (match != null) {
+ _passage = TerminalPassage(terminal, match.begin.y, lastRow: match.end.y);
+ if (!_passage!.validate()) {
+ return fail(_passage!.error ?? 'Choose a shorter phrase.');
+ }
+ }
+ _paintPassage();
+ final excerpt = _passage?.text.replaceAll(RegExp(r'\s+'), ' ').trim() ?? '';
+ return {
+ 'ok': true,
+ 'excerpt': String.fromCharCodes(excerpt.runes.take(120)),
+ 'rows': _passage?.rows ?? 0,
+ 'extending': false,
+ 'query': search.query,
+ 'match': search.selected + 1,
+ 'matches': search.count,
+ };
+ }
+
+ void _clearPassageHighlight() {
+ final highlight = _passageHighlight;
+ _passageHighlight = null;
+ if (highlight == null) return;
+ highlight.dispose();
+ highlight.p1.dispose();
+ highlight.p2.dispose();
+ }
+
+ void _paintPassage() {
+ _clearPassageHighlight();
+ final p = _passage;
+ if (p != null && p.validate() && p.canHighlight) {
+ final range = p.range;
+ final theme = terminalThemeFor(
+ grid.AppTheme.palette.value,
+ terminalThemeStore.value,
+ );
+ _passageHighlight = _controller.highlight(
+ p1: _viewTerminal.buffer.createAnchorFromOffset(range.begin),
+ p2: _viewTerminal.buffer.createAnchorFromOffset(range.end),
+ color: theme.selection,
+ );
+ final render = _laidOutTerminalView()?.renderTerminal;
+ if (render != null && _scrollController.hasClients) {
+ final position = _scrollController.position;
+ final top = range.begin.y * render.lineHeight + 10;
+ final bottom = (range.end.y + 1) * render.lineHeight + 10;
+ final offset = top < position.pixels + render.lineHeight * 2
+ ? top - render.lineHeight * 2
+ : bottom > position.pixels + position.viewportDimension
+ ? bottom - position.viewportDimension
+ : position.pixels;
+ position.jumpTo(
+ offset.clamp(position.minScrollExtent, position.maxScrollExtent),
+ );
+ }
+ }
+ if (mounted) setState(() {});
+ }
+
+ void _onPassageOutput() {
+ final p = _passage;
+ if (p == null || _passageRefreshPending) return;
+ if (p.pinned
+ ? (_passageHighlight == null || p.canHighlight)
+ : p.validate()) {
+ return;
+ }
+ _passageRefreshPending = true;
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ _passageRefreshPending = false;
+ if (mounted && identical(p, _passage)) _paintPassage();
+ });
+ }
+
+ void _closePassage({bool rebuild = true}) {
+ _passageSearch?.dispose();
+ _passageSearch = null;
+ _clearPassageHighlight();
+ _passage?.dispose();
+ _passage = null;
+ _passageId = null;
+ _passageRevision = 0;
+ _passageStream = null;
+ if (rebuild && mounted) setState(() {});
+ }
+
+ Widget _passageHint(BuildContext context) {
+ final p = _passage;
+ final theme = terminalThemeFor(
+ grid.AppTheme.palette.value,
+ terminalThemeStore.value,
+ );
+ final cell = terminalCellSizeOf(context);
+ final label =
+ p?.error ??
+ (p?.pinned == true
+ ? '${p!.rows} line${p.rows == 1 ? '' : 's'} attached to voice'
+ : _passageSearch != null
+ ? 'Find "${_passageSearch!.query}" · ${_passageSearch!.searching ? 'searching' : '${_passageSearch!.selected + 1}/${_passageSearch!.count}'}'
+ : 'Device: ${p?.extending == true ? 'extend selection' : 'choose a line'}');
+ return ColoredBox(
+ color: theme.background,
+ child: Padding(
+ padding: EdgeInsets.symmetric(horizontal: cell.width),
+ child: Row(
+ children: [
+ Expanded(
+ child: Text(
+ label,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: terminalContentStyle(color: theme.foreground),
+ ),
+ ),
+ TerminalTextAction(
+ label: p?.pinned == true ? 'Hide' : 'Cancel',
+ onPressed: _closePassage,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
void _applyDialDelta(double delta) {
final terminal = widget.session.terminal;
if (terminal.isUsingAltBuffer) {
@@ -1336,6 +1780,10 @@ class _TerminalPanelState extends State<TerminalPanel>
/// platform's exact one: Linux reserves Ctrl-V for the terminal program and pastes with
/// Ctrl-Shift-V.
KeyEventResult _onTerminalKey(FocusNode node, KeyEvent event) {
+ if (_passageId != null && event.logicalKey == LogicalKeyboardKey.escape) {
+ if (event is KeyDownEvent) _closePassage();
+ return KeyEventResult.handled;
+ }
final keyboard = HardwareKeyboard.instance;
// A pane that lost control still gets the keys (xterm's read-only mode
// keeps the focus node, it only stops opening an input connection), and
@@ -1724,6 +2172,13 @@ class _TerminalPanelState extends State<TerminalPanel>
// excluded from `_inputBlocked` — nothing the takeover band
// offers would help a pane whose machine or launch is the
// problem — so these two conditions cannot both hold.
+ if (_passageId != null && !_inputBlocked)
+ Positioned(
+ top: 0,
+ left: 0,
+ right: 0,
+ child: _passageHint(context),
+ ),
if (_inputBlocked ||
(_retakingControl &&
session.status == TerminalSessionStatus.opening))
@@ -1912,6 +2367,63 @@ class _TerminalPanelState extends State<TerminalPanel>
}
}
+/// A buffer anchor follows scrollback eviction/reflow while the pane is parked.
+/// If its text or stream is replaced, Return can still focus the pane but must
+/// not pretend that the old reading position survives.
+class _ReadingBookmark implements TerminalReadingBookmark {
+ _ReadingBookmark(
+ this.owner,
+ this.buffer,
+ this.anchor,
+ this.fraction,
+ this.followTail,
+ this.streamId,
+ ) : text = buffer.lines[anchor.y].getText();
+ final _TerminalPanelState owner;
+ final Buffer buffer;
+ final CellAnchor anchor;
+ final double fraction;
+ final bool followTail;
+ final String? streamId;
+ final String text;
+ bool _released = false;
+ bool _consumed = false;
+
+ bool get valid =>
+ !_released &&
+ owner.mounted &&
+ identical(owner._viewTerminal.buffer, buffer) &&
+ owner.widget.session.streamId == streamId &&
+ (followTail ||
+ (anchor.attached && buffer.lines[anchor.y].getText() == text));
+
+ @override
+ bool restore() {
+ if (_consumed || !valid) {
+ dispose();
+ return false;
+ }
+ _consumed = true;
+ owner._cancelDialInertia();
+ owner._readingReturn = this;
+ owner._afterTerminalMounted(scrollToEnd: false);
+ return true;
+ }
+
+ @override
+ void dispose() {
+ if (!_consumed) release();
+ }
+
+ void release() {
+ if (_released) return;
+ _released = true;
+ if (anchor.attached) anchor.dispose();
+ owner._readingBookmarks.remove(this);
+ if (identical(owner._readingReturn, this)) owner._readingReturn = null;
+ }
+}
+
class _TerminalHeader extends StatelessWidget {
final AppNotifier notifier;
final TerminalSession session;
diff --git a/desktop/lib/ws/ws_conn.dart b/desktop/lib/ws/ws_conn.dart
index b65479862..8c828fc39 100644
--- a/desktop/lib/ws/ws_conn.dart
+++ b/desktop/lib/ws/ws_conn.dart
@@ -578,6 +578,12 @@ class WsConn {
'terminal_sync',
'dial_scroll',
'dial_focus',
+ 'dial_selection',
+ 'app_selection_result',
+ 'dial_visit',
+ 'app_visit_result',
+ 'dial_form',
+ 'app_form_result',
'ping',
'pong',
};
diff --git a/desktop/test/device_carry_test.dart b/desktop/test/device_carry_test.dart
new file mode 100644
index 000000000..f1d99e4c1
--- /dev/null
+++ b/desktop/test/device_carry_test.dart
@@ -0,0 +1,126 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:xterm/xterm.dart';
+
+import 'device_finder_test.dart' show FinderRemote;
+import 'device_passage_test.dart' show command;
+import 'device_visit_test.dart' show visit;
+import 'swarm_screen_test.dart' show mount, terminal;
+import 'swarm_state_test.dart' show createApp;
+import 'terminal_find_test.dart' show output;
+
+void main() {
+ testWidgets(
+ 'carried passage survives latest, an alert, and a reading return',
+ (t) async {
+ final app = createApp(connected: true), input = <TerminalBinaryFrame>[];
+ final source = terminal('a0', input), target = terminal('a69', input);
+ source.terminal.write(
+ List.generate(
+ 180,
+ (i) => 'Source line $i: context to carry\r\n',
+ ).join(),
+ );
+ final origin = app.adoptSessionForTest(source);
+ final originTab = app.activeSwarmId;
+ app.newSwarm(name: 'Needs attention');
+ final destination = app.adoptSessionForTest(target);
+ app.selectSwarm(originTab);
+ try {
+ await mount(t, app);
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == source.terminal,
+ );
+ final renderer = t.state(finder);
+ final scroll = t.widget<TerminalView>(finder).scrollController!;
+ scroll.jumpTo(360.25);
+ await t.pump();
+ expect(
+ app.selectDevicePassage('m', command('begin', 1))!['ok'],
+ isTrue,
+ );
+ final pinned = app.selectDevicePassage('m', command('pin', 2))!;
+ final text = pinned['text'] as String;
+ expect(text, contains('Source line'));
+ app.selectDevicePassage('m', command('cancel', 3));
+ await t.pump();
+ final before = scroll.offset;
+ expect(
+ app.visitFromDevice('m', visit('latest', target: 'a0'))!['ok'],
+ isTrue,
+ );
+ await t.pump();
+ expect(scroll.offset, closeTo(scroll.position.maxScrollExtent, .01));
+ expect(
+ app.visitFromDevice('m', visit('open', target: 'a69'))!['ok'],
+ isTrue,
+ );
+ await t.pump();
+ expect(app.focusedPane, same(destination));
+ source.terminal.write('New output while visiting the other agent\r\n');
+ await t.pump();
+ final returned = app.visitFromDevice('m', visit('back'))!;
+ expect(returned['ok'], isTrue);
+ expect(returned, isNot(contains('note')));
+ await t.pump();
+ expect(app.focusedPane, same(origin));
+ expect(app.activeSwarmId, originTab);
+ expect(scroll.offset, closeTo(before, .01));
+ expect(t.state(finder), same(renderer));
+ expect(pinned['text'], text);
+ expect(text, isNot(contains('New output')));
+ expect(app.allPanes, hasLength(2));
+ expect(input, isEmpty);
+ expect(t.takeException(), isNull);
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets('carry freezes source text before Finder changes recipients', (
+ t,
+ ) async {
+ final app = createApp(connected: true), input = <TerminalBinaryFrame>[];
+ final source = terminal('a0', input), target = terminal('a69', input);
+ await output(
+ source,
+ 0,
+ List.generate(30, (i) => 'Source line $i: context to carry').join('\r\n'),
+ keyframe: true,
+ );
+ app.adoptSessionForTest(source);
+ final origin = app.activeSwarmId;
+ app.newSwarm(name: 'Recipient');
+ final destination = app.adoptSessionForTest(target);
+ app.selectSwarm(origin);
+ try {
+ await mount(t, app);
+ expect(app.selectDevicePassage('m', command('begin', 1))!['ok'], isTrue);
+ final pinned = app.selectDevicePassage('m', command('pin', 2))!;
+ final text = pinned['text'] as String;
+ expect(text, contains('Source line'));
+ app.selectDevicePassage('m', command('cancel', 3));
+ await t.pump();
+ final finder = FinderRemote(t, app);
+ await finder.send('open');
+ await finder.say('Agent 69.');
+ expect(app.focusedPane?.agentId, 'a0');
+ await output(source, 1, 'The source has moved on.\r\n', keyframe: true);
+ await finder.send('activate');
+ await finder.send('state');
+ expect(app.focusedPane, same(destination));
+ expect(app.paneFocusByUser, isFalse);
+ expect(pinned['text'], text);
+ expect(text, isNot(contains('moved on')));
+ expect(input, isEmpty);
+ expect(app.allPanes, hasLength(2));
+ expect(t.takeException(), isNull);
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+}
diff --git a/desktop/test/device_finder_test.dart b/desktop/test/device_finder_test.dart
new file mode 100644
index 000000000..b84ed6852
--- /dev/null
+++ b/desktop/test/device_finder_test.dart
@@ -0,0 +1,243 @@
+import 'dart:async';
+
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/core/models.dart';
+import 'package:harness/state/app_state.dart';
+import 'package:harness/state/device_finder.dart';
+import 'package:harness/state/device_form.dart';
+import 'package:harness/state/swarm_search.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+
+import 'swarm_screen_test.dart' show mount, terminal;
+import 'swarm_state_test.dart' show createApp;
+
+class FinderRemote {
+ FinderRemote(this.t, this.app);
+ final WidgetTester t;
+ final AppNotifier app;
+ var state = <String, dynamic>{};
+ var serial = 0;
+ String id = 'find-test';
+ Future<Map<String, dynamic>> send(
+ String op, {
+ int delta = 0,
+ int? revision,
+ String? queryId,
+ String? text,
+ String surface = 'find',
+ }) async {
+ Map<String, dynamic>? response;
+ final pending = app
+ .formFromDevice('m', {
+ 'op': op,
+ 'surface': surface,
+ 'formId': id,
+ 'requestId': 'request-${++serial}',
+ 'expiresAt': DateTime.now().millisecondsSinceEpoch + 2000,
+ 'revision': revision ?? state['revision'] ?? 0,
+ 'delta': delta,
+ 'queryId': ?queryId,
+ 'text': ?text,
+ })
+ .then((v) => response = v);
+ for (var i = 0; i < 20 && response == null; i++) {
+ await t.pump(const Duration(milliseconds: 20));
+ }
+ await pending;
+ state = response!;
+ await t.pump(const Duration(milliseconds: 100));
+ return state;
+ }
+
+ Future<void> say(String name) async {
+ final id = 'voice-${serial + 1}';
+ await send('query.begin', queryId: id);
+ expect(state['queryId'], id);
+ await send('query', queryId: id, text: name);
+ }
+}
+
+void main() {
+ testWidgets(
+ 'spoken lookup goes to an existing pane in another tab without duplicating it',
+ (t) async {
+ final app = createApp(connected: true), input = <TerminalBinaryFrame>[];
+ app.adoptSessionForTest(terminal('a0', input));
+ final origin = app.activeSwarmId;
+ app.newSwarm(name: 'Elsewhere');
+ final target = app.adoptSessionForTest(terminal('a69', input));
+ final targetTab = app.activeSwarmId;
+ app.selectSwarm(origin);
+ try {
+ await mount(t, app);
+ final r = FinderRemote(t, app);
+ expect((await r.send('open'))['title'], 'Find Harness');
+ await r.say('Agent 69.');
+ expect(r.state['label'], 'Agent 69');
+ expect(r.state['enabled'], isTrue);
+ expect(app.activeSwarmId, origin);
+ final revision = r.state['revision'] as int;
+ await r.send('activate');
+ await r.send('state');
+ expect(r.state['active'], isFalse);
+ expect(app.focusedPane, same(target));
+ expect(app.paneFocusByUser, isFalse);
+ expect(app.activeSwarmId, targetTab);
+ expect(app.allPanes, hasLength(2));
+ await r.send('activate', revision: revision);
+ expect(app.allPanes, hasLength(2));
+ expect(input, isEmpty);
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets(
+ 'typing, navigation, disposal and cancellation defeat late speech',
+ (t) async {
+ final app = createApp(connected: true);
+ app.adoptSessionForTest(terminal('a0', []));
+ try {
+ await mount(t, app);
+ final r = FinderRemote(t, app);
+ await r.send('open');
+ expect((await r.send('state', surface: 'new'))['ok'], isFalse);
+ expect((await r.send('state'))['title'], 'Find Harness');
+ await r.send('query.begin', queryId: 'discard');
+ await r.send('query.cancel', queryId: 'discard');
+ expect(
+ (await r.send('query', queryId: 'discard', text: 'Agent 69'))['ok'],
+ isFalse,
+ );
+ await r.send('query.begin', queryId: 'typed');
+ final before = r.state['revision'] as int;
+ await t.enterText(
+ find.byKey(const ValueKey('swarm-search-input')),
+ 'Agent 3',
+ );
+ expect(
+ (await r.send(
+ 'query',
+ revision: before,
+ queryId: 'typed',
+ text: 'Agent 69',
+ ))['ok'],
+ isFalse,
+ );
+ expect(r.state['query'], 'Agent 3');
+ await r.say('> stop everything');
+ expect(r.state['query'], 'Agent 3');
+ expect(r.state['error'], contains('name'));
+ await r.send('query.begin', queryId: 'closed');
+ await r.send('close');
+ expect(
+ (await r.send(
+ 'query',
+ queryId: 'closed',
+ text: 'Agent 69',
+ ))['active'],
+ isFalse,
+ );
+ r.id = 'find-replacement';
+ expect((await r.send('open'))['active'], isTrue);
+ expect(r.state['query'], '');
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ test('a status repaint preserves speech; a changed destination does not', () {
+ final port = DeviceFormPort(explicitGuard: true);
+ var identity = 'one', status = 'Working';
+ String? text;
+ port.attach(
+ () => {
+ 'active': true,
+ 'canQuery': true,
+ 'guard': identity,
+ 'detail': status,
+ },
+ (_, _, value) => text = value,
+ );
+ var revision = port.snapshot()['revision'] as int;
+ port.command('query.begin', revision, 0, queryId: 'speech');
+ status = 'Idle';
+ expect(
+ port.command('query', revision, 0, queryId: 'speech', text: 'name')['ok'],
+ isTrue,
+ );
+ expect(text, 'name');
+ port.command('query.begin', revision, 0, queryId: 'moved');
+ identity = 'two';
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'moved',
+ text: 'different',
+ )['ok'],
+ isFalse,
+ );
+ expect(text, 'name');
+ });
+
+ test(
+ 'opening stays busy until navigation completes; failure is not a success',
+ () async {
+ final app = createApp(connected: true);
+ final search = SwarmSearchController(app, [], activityFirst: true);
+ final finished = Completer<bool>();
+ late DeviceFinder remote;
+ remote = DeviceFinder(
+ search,
+ choose: (_) {
+ remote.close();
+ return finished.future;
+ },
+ dismiss: () {},
+ isComposing: () => false,
+ );
+ try {
+ search.setQuery('Agent 69');
+ final revision = remote.port.snapshot()['revision'] as int;
+ expect(remote.port.command('activate', revision, 0)['busy'], isTrue);
+ expect(remote.port.snapshot()['active'], isTrue);
+ finished.complete(false);
+ await Future<void>.delayed(Duration.zero);
+ expect(remote.port.snapshot(), containsPair('ok', false));
+ expect(remote.port.snapshot()['error'], contains('Could not open'));
+ } finally {
+ remote.close();
+ search.dispose();
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets('offline results cannot be opened from a stale highlight', (
+ t,
+ ) async {
+ final app = createApp(connected: true);
+ app.adoptSessionForTest(terminal('a0', []));
+ try {
+ await mount(t, app);
+ final r = FinderRemote(t, app);
+ await r.send('open');
+ await r.say('Agent 69');
+ final revision = r.state['revision'] as int;
+ app.machineStates['m']!.connectionStatus = ConnectionStatus.disconnected;
+ expect((await r.send('activate', revision: revision))['ok'], isFalse);
+ expect(r.state['enabled'], isFalse);
+ expect(app.focusedPane?.agentId, 'a0');
+ } finally {
+ await t.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+}
diff --git a/desktop/test/device_form_test.dart b/desktop/test/device_form_test.dart
new file mode 100644
index 000000000..ac6718109
--- /dev/null
+++ b/desktop/test/device_form_test.dart
@@ -0,0 +1,283 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/state/device_form.dart';
+import 'package:harness/state/new_harness.dart';
+import 'package:harness/widgets/new_harness_form.dart';
+import 'package:harness/ws/ws_conn.dart';
+
+import 'support/mixed_agents.dart';
+import 'swarm_state_test.dart' show createApp;
+
+class _Daemon extends WsConn {
+ _Daemon()
+ : super(
+ wsBaseUrl: 'ws://fixture.invalid',
+ autonomousEnv: 'test',
+ machineId: 'm',
+ accessTokenProvider: (_, _) async => '',
+ onAuthFailure: (_) {},
+ onEvent: (_) {},
+ onStatus: (_) {},
+ );
+ final requests = <String>[];
+ @override
+ Future<Map<String, dynamic>> request(
+ String type, {
+ Map<String, dynamic> payload = const {},
+ Duration timeout = const Duration(seconds: 20),
+ }) async {
+ requests.add(type);
+ if (type == 'engines_probe') return {'engines': []};
+ if (type == 'dsh_list') return {'dsh': []};
+ if (type == 'git_project_info') {
+ return {
+ 'isGit': true,
+ 'branch': 'main',
+ 'branches': [
+ {'ref': 'refs/heads/main', 'name': 'main'},
+ ],
+ };
+ }
+ return {};
+ }
+}
+
+void main() {
+ Future<(DeviceFormPort, NewHarnessController, _Daemon)> mount(
+ WidgetTester t,
+ ) async {
+ final daemon = _Daemon(), app = createApp(connectionForTest: (_) => daemon);
+ seedMixedAgents(app);
+ final box = NewHarnessController(
+ app,
+ machineId: 'm',
+ folder: '/work/openharness',
+ offersStore: true,
+ );
+ final port = DeviceFormPort();
+ addTearDown(box.dispose);
+ addTearDown(app.dispose);
+ await t.pumpWidget(
+ MaterialApp(
+ home: Scaffold(
+ body: NewHarnessForm(
+ controller: box,
+ devicePort: port,
+ onClose: port.detach,
+ onCreated: port.detach,
+ onStore: () =>
+ fail('A device action must not open an unsupported route.'),
+ ),
+ ),
+ ),
+ );
+ await t.pumpAndSettle();
+ return (port, box, daemon);
+ }
+
+ Future<Map<String, dynamic>> command(
+ WidgetTester t,
+ DeviceFormPort p,
+ String op, {
+ int delta = 0,
+ }) async {
+ final result = p.command(op, p.snapshot()['revision'] as int, delta);
+ await t.pumpAndSettle();
+ return result;
+ }
+
+ Future<void> row(WidgetTester t, DeviceFormPort p, String label) async {
+ for (var i = 0; i < 12 && p.snapshot()['label'] != label; i++) {
+ await command(t, p, 'move', delta: 1);
+ }
+ expect(p.snapshot()['label'], label);
+ }
+
+ testWidgets(
+ 'same form: movement previews; accepting an agent never starts it',
+ (t) async {
+ final (port, box, daemon) = await mount(t);
+ expect(port.snapshot(), containsPair('label', 'New Harness'));
+ await row(t, port, 'Agent');
+ await command(t, port, 'activate');
+ expect(port.snapshot()['title'], 'Agent');
+ final before = port.snapshot()['revision'] as int;
+ await command(t, port, 'move', delta: 1);
+ expect(port.command('activate', before, 0)['ok'], isFalse);
+ expect(daemon.requests, isNot(contains('agent_create')));
+ // Choose the direct Codex entry, avoiding any specialized runner step.
+ box.move(box.options.indexWhere((o) => o.id == 'codex') - box.cursor);
+ await t.pumpAndSettle();
+ final chosen = port.snapshot()['revision'] as int;
+ await command(t, port, 'activate');
+ expect(port.snapshot()['label'], 'New Harness');
+ expect(daemon.requests, isNot(contains('agent_create')));
+ expect(port.command('activate', chosen, 0)['ok'], isFalse);
+ await command(t, port, 'activate');
+ expect(daemon.requests.where((r) => r == 'agent_create'), hasLength(1));
+ },
+ );
+
+ testWidgets(
+ 'project movement keeps the committed machine and folder; back cancels',
+ (t) async {
+ final (port, box, daemon) = await mount(t);
+ final folder = box.project.folder, machine = box.machineId;
+ await row(t, port, 'Project');
+ await command(t, port, 'activate');
+ await command(t, port, 'move', delta: 1);
+ expect(box.project.folder, folder);
+ expect(box.machineId, machine);
+ await command(t, port, 'back');
+ expect(box.project.folder, folder);
+ expect(box.machineId, machine);
+ expect(daemon.requests, isNot(contains('agent_create')));
+ await command(t, port, 'close');
+ expect(port.snapshot()['active'], isFalse);
+ expect(port.command('activate', 0, 0)['active'], isFalse);
+ },
+ );
+
+ testWidgets(
+ 'desktop-only setup stays visible and cannot be invoked remotely',
+ (t) async {
+ final (port, box, daemon) = await mount(t);
+ await row(t, port, 'Agent');
+ await command(t, port, 'activate');
+ final store = box.options.indexWhere(
+ (o) => o.id == NewHarnessController.storeId,
+ );
+ expect(store, greaterThanOrEqualTo(0));
+ box.move(store - box.cursor);
+ await t.pumpAndSettle();
+ expect(port.snapshot()['enabled'], isFalse);
+ expect(port.snapshot()['error'], contains('desktop'));
+ await command(t, port, 'activate');
+ expect(daemon.requests, isNot(contains('agent_create')));
+ },
+ );
+
+ testWidgets('spoken names filter choices; only a later tap commits', (
+ t,
+ ) async {
+ final (port, box, daemon) = await mount(t);
+ await row(t, port, 'Agent');
+ final before = port.snapshot();
+ final revision = before['revision'] as int;
+ expect(before['canQuery'], isTrue);
+ expect(
+ port.command('query.begin', revision, 0, queryId: 'speech')['queryId'],
+ 'speech',
+ );
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'speech',
+ text: 'Codex.',
+ )['ok'],
+ isTrue,
+ );
+ await t.pumpAndSettle();
+ expect(box.query, 'Codex');
+ expect(port.snapshot()['label'], 'Codex');
+ expect(daemon.requests, isNot(contains('agent_create')));
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'speech',
+ text: 'Claude',
+ )['ok'],
+ isFalse,
+ );
+ await command(t, port, 'activate');
+ expect(box.engine, 'codex');
+ expect(daemon.requests, isNot(contains('agent_create')));
+ });
+
+ testWidgets(
+ 'discard, changing fields, and desktop typing invalidate spoken searches',
+ (t) async {
+ final (port, box, daemon) = await mount(t);
+ await row(t, port, 'Project');
+ var revision = port.snapshot()['revision'] as int;
+ port.command('query.begin', revision, 0, queryId: 'discard');
+ port.command('query.cancel', revision, 0, queryId: 'discard');
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'discard',
+ text: 'other',
+ )['ok'],
+ isFalse,
+ );
+ expect(box.query, isEmpty);
+ port.command('query.begin', revision, 0, queryId: 'moved');
+ await command(t, port, 'move', delta: 1);
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'moved',
+ text: 'other',
+ )['ok'],
+ isFalse,
+ );
+ await row(t, port, 'Agent');
+ revision = port.snapshot()['revision'] as int;
+ port.command('query.begin', revision, 0, queryId: 'typed');
+ box.setQuery('Claude');
+ expect(
+ port.command(
+ 'query',
+ revision,
+ 0,
+ queryId: 'typed',
+ text: 'Codex',
+ )['ok'],
+ isFalse,
+ );
+ expect(box.query, 'Claude');
+ await command(t, port, 'back');
+ await row(t, port, 'New Harness');
+ expect(port.snapshot()['canQuery'], isFalse);
+ expect(
+ port.command(
+ 'query.begin',
+ port.snapshot()['revision'] as int,
+ 0,
+ queryId: 'start',
+ )['ok'],
+ isFalse,
+ );
+ expect(daemon.requests, isNot(contains('agent_create')));
+ },
+ );
+
+ test('expired and malformed device requests cannot call a form', () async {
+ final app = createApp(connected: true);
+ addTearDown(app.dispose);
+ var calls = 0;
+ app.deviceFormCommand = (_, _) async {
+ calls++;
+ return {'ok': true, 'active': false};
+ };
+ final frame = <String, dynamic>{
+ 'formId': 'form-one',
+ 'requestId': 'request-one',
+ 'op': 'activate',
+ 'revision': 1,
+ 'expiresAt': 0,
+ };
+ expect((await app.formFromDevice('m', frame))!['ok'], isFalse);
+ expect(await app.formFromDevice('m', {...frame, 'delta': 'bad'}), isNull);
+ expect(await app.formFromDevice('m', {...frame, 'op': 'run'}), isNull);
+ expect(calls, 0);
+ });
+}
diff --git a/desktop/test/device_output_search_test.dart b/desktop/test/device_output_search_test.dart
new file mode 100644
index 000000000..85f5bc9e1
--- /dev/null
+++ b/desktop/test/device_output_search_test.dart
@@ -0,0 +1,174 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:xterm/xterm.dart';
+
+import 'device_passage_test.dart' show command;
+import 'swarm_screen_test.dart' show mount, terminal;
+import 'swarm_state_test.dart' show createApp;
+import 'terminal_find_test.dart' show output;
+
+void main() {
+ testWidgets(
+ 'spoken lookup steps matches and pins literal output without input',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(
+ session,
+ 0,
+ 'first error [x]\r\nsecond ERROR [x]\r\nthird error x\r\n',
+ keyframe: true,
+ );
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ expect(app.selectDevicePassage('m', command('begin', 1))!['ok'], true);
+ final searching = app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'error [x]'}),
+ );
+ await tester.pumpAndSettle();
+ final found = (await searching)!;
+ expect(found, containsPair('ok', true));
+ expect(found['matches'], 2);
+ expect(found['query'], 'error [x]');
+ final next = app.searchDevicePassage(
+ 'm',
+ command('match', 3, extra: {'delta': 1}),
+ );
+ await tester.pumpAndSettle();
+ final moved = (await next)!;
+ expect(moved['ok'], true);
+ expect(moved['match'], found['match'] == 1 ? 2 : 1);
+ final pinned = app.selectDevicePassage('m', command('pin', 4))!;
+ expect(pinned['ok'], true);
+ expect((pinned['text'] as String).toLowerCase(), contains('error [x]'));
+ expect(pinned.containsKey('query'), false);
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets(
+ 'zero matches can be searched again and line mode keeps the passage',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(session, 0, 'a remembered phrase\r\n', keyframe: true);
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ app.selectDevicePassage('m', command('begin', 1));
+ final missing = app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'absent'}),
+ );
+ await tester.pumpAndSettle();
+ expect(await missing, containsPair('matches', 0));
+ expect(find.text('Find "absent" · 0/0'), findsOneWidget);
+ expect(app.selectDevicePassage('m', command('pin', 3))!['ok'], false);
+ // A rejected pin on an empty match does not advance the local cursor.
+ final retry = app.searchDevicePassage(
+ 'm',
+ command('search', 3, extra: {'query': 'remembered'}),
+ );
+ await tester.pumpAndSettle();
+ expect(await retry, containsPair('matches', 1));
+ final lines = app.selectDevicePassage('m', command('lines', 4))!;
+ expect(lines['ok'], true);
+ expect(lines.containsKey('query'), false);
+ expect(lines['excerpt'], 'a remembered phrase');
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets(
+ 'cancel, focus, stream, stale revision and covering picker reject lookup',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(
+ session,
+ 0,
+ List.generate(1000, (i) => 'log $i').join('\r\n'),
+ keyframe: true,
+ );
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ app.selectDevicePassage('m', command('begin', 1));
+ final pending = app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'log'}),
+ );
+ app.selectDevicePassage('m', command('cancel', 3));
+ await tester.pumpAndSettle();
+ expect(await pending, containsPair('ok', false));
+ expect(
+ tester
+ .widget<TerminalView>(find.byType(TerminalView))
+ .controller!
+ .highlights,
+ isEmpty,
+ );
+ app.selectDevicePassage('m', command('begin', 1));
+ expect(
+ await app.searchDevicePassage(
+ 'm',
+ command('search', 1, extra: {'query': 'log'}),
+ ),
+ containsPair('ok', false),
+ );
+ app.foreground.value = false;
+ expect(
+ await app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'log'}),
+ ),
+ containsPair('ok', false),
+ );
+ app.foreground.value = true;
+ final context = tester.element(find.byType(TerminalView));
+ final dialog = showDialog<void>(
+ context: context,
+ builder: (_) =>
+ const AlertDialog(content: TextField(autofocus: true)),
+ );
+ await tester.pumpAndSettle();
+ expect(
+ await app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'log'}),
+ ),
+ containsPair('ok', false),
+ );
+ Navigator.of(context).pop();
+ await dialog;
+ await tester.pumpAndSettle();
+ session.streamId = 'new-stream';
+ expect(
+ await app.searchDevicePassage(
+ 'm',
+ command('search', 2, extra: {'query': 'log'}),
+ ),
+ containsPair('ok', false),
+ );
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+}
diff --git a/desktop/test/device_passage_test.dart b/desktop/test/device_passage_test.dart
new file mode 100644
index 000000000..b6686128a
--- /dev/null
+++ b/desktop/test/device_passage_test.dart
@@ -0,0 +1,167 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:xterm/xterm.dart';
+
+import 'swarm_screen_test.dart' show mount, terminal;
+import 'swarm_state_test.dart' show createApp;
+import 'terminal_find_test.dart' show output;
+
+Map<String, dynamic> command(
+ String op,
+ int revision, {
+ String agent = 'a0',
+ Map<String, dynamic> extra = const {},
+}) => {
+ 'requestId': 'request-$revision',
+ 'selectionId': 'selection-one',
+ 'agentId': agent,
+ 'machineId': 'm',
+ 'revision': revision,
+ 'op': op,
+ ...extra,
+};
+
+void main() {
+ testWidgets('a covered terminal cannot be selected through a dialog', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(session, 0, 'Private work under a picker\r\n', keyframe: true);
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ final context = tester.element(find.byType(TerminalView));
+ final dialog = showDialog<void>(
+ context: context,
+ builder: (_) => const AlertDialog(content: TextField(autofocus: true)),
+ );
+ await tester.pumpAndSettle();
+ expect(app.selectDevicePassage('m', command('begin', 1))!['ok'], isFalse);
+ Navigator.of(context).pop();
+ await dialog;
+ await tester.pumpAndSettle();
+ expect(app.selectDevicePassage('m', command('begin', 1))!['ok'], isTrue);
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets(
+ 'device chooses, extends, pins and cancels text without agent input',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(
+ session,
+ 0,
+ List.generate(30, (i) => 'line $i: a useful sentence').join('\r\n'),
+ keyframe: true,
+ );
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ final first = app.selectDevicePassage('m', command('begin', 1))!;
+ expect(first, containsPair('ok', true));
+ expect(first['excerpt'], contains('useful sentence'));
+ await tester.pump();
+ expect(find.text('Device: choose a line'), findsOneWidget);
+ expect(
+ app.selectDevicePassage(
+ 'm',
+ command('extend', 2, extra: {'extend': true}),
+ )!['ok'],
+ isTrue,
+ );
+ final moved = app.selectDevicePassage(
+ 'm',
+ command('step', 3, extra: {'delta': 2}),
+ )!;
+ expect(moved['rows'], 3);
+ final pinned = app.selectDevicePassage('m', command('pin', 4))!;
+ expect((pinned['text'] as String).split('\n'), hasLength(3));
+ await tester.pump();
+ expect(find.text('3 lines attached to voice'), findsOneWidget);
+ app.selectDevicePassage('m', command('cancel', 5));
+ await tester.pump();
+ expect(find.text('3 lines attached to voice'), findsNothing);
+ expect(input, isEmpty);
+ expect(tester.takeException(), isNull);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets('Escape cancels locally and a changed stream cannot be quoted', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(session, 0, 'Read this without typing\r\n', keyframe: true);
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ expect(app.selectDevicePassage('m', command('begin', 1))!['ok'], isTrue);
+ await tester.pump();
+ await tester.sendKeyEvent(LogicalKeyboardKey.escape);
+ await tester.pump();
+ expect(app.selectDevicePassage('m', command('pin', 2))!['ok'], isFalse);
+ expect(input, isEmpty);
+ app.selectDevicePassage('m', command('begin', 1));
+ session.streamId = 'replacement';
+ expect(app.selectDevicePassage('m', command('pin', 2))!['ok'], isFalse);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets(
+ 'another pane, machine, background window and stale revision cannot select',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ await output(session, 0, 'Target text\r\n', keyframe: true);
+ app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ expect(
+ app.selectDevicePassage('m', command('begin', 1, agent: 'a1'))!['ok'],
+ isFalse,
+ );
+ expect(app.selectDevicePassage('other', command('begin', 1)), isNull);
+ app.foreground.value = false;
+ expect(
+ app.selectDevicePassage('m', command('begin', 1))!['ok'],
+ isFalse,
+ );
+ app.foreground.value = true;
+ expect(
+ app.selectDevicePassage('m', command('begin', 1))!['ok'],
+ isTrue,
+ );
+ expect(
+ app.selectDevicePassage(
+ 'm',
+ command('step', 1, extra: {'delta': 1}),
+ )!['ok'],
+ isFalse,
+ );
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+}
diff --git a/desktop/test/device_visit_test.dart b/desktop/test/device_visit_test.dart
new file mode 100644
index 000000000..0469f2505
--- /dev/null
+++ b/desktop/test/device_visit_test.dart
@@ -0,0 +1,403 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/terminal/terminal_binary.dart';
+import 'package:harness/state/app_state.dart';
+import 'package:harness/core/models.dart';
+import 'package:harness/terminal/terminal_session.dart';
+import 'package:xterm/xterm.dart';
+
+import 'swarm_screen_test.dart' show mount, terminal;
+import 'swarm_state_test.dart' show createApp;
+
+Map<String, dynamic> visit(
+ String op, {
+ String id = 'visit-one',
+ String from = 'a0',
+ String target = 'a1',
+}) => {
+ 'requestId': 'request-$op',
+ 'visitId': id,
+ 'op': op,
+ 'expiresAt': DateTime.now().millisecondsSinceEpoch + 2000,
+ 'fromMachineId': 'm',
+ 'fromAgentId': from,
+ 'machineId': 'm',
+ 'agentId': target,
+};
+
+void main() {
+ testWidgets('latest output keeps a reading return through repeated peeks', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ session.terminal.write(
+ List.generate(200, (i) => 'Reading line $i\r\n').join(),
+ );
+ final pane = app.adoptSessionForTest(session);
+ try {
+ await mount(tester, app);
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == session.terminal,
+ );
+ final renderer = tester.state(finder);
+ final scroll = tester.widget<TerminalView>(finder).scrollController!;
+ scroll.jumpTo(180.5);
+ await tester.pump();
+ final before = scroll.offset;
+ final peek = visit('latest', target: 'a0');
+ expect(app.visitFromDevice('m', peek), containsPair('active', true));
+ await tester.pump();
+ expect(scroll.offset, closeTo(scroll.position.maxScrollExtent, .01));
+ session.terminal.write('New output while following\r\n');
+ await tester.pump();
+ expect(scroll.offset, closeTo(scroll.position.maxScrollExtent, .01));
+ // A second Latest is part of the same excursion, not a new bookmark.
+ expect(app.visitFromDevice('m', peek)!['ok'], isTrue);
+ await tester.pump();
+ final back = app.visitFromDevice('m', visit('back'))!;
+ expect(back['ok'], isTrue);
+ expect(back, isNot(contains('note')));
+ await tester.pump();
+ expect(scroll.offset, closeTo(before, .01));
+ session.terminal.write('New output after returning\r\n');
+ await tester.pump();
+ expect(scroll.offset, closeTo(before, .01));
+ expect(app.focusedPane, same(pane));
+ expect(tester.state(finder), same(renderer));
+ expect(input, isEmpty);
+ expect(tester.takeException(), isNull);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets('latest then another alert still returns to the original line', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final a = terminal('a0', input), b = terminal('a1', input);
+ for (final session in [a, b]) {
+ session.terminal.write(List.generate(160, (i) => 'line $i\r\n').join());
+ app.adoptSessionForTest(session);
+ }
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == a.terminal,
+ );
+ final scroll = tester.widget<TerminalView>(finder).scrollController!;
+ scroll.jumpTo(240.25);
+ await tester.pump();
+ expect(
+ app.visitFromDevice('m', visit('latest', target: 'a0'))!['ok'],
+ isTrue,
+ );
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isTrue);
+ await tester.pump();
+ expect(
+ app.visitFromDevice('m', visit('latest', from: 'a1'))!['ok'],
+ isTrue,
+ );
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('back'))!['ok'], isTrue);
+ await tester.pump();
+ expect(app.focusedPane!.agentId, 'a0');
+ expect(scroll.offset, closeTo(240.25, .01));
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets(
+ 'latest refuses stale recipients and application-owned scrolling',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final session = terminal('a0', input);
+ session.terminal.write(List.generate(160, (i) => 'line $i\r\n').join());
+ app.adoptSessionForTest(session);
+ app.adoptSessionForTest(terminal('a1', input));
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == session.terminal,
+ );
+ final scroll = tester.widget<TerminalView>(finder).scrollController!;
+ scroll.jumpTo(200);
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('latest'))!['ok'], isFalse);
+ expect(
+ app.visitFromDevice('m', {
+ ...visit('latest', target: 'a0'),
+ 'expiresAt': 0,
+ })!['ok'],
+ isFalse,
+ );
+ expect(scroll.offset, closeTo(200, .01));
+ expect(app.focusedPane!.agentId, 'a0');
+ session.terminal.write('\x1b[?1049hApplication-owned screen');
+ await tester.pump();
+ final reply = app.visitFromDevice('m', visit('latest', target: 'a0'))!;
+ expect(reply['ok'], isFalse);
+ expect(reply['active'], isFalse);
+ expect(reply['error'], contains('scrollback'));
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets(
+ 'cross-machine return stays with its window and survives a target disconnect',
+ (tester) async {
+ final app = createApp(connected: true);
+ const machine = Machine(
+ machineId: 'remote',
+ authMode: MachineAuthMode.remote,
+ name: 'Remote',
+ );
+ app.machines.add(machine);
+ app.machineStates['remote'] = MachineState(machine)
+ ..nodeOnline = false
+ ..agents = [
+ Agent(
+ id: 'help',
+ name: 'Needs help',
+ engine: 'codex',
+ terminalAvailable: true,
+ ),
+ ];
+ final origin = app.adoptSessionForTest(terminal('a0', []));
+ app.newSwarm();
+ final input = <TerminalBinaryFrame>[];
+ final remote =
+ TerminalSession(
+ machineId: 'remote',
+ agentId: 'help',
+ agentName: 'Needs help',
+ engineId: 'codex',
+ send: (_, _) async => true,
+ sendBinary: (frame) async {
+ input.add(frame);
+ return true;
+ },
+ )
+ ..status = TerminalSessionStatus.controlling
+ ..streamId = 'remote-stream';
+ app.adoptSessionForTest(remote);
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ final opened = app.visitFromDevice('m', {
+ ...visit('open'),
+ 'machineId': 'remote',
+ 'agentId': 'help',
+ })!;
+ expect(opened, containsPair('ok', true));
+ await tester.pump();
+ expect(app.focusedPane!.machineId, 'remote');
+ expect(app.visitFromDevice('remote', visit('back'))!['ok'], isFalse);
+ // An offline visit must still offer a way back; it cannot require a
+ // healthy terminal attachment before releasing the original bookmark.
+ remote.transportLost('Fixture disconnected');
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('back'))!['ok'], isTrue);
+ await tester.pump();
+ expect(app.focusedPane, same(origin));
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets('return never reopens a closed origin or a replaced tile', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ final origin = app.adoptSessionForTest(terminal('a0', []));
+ app.adoptSessionForTest(terminal('a1', []));
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isTrue);
+ await tester.pump();
+ await app.closePane(origin.id);
+ await tester.pump();
+ final count = app.allPanes.length;
+ final reply = app.visitFromDevice('m', visit('back'))!;
+ expect(reply['ok'], isFalse);
+ expect(reply['error'], contains('closed'));
+ expect(app.allPanes.length, count);
+ expect(app.focusedPane!.agentId, 'a1');
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets(
+ 'visit and return retain the pane and reading line after output',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ final a = terminal('a0', input), b = terminal('a1', input);
+ a.terminal.write(
+ List.generate(200, (i) => 'original line $i\r\n').join(),
+ );
+ b.terminal.write('Please inspect the result.\r\n');
+ final origin = app.adoptSessionForTest(a);
+ final originTab = app.activeSwarmId;
+ app.newSwarm();
+ app.adoptSessionForTest(b);
+ final targetTab = app.activeSwarmId;
+ app.selectSwarm(originTab);
+ try {
+ await mount(tester, app);
+ final finder = find.byWidgetPredicate(
+ (w) => w is TerminalView && w.terminal == a.terminal,
+ );
+ final renderer = tester.state(finder);
+ final view = tester.widget<TerminalView>(finder);
+ view.scrollController!.jumpTo(180);
+ await tester.pump();
+ final pixel = view.scrollController!.offset;
+ final count = app.allPanes.length;
+ expect(
+ app.visitFromDevice('m', visit('open')),
+ containsPair('active', true),
+ );
+ await tester.pump();
+ expect(app.activeSwarmId, targetTab);
+ expect(app.focusedPane!.agentId, 'a1');
+ a.terminal.write('arrived during visit\r\n');
+ await tester.pump();
+ final result = app.visitFromDevice('m', visit('back'))!;
+ expect(result, containsPair('ok', true));
+ expect(result, isNot(contains('note')));
+ await tester.pump();
+ await tester.pump(const Duration(milliseconds: 50));
+ expect(app.focusedPane, same(origin));
+ expect(app.activeSwarmId, originTab);
+ expect(tester.state(finder), same(renderer));
+ expect(view.scrollController!.offset, closeTo(pixel, .01));
+ expect(app.allPanes.length, count);
+ expect(app.paneFocusByUser, isFalse);
+ expect(input, isEmpty);
+ expect(tester.takeException(), isNull);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets(
+ 'visiting several alerts returns to the original work, never the last alert',
+ (tester) async {
+ final app = createApp(connected: true);
+ final input = <TerminalBinaryFrame>[];
+ for (var i = 0; i < 3; i++) {
+ app.adoptSessionForTest(terminal('a$i', input));
+ }
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isTrue);
+ await tester.pump();
+ expect(
+ app.visitFromDevice(
+ 'm',
+ visit('open', from: 'a1', target: 'a2'),
+ )!['ok'],
+ isTrue,
+ );
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('back'))!['ok'], isTrue);
+ await tester.pump();
+ expect(app.focusedPane!.agentId, 'a0');
+ expect(input, isEmpty);
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+
+ testWidgets('dialogs and stale commands cannot navigate behind a picker', (
+ tester,
+ ) async {
+ final app = createApp(connected: true);
+ app.adoptSessionForTest(terminal('a0', []));
+ app.adoptSessionForTest(terminal('a1', []));
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ final context = tester.element(find.byType(TerminalView).first);
+ final dialog = showDialog<void>(
+ context: context,
+ builder: (_) => const AlertDialog(content: TextField(autofocus: true)),
+ );
+ await tester.pumpAndSettle();
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isFalse);
+ expect(app.focusedPane!.agentId, 'a0');
+ Navigator.of(context).pop();
+ await dialog;
+ await tester.pumpAndSettle();
+ expect(
+ app.visitFromDevice('m', {...visit('open'), 'expiresAt': 0})!['ok'],
+ isFalse,
+ );
+ expect(
+ app.visitFromDevice('m', visit('open', from: 'a9'))!['ok'],
+ isFalse,
+ );
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isTrue);
+ await tester.pump();
+ await app.focusAgentFromDevice('m', 'a0');
+ await tester.pump();
+ expect(app.visitFromDevice('m', visit('back'))!['ok'], isFalse);
+ expect(app.focusedPane!.agentId, 'a0');
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ });
+
+ testWidgets(
+ 'a replaced stream returns to its pane without claiming its old text',
+ (tester) async {
+ final app = createApp(connected: true);
+ final a = terminal('a0', []);
+ app.adoptSessionForTest(a);
+ app.adoptSessionForTest(terminal('a1', []));
+ await app.focusAgentFromDevice('m', 'a0');
+ try {
+ await mount(tester, app);
+ expect(app.visitFromDevice('m', visit('open'))!['ok'], isTrue);
+ await tester.pump();
+ a.streamId = 'new-stream';
+ final result = app.visitFromDevice('m', visit('back'))!;
+ expect(result['ok'], isTrue);
+ expect(result['note'], contains('no longer available'));
+ await tester.pump();
+ expect(app.focusedPane!.agentId, 'a0');
+ } finally {
+ await tester.pumpWidget(const SizedBox());
+ app.dispose();
+ }
+ },
+ );
+}
diff --git a/desktop/test/terminal_passage_test.dart b/desktop/test/terminal_passage_test.dart
new file mode 100644
index 000000000..e24de7447
--- /dev/null
+++ b/desktop/test/terminal_passage_test.dart
@@ -0,0 +1,126 @@
+import 'package:flutter_test/flutter_test.dart';
+import 'package:harness/terminal/terminal_passage.dart';
+import 'package:xterm/xterm.dart';
+
+void main() {
+ Terminal terminal(String text, {int maxLines = 1000}) =>
+ Terminal(maxLines: maxLines)
+ ..resize(80, 24)
+ ..write(text);
+
+ test(
+ 'line cursor and reversible range preserve exact text without input',
+ () {
+ final t = terminal('alpha\r\n beta\r\ngamma\r\n');
+ final input = <String>[];
+ t.onOutput = input.add;
+ final p = TerminalPassage(t, 1);
+ expect(p.text, ' beta');
+ expect(p.setExtending(true), isTrue);
+ expect(p.step(1), isTrue);
+ expect(p.text, ' beta\ngamma');
+ expect(p.step(-2), isTrue);
+ expect(p.text, 'alpha\n beta');
+ expect(p.setExtending(false), isTrue);
+ expect(p.text, 'alpha');
+ expect(p.pin(), 'alpha');
+ expect(p.step(1), isFalse);
+ expect(input, isEmpty);
+ p.dispose();
+ },
+ );
+
+ test('TUI repaint cannot silently replace the quoted selection', () {
+ final t = terminal('original');
+ final p = TerminalPassage(t, 0);
+ t.write('\rchanged!');
+ expect(p.validate(), isFalse);
+ expect(p.pin(), isNull);
+ expect(p.error, contains('changed'));
+ p.dispose();
+ });
+
+ test(
+ 'a pinned passage remains the captured snapshot while output changes',
+ () {
+ final t = terminal('original');
+ final p = TerminalPassage(t, 0);
+ expect(p.pin(), 'original');
+ t.write('\rchanged!');
+ expect(p.text, 'original');
+ expect(p.validate(), isTrue);
+ p.dispose();
+ },
+ );
+
+ test(
+ 'buffer switch invalidates; long ranges and malformed steps are bounded',
+ () {
+ final t = terminal(List.generate(35, (i) => 'row $i').join('\r\n'));
+ final p = TerminalPassage(t, 5)..setExtending(true);
+ for (var i = 0; i < 100; i++) {
+ p.step(1000000);
+ }
+ expect(p.rows, TerminalPassage.maxRows);
+ for (var i = 0; i < 100; i++) {
+ p.step(-1000000);
+ }
+ expect(p.rows, lessThanOrEqualTo(TerminalPassage.maxRows));
+ t.write('\x1b[?1049h');
+ expect(p.pin(), isNull);
+ p.dispose();
+ },
+ );
+
+ test('empty lines cannot become a voice quote', () {
+ final t = terminal('');
+ final p = TerminalPassage(t, 0);
+ expect(p.pin(), isNull);
+ expect(p.error, contains('text'));
+ p.dispose();
+ });
+
+ test('Unicode, soft wraps, and indentation survive a selection', () {
+ final t = terminal(' 雪 and café 🐙\r\n');
+ final p = TerminalPassage(t, 0);
+ expect(p.pin(), ' 雪 and café 🐙');
+ p.dispose();
+ final narrow = Terminal()
+ ..resize(40, 24)
+ ..write('a' * 45);
+ final wrapped = TerminalPassage(narrow, 0)
+ ..setExtending(true)
+ ..step(1);
+ expect(wrapped.pin(), 'a' * 45);
+ wrapped.dispose();
+ });
+
+ test(
+ 'initial wrapped match range stays exact and rejects excessive rows',
+ () {
+ final t = Terminal()
+ ..resize(20, 24)
+ ..write('a' * 45);
+ final p = TerminalPassage(t, 0, lastRow: 2);
+ expect(p.rows, 3);
+ expect(p.pin(), 'a' * 45);
+ p.dispose();
+ final huge = TerminalPassage(t, 0, lastRow: 23);
+ expect(huge.validate(), false);
+ expect(huge.text, isEmpty);
+ huge.dispose();
+ },
+ );
+
+ test('scrollback eviction fails closed and disposal is idempotent', () {
+ final t = terminal('keep\r\n', maxLines: 30);
+ final p = TerminalPassage(t, 0);
+ for (var i = 0; i < 80; i++) {
+ t.write('new\r\n');
+ }
+ expect(p.pin(), isNull);
+ p.dispose();
+ p.dispose();
+ expect(p.validate(), isFalse);
+ });
+}
diff --git a/devices/harness-device/firmware/fonts/GeistMono-OFL.txt b/devices/harness-device/firmware/fonts/GeistMono-OFL.txt
new file mode 100644
index 000000000..422d36474
--- /dev/null
+++ b/devices/harness-device/firmware/fonts/GeistMono-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font.git)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/devices/harness-device/firmware/fonts/GeistMono-Regular.ttf b/devices/harness-device/firmware/fonts/GeistMono-Regular.ttf
new file mode 100644
index 000000000..18f4acb5e
Binary files /dev/null and b/devices/harness-device/firmware/fonts/GeistMono-Regular.ttf differ
diff --git a/devices/harness-device/firmware/fonts/Jgs-OFL.txt b/devices/harness-device/firmware/fonts/Jgs-OFL.txt
new file mode 100644
index 000000000..f67b3d0c8
--- /dev/null
+++ b/devices/harness-device/firmware/fonts/Jgs-OFL.txt
@@ -0,0 +1,94 @@
+Copyright (c) 2022, Adel Faure [email protected],
+with Reserved Font Name jgs5, jgs7, jgs9.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/devices/harness-device/firmware/fonts/jgs7.ttf b/devices/harness-device/firmware/fonts/jgs7.ttf
new file mode 100644
index 000000000..8923a372c
Binary files /dev/null and b/devices/harness-device/firmware/fonts/jgs7.ttf differ
diff --git a/devices/harness-device/firmware/main/CMakeLists.txt b/devices/harness-device/firmware/main/CMakeLists.txt
index e9ffe6c43..35854acda 100644
--- a/devices/harness-device/firmware/main/CMakeLists.txt
+++ b/devices/harness-device/firmware/main/CMakeLists.txt
@@ -145,6 +145,39 @@ else() # esp32s3 — the round dial
endif()
+# Shared protocol/audio guards are also used by the stock renderer on both boards.
+list(APPEND BOARD_SRCS "cable_scroll.c" "cable_json_guard.c" "cable_features.c"
+ "voice_buffer.c" "audio_probe.c" "ui/ui_perf.c")
+
+# Habitat replaces the round dial's renderer only; the Pro keeps its native panel and UI.
+if(DEVICE_HABITAT)
+ if(NOT IDF_TARGET STREQUAL "esp32s3")
+ message(FATAL_ERROR "DEVICE_HABITAT requires the 466-pixel ESP32-S3 round dial")
+ endif()
+ list(FILTER BOARD_SRCS EXCLUDE REGEX "^ui/")
+ list(REMOVE_ITEM BOARD_SRCS "audio_client.c")
+ list(APPEND BOARD_SRCS "audio_client_habitat.c" "ui/ui_perf.c"
+ "ui/habitat/display_habitat.c"
+ "ui/habitat/touch_habitat.c"
+ "ui/habitat/ui_habitat.c"
+ "ui/habitat/terminal.c"
+ "ui/habitat/scroll.c"
+ "ui/habitat/workspace.c"
+ "ui/habitat/selection.c"
+ "ui/habitat/carry.c"
+ "ui/habitat/visit.c"
+ "ui/habitat/form.c"
+ "ui/habitat/draft.c"
+ "ui/habitat/gestures.c"
+ "ui/habitat/tim.c"
+ "ui/habitat/octopus.c"
+ "ui/habitat/ascii_clip.c"
+ "ui/habitat/octopus_font.c"
+ "ui/habitat/command_face.c"
+ "ui/habitat/fonts.c"
+ )
+endif()
+
idf_component_register(
SRCS ${BOARD_SRCS}
INCLUDE_DIRS
@@ -158,6 +191,19 @@ idf_component_register(
# format-truncation analysis that errors on safe same-size copies. Keep it as a warning, not error.
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-format-truncation)
+if(DEVICE_PERF_BENCH)
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_PERF_BENCH=1)
+endif()
+
+# Event-tagged A/B profiling of the connected octopus. Never part of a daily image.
+if(DEVICE_OCTOPUS_BENCH)
+ if(NOT DEVICE_PERF_BENCH OR NOT DEVICE_HABITAT OR DEVICE_CREATURE_GALLERY)
+ message(FATAL_ERROR "DEVICE_OCTOPUS_BENCH requires Habitat + PERF, without the gallery")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_OCTOPUS_BENCH=1)
+ target_sources(${COMPONENT_LIB} PRIVATE "ui/habitat/perf_bench.c")
+endif()
+
# PROD build override: `idf.py -DDEVICE_FORCE_PROD=1 build` (into a separate build dir) forces the
# production backend and ignores any local provisioned_config.h — no need to move the header, so the LOCAL
# and PROD build dirs both stay warm (no CMake-reconfigure churn). See app_main.c's DEVICE_FORCE_PROD.
@@ -190,3 +236,63 @@ if(BOARD_PROBE AND NOT IDF_TARGET STREQUAL "esp32p4")
target_compile_definitions(${COMPONENT_LIB} PRIVATE BOARD_PROBE=1)
target_sources(${COMPONENT_LIB} PRIVATE "board/board_probe.c")
endif()
+
+if(DEVICE_HABITAT)
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_HABITAT=1)
+endif()
+
+if(DEVICE_TRANSPORT_BENCH)
+ if(NOT DEVICE_HABITAT OR DEVICE_CREATURE_GALLERY OR DEVICE_LAYOUT_BENCH)
+ message(FATAL_ERROR "DEVICE_TRANSPORT_BENCH requires the normal Habitat renderer")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_TRANSPORT_BENCH=1)
+ target_sources(${COMPONENT_LIB} PRIVATE "ui/habitat/transport_bench.c"
+ "../test/reference91/cable_frame_ref.c")
+endif()
+
+# Opt-in, local-only ASCII visual study. Omitted entirely from normal firmware.
+if(DEVICE_CREATURE_GALLERY)
+ if(NOT DEVICE_HABITAT)
+ message(FATAL_ERROR "DEVICE_CREATURE_GALLERY requires DEVICE_HABITAT")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_CREATURE_GALLERY=1)
+ target_sources(${COMPONENT_LIB} PRIVATE
+ "ui/habitat/creature_gallery.c"
+ "ui/habitat/creature_font.c")
+endif()
+
+# One-boot layout CPU profiling. Never enabled in the daily device image.
+if(DEVICE_LAYOUT_BENCH)
+ if(NOT DEVICE_HABITAT OR DEVICE_CREATURE_GALLERY OR DEVICE_OCTOPUS_BENCH)
+ message(FATAL_ERROR "DEVICE_LAYOUT_BENCH requires the connected Habitat UI only")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_LAYOUT_BENCH=1)
+ target_sources(${COMPONENT_LIB} PRIVATE "ui/habitat/layout_bench.c" "ui/habitat/scroll_bench.c")
+ if(DEVICE_LAYOUT_BASELINE STREQUAL "82")
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_LAYOUT_BASELINE82=1)
+ elseif(DEVICE_LAYOUT_BASELINE STREQUAL "79")
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_LAYOUT_BASELINE79=1)
+ target_sources(${COMPONENT_LIB} PRIVATE "../test/reference79/terminal_ref.c")
+ else()
+ target_sources(${COMPONENT_LIB} PRIVATE
+ "../test/reference48/terminal_ref.c" "../test/reference48/octopus_ref.c")
+ endif()
+ target_include_directories(${COMPONENT_LIB} PRIVATE
+ "${CMAKE_CURRENT_LIST_DIR}/../test" "${CMAKE_CURRENT_LIST_DIR}/ui/habitat")
+endif()
+
+# One-shot fault injection, omitted from daily builds. A retained marker makes
+# the reboot after the injected stall resume normal operation instead of looping.
+if(DEVICE_RENDER_FAULT)
+ if(NOT DEVICE_HABITAT OR DEVICE_CREATURE_GALLERY OR DEVICE_LAYOUT_BENCH OR DEVICE_OCTOPUS_BENCH)
+ message(FATAL_ERROR "DEVICE_RENDER_FAULT requires the normal Habitat renderer")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_RENDER_FAULT=1)
+endif()
+
+if(DEVICE_RENDER_STRESS)
+ if(NOT DEVICE_HABITAT OR DEVICE_CREATURE_GALLERY OR DEVICE_LAYOUT_BENCH OR DEVICE_OCTOPUS_BENCH OR DEVICE_RENDER_FAULT)
+ message(FATAL_ERROR "DEVICE_RENDER_STRESS requires the normal Habitat renderer without fault injection")
+ endif()
+ target_compile_definitions(${COMPONENT_LIB} PRIVATE DEVICE_RENDER_STRESS=1)
+endif()
diff --git a/devices/harness-device/firmware/main/app_main.c b/devices/harness-device/firmware/main/app_main.c
index 176ad2ee0..18148687b 100644
--- a/devices/harness-device/firmware/main/app_main.c
+++ b/devices/harness-device/firmware/main/app_main.c
@@ -36,6 +36,7 @@
#include "ui/display.h"
#include "ui/touch.h"
#include "ui/ui_screens.h"
+#include "ui/ui_perf.h"
static const char *TAG = "app";
@@ -73,7 +74,9 @@ static int refresh_projects(void)
project_t *pr = proj_scratch();
if (!pr) { ESP_LOGW(TAG, "project scratch alloc failed"); return -1; }
- const int n = cable_client_list_agents(pr, MAX_PROJECTS);
+ cable_agent_snapshot_t snapshot;
+ const int n = cable_client_list_agents_snapshot(pr, MAX_PROJECTS, &snapshot);
+ if (n < 0) return -1; // agents.end will request another refresh after the complete roster arrives
ESP_LOGI(TAG, "agents: %d", n);
// Apply the WHOLE reconcile atomically. With the huge-range circular carousel each add/remove
@@ -121,7 +124,8 @@ static int refresh_projects(void)
if (n > 1) ui_project_apply_order(ids, n);
// The fleet behind the list: the overview's count, and whether the empty page means "no window" or
// "empty tab".
- ui_fleet_set(cable_client_agent_total(), cable_client_has_window());
+ ui_fleet_set(snapshot.total, snapshot.window);
+ ui_workspace_applied(snapshot.tab, snapshot.generation);
// The list is built. If a landing is pending, LAND: drop the loading spinner and focus agent 1 (or the
// No-agents page). No-op otherwise, so a periodic refresh never yanks the view.
@@ -197,18 +201,22 @@ void app_main(void)
audio_client_init();
ram_telemetry_checkpoint("voice_buffer_ready");
- // Voice: double-tap (or hold physical button B / GPIO0) captures and streams PCM over the cable.
- // Nothing to configure — the wire carries the identity, so voice needs neither a URL nor a token.
- ptt_start();
-
// Speaker notify: beep on a finished turn. Init before the link so the beep task exists when the first
// summary arrives.
audio_notify_init();
+ // Enable physical PTT after codec initialization. Otherwise holding the
+ // button during boot can race the microphone's first allocation.
+ ptt_start();
+
// Agents have not arrived yet — don't flash the "No agents" empty tile. Park on the loading screen and
// arm a landing so refresh_projects slides to agent 0 once the first list lands.
ui_enter_boot_loading();
+#ifdef DEVICE_PERF_BENCH
+ ui_perf_run(); // synthetic, local-only, before the cable can affect a live harness
+#endif
+
if (!cable_client_start()) {
// A dial with no link still runs, still lights up, and still says so on screen. A device stuck in a
// boot loop is not diagnosable from across the room; one showing "Not connected" is.
diff --git a/devices/harness-device/firmware/main/audio_capture.c b/devices/harness-device/firmware/main/audio_capture.c
index 16e01757f..7197e4242 100644
--- a/devices/harness-device/firmware/main/audio_capture.c
+++ b/devices/harness-device/firmware/main/audio_capture.c
@@ -1,4 +1,6 @@
#include "audio_capture.h"
+#include "config_store.h"
+#include "audio_probe.h"
#include "board_pins.h"
#include "board/board_i2c.h"
#include "driver/i2s_std.h"
@@ -6,9 +8,11 @@
#include "esp_codec_dev_defaults.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
+#include "freertos/semphr.h"
#include "esp_timer.h"
#include "esp_log.h"
#include <string.h>
+#include <stdatomic.h>
static const char *TAG = "audio_cap";
@@ -18,6 +22,16 @@ static const audio_codec_ctrl_if_t *s_ctrl_if;
static const audio_codec_if_t *s_es7210;
static esp_codec_dev_handle_t s_mic;
static bool s_open;
+static SemaphoreHandle_t s_codec_lock;
+static atomic_bool s_capture_requested;
+static atomic_uint s_rx_overruns;
+uint32_t audio_capture_overruns(void){return atomic_load(&s_rx_overruns);}
+static bool rx_overrun(i2s_chan_handle_t channel,i2s_event_data_t *event,void *ctx)
+{
+ (void)channel;(void)event;(void)ctx;
+ atomic_fetch_add_explicit(&s_rx_overruns,1,memory_order_relaxed);
+ return false;
+}
// ES8311 speaker (OUT) path for the notification beep — shares the I2S + I2C with the mic.
static const audio_codec_ctrl_if_t *s_spk_ctrl;
@@ -25,34 +39,63 @@ static const audio_codec_gpio_if_t *s_gpio_if;
static const audio_codec_if_t *s_es8311;
static esp_codec_dev_handle_t s_spk;
static TaskHandle_t s_beep_task;
+static atomic_bool s_muted = true;
+
+bool audio_notify_is_muted(void)
+{
+ return atomic_load_explicit(&s_muted, memory_order_relaxed);
+}
-// Pre-rendered "beep beep beep": BEEP_COUNT 80ms ~2kHz square tones with 60ms gaps, at AUDIO_SAMPLE_RATE.
+bool audio_notify_set_muted(bool muted)
+{
+ atomic_store_explicit(&s_muted, muted, memory_order_relaxed);
+ return config_save_muted(muted);
+}
+
+// BEEP_COUNT 80ms ~2kHz tones with 60ms gaps. Generate only the next 20ms,
+// retaining the identical waveform without reserving 11 KiB for an idle sound.
#define BEEP_SAMPLES (AUDIO_SAMPLE_RATE * 80 / 1000)
#define GAP_SAMPLES (AUDIO_SAMPLE_RATE * 60 / 1000)
#define BEEP_COUNT 3
#define TONE_SAMPLES (BEEP_SAMPLES * BEEP_COUNT + GAP_SAMPLES * (BEEP_COUNT - 1))
-static int16_t s_tone[TONE_SAMPLES];
+#define TONE_BLOCK_SAMPLES (AUDIO_SAMPLE_RATE / 50)
+static int16_t s_tone[TONE_BLOCK_SAMPLES];
-static void render_tone(void)
+static void render_tone(size_t offset, size_t count)
{
const int half = AUDIO_SAMPLE_RATE / 2000 / 2; // half-period of a ~2kHz square wave
const int16_t amp = 6000;
- int i = 0;
- for (int b = 0; b < BEEP_COUNT; b++) {
- for (int n = 0; n < BEEP_SAMPLES; n++, i++)
- s_tone[i] = ((n / (half > 0 ? half : 1)) & 1) ? amp : -amp;
- if (b < BEEP_COUNT - 1) for (int n = 0; n < GAP_SAMPLES; n++, i++) s_tone[i] = 0;
+ for (size_t i = 0; i < count; i++) {
+ size_t phase = (offset + i) % (BEEP_SAMPLES + GAP_SAMPLES);
+ s_tone[i] = phase < BEEP_SAMPLES
+ ? (((phase / (half > 0 ? half : 1)) & 1) ? amp : -amp) : 0;
}
}
static void play_beep(void)
{
- if (!s_spk) return;
+ if (!s_spk || audio_notify_is_muted() || atomic_load(&s_capture_requested)) return;
+ if (xSemaphoreTake(s_codec_lock, 0) != pdTRUE) return;
+ if (audio_notify_is_muted() || atomic_load(&s_capture_requested)) {
+ xSemaphoreGive(s_codec_lock);
+ return;
+ }
esp_codec_dev_sample_info_t fs = { .sample_rate = AUDIO_SAMPLE_RATE, .channel = 1, .bits_per_sample = 16 };
- if (esp_codec_dev_open(s_spk, &fs) != ESP_OK) { ESP_LOGW(TAG, "spk open failed"); return; }
- esp_codec_dev_set_out_vol(s_spk, 100);
- esp_codec_dev_write(s_spk, s_tone, sizeof(s_tone));
+ if (esp_codec_dev_open(s_spk, &fs) != ESP_OK) { xSemaphoreGive(s_codec_lock); ESP_LOGW(TAG, "spk open failed"); return; }
+ if (!audio_notify_is_muted()) {
+ esp_codec_dev_set_out_vol(s_spk, 100);
+ // Let mute or a microphone start interrupt a tone within one 20ms write.
+ for (size_t offset=0; offset<TONE_SAMPLES;) {
+ if (audio_notify_is_muted() || atomic_load(&s_capture_requested)) break;
+ size_t count=TONE_SAMPLES-offset;
+ if (count>TONE_BLOCK_SAMPLES) count=TONE_BLOCK_SAMPLES;
+ render_tone(offset,count);
+ if (esp_codec_dev_write(s_spk, s_tone, (int)(count*sizeof s_tone[0])) != ESP_CODEC_DEV_OK) break;
+ offset+=count;
+ }
+ }
esp_codec_dev_close(s_spk);
+ xSemaphoreGive(s_codec_lock);
ESP_LOGI(TAG, "beep");
}
@@ -65,9 +108,28 @@ static void beep_task(void *arg)
}
}
+static void notify_init_failed(const char *why)
+{
+ // The microphone owns the shared I2S interface. Release only the speaker
+ // objects acquired by this attempt, so a later retry cannot leak them.
+ if (s_spk) { esp_codec_dev_delete(s_spk); s_spk = NULL; }
+ if (s_es8311) { audio_codec_delete_codec_if(s_es8311); s_es8311 = NULL; }
+ if (s_gpio_if) { audio_codec_delete_gpio_if(s_gpio_if); s_gpio_if = NULL; }
+ if (s_spk_ctrl) { audio_codec_delete_ctrl_if(s_spk_ctrl); s_spk_ctrl = NULL; }
+ ESP_LOGW(TAG, "speaker unavailable: %s", why);
+}
+
void audio_notify_init(void)
{
+#ifdef DEVICE_CREATURE_GALLERY
+ atomic_store_explicit(&s_muted, true, memory_order_relaxed);
+ ESP_LOGI(TAG, "notifications muted (local ASCII gallery)");
+ return; // No speaker initialization or beep task in the visual-only study.
+#endif
if (s_beep_task) return;
+ atomic_store_explicit(&s_muted, config_load_muted(), memory_order_relaxed);
+ if (audio_notify_is_muted()) config_save_muted(true);
+ ESP_LOGI(TAG, "notifications %s", audio_notify_is_muted() ? "muted" : "audible");
if (!s_mic && !audio_capture_init()) { ESP_LOGW(TAG, "notify init: I2S unavailable"); return; }
audio_codec_i2c_cfg_t i2c_cfg = {
@@ -77,7 +139,7 @@ void audio_notify_init(void)
};
s_spk_ctrl = audio_codec_new_i2c_ctrl(&i2c_cfg);
s_gpio_if = audio_codec_new_gpio();
- if (!s_spk_ctrl || !s_gpio_if) { ESP_LOGW(TAG, "es8311 ctrl/gpio if failed"); return; }
+ if (!s_spk_ctrl || !s_gpio_if) { notify_init_failed("control/GPIO allocation"); return; }
es8311_codec_cfg_t es_cfg = {
.ctrl_if = s_spk_ctrl,
@@ -87,7 +149,7 @@ void audio_notify_init(void)
.use_mclk = true,
};
s_es8311 = es8311_codec_new(&es_cfg);
- if (!s_es8311) { ESP_LOGW(TAG, "es8311 new — no speaker?"); return; }
+ if (!s_es8311) { notify_init_failed("codec allocation"); return; }
esp_codec_dev_cfg_t dev_cfg = {
.dev_type = ESP_CODEC_DEV_TYPE_OUT,
@@ -95,33 +157,57 @@ void audio_notify_init(void)
.data_if = s_data_if,
};
s_spk = esp_codec_dev_new(&dev_cfg);
- if (!s_spk) { ESP_LOGW(TAG, "spk codec_dev new failed"); return; }
+ if (!s_spk) { notify_init_failed("device allocation"); return; }
- render_tone();
// The full codec-open path retained only 688 B on a 3 KiB stack during
// event stress. Four KiB restores the 25% and 1 KiB safety margins.
- xTaskCreate(beep_task, "beep", 4096, NULL, 5, &s_beep_task);
+ if (xTaskCreate(beep_task, "beep", 4096, NULL, 5, &s_beep_task) != pdPASS) {
+ s_beep_task = NULL;
+ notify_init_failed("task allocation");
+ return;
+ }
ESP_LOGI(TAG, "speaker (ES8311) ready");
}
void audio_notify_done(void)
{
- static int64_t last_us;
- if (!s_beep_task) return;
- int64_t now = esp_timer_get_time();
- if (now - last_us < 1000000) return; // debounce: at most one beep per ~1s
- last_us = now;
+ static atomic_uint last_ms;
+ if (!s_beep_task || audio_notify_is_muted()) return;
+ uint32_t previous = atomic_load(&last_ms);
+ uint32_t now = (uint32_t)(esp_timer_get_time() / 1000);
+ if (now - previous < 1000) return;
+ // A concurrent completion owns the notification if it won this exchange.
+ if (!atomic_compare_exchange_strong(&last_ms, &previous, now)) return;
xTaskNotifyGive(s_beep_task);
}
+static bool capture_init_failed(const char *why)
+{
+ if (s_mic) { esp_codec_dev_delete(s_mic); s_mic = NULL; }
+ if (s_es7210) { audio_codec_delete_codec_if(s_es7210); s_es7210 = NULL; }
+ if (s_ctrl_if) { audio_codec_delete_ctrl_if(s_ctrl_if); s_ctrl_if = NULL; }
+ if (s_data_if) { audio_codec_delete_data_if(s_data_if); s_data_if = NULL; }
+ if (s_rx) { i2s_channel_disable(s_rx); i2s_del_channel(s_rx); s_rx = NULL; }
+ if (s_tx) { i2s_channel_disable(s_tx); i2s_del_channel(s_tx); s_tx = NULL; }
+ if (s_codec_lock) { vSemaphoreDelete(s_codec_lock); s_codec_lock = NULL; }
+ ESP_LOGE(TAG, "microphone unavailable: %s", why);
+ return false;
+}
+
bool audio_capture_init(void)
{
if (s_mic) return true;
+ if (!s_codec_lock) s_codec_lock=xSemaphoreCreateMutex();
+ if (!s_codec_lock) return false;
// Full-duplex I2S (BSP-exact): ES7210(ADC)+ES8311(codec) share BCLK/WS, so create both
// tx+rx and enable them — RX-only setups leave the shared clocks misconfigured → silence.
i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
- if (i2s_new_channel(&chan_cfg, &s_tx, &s_rx) != ESP_OK) { ESP_LOGE(TAG, "i2s_new_channel"); return false; }
+#ifdef DEVICE_HABITAT
+ chan_cfg.dma_frame_num = 160; // 10ms of mono PCM at 16kHz.
+ chan_cfg.dma_desc_num = 12; // 120ms of DMA headroom, independent of the USB sender.
+#endif
+ if (i2s_new_channel(&chan_cfg, &s_tx, &s_rx) != ESP_OK) return capture_init_failed("I2S allocation");
i2s_std_config_t std = {
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(AUDIO_SAMPLE_RATE),
@@ -135,15 +221,18 @@ bool audio_capture_init(void)
.invert_flags = { .mclk_inv = false, .bclk_inv = false, .ws_inv = false },
},
};
- if (i2s_channel_init_std_mode(s_tx, &std) != ESP_OK) { ESP_LOGE(TAG, "i2s init tx"); return false; }
- if (i2s_channel_init_std_mode(s_rx, &std) != ESP_OK) { ESP_LOGE(TAG, "i2s init rx"); return false; }
- i2s_channel_enable(s_tx);
- i2s_channel_enable(s_rx);
+ if (i2s_channel_init_std_mode(s_tx, &std) != ESP_OK) return capture_init_failed("I2S TX init");
+ if (i2s_channel_init_std_mode(s_rx, &std) != ESP_OK) return capture_init_failed("I2S RX init");
+ i2s_event_callbacks_t callbacks={.on_recv_q_ovf=rx_overrun};
+ if (i2s_channel_register_event_callback(s_rx,&callbacks,NULL) != ESP_OK)
+ return capture_init_failed("I2S callback");
+ if (i2s_channel_enable(s_tx) != ESP_OK) return capture_init_failed("I2S TX enable");
+ if (i2s_channel_enable(s_rx) != ESP_OK) return capture_init_failed("I2S RX enable");
// esp_codec_dev: I2S data interface + ES7210 over the shared I2C control bus.
audio_codec_i2s_cfg_t i2s_cfg = { .port = I2S_NUM_0, .rx_handle = s_rx, .tx_handle = s_tx };
s_data_if = audio_codec_new_i2s_data(&i2s_cfg);
- if (!s_data_if) { ESP_LOGE(TAG, "i2s data_if"); return false; }
+ if (!s_data_if) return capture_init_failed("I2S interface allocation");
audio_codec_i2c_cfg_t i2c_cfg = {
.port = I2C_NUM_0,
@@ -151,7 +240,7 @@ bool audio_capture_init(void)
.bus_handle = board_i2c_get(),
};
s_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg);
- if (!s_ctrl_if) { ESP_LOGE(TAG, "es7210 ctrl_if"); return false; }
+ if (!s_ctrl_if) return capture_init_failed("control interface allocation");
es7210_codec_cfg_t es_cfg = {
.ctrl_if = s_ctrl_if,
@@ -159,7 +248,7 @@ bool audio_capture_init(void)
// aren't necessarily MIC1/MIC2; an explicit wrong selection captures silence).
};
s_es7210 = es7210_codec_new(&es_cfg);
- if (!s_es7210) { ESP_LOGE(TAG, "es7210 new"); return false; }
+ if (!s_es7210) return capture_init_failed("codec allocation");
esp_codec_dev_cfg_t dev_cfg = {
.dev_type = ESP_CODEC_DEV_TYPE_IN,
@@ -167,7 +256,7 @@ bool audio_capture_init(void)
.data_if = s_data_if,
};
s_mic = esp_codec_dev_new(&dev_cfg);
- if (!s_mic) { ESP_LOGE(TAG, "codec_dev new"); return false; }
+ if (!s_mic) return capture_init_failed("device allocation");
ESP_LOGI(TAG, "mic (ES7210) ready");
return true;
}
@@ -176,16 +265,19 @@ bool audio_capture_start(void)
{
if (!s_mic && !audio_capture_init()) return false;
if (s_open) return true;
+ atomic_store(&s_capture_requested,true);
+ xSemaphoreTake(s_codec_lock,portMAX_DELAY);
esp_codec_dev_sample_info_t fs = {
.sample_rate = AUDIO_SAMPLE_RATE,
.channel = 1,
.bits_per_sample = 16,
};
- if (esp_codec_dev_open(s_mic, &fs) != ESP_OK) { ESP_LOGE(TAG, "codec open"); return false; }
+ if (esp_codec_dev_open(s_mic, &fs) != ESP_OK) { atomic_store(&s_capture_requested,false);xSemaphoreGive(s_codec_lock);ESP_LOGE(TAG, "codec open"); return false; }
// Make sure the I2S RX clock is running (esp_codec_dev_open may leave it disabled).
esp_err_t en = i2s_channel_enable(s_rx);
if (en != ESP_OK && en != ESP_ERR_INVALID_STATE) ESP_LOGW(TAG, "i2s enable: %s", esp_err_to_name(en));
esp_codec_dev_set_in_gain(s_mic, 37.5); // higher analog mic gain
+ atomic_store(&s_rx_overruns,0);
s_open = true;
ESP_LOGI(TAG, "mic stream open (%d Hz mono)", AUDIO_SAMPLE_RATE);
return true;
@@ -194,11 +286,13 @@ bool audio_capture_start(void)
int audio_capture_read(uint8_t *buf, int len)
{
if (!s_open) return -1;
+ int64_t started = esp_timer_get_time();
int r = esp_codec_dev_read(s_mic, buf, len);
+ audio_probe_read((uint32_t)(esp_timer_get_time()-started),r==ESP_CODEC_DEV_OK?len:0);
return (r == ESP_CODEC_DEV_OK) ? len : -1;
}
void audio_capture_stop(void)
{
- if (s_open) { esp_codec_dev_close(s_mic); s_open = false; }
+ if (s_open) { esp_codec_dev_close(s_mic); s_open = false;atomic_store(&s_capture_requested,false);xSemaphoreGive(s_codec_lock); }
}
diff --git a/devices/harness-device/firmware/main/audio_capture.h b/devices/harness-device/firmware/main/audio_capture.h
index 0f662a9b5..4fa9182e8 100644
--- a/devices/harness-device/firmware/main/audio_capture.h
+++ b/devices/harness-device/firmware/main/audio_capture.h
@@ -32,6 +32,9 @@ int audio_capture_read(uint8_t *buf, int len);
// Close the mic stream.
void audio_capture_stop(void);
+// DMA queue overflows since the current capture opened; a count above zero means lost samples.
+uint32_t audio_capture_overruns(void);
+
// --- Notification beep (ES8311 speaker output) ---
// One-time init of the ES8311 OUT path + a worker task that plays a short tone on request.
// Call once at boot (after the I2C bus is up). Safe no-op if the speaker codec isn't present.
@@ -40,3 +43,7 @@ void audio_notify_init(void);
// Play a short "beep beep" (non-blocking; queues to the beep task). Debounced ~1s.
// Safe to call from any task (e.g. the commander WS event task on a "done" event).
void audio_notify_done(void);
+
+// Applies immediately, including queued notifications, and persists to NVS.
+bool audio_notify_set_muted(bool muted);
+bool audio_notify_is_muted(void);
diff --git a/devices/harness-device/firmware/main/audio_client.c b/devices/harness-device/firmware/main/audio_client.c
index 709347ab8..409c283b0 100644
--- a/devices/harness-device/firmware/main/audio_client.c
+++ b/devices/harness-device/firmware/main/audio_client.c
@@ -1,5 +1,37 @@
#include "audio_client.h"
+
+void audio_client_request_review(void) {}
+bool audio_client_review_requested(void) { return false; }
+void audio_client_copy_draft(char *out,size_t capacity,unsigned *revision,bool *append)
+{
+ if (capacity) out[0]=0;
+ if (revision) *revision=0;
+ if (append) *append=false;
+}
+
+void audio_client_copy_question(char *out, size_t capacity, unsigned *index)
+{
+ if (capacity) out[0] = 0;
+ if (index) *index = 0;
+}
+
+void audio_client_copy_carry(char *out, size_t capacity) { if (capacity) out[0] = 0; }
+
+void audio_client_copy_form(char *out, size_t capacity, unsigned *revision)
+{
+ if (capacity) out[0] = 0;
+ if (revision) *revision = 0;
+}
+void audio_client_copy_selection(char *out, size_t capacity, unsigned *revision)
+{
+ if (capacity) out[0] = 0;
+ if (revision) *revision = 0;
+}
+
+// The stock UI does not display the Habitat microphone envelope.
+unsigned audio_client_input_level(void) { return 0; }
#include "audio_capture.h"
+#include "audio_probe.h"
#include "cable_client.h"
#include "config_store.h"
#include "ram_telemetry.h"
@@ -114,7 +146,10 @@ static bool stream_capture_cable(uint8_t *tmp)
char lang[CFG_VLANG_MAX];
config_load_voicelang(lang, sizeof(lang));
const char *cmd = s_cmd == VOICE_CMD_GOAL ? "goal" : (s_cmd == VOICE_CMD_LOOP ? "loop" : "");
- cable_client_voice_begin(s_agent[0] ? s_agent : NULL, cmd, lang, AUDIO_SAMPLE_RATE);
+ if (!audio_stream_begin(s_agent[0] ? s_agent : NULL, cmd, lang, AUDIO_SAMPLE_RATE)) {
+ audio_stream_abort("could not start voice stream");
+ return false;
+ }
// Drain up to this many chunks per iteration. Bounded so mic capture is never starved: the I2S DMA is
// shallow, and a consumer that hogs the loop drops live speech — the same damage the drop policy above
@@ -131,16 +166,16 @@ static bool stream_capture_cable(uint8_t *tmp)
size_t len = BUF_MAX - pos;
if (len > remain) len = (size_t)remain;
if (len > CABLE_VOICE_CHUNK) len = CABLE_VOICE_CHUNK;
- if (!cable_client_voice_pcm(s_buf + pos, len)) {
+ if (!audio_stream_pcm(s_buf + pos, len)) {
ESP_LOGW(TAG, "voice(cable): chunk stalled at %lluKB — aborting the utterance",
(unsigned long long)(sent / 1024));
- cable_client_voice_abort("cable stalled");
+ audio_stream_abort("cable stalled");
return false;
}
sent += len;
}
}
- if (s_abort_req) { cable_client_voice_abort("aborted"); return false; }
+ if (s_abort_req) { audio_stream_abort("aborted"); return false; }
// Tail: everything the mic produced after the last drain.
while (sent < s_prod_off) {
@@ -149,14 +184,14 @@ static bool stream_capture_cable(uint8_t *tmp)
size_t len = BUF_MAX - pos;
if (len > remain) len = (size_t)remain;
if (len > CABLE_VOICE_CHUNK) len = CABLE_VOICE_CHUNK;
- if (!cable_client_voice_pcm(s_buf + pos, len)) {
+ if (!audio_stream_pcm(s_buf + pos, len)) {
ESP_LOGW(TAG, "voice(cable): tail stalled at %lluKB", (unsigned long long)(sent / 1024));
- cable_client_voice_abort("cable stalled");
+ audio_stream_abort("cable stalled");
return false;
}
sent += len;
}
- return (cable_client_voice_end(), true);
+ return (audio_stream_end(), true);
}
static void voice_task(void *arg)
@@ -265,6 +300,11 @@ bool audio_client_active(void)
return true;
}
+void audio_client_copy_upload_id(char *out, size_t capacity)
+{
+ snprintf(out, capacity, "%s", s_upload_id);
+}
+
bool audio_client_upload_matches(const char *upload_id)
{
// Keep matching the just-finished utterance until the next start replaces s_upload_id: the
@@ -279,3 +319,8 @@ bool audio_client_recording(void)
{
return s_recording;
}
+
+void audio_client_start_search(const char *agent, const char *selection, unsigned revision)
+{ (void)agent; (void)selection; (void)revision; }
+void audio_client_copy_search(char *out, size_t capacity, unsigned *revision)
+{ if (capacity) *out = 0; if (revision) *revision = 0; }
diff --git a/devices/harness-device/firmware/main/audio_client.h b/devices/harness-device/firmware/main/audio_client.h
index 931aaf0ad..e8d93bc57 100644
--- a/devices/harness-device/firmware/main/audio_client.h
+++ b/devices/harness-device/firmware/main/audio_client.h
@@ -1,10 +1,10 @@
-// Records mic PCM into a PSRAM buffer during a PWR-button voice capture, then sends the whole
-// utterance over the existing commander WS (voice_start → PCM chunks → voice_end).
+// Touch-driven voice capture: 16kHz PCM streamed over the existing USB cable session.
#pragma once
#include <stdbool.h>
+#include <stddef.h>
-// Reserve the PSRAM record buffer once at boot (call early, before WiFi, to avoid heap fragmentation).
+// Reserve audio buffers (and Habitat's capture/sender workers) once at boot.
void audio_client_init(void);
// Which slash command (if any) the backend should put in front of this utterance's transcript. The
@@ -23,6 +23,13 @@ typedef enum { VOICE_CMD_NONE = 0, VOICE_CMD_GOAL, VOICE_CMD_LOOP } voice_cmd_t;
* belong to. `cmd` is the one modifier a person can express by how they hold the button.
*/
void audio_client_start_cable(const char *agent_id, voice_cmd_t cmd);
+// Habitat's deliberate quote-and-speak flow. No selected text is held on the device.
+void audio_client_start_form(const char *id, unsigned revision);
+void audio_client_copy_form(char *out, size_t capacity, unsigned *revision);
+void audio_client_start_selection(const char *agent_id, const char *selection_id, unsigned revision);
+void audio_client_start_carry(const char *agent_id, const char *carry_id);
+void audio_client_copy_carry(char *out, size_t capacity);
+void audio_client_copy_selection(char *out, size_t capacity, unsigned *revision);
void audio_client_stop(void);
@@ -34,11 +41,25 @@ bool audio_client_active(void);
// True when `upload_id` belongs to the current or just-finished utterance. Used to accept a final
// quota verdict after voice_end while ignoring delayed frames once a newer utterance has started.
bool audio_client_upload_matches(const char *upload_id);
+void audio_client_copy_upload_id(char *out, size_t capacity);
// True only while capturing mic PCM (false once the clip is uploading). Used by the UI to switch its
// indicator to "Sending…" when capture ends.
bool audio_client_recording(void);
-// True once this recording has crossed the speech-energy gate (the user actually spoke). The UI's 15s
-// silence watchdog discards a recording that never crosses it (accidental / forgotten Voice press).
+// Coarse energy estimate, not a reliable speech detector: quiet speech may never cross this gate.
+// Habitat recording stays under explicit user control; this estimate must not discard its audio.
bool audio_client_heard_voice(void);
+// 0..4 measured mic envelope for local visual feedback; not speech recognition/VAD.
+unsigned audio_client_input_level(void);
+
+void audio_client_start_question(const char *id, const char *token, unsigned index);
+void audio_client_copy_question(char *out, size_t capacity, unsigned *index);
+
+void audio_client_request_review(void);
+bool audio_client_review_requested(void);
+void audio_client_start_draft(const char *id, unsigned revision, bool append);
+void audio_client_copy_draft(char *out, size_t capacity, unsigned *revision, bool *append);
+
+void audio_client_start_search(const char *agent_id, const char *selection_id, unsigned revision);
+void audio_client_copy_search(char *out, size_t capacity, unsigned *revision);
diff --git a/devices/harness-device/firmware/main/audio_client_habitat.c b/devices/harness-device/firmware/main/audio_client_habitat.c
new file mode 100644
index 000000000..a4f33d621
--- /dev/null
+++ b/devices/harness-device/firmware/main/audio_client_habitat.c
@@ -0,0 +1,342 @@
+// Continuous 10ms capture. A separate, lower-priority sender absorbs USB backpressure.
+#include "audio_client.h"
+#include "audio_capture.h"
+#include "audio_probe.h"
+#include "voice_buffer.h"
+#include "config_store.h"
+#include "ram_telemetry.h"
+#include "esp_heap_caps.h"
+#include "esp_timer.h"
+#include "esp_random.h"
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <stdatomic.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define CAPTURE_SAMPLES 160
+#define BUFFER_BYTES 32768
+static const char *TAG = "audio_fast";
+static TaskHandle_t capture_task, sender_task;
+static uint8_t *storage;
+static voice_buffer_t buffer;
+static atomic_bool active, recording, stop_requested, abort_requested, capture_done, heard;
+static atomic_uint input_level;
+static portMUX_TYPE state_lock = portMUX_INITIALIZER_UNLOCKED;
+static char agent[ID_MAX], upload[24];
+static char selection[48];
+static unsigned selection_revision;
+static char search_id[48];
+static unsigned search_revision;
+static char form_id[48];
+static char carry_id[48];
+static unsigned form_revision;
+static char question_token[48];
+static unsigned question_index;
+static char draft_id[48];
+static unsigned draft_revision;
+static bool draft_append;
+static atomic_bool review_requested;
+static voice_cmd_t command;
+static uint32_t produced, high_water, read_max_us;
+
+static void capture(void *unused)
+{
+ (void)unused;
+ int16_t pcm[CAPTURE_SAMPLES];
+ for (;;) {
+ ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
+ voice_gate_t gate = {0};
+ voice_level_t meter = {0};
+ unsigned failures = 0;
+ if (!audio_capture_start()) {
+ atomic_store(&abort_requested, true);
+ goto complete;
+ }
+ while (!atomic_load(&stop_requested)) {
+ int64_t before = esp_timer_get_time();
+ int n = audio_capture_read((uint8_t *)pcm, sizeof(pcm));
+ uint32_t elapsed = (uint32_t)(esp_timer_get_time() - before);
+ if (elapsed > read_max_us)
+ read_max_us = elapsed;
+ if (n <= 0) {
+ if (++failures >= 3) {
+ atomic_store(&abort_requested, true);
+ break;
+ }
+ vTaskDelay(pdMS_TO_TICKS(2));
+ continue;
+ }
+ failures = 0;
+ if (audio_capture_overruns()) {
+ ESP_LOGE(TAG, "DMA dropped samples; discarding this utterance");
+ atomic_store(&abort_requested, true);
+ break;
+ }
+ if (atomic_load(&abort_requested))
+ break;
+ voice_gate_feed(&gate, pcm, (size_t)n / 2, AUDIO_SAMPLE_RATE);
+ atomic_store_explicit(&input_level, voice_level_feed(&meter, pcm, (size_t)n / 2),
+ memory_order_relaxed);
+ atomic_store(&heard, gate.heard);
+ if (!voice_buffer_write(&buffer, (uint8_t *)pcm, (size_t)n)) {
+ ESP_LOGE(TAG, "USB stalled beyond the PCM buffer; discarding utterance");
+ atomic_store(&abort_requested, true);
+ break;
+ }
+ produced += (uint32_t)n;
+ uint32_t used = voice_buffer_used(&buffer);
+ if (used > high_water)
+ high_water = used;
+ xTaskNotifyGive(sender_task);
+ }
+ audio_capture_stop();
+ complete:
+ atomic_store_explicit(&input_level, 0, memory_order_relaxed);
+ atomic_store(&recording, false);
+ atomic_store_explicit(&capture_done, true, memory_order_release);
+ xTaskNotifyGive(sender_task);
+ }
+}
+
+static void send_audio(void *unused)
+{
+ (void)unused;
+ for (;;) {
+ ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
+ if (!atomic_load(&active))
+ continue;
+ char lang[CFG_VLANG_MAX];
+ config_load_voicelang(lang, sizeof(lang));
+ const char *cmd = command == VOICE_CMD_GOAL ? "goal"
+ : command == VOICE_CMD_LOOP ? "loop"
+ : "";
+ int64_t began = esp_timer_get_time();
+ xTaskNotifyGive(capture_task);
+ if (!audio_stream_begin(agent[0] ? agent : NULL, cmd, lang, AUDIO_SAMPLE_RATE))
+ atomic_store(&abort_requested, true);
+ uint32_t delivered = 0, send_max_us = 0;
+ for (;;) {
+ if (atomic_load(&abort_requested))
+ break;
+ const uint8_t *data;
+ size_t n = voice_buffer_peek(&buffer, &data, CABLE_VOICE_CHUNK);
+ if (!n) {
+ if (atomic_load_explicit(&capture_done, memory_order_acquire)) {
+ // Acquire done before the final head check: do not lose the producer's last
+ // chunk.
+ if (!voice_buffer_peek(&buffer, &data, CABLE_VOICE_CHUNK))
+ break;
+ continue;
+ }
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
+ continue;
+ }
+ int64_t before = esp_timer_get_time();
+ bool ok = audio_stream_pcm(data, n);
+ uint32_t elapsed = (uint32_t)(esp_timer_get_time() - before);
+ if (elapsed > send_max_us)
+ send_max_us = elapsed;
+ if (!ok) {
+ atomic_store(&abort_requested, true);
+ break;
+ }
+ voice_buffer_consume(&buffer, n);
+ delivered += (uint32_t)n;
+ }
+ atomic_store(&stop_requested, true);
+ while (!atomic_load_explicit(&capture_done, memory_order_acquire))
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(20));
+ if (atomic_load(&abort_requested))
+ audio_stream_abort("capture or cable interrupted");
+ else
+ audio_stream_end();
+ ESP_LOGI(TAG,
+ "voice_ms=%lu produced=%lu delivered=%lu ring_peak=%lu read_max_us=%lu "
+ "send_max_us=%lu rx_overruns=%lu aborted=%d energy_gate=%d stack_rx=%u stack_tx=%u",
+ (unsigned long)((esp_timer_get_time() - began) / 1000), (unsigned long)produced,
+ (unsigned long)delivered, (unsigned long)high_water, (unsigned long)read_max_us,
+ (unsigned long)send_max_us, (unsigned long)audio_capture_overruns(),
+ atomic_load(&abort_requested), atomic_load(&heard),
+ (unsigned)uxTaskGetStackHighWaterMark(capture_task),
+ (unsigned)uxTaskGetStackHighWaterMark(NULL));
+ // The next gesture cannot reuse metadata or the ring until capture and finalization
+ // finished.
+ atomic_store_explicit(&active, false, memory_order_release);
+ }
+}
+
+void audio_client_init(void)
+{
+ if (storage)
+ return;
+ storage = ram_psram_alloc(BUFFER_BYTES, "voice_stream_ring");
+ if (!storage) {
+ ESP_LOGE(TAG, "PCM buffer allocation failed");
+ return;
+ }
+ voice_buffer_init(&buffer, storage, BUFFER_BYTES);
+ BaseType_t a =
+ xTaskCreatePinnedToCore(capture, "voice_capture", 5120, NULL, 6, &capture_task, 0);
+ BaseType_t b =
+ xTaskCreatePinnedToCore(send_audio, "voice_send", 5120, NULL, 4, &sender_task, 0);
+ if (a != pdPASS || b != pdPASS) {
+ if (capture_task)
+ vTaskDelete(capture_task);
+ if (sender_task)
+ vTaskDelete(sender_task);
+ capture_task = sender_task = NULL;
+ free(storage);
+ storage = NULL;
+ ESP_LOGE(TAG, "Audio task allocation failed");
+ return;
+ }
+ ESP_LOGI(TAG, "10ms PCM capture; independent sender; %d-byte ring", BUFFER_BYTES);
+}
+static void start_context(const char *id, voice_cmd_t cmd, const char *selected, unsigned revision, const char *form, unsigned form_rev, const char *carried, const char *question, unsigned index, const char *draft, unsigned draft_rev, bool append, const char *search, unsigned search_rev)
+{
+ if (!capture_task || !sender_task) {
+ ESP_LOGE(TAG, "Audio unavailable");
+ return;
+ }
+ uint32_t u0 = esp_random(), u1 = esp_random();
+ portENTER_CRITICAL(&state_lock);
+ if (atomic_load(&active)) {
+ portEXIT_CRITICAL(&state_lock);
+ return;
+ }
+ snprintf(agent, sizeof(agent), "%s", id ? id : "");
+ snprintf(selection, sizeof(selection), "%s", selected ? selected : "");
+ selection_revision = revision;
+ snprintf(search_id, sizeof search_id, "%s", search ? search : "");
+ search_revision = search_rev;
+ snprintf(form_id, sizeof(form_id), "%s", form ? form : "");
+ form_revision = form_rev;
+ snprintf(carry_id, sizeof(carry_id), "%s", carried ? carried : "");
+ snprintf(upload, sizeof(upload), "%08lx%08lx", (unsigned long)u0, (unsigned long)u1);
+ snprintf(question_token, sizeof(question_token), "%s", question ? question : "");
+ question_index = index;
+ snprintf(draft_id, sizeof(draft_id), "%s", draft ? draft : "");
+ draft_revision = draft_rev; draft_append = append;
+ atomic_store(&review_requested, false);
+ command = cmd;
+ produced = high_water = read_max_us = 0;
+ voice_buffer_init(&buffer, storage, BUFFER_BYTES);
+ atomic_store(&heard, false);
+ atomic_store(&input_level, 0);
+ atomic_store(&stop_requested, false);
+ atomic_store(&abort_requested, false);
+ atomic_store(&capture_done, false);
+ atomic_store(&recording, true);
+ atomic_store(&active, true);
+ portEXIT_CRITICAL(&state_lock);
+ xTaskNotifyGive(sender_task);
+}
+void audio_client_start_cable(const char *id, voice_cmd_t cmd) { start_context(id, cmd, NULL, 0, NULL, 0, NULL, NULL, 0, NULL, 0, false, NULL, 0); }
+void audio_client_start_selection(const char *id, const char *selected, unsigned revision)
+{
+ if (id && *id && selected && *selected && revision) start_context(id, VOICE_CMD_NONE, selected, revision, NULL, 0, NULL, NULL, 0, NULL, 0, false, NULL, 0);
+}
+void audio_client_start_form(const char *id, unsigned revision)
+{
+ if (id && *id) start_context(NULL, VOICE_CMD_NONE, NULL, 0, id, revision, NULL, NULL, 0, NULL, 0, false, NULL, 0);
+}
+void audio_client_start_carry(const char *id, const char *carried)
+{
+ if (id && *id && carried && *carried) start_context(id, VOICE_CMD_NONE, NULL, 0, NULL, 0, carried, NULL, 0, NULL, 0, false, NULL, 0);
+}
+void audio_client_request_review(void) { atomic_store(&review_requested,true); }
+bool audio_client_review_requested(void) { return atomic_load(&review_requested); }
+void audio_client_start_draft(const char *id,unsigned revision,bool append)
+{
+ if (id && *id) start_context(NULL,VOICE_CMD_NONE,NULL,0,NULL,0,NULL,NULL,0,id,revision,append,NULL,0);
+}
+void audio_client_copy_draft(char *out,size_t capacity,unsigned *revision,bool *append)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out,capacity,"%s",draft_id);
+ if (revision) *revision=draft_revision;
+ if (append) *append=draft_append;
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_start_question(const char *id, const char *token, unsigned index)
+{
+ if (id && *id && token && *token && index < 4)
+ start_context(id, VOICE_CMD_NONE, NULL, 0, NULL, 0, NULL, token, index, NULL, 0, false, NULL, 0);
+}
+void audio_client_copy_question(char *out, size_t capacity, unsigned *index)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out, capacity, "%s", question_token);
+ if (index) *index = question_index;
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_copy_carry(char *out, size_t capacity)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out, capacity, "%s", carry_id);
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_copy_form(char *out, size_t capacity, unsigned *revision)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out, capacity, "%s", form_id);
+ if (revision) *revision = form_revision;
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_copy_selection(char *out, size_t capacity, unsigned *revision)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out, capacity, "%s", selection);
+ if (revision) *revision = selection_revision;
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_stop(void)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (atomic_load(&active))
+ atomic_store(&stop_requested, true);
+ portEXIT_CRITICAL(&state_lock);
+}
+void audio_client_abort(void)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (atomic_load(&active)) {
+ atomic_store(&abort_requested, true);
+ atomic_store(&stop_requested, true);
+ }
+ portEXIT_CRITICAL(&state_lock);
+}
+bool audio_client_active(void) { return atomic_load_explicit(&active, memory_order_acquire); }
+bool audio_client_recording(void) { return atomic_load(&recording); }
+bool audio_client_heard_voice(void) { return atomic_load(&heard); }
+unsigned audio_client_input_level(void) { return atomic_load_explicit(&input_level, memory_order_relaxed); }
+void audio_client_copy_upload_id(char *out, size_t capacity)
+{
+ portENTER_CRITICAL(&state_lock);
+ snprintf(out, capacity, "%s", upload);
+ portEXIT_CRITICAL(&state_lock);
+}
+bool audio_client_upload_matches(const char *id)
+{
+ bool match;
+ portENTER_CRITICAL(&state_lock);
+ match = id && *id && !strcmp(id, upload);
+ portEXIT_CRITICAL(&state_lock);
+ return match;
+}
+
+void audio_client_start_search(const char *id, const char *selected, unsigned revision)
+{
+ if (id && *id && selected && *selected && revision)
+ start_context(id,VOICE_CMD_NONE,NULL,0,NULL,0,NULL,NULL,0,NULL,0,false,selected,revision);
+}
+void audio_client_copy_search(char *out,size_t capacity,unsigned *revision)
+{
+ portENTER_CRITICAL(&state_lock);
+ if (capacity) snprintf(out,capacity,"%s",search_id);
+ if (revision) *revision=search_revision;
+ portEXIT_CRITICAL(&state_lock);
+}
diff --git a/devices/harness-device/firmware/main/audio_probe.c b/devices/harness-device/firmware/main/audio_probe.c
new file mode 100644
index 000000000..b55a714e5
--- /dev/null
+++ b/devices/harness-device/firmware/main/audio_probe.c
@@ -0,0 +1,93 @@
+#include "audio_probe.h"
+#ifdef DEVICE_PERF_BENCH
+#include "audio_client.h"
+#include "audio_capture.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <stdatomic.h>
+#include <stdlib.h>
+#include <string.h>
+static atomic_bool probing;
+static bool stalled, aborted;
+static int64_t next_stall;
+static uint32_t read_us[512], reads, produced, sent;
+void audio_probe_read(uint32_t us, int bytes)
+{
+ if (!atomic_load(&probing))
+ return;
+ if (reads < 512)
+ read_us[reads++] = us;
+ if (bytes > 0)
+ produced += (uint32_t)bytes;
+}
+bool audio_stream_begin(const char *id, const char *cmd, const char *lang, int rate)
+{
+ if (!atomic_load(&probing))
+ return cable_client_voice_begin(id, cmd, lang, rate);
+ return true;
+}
+bool audio_stream_pcm(const uint8_t *pcm, size_t size)
+{
+ if (!atomic_load(&probing))
+ return cable_client_voice_pcm(pcm, size);
+ if (stalled && esp_timer_get_time() >= next_stall) {
+ next_stall += 500000;
+ vTaskDelay(pdMS_TO_TICKS(120));
+ }
+ sent += (uint32_t)size;
+ return true;
+}
+void audio_stream_end(void)
+{
+ if (!atomic_load(&probing))
+ cable_client_voice_end();
+}
+void audio_stream_abort(const char *reason)
+{
+ if (atomic_load(&probing))
+ aborted = true;
+ else
+ cable_client_voice_abort(reason);
+}
+static int compare(const void *a, const void *b)
+{
+ uint32_t x = *(const uint32_t *)a, y = *(const uint32_t *)b;
+ return (x > y) - (x < y);
+}
+void audio_probe_run(void)
+{
+ // Uses the real codec, capture worker and buffer. PCM is discarded by the local sink;
+ // no audio is written to a file, USB, host daemon or transcription service.
+ for (int scenario = 0; scenario < 2; scenario++) {
+ reads = produced = sent = 0;
+ aborted = false;
+ stalled = scenario != 0;
+ next_stall = esp_timer_get_time() + 500000;
+ atomic_store(&probing, true);
+ audio_client_start_cable(NULL, VOICE_CMD_NONE);
+ int64_t until = esp_timer_get_time() + 2000000;
+ while (esp_timer_get_time() < until && audio_client_active())
+ vTaskDelay(pdMS_TO_TICKS(10));
+ audio_client_stop();
+ until = esp_timer_get_time() + 3000000;
+ while (audio_client_active() && esp_timer_get_time() < until)
+ vTaskDelay(pdMS_TO_TICKS(10));
+ if (audio_client_active()) {
+ ESP_LOGE("AUDIO_PERF", "capture did not stop");
+ audio_client_abort();
+ return;
+ }
+ atomic_store(&probing, false);
+ qsort(read_us, reads, sizeof(*read_us), compare);
+ ESP_LOGI("AUDIO_PERF",
+ "case=%s reads=%lu read_p50_us=%lu read_p95_us=%lu produced=%lu delivered=%lu "
+ "rx_overruns=%lu aborted=%d",
+ scenario ? "sink_stall_120ms" : "healthy_sink", (unsigned long)reads,
+ (unsigned long)(reads ? read_us[reads / 2] : 0),
+ (unsigned long)(reads ? read_us[reads * 95 / 100] : 0), (unsigned long)produced,
+ (unsigned long)sent, (unsigned long)audio_capture_overruns(), aborted);
+ }
+}
+#endif
diff --git a/devices/harness-device/firmware/main/audio_probe.h b/devices/harness-device/firmware/main/audio_probe.h
new file mode 100644
index 000000000..2b3bc3b30
--- /dev/null
+++ b/devices/harness-device/firmware/main/audio_probe.h
@@ -0,0 +1,20 @@
+#pragma once
+#include "cable_client.h"
+#ifdef DEVICE_PERF_BENCH
+bool audio_stream_pcm(const uint8_t *pcm, size_t len);
+bool audio_stream_begin(const char *id, const char *cmd, const char *lang, int rate);
+void audio_stream_end(void);
+void audio_stream_abort(const char *reason);
+void audio_probe_read(uint32_t microseconds, int bytes);
+void audio_probe_run(void);
+#else
+#define audio_stream_pcm cable_client_voice_pcm
+#define audio_stream_begin cable_client_voice_begin
+#define audio_stream_end cable_client_voice_end
+#define audio_stream_abort cable_client_voice_abort
+static inline void audio_probe_read(uint32_t microseconds, int bytes)
+{
+ (void)microseconds;
+ (void)bytes;
+}
+#endif
diff --git a/devices/harness-device/firmware/main/board/board_i2c.c b/devices/harness-device/firmware/main/board/board_i2c.c
index ea466b399..07c1c6d13 100644
--- a/devices/harness-device/firmware/main/board/board_i2c.c
+++ b/devices/harness-device/firmware/main/board/board_i2c.c
@@ -1,13 +1,34 @@
#include "board_i2c.h"
#include "board_pins.h"
#include "esp_log.h"
+#include "esp_timer.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <stdatomic.h>
static const char *TAG = "board_i2c";
-static i2c_master_bus_handle_t s_bus;
+static _Atomic(i2c_master_bus_handle_t) s_bus;
+static atomic_flag s_initializing = ATOMIC_FLAG_INIT;
i2c_master_bus_handle_t board_i2c_get(void)
{
- if (s_bus) return s_bus;
+ i2c_master_bus_handle_t bus = atomic_load_explicit(&s_bus, memory_order_acquire);
+ if (bus) return bus;
+ // Normal startup creates the bus before any worker exists. If that attempt
+ // fails, touch and audio may retry together: only one may allocate port 0.
+ // Never hold a critical section while the SDK allocates or waits on hardware.
+ int64_t deadline = esp_timer_get_time() + 500000;
+ while (atomic_flag_test_and_set_explicit(&s_initializing, memory_order_acquire)) {
+ bus = atomic_load_explicit(&s_bus, memory_order_acquire);
+ if (bus) return bus;
+ if (esp_timer_get_time() >= deadline) return NULL;
+ vTaskDelay(1);
+ }
+ bus = atomic_load_explicit(&s_bus, memory_order_acquire);
+ if (bus) {
+ atomic_flag_clear_explicit(&s_initializing, memory_order_release);
+ return bus;
+ }
i2c_master_bus_config_t cfg = {
.i2c_port = BSP_I2C_PORT,
.sda_io_num = BSP_I2C_SDA,
@@ -16,9 +37,12 @@ i2c_master_bus_handle_t board_i2c_get(void)
.glitch_ignore_cnt = 7,
.flags.enable_internal_pullup = true,
};
- if (i2c_new_master_bus(&cfg, &s_bus) != ESP_OK) {
+ if (i2c_new_master_bus(&cfg, &bus) != ESP_OK) {
ESP_LOGE(TAG, "i2c bus init failed");
- s_bus = NULL;
+ bus = NULL;
+ } else {
+ atomic_store_explicit(&s_bus, bus, memory_order_release);
}
- return s_bus;
+ atomic_flag_clear_explicit(&s_initializing, memory_order_release);
+ return bus;
}
diff --git a/devices/harness-device/firmware/main/board/board_i2c.h b/devices/harness-device/firmware/main/board/board_i2c.h
index c5113ecf0..14de61e91 100644
--- a/devices/harness-device/firmware/main/board/board_i2c.h
+++ b/devices/harness-device/firmware/main/board/board_i2c.h
@@ -5,5 +5,6 @@
#include "driver/i2c_master.h"
-// Returns the shared I2C master bus handle (creates it once). NULL on failure.
+// Returns the shared bus (creates it once). Safe across concurrent task retries.
+// NULL on failure or if another initializer has not finished within 500 ms.
i2c_master_bus_handle_t board_i2c_get(void);
diff --git a/devices/harness-device/firmware/main/cable_client.c b/devices/harness-device/firmware/main/cable_client.c
index 7c6c05555..e1acf3774 100644
--- a/devices/harness-device/firmware/main/cable_client.c
+++ b/devices/harness-device/firmware/main/cable_client.c
@@ -1,15 +1,19 @@
#include "cable_client.h"
+#include "cable_scroll.h"
#include <stdlib.h>
+#include <stdatomic.h>
#include <string.h>
#include "cJSON.h"
#include "cable_link.h"
+#include "cable_json_guard.h"
#include "cable_machines.h"
#include "device_mac.h"
#include "esp_app_desc.h"
#include "esp_log.h"
#include "audio_capture.h" // audio_notify_done() — the completion beep
+#include "audio_client.h"
#include "esp_timer.h"
#include "fw_update.h"
#include "last_words.h"
@@ -34,18 +38,14 @@ static const char *TAG = "cable_client";
#define HELLO_SESSION_MS 15000 // session up: a keepalive, and a re-introduction if the daemon restarted
#define SILENCE_MS 15000 // nothing of any kind for this long → the daemon is gone
-// One JSON message. Comfortably over anything the vocabulary sends; a `question` with several options is
-// the largest, and the daemon is expected to have trimmed it for a 466 px screen long before here.
-#define JSON_MAX 2048
-
typedef struct {
char id[ID_MAX];
- char name[NAME_MAX];
+ char name[CABLE_NAME_MAX];
char engine[12];
char model[24];
char effort[16];
char machine_id[ID_MAX]; // which machine this agent lives on ("" from a daemon that predates it)
- char machine[NAME_MAX]; // that machine's name, drawn under the agent's
+ char machine[CABLE_NAME_MAX]; // that machine's name, drawn under the agent's
} cable_agent_t;
@@ -61,11 +61,20 @@ static SemaphoreHandle_t s_agents_lock;
static cable_machines_t s_machines;
static char s_machine_id[MACHINE_ID_MAX];
-static volatile bool s_session;
-static volatile int64_t s_last_rx_us;
-static char s_machine_name[NAME_MAX];
+static atomic_bool s_session;
+static atomic_uint s_features;
+static bool s_started; // boot owner; successful start is idempotent
+// Only the USB reader accesses this after start. A volatile 64-bit value is
+// not atomic on this 32-bit CPU; session expiry must share the reader's owner.
+static int64_t s_last_rx_us;
+static char s_machine_name[CABLE_NAME_MAX];
static uint32_t s_bad, s_unknown;
+bool cable_client_supports(uint32_t features)
+{
+ return (atomic_load(&s_features) & features) == features;
+}
+
// ── outbound ────────────────────────────────────────────────────────────────────────────────────────
// Serialise and send. Takes ownership of `root` — every caller builds a tree for exactly one message, and
@@ -87,10 +96,50 @@ static bool send_json(cJSON *root)
static cJSON *msg(const char *t)
{
cJSON *root = cJSON_CreateObject();
- if (root) cJSON_AddStringToObject(root, "t", t);
+ if (root && !cJSON_AddStringToObject(root, "t", t)) {
+ cJSON_Delete(root);
+ return NULL;
+ }
return root;
}
+// One allocation failure invalidates the entire command. A partially built
+// voice.begin must never lose its agentId and become a different routing mode.
+// Keep failure sticky by releasing the tree and clearing the caller's pointer;
+// subsequent fields become no-ops and send_json(NULL) cannot emit anything.
+static bool msg_check(cJSON **root, bool ok)
+{
+ if (!ok) { cJSON_Delete(*root); *root = NULL; }
+ return ok;
+}
+static bool msg_string(cJSON **root, const char *key, const char *value)
+{
+ return *root && msg_check(root, cJSON_AddStringToObject(*root, key, value) != NULL);
+}
+static bool msg_number(cJSON **root, const char *key, double value)
+{
+ return *root && msg_check(root, cJSON_AddNumberToObject(*root, key, value) != NULL);
+}
+static bool msg_bool(cJSON **root, const char *key, bool value)
+{
+ return *root && msg_check(root, cJSON_AddBoolToObject(*root, key, value) != NULL);
+}
+static cJSON *msg_array(cJSON **root, const char *key)
+{
+ if (!*root) return NULL;
+ cJSON *array = cJSON_AddArrayToObject(*root, key);
+ msg_check(root, array != NULL);
+ return array;
+}
+static bool msg_item(cJSON **root, const char *key, cJSON *item)
+{
+ if (!*root || !cJSON_AddItemToObject(*root, key, item)) {
+ cJSON_Delete(item);
+ return msg_check(root, false);
+ }
+ return true;
+}
+
const char *cable_fw_version(void)
{
// Never NULL: esp_app_get_description() reads a structure linked into this very image. Read from the
@@ -102,18 +151,18 @@ static void send_hello(void)
{
cJSON *root = msg("hello");
if (!root) return;
- cJSON_AddStringToObject(root, "fw", cable_fw_version());
+ msg_string(&root, "fw", cable_fw_version());
// Named before anything else about this dial is believed. See CABLE_PRODUCT.
- cJSON_AddStringToObject(root, "product", CABLE_PRODUCT);
- cJSON_AddNumberToObject(root, "proto", CABLE_PROTO_VERSION);
+ msg_string(&root, "product", CABLE_PRODUCT);
+ msg_number(&root, "proto", CABLE_PROTO_VERSION);
// Which of the two dials this is (board.h) — informational, so a log or a bug report can say. A
// daemon that predates the field ignores it.
- cJSON_AddStringToObject(root, "hw", board()->name);
+ msg_string(&root, "hw", board()->name);
// Also the device's USB serial number, so the daemon can tell one dial from another before a byte is
// exchanged — and can tell a keepalive greeting from a new board.
char mac[24] = "";
device_mac_str(mac, sizeof(mac));
- cJSON_AddStringToObject(root, "mac", mac);
+ msg_string(&root, "mac", mac);
send_json(root);
}
@@ -127,7 +176,7 @@ void cable_client_select_machine(const char *machine_id)
if (!machine_id || !machine_id[0]) return;
cJSON *root = msg("machine.select");
if (!root) return;
- cJSON_AddStringToObject(root, "machineId", machine_id);
+ msg_string(&root, "machineId", machine_id);
send_json(root);
}
@@ -138,7 +187,7 @@ void cable_client_select_swarm(const char *swarm_id)
if (!swarm_id || !swarm_id[0]) return;
cJSON *root = msg("swarm.select");
if (!root) return;
- cJSON_AddStringToObject(root, "swarmId", swarm_id);
+ msg_string(&root, "swarmId", swarm_id);
send_json(root);
}
@@ -153,8 +202,8 @@ void cable_client_send_turn(const char *agent_id, const char *text)
if (!agent_id || !agent_id[0] || !text) return;
cJSON *root = msg("turn.send");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
- cJSON_AddStringToObject(root, "text", text);
+ msg_string(&root, "agentId", agent_id);
+ msg_string(&root, "text", text);
send_json(root);
}
@@ -163,7 +212,7 @@ void cable_client_stop_turn(const char *agent_id)
if (!agent_id || !agent_id[0]) return;
cJSON *root = msg("turn.stop");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
+ msg_string(&root, "agentId", agent_id);
send_json(root);
}
@@ -172,7 +221,7 @@ void cable_client_send_focus(const char *agent_id)
if (!agent_id || !agent_id[0]) return;
cJSON *root = msg("focus");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
+ msg_string(&root, "agentId", agent_id);
send_json(root);
}
@@ -181,24 +230,22 @@ void cable_client_send_open(const char *agent_id, const char *reason)
if (!agent_id || !agent_id[0]) return;
cJSON *root = msg("agent.open");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
+ msg_string(&root, "agentId", agent_id);
// Absent for a tap: an older daemon reads the frame exactly as before.
- if (reason && reason[0]) cJSON_AddStringToObject(root, "reason", reason);
+ if (reason && reason[0]) msg_string(&root, "reason", reason);
send_json(root);
}
void cable_client_send_scroll(cable_scroll_phase_t phase, int dy, int velocity)
{
- static const char *const NAMES[] = { "down", "move", "up" };
+ _Static_assert(CABLE_SCROLL_DOWN == 0 && CABLE_SCROLL_MOVE == 1 && CABLE_SCROLL_UP == 2,
+ "scroll phase wire order");
// NO EARLY-OUT ON A ZERO dy. The two ends of a stroke are the whole point of this message: a `down`
// with nothing in it is what stops a fling still running, and an `up` with nothing in it is a finger
// that came to rest before it lifted — which must land as a stop, not as a throw.
- cJSON *root = msg("scroll");
- if (!root) return;
- cJSON_AddStringToObject(root, "phase", NAMES[phase]);
- cJSON_AddNumberToObject(root, "dy", dy);
- if (phase == CABLE_SCROLL_UP) cJSON_AddNumberToObject(root, "v", velocity);
- send_json(root);
+ char wire[CABLE_SCROLL_JSON_MAX];
+ size_t n = cable_scroll_encode(wire, sizeof wire, phase, dy, velocity);
+ if (n) cable_link_send(CABLE_TYPE_JSON, (const uint8_t *)wire, n);
}
void cable_client_answer(const char *agent_id, const char *request_id, const cJSON *answers)
@@ -206,14 +253,46 @@ void cable_client_answer(const char *agent_id, const char *request_id, const cJS
if (!agent_id || !request_id || !answers) return;
cJSON *root = msg("answer");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
- cJSON_AddStringToObject(root, "requestId", request_id);
+ msg_string(&root, "agentId", agent_id);
+ msg_string(&root, "requestId", request_id);
// Duplicated, not adopted: the caller keeps its own tree and this one is deleted with the message.
cJSON *copy = cJSON_Duplicate(answers, true);
if (!copy) { cJSON_Delete(root); return; }
- cJSON_AddItemToObject(root, "answers", copy);
+ msg_item(&root, "answers", copy);
+ send_json(root);
+}
+
+void cable_client_question_read(const char *agent_id, const char *request_id)
+{
+ cJSON *root=msg("question.read"); if (!root) return;
+ msg_string(&root,"agentId",agent_id);
+ msg_string(&root,"requestId",request_id);
send_json(root);
}
+bool cable_client_answer_reviewed(const char *agent_id, const char *request_id, const char *token,
+ const uint8_t *choices, const char drafts[][48], int count)
+{
+ if (!agent_id || !request_id || !token || !choices || count<1 || count>4) return false;
+ cJSON *root=msg("answer.reviewed"); if (!root) return false;
+ msg_string(&root,"agentId",agent_id);
+ msg_string(&root,"requestId",request_id);
+ msg_string(&root,"token",token);
+ cJSON *array=msg_array(&root,"choices");
+ if (!array) { cJSON_Delete(root); return false; }
+ for (int i=0;i<count;i++) {
+ cJSON *value=cJSON_CreateNumber(choices[i]);
+ if (!value) { cJSON_Delete(root); return false; }
+ cJSON_AddItemToArray(array,value);
+ }
+ cJSON *spoken=msg_array(&root,"drafts");
+ if (!spoken) { cJSON_Delete(root); return false; }
+ for (int i=0;i<count;i++) {
+ cJSON *value=cJSON_CreateString(drafts ? drafts[i] : "");
+ if (!value) { cJSON_Delete(root); return false; }
+ cJSON_AddItemToArray(spoken,value);
+ }
+ return send_json(root);
+}
// ── models: the one round trip ──────────────────────────────────────────────────────────────────────
// Everything else here is fire-and-forget, which is what keeps a spoken turn off the critical path. The
@@ -225,47 +304,87 @@ static SemaphoreHandle_t s_models_sem;
static model_item_t *s_models_out;
static int s_models_max;
static int s_models_n;
+static char s_models_agent[ID_MAX];
+static uint32_t s_models_request;
+static bool s_models_replied;
static void handle_models(const cJSON *p)
{
- if (!s_models_sem || !s_models_out) return; // nobody is waiting; a late answer is not an error
+ if (!s_models_sem || !s_agents_lock) return;
+ // The caller owns the output storage. Its timeout may run on the other core
+ // while this reader is copying a reply, so pointer + capacity + completion
+ // share the client data lock. Never hold it while waiting for the reply.
+ xSemaphoreTake(s_agents_lock, portMAX_DELAY);
+ const cJSON *agent_id = cJSON_GetObjectItemCaseSensitive(p, "agentId");
+ const cJSON *request = cJSON_GetObjectItemCaseSensitive(p, "request");
+ // Legacy hosts echo agentId. Newer hosts also echo the request serial, so
+ // an old same-agent response cannot complete a later picker. Accept only
+ // the first matching reply while the caller still owns its output buffer.
+ if (!s_models_out || s_models_replied || !cJSON_IsString(agent_id) ||
+ strcmp(agent_id->valuestring, s_models_agent) ||
+ (request && (!cJSON_IsNumber(request) || request->valuedouble != s_models_request))) {
+ xSemaphoreGive(s_agents_lock); return;
+ }
const cJSON *items = cJSON_GetObjectItemCaseSensitive(p, "items");
+ if (!cJSON_IsArray(items)) { xSemaphoreGive(s_agents_lock); return; }
int n = 0;
const cJSON *it = NULL;
cJSON_ArrayForEach(it, items) {
if (n >= s_models_max) break;
const cJSON *id = cJSON_GetObjectItemCaseSensitive(it, "id");
- if (!cJSON_IsString(id) || !id->valuestring[0]) continue;
+ if (!cJSON_IsString(id) || !id->valuestring[0] ||
+ strlen(id->valuestring) >= sizeof s_models_out[n].id) continue;
snprintf(s_models_out[n].id, sizeof(s_models_out[n].id), "%s", id->valuestring);
n++;
}
s_models_n = n;
+ s_models_replied = true;
xSemaphoreGive(s_models_sem);
+ xSemaphoreGive(s_agents_lock);
}
int cable_client_models_list(const char *agent_id, const char *picker_mode, const char *selected_model,
model_item_t *arr, int max)
{
- if (!agent_id || !arr || max <= 0 || !s_models_sem) return -1;
+ if (!agent_id || !agent_id[0] || strlen(agent_id) >= sizeof s_models_agent ||
+ !arr || max <= 0 || !s_models_sem || !s_agents_lock) return -1;
+
+ // Build the complete request before publishing a borrowed output pointer.
+ // A failed allocation must not leave a late reply pointing at caller memory.
+ cJSON *root = msg("models.list");
+ if (!root) return -1;
+ if (!msg_string(&root, "agentId", agent_id) ||
+ (picker_mode && !msg_string(&root, "mode", picker_mode)) ||
+ (selected_model && selected_model[0] &&
+ !msg_string(&root, "selected", selected_model))) {
+ cJSON_Delete(root);
+ return -1;
+ }
+ xSemaphoreTake(s_agents_lock, portMAX_DELAY);
+ if (s_models_out) { xSemaphoreGive(s_agents_lock); cJSON_Delete(root); return -1; }
+ s_models_request = s_models_request >= INT32_MAX ? 1 : s_models_request + 1;
+ if (!msg_number(&root, "request", s_models_request)) {
+ xSemaphoreGive(s_agents_lock); return -1;
+ }
+ snprintf(s_models_agent, sizeof s_models_agent, "%s", agent_id);
+ s_models_replied = false;
s_models_out = arr;
s_models_max = max;
s_models_n = 0;
// Drain a stale give from a previous request that timed out and then answered.
xSemaphoreTake(s_models_sem, 0);
+ xSemaphoreGive(s_agents_lock);
- cJSON *root = msg("models.list");
- if (!root) return -1;
- cJSON_AddStringToObject(root, "agentId", agent_id);
- if (picker_mode) cJSON_AddStringToObject(root, "mode", picker_mode);
- if (selected_model && selected_model[0]) cJSON_AddStringToObject(root, "selected", selected_model);
- if (!send_json(root)) { s_models_out = NULL; return -1; }
-
- const bool answered = xSemaphoreTake(s_models_sem, pdMS_TO_TICKS(MODELS_WAIT_MS)) == pdTRUE;
+ const bool sent = send_json(root);
+ const bool answered = sent && xSemaphoreTake(s_models_sem, pdMS_TO_TICKS(MODELS_WAIT_MS)) == pdTRUE;
+ xSemaphoreTake(s_agents_lock, portMAX_DELAY);
const int n = answered ? s_models_n : -1;
s_models_out = NULL;
- if (!answered) ESP_LOGW(TAG, "models: no answer in %d ms", MODELS_WAIT_MS);
+ s_models_max = 0;
+ xSemaphoreGive(s_agents_lock);
+ if (sent && !answered) ESP_LOGW(TAG, "models: no answer in %d ms", MODELS_WAIT_MS);
return n;
}
@@ -274,22 +393,118 @@ void cable_client_agent_update(const char *agent_id, const char *model, const ch
if (!agent_id || !agent_id[0]) return;
cJSON *root = msg("agent.update");
if (!root) return;
- cJSON_AddStringToObject(root, "agentId", agent_id);
- if (model && model[0]) cJSON_AddStringToObject(root, "model", model);
- if (effort && effort[0]) cJSON_AddStringToObject(root, "effort", effort);
+ msg_string(&root, "agentId", agent_id);
+ if (model && model[0]) msg_string(&root, "model", model);
+ if (effort && effort[0]) msg_string(&root, "effort", effort);
send_json(root);
}
-void cable_client_voice_begin(const char *agent_id, const char *cmd, const char *lang, int sample_rate)
+bool cable_client_voice_begin(const char *agent_id, const char *cmd, const char *lang, int sample_rate)
{
cJSON *root = msg("voice.begin");
- if (!root) return;
+ if (!root) return false;
// OMITTED, not empty, when there is no agent: absence is what tells the daemon it has to route the
// transcript itself. An empty string would read as "this agent", and there is no agent called "".
- if (agent_id && agent_id[0]) cJSON_AddStringToObject(root, "agentId", agent_id);
- if (cmd && cmd[0]) cJSON_AddStringToObject(root, "cmd", cmd);
- cJSON_AddStringToObject(root, "lang", lang && lang[0] ? lang : "en");
- cJSON_AddNumberToObject(root, "sr", sample_rate);
+ if (agent_id && agent_id[0]) msg_string(&root, "agentId", agent_id);
+ if (cmd && cmd[0]) msg_string(&root, "cmd", cmd);
+ msg_string(&root, "lang", lang && lang[0] ? lang : "en");
+ msg_number(&root, "sr", sample_rate);
+ char upload_id[24];
+ audio_client_copy_upload_id(upload_id, sizeof(upload_id));
+ msg_string(&root, "uploadId", upload_id);
+ char carried[48];
+ audio_client_copy_carry(carried, sizeof(carried));
+ if (carried[0]) msg_string(&root, "carryId", carried);
+ char form[48]; unsigned form_revision = 0;
+ audio_client_copy_form(form, sizeof(form), &form_revision);
+ if (form[0]) {
+ msg_string(&root, "formId", form);
+ msg_number(&root, "formRevision", form_revision);
+ }
+ char draft[48]; unsigned draft_revision=0; bool append=false;
+ audio_client_copy_draft(draft,sizeof draft,&draft_revision,&append);
+ if (draft[0]) {
+ msg_string(&root,"draftId",draft);
+ msg_number(&root,"draftRevision",draft_revision);
+ msg_string(&root,"draftOp",append ? "append" : "replace");
+ }
+ char question[48]; unsigned question_index = 0;
+ audio_client_copy_question(question, sizeof(question), &question_index);
+ if (question[0]) {
+ msg_string(&root, "questionToken", question);
+ msg_number(&root, "questionIndex", question_index);
+ }
+ char search[48]; unsigned search_revision = 0;
+ audio_client_copy_search(search, sizeof search, &search_revision);
+ if (search[0]) {
+ msg_string(&root,"searchId",search);
+ msg_number(&root,"searchRevision",search_revision);
+ }
+ char selected[48]; unsigned revision = 0;
+ audio_client_copy_selection(selected, sizeof(selected), &revision);
+ if (selected[0] && revision) {
+ msg_string(&root, "selectionId", selected);
+ msg_number(&root, "selectionRevision", revision);
+ }
+ return send_json(root);
+}
+
+void cable_client_carry(const char *id, const char *agent, const char *selection,
+ uint32_t request, uint32_t revision, bool cancel)
+{
+ cJSON *root=msg(cancel ? "carry.cancel" : "carry.prepare");
+ if (!root) return;
+ msg_string(&root,"carryId",id);
+ if (!cancel) {
+ char request_id[24]; snprintf(request_id,sizeof(request_id),"carry-%lu",(unsigned long)request);
+ msg_string(&root,"requestId",request_id);
+ msg_string(&root,"agentId",agent);
+ msg_string(&root,"selectionId",selection);
+ msg_number(&root,"revision",revision);
+ }
+ send_json(root);
+}
+void cable_client_form(const char *id, uint32_t request, const char *op, uint32_t revision, int delta)
+{
+ cJSON *root = msg("form");
+ if (!root) return;
+ char request_id[24]; snprintf(request_id, sizeof request_id, "form-%lu", (unsigned long)request);
+ msg_string(&root, "requestId", request_id);
+ msg_string(&root, "formId", id);
+ msg_string(&root, "surface", !strncmp(id, "find-", 5) ? "find" : "new");
+ msg_string(&root, "op", op);
+ msg_number(&root, "revision", revision);
+ msg_number(&root, "delta", delta);
+ bool sent=send_json(root);
+ if (strcmp(op,"state") || !sent)
+ ESP_LOGI(TAG,"picker %s req=%lu revision=%lu sent=%d",op,
+ (unsigned long)request,(unsigned long)revision,sent);
+}
+void cable_client_visit(const char *id, uint32_t request, const char *op, const char *agent)
+{
+ cJSON *root = msg("visit");
+ if (!root) return;
+ char request_id[24]; snprintf(request_id, sizeof request_id, "visit-%lu", (unsigned long)request);
+ msg_string(&root, "requestId", request_id);
+ msg_string(&root, "visitId", id);
+ msg_string(&root, "op", op);
+ msg_string(&root, "agentId", agent);
+ send_json(root);
+}
+
+void cable_client_select_text(const char *agent_id, const char *selection_id, uint32_t request,
+ uint32_t revision, const char *op, int delta, bool extend)
+{
+ cJSON *root = msg("selection");
+ if (!root) return;
+ char request_id[24]; snprintf(request_id, sizeof(request_id), "pick-%lu", (unsigned long)request);
+ msg_string(&root, "requestId", request_id);
+ msg_string(&root, "agentId", agent_id);
+ msg_string(&root, "selectionId", selection_id);
+ msg_string(&root, "op", op);
+ msg_number(&root, "revision", revision);
+ msg_number(&root, "delta", delta);
+ msg_bool(&root, "extend", extend);
send_json(root);
}
@@ -298,16 +513,41 @@ bool cable_client_voice_pcm(const uint8_t *pcm, size_t len)
return cable_link_send(CABLE_TYPE_PCM, pcm, len);
}
+void cable_client_draft(const char *id,const char *op,uint32_t request,uint32_t revision,int delta)
+{
+ cJSON *root=msg("draft.command");if(!root)return;
+ char req[32];snprintf(req,sizeof req,"draft-%lu",(unsigned long)request);
+ msg_string(&root,"draftId",id);msg_string(&root,"requestId",req);
+ msg_string(&root,"op",op);msg_number(&root,"revision",revision);
+ msg_number(&root,"delta",delta);send_json(root);
+}
void cable_client_voice_end(void)
{
- send_json(msg("voice.end"));
+ cJSON *root=msg("voice.end"); if (!root) return;
+ char upload[24]; audio_client_copy_upload_id(upload,sizeof upload);
+ msg_string(&root,"uploadId",upload);
+ if (audio_client_review_requested()) msg_bool(&root,"review",true);
+ send_json(root);
}
void cable_client_voice_abort(const char *why)
{
cJSON *root = msg("voice.abort");
if (!root) return;
- if (why && why[0]) cJSON_AddStringToObject(root, "why", why);
+ if (why && why[0]) msg_string(&root, "why", why);
+ char upload_id[24];
+ audio_client_copy_upload_id(upload_id, sizeof(upload_id));
+ msg_string(&root, "uploadId", upload_id);
+ send_json(root);
+}
+
+void cable_client_voice_cancel(const char *upload_id)
+{
+ if (!upload_id || !*upload_id) return;
+ cJSON *root = msg("voice.abort");
+ if (!root) return;
+ msg_string(&root, "uploadId", upload_id);
+ msg_string(&root, "why", "discarded");
send_json(root);
}
@@ -316,8 +556,8 @@ void cable_client_voice_confirm(const char *route_id, const char *agent_id)
if (!route_id || !agent_id) return;
cJSON *root = msg("voice.confirm");
if (!root) return;
- cJSON_AddStringToObject(root, "routeId", route_id);
- cJSON_AddStringToObject(root, "agentId", agent_id);
+ msg_string(&root, "routeId", route_id);
+ msg_string(&root, "agentId", agent_id);
send_json(root);
}
@@ -328,7 +568,7 @@ void cable_client_fw_progress(uint32_t written)
{
cJSON *root = msg("fw.progress");
if (!root) return;
- cJSON_AddNumberToObject(root, "written", (double)written);
+ msg_number(&root, "written", (double)written);
send_json(root);
}
@@ -336,7 +576,7 @@ void cable_client_fw_error(const char *message)
{
cJSON *root = msg("fw.error");
if (!root) return;
- cJSON_AddStringToObject(root, "message", message ? message : "");
+ msg_string(&root, "message", message ? message : "");
send_json(root);
}
@@ -347,6 +587,8 @@ const char *cable_client_machine_name(void) { return s_machine_name; }
// Set by `agents.end`, read by the refresh that applies the list — see ui_fleet_set.
static int s_agents_total;
static bool s_has_window;
+static char s_agents_tab[ID_MAX];
+static uint32_t s_agents_generation;
int cable_client_agent_total(void)
{
@@ -366,11 +608,37 @@ bool cable_client_has_window(void)
return w;
}
+bool cable_client_request_agents(void)
+{
+ // Shipping bridges understand agents.list. The narrower refresh is optional;
+ // sending it without negotiation strands a successful tab switch at its
+ // snapshot receipt until the workspace timeout.
+ return send_json(msg(cable_client_supports(CABLE_FEATURE_AGENTS_REFRESH)
+ ? "agents.refresh" : "agents.list"));
+}
+uint32_t cable_client_agent_generation(void)
+{
+ if (!s_agents_lock) return 0;
+ xSemaphoreTake(s_agents_lock, portMAX_DELAY);
+ uint32_t generation = s_agents_generation;
+ xSemaphoreGive(s_agents_lock);
+ return generation;
+}
int cable_client_list_agents(project_t *out, int max)
{
+ return cable_client_list_agents_snapshot(out,max,NULL);
+}
+int cable_client_list_agents_snapshot(project_t *out, int max, cable_agent_snapshot_t *snapshot)
+{
+ if (snapshot) memset(snapshot,0,sizeof *snapshot);
if (!out || max <= 0 || !s_agents_lock || !s_agents) return 0;
int n = 0;
xSemaphoreTake(s_agents_lock, portMAX_DELAY);
+ if (s_agents_building) { xSemaphoreGive(s_agents_lock); return -1; }
+ if (snapshot) {
+ snprintf(snapshot->tab,sizeof snapshot->tab,"%s",s_agents_tab);
+ snapshot->generation=s_agents_generation; snapshot->total=s_agents_total; snapshot->window=s_has_window;
+ }
for (int i = 0; i < s_agent_count && n < max; i++) {
memset(&out[n], 0, sizeof(out[n]));
snprintf(out[n].id, sizeof(out[n].id), "%s", s_agents[i].id);
@@ -405,26 +673,35 @@ static const char *str_of(const cJSON *o, const char *key)
// (the window's default is "New swarm", but a blank one still has to be a row that can be picked).
static void handle_swarms(const cJSON *p)
{
+ const cJSON *items = cJSON_GetObjectItemCaseSensitive(p, "items");
+ if (!cJSON_IsArray(items)) return;
static cable_swarm_t rows[SWARMS_MAX]; // static: 24 × ~96 B is too much for the reader task's stack
int n = 0;
const cJSON *it = NULL;
- cJSON_ArrayForEach(it, cJSON_GetObjectItemCaseSensitive(p, "items")) {
+ cJSON_ArrayForEach(it, items) {
if (n >= SWARMS_MAX) break;
const cJSON *id = cJSON_GetObjectItemCaseSensitive(it, "id");
- if (!cJSON_IsString(id) || !id->valuestring[0]) continue;
+ if (!cJSON_IsString(id) || !id->valuestring[0] ||
+ strlen(id->valuestring) >= sizeof rows[n].id) continue;
+ bool duplicate = false;
+ for (int i = 0; i < n; i++) if (!strcmp(rows[i].id, id->valuestring)) duplicate = true;
+ if (duplicate) continue;
snprintf(rows[n].id, sizeof(rows[n].id), "%s", id->valuestring);
const cJSON *name = cJSON_GetObjectItemCaseSensitive(it, "name");
snprintf(rows[n].name, sizeof(rows[n].name), "%s", cJSON_IsString(name) ? name->valuestring : "");
const cJSON *agents = cJSON_GetObjectItemCaseSensitive(it, "agents");
- rows[n].agents = cJSON_IsNumber(agents) ? (int)agents->valuedouble : 0;
+ rows[n].agents = cJSON_IsNumber(agents) && agents->valueint > 0 ? agents->valueint : 0;
// Absent from an older daemon: fall back to the agent count, which is what this row meant
// before tiles were counted separately.
const cJSON *panes = cJSON_GetObjectItemCaseSensitive(it, "panes");
- rows[n].panes = cJSON_IsNumber(panes) ? (int)panes->valuedouble : rows[n].agents;
+ rows[n].panes = cJSON_IsNumber(panes) ? (panes->valueint > 0 ? panes->valueint : 0) : rows[n].agents;
n++;
}
- ui_swarms_replace(rows, n, str_of(p, "selected"));
+ const char *selected = str_of(p, "selected");
+ if (selected && strlen(selected) >= ID_MAX) selected = NULL;
+ ui_swarms_replace(rows, n, selected);
+#ifndef DEVICE_HABITAT
/* …and the selected tab's shape, which rides the same frame so the two can never be read half
* updated: a grid drawn against the previous tab's rectangles puts agents where they are not. */
static cable_tile_t tiles[SWARM_TILES_MAX];
@@ -437,6 +714,11 @@ static void handle_swarms(const cJSON *p)
const cJSON *x2 = cJSON_GetObjectItemCaseSensitive(ti, "x2");
const cJSON *y2 = cJSON_GetObjectItemCaseSensitive(ti, "y2");
if (!cJSON_IsNumber(x1) || !cJSON_IsNumber(y1) || !cJSON_IsNumber(x2) || !cJSON_IsNumber(y2)) continue;
+ /* Reject out-of-range/NaN/infinite coordinates before converting to integer pixels. */
+ if (!(x1->valuedouble >= 0 && x1->valuedouble <= 1000 &&
+ y1->valuedouble >= 0 && y1->valuedouble <= 1000 &&
+ x2->valuedouble >= 0 && x2->valuedouble <= 1000 &&
+ y2->valuedouble >= 0 && y2->valuedouble <= 1000)) continue;
tiles[tn].x1 = (int16_t)x1->valuedouble;
tiles[tn].y1 = (int16_t)y1->valuedouble;
tiles[tn].x2 = (int16_t)x2->valuedouble;
@@ -451,11 +733,13 @@ static void handle_swarms(const cJSON *p)
}
/* Tagged with the tab these rectangles are OF — the same `selected` the rows above carry, read
* from the same frame so the two can never disagree. */
- ui_tiles_replace(tiles, tn, str_of(p, "selected"));
+ ui_tiles_replace(tiles, tn, selected);
+#endif
}
static void session_up(const cJSON *p)
{
+ atomic_store(&s_features, cable_features_parse(p));
const char *app = str_of(p, "app");
const cJSON *machine = p ? cJSON_GetObjectItemCaseSensitive(p, "machine") : NULL;
const char *name = str_of(machine, "name");
@@ -478,8 +762,8 @@ static void session_up(const cJSON *p)
// always has. That is the only debugging instrument this single-port board has.
cable_link_set_log_framing(true);
ESP_LOGI(TAG, "session up: %s (%s, proto %d)", s_machine_name, app ? app : "daemon",
- (int)(cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(p, "proto"))
- ? cJSON_GetObjectItemCaseSensitive(p, "proto")->valuedouble
+ (cJSON_IsNumber(cJSON_GetObjectItemCaseSensitive(p, "proto"))
+ ? cJSON_GetObjectItemCaseSensitive(p, "proto")->valueint
: 0));
// ASK FOR BOTH, EXPLICITLY. A rebooted dial greets with the same mac and the same firmware, so
// the daemon's re-attach test reads that greeting as a keepalive and pushes nothing at all — the
@@ -496,6 +780,7 @@ static void session_down(const char *why)
{
if (!s_session) return;
s_session = false;
+ atomic_store(&s_features, 0);
// FORGET THE AGENTS. They belonged to a daemon that is no longer there, and a tile is not a memory —
// it is a claim that something is running on the other end of this cable right now. Keeping the list
@@ -505,6 +790,8 @@ static void session_down(const char *why)
if (s_agents_lock) {
xSemaphoreTake(s_agents_lock, portMAX_DELAY);
s_agent_count = 0;
+ s_agents_total = 0; s_has_window = false;
+ s_agents_tab[0] = 0; s_agents_generation++;
s_agents_building = false;
xSemaphoreGive(s_agents_lock);
ui_request_agent_reload(); // refresh_task reconciles the now-empty list → the tiles go
@@ -527,9 +814,14 @@ static void session_down(const char *why)
static void handle_agent(const cJSON *p)
{
const char *id = str_of(p, "id");
- if (!id || !id[0] || !s_agents || !s_agents_lock) return;
+ if (!id || !id[0] || strlen(id) >= ID_MAX || !s_agents || !s_agents_lock) return;
xSemaphoreTake(s_agents_lock, portMAX_DELAY);
if (s_agents_building && s_agent_count < CABLE_MAX_AGENTS) {
+ // IDs are opaque routing targets. Truncation or duplicate rows can
+ // make a displayed name refer to a different pane when it is tapped.
+ for (int i = 0; i < s_agent_count; i++) if (!strcmp(s_agents[i].id, id)) {
+ xSemaphoreGive(s_agents_lock); return;
+ }
cable_agent_t *a = &s_agents[s_agent_count++];
memset(a, 0, sizeof(*a));
snprintf(a->id, sizeof(a->id), "%s", id);
@@ -538,11 +830,12 @@ static void handle_agent(const cJSON *p)
const char *engine = str_of(p, "engine");
if (engine) snprintf(a->engine, sizeof(a->engine), "%s", engine);
const char *model = str_of(p, "model");
- if (model) snprintf(a->model, sizeof(a->model), "%s", model);
+ if (model && strlen(model) < sizeof a->model) snprintf(a->model, sizeof(a->model), "%s", model);
const char *effort = str_of(p, "effort");
- if (effort) snprintf(a->effort, sizeof(a->effort), "%s", effort);
+ if (effort && strlen(effort) < sizeof a->effort) snprintf(a->effort, sizeof(a->effort), "%s", effort);
const char *machine_id = str_of(p, "machineId");
- if (machine_id) snprintf(a->machine_id, sizeof(a->machine_id), "%s", machine_id);
+ if (machine_id && strlen(machine_id) < sizeof a->machine_id)
+ snprintf(a->machine_id, sizeof(a->machine_id), "%s", machine_id);
const char *machine = str_of(p, "machine");
if (machine) snprintf(a->machine, sizeof(a->machine), "%s", machine);
@@ -575,8 +868,10 @@ static void handle_agents_end(const cJSON *p)
// empty list reads as "the app is shut" rather than "this tab is empty".
const cJSON *total = p ? cJSON_GetObjectItemCaseSensitive(p, "total") : NULL;
const char *tab = p ? str_of(p, "tab") : NULL;
- s_agents_total = cJSON_IsNumber(total) ? (int)total->valuedouble : n;
+ s_agents_total = cJSON_IsNumber(total) ? (total->valueint > 0 ? total->valueint : 0) : n;
s_has_window = tab && tab[0];
+ snprintf(s_agents_tab,sizeof s_agents_tab,"%s",tab ? tab : "");
+ s_agents_generation++;
xSemaphoreGive(s_agents_lock);
ESP_LOGI(TAG, "agents: %d of %d%s", n, s_agents_total, s_has_window ? "" : " (no window)");
// app_main's refresh reads the list and rebuilds the tiles. Going through the same request the
@@ -634,6 +929,31 @@ static void handle_machine_updated(const cJSON *p)
if (row) ui_machines_replace_one(row, s_machines.applied_selected);
}
+static void handle_notifications(const cJSON *p)
+{
+ const cJSON *items = cJSON_GetObjectItemCaseSensitive(p, "items");
+ if (!cJSON_IsArray(items)) return;
+ static cable_notif_t rows[8]; // static: too much for the reader task's stack
+ int n = 0;
+ const cJSON *it = NULL;
+ cJSON_ArrayForEach(it, items) {
+ if (n >= (int)(sizeof(rows) / sizeof(rows[0]))) break;
+ const char *aid = str_of(it, "agentId");
+ if (!aid || !aid[0] || strlen(aid) >= sizeof rows[n].agent_id) continue;
+ bool duplicate = false;
+ for (int i = 0; i < n; i++) if (!strcmp(rows[i].agent_id, aid)) duplicate = true;
+ if (duplicate) continue;
+ memset(&rows[n], 0, sizeof(rows[n]));
+ snprintf(rows[n].agent_id, sizeof(rows[n].agent_id), "%s", aid);
+ snprintf(rows[n].name, sizeof(rows[n].name), "%s", str_of(it, "name") ? str_of(it, "name") : "");
+ snprintf(rows[n].machine, sizeof(rows[n].machine), "%s", str_of(it, "machine") ? str_of(it, "machine") : "");
+ snprintf(rows[n].summary, sizeof(rows[n].summary), "%s", str_of(it, "summary") ? str_of(it, "summary") : "");
+ rows[n].question = bool_of(it, "question");
+ n++;
+ }
+ ui_notif_replace(rows, n);
+}
+
static void handle_message(const cJSON *root)
{
const char *t = str_of(root, "t");
@@ -673,6 +993,9 @@ static void handle_message(const cJSON *root)
}
const char *agent_id = str_of(p, "agentId");
+ // A late focus, completion or voice reply must not turn an oversized
+ // identity into another pane through a bounded UI copy.
+ if (agent_id && strnlen(agent_id, ID_MAX) >= ID_MAX) { s_bad++; return; }
if (strcmp(t, "focus") == 0) {
// The daemon's surface moved. Follow it, so the two screens are one desk.
@@ -693,6 +1016,12 @@ static void handle_message(const cJSON *root)
if (agent_id) ui_project_emit(agent_id, "", "processing", text ? text : "", NULL);
return;
}
+ if (strcmp(t, "turn.activity") == 0) {
+#ifdef DEVICE_HABITAT
+ if (agent_id) ui_project_emit(agent_id, "", "activity", str_of(p, "text"), NULL);
+#endif
+ return;
+ }
if (strcmp(t, "turn.done") == 0) {
// `done` stops the spinner and deliberately does NOT ring: a turn's completion is announced by
// the summary that follows, which is the thing a person can act on. Ringing here as well is how
@@ -751,25 +1080,7 @@ static void handle_message(const cJSON *root)
// window's badge stop agreeing the first time somebody switches to the tab a card was about.
// The window's whole unread list, replayed because this dial has just attached and its drawer is
// empty — see ui_notif_replace.
- if (strcmp(t, "notif.replace") == 0) {
- static cable_notif_t rows[8]; // static: too much for the reader task's stack
- int n = 0;
- const cJSON *it = NULL;
- cJSON_ArrayForEach(it, cJSON_GetObjectItemCaseSensitive(p, "items")) {
- if (n >= (int)(sizeof(rows) / sizeof(rows[0]))) break;
- const char *aid = str_of(it, "agentId");
- if (!aid || !aid[0]) continue;
- memset(&rows[n], 0, sizeof(rows[n]));
- snprintf(rows[n].agent_id, sizeof(rows[n].agent_id), "%s", aid);
- snprintf(rows[n].name, sizeof(rows[n].name), "%s", str_of(it, "name") ? str_of(it, "name") : "");
- snprintf(rows[n].machine, sizeof(rows[n].machine), "%s", str_of(it, "machine") ? str_of(it, "machine") : "");
- snprintf(rows[n].summary, sizeof(rows[n].summary), "%s", str_of(it, "summary") ? str_of(it, "summary") : "");
- rows[n].question = bool_of(it, "question");
- n++;
- }
- ui_notif_replace(rows, n);
- return;
- }
+ if (strcmp(t, "notif.replace") == 0) { handle_notifications(p); return; }
if (strcmp(t, "notif.seen") == 0) {
if (agent_id) ui_notif_seen(agent_id);
return;
@@ -779,6 +1090,8 @@ static void handle_message(const cJSON *root)
ui_cable_toast(str_of(p, "message"));
return;
}
+ if (strcmp(t,"question.state")==0) { ui_question_state(p); return; }
+ if (strcmp(t,"answer.receipt")==0) { ui_answer_receipt(p); return; }
if (strcmp(t, "question") == 0) {
const cJSON *questions = cJSON_GetObjectItemCaseSensitive(p, "questions");
// The name rides on the frame for the same reason as on `summary`: the asker may be off this tab.
@@ -793,7 +1106,32 @@ static void handle_message(const cJSON *root)
return;
}
+ if (strcmp(t,"draft.state")==0) { ui_draft_state(p);return; }
+ if (strcmp(t,"voice.draft")==0) {
+ const char *upload_id=str_of(p,"uploadId");
+ if (!upload_id || !audio_client_upload_matches(upload_id)) return;
+ ui_voice_draft(p);return;
+ }
+ if (strcmp(t, "voice.question") == 0) {
+ const char *upload_id = str_of(p, "uploadId");
+ if (!upload_id || !audio_client_upload_matches(upload_id)) return;
+ ui_voice_question(p);
+ return;
+ }
+ if (strcmp(t, "voice.search") == 0) {
+ const cJSON *upload = cJSON_GetObjectItemCaseSensitive(p, "uploadId");
+ if (!cJSON_IsString(upload) || !audio_client_upload_matches(upload->valuestring)) return;
+ ui_voice_search(p); return;
+ }
+ if (strcmp(t, "voice.form") == 0) {
+ const char *upload_id = str_of(p, "uploadId");
+ if (!upload_id || !audio_client_upload_matches(upload_id)) return;
+ ui_voice_form(p);
+ return;
+ }
if (strcmp(t, "voice.transcript") == 0) {
+ const char *upload_id = str_of(p, "uploadId");
+ if (upload_id && !audio_client_upload_matches(upload_id)) return;
const cJSON *conf = cJSON_GetObjectItemCaseSensitive(p, "confidence");
const bool needs_confirm = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "needsConfirm"));
ui_voice_routed(!needs_confirm, agent_id == NULL, str_of(p, "routeId"), agent_id,
@@ -801,15 +1139,22 @@ static void handle_message(const cJSON *root)
return;
}
if (strcmp(t, "voice.error") == 0) {
- ui_cable_toast(str_of(p, "message")); // releases the routing overlay before showing the reason
+ const char *upload_id = str_of(p, "uploadId");
+ if (upload_id && !audio_client_upload_matches(upload_id)) return;
+ ui_voice_error(str_of(p, "message"));
return;
}
+ if (strcmp(t, "selection.state") == 0) { ui_selection_state(p); return; }
+ if (strcmp(t, "carry.state") == 0) { ui_carry_state(p); return; }
+ if (strcmp(t, "form.state") == 0) { ui_form_state(p); return; }
+ if (strcmp(t, "visit.state") == 0) { ui_visit_state(p); return; }
if (strcmp(t, "toast") == 0) { ui_cable_toast(str_of(p, "text")); return; }
if (strcmp(t, "fw.offer") == 0) {
const cJSON *size = cJSON_GetObjectItemCaseSensitive(p, "size");
// Declining is silence: fw_update_offer() answers with `fw.accept` only when it is willing, and
// the daemon offers again on the next hello.
- fw_update_offer(str_of(p, "version"), cJSON_IsNumber(size) ? (int)size->valuedouble : 0,
+ fw_update_offer(str_of(p, "version"),
+ cJSON_IsNumber(size) && size->valuedouble == size->valueint ? size->valueint : 0,
str_of(p, "sha256"));
return;
}
@@ -824,9 +1169,8 @@ static void on_frame(uint8_t version, uint8_t type, const uint8_t *payload, size
{
(void)version;
(void)ctx;
- s_last_rx_us = esp_timer_get_time();
-
if (type == CABLE_TYPE_FW) {
+ s_last_rx_us = esp_timer_get_time();
// Straight to flash, on this task. That is deliberate and it is what the credit window is sized
// against: the write blocks the reader for ~16 ms per slice, and nothing drains the port
// meanwhile — see docs/specs/cable-protocol.md §7.
@@ -839,32 +1183,43 @@ static void on_frame(uint8_t version, uint8_t type, const uint8_t *payload, size
return;
}
- // cJSON needs a nul-terminated string and the payload is not one. Copied rather than parsed in place:
- // the decoder's buffer is reused the moment this returns.
- if (payload_len == 0 || payload_len >= JSON_MAX) { s_bad++; return; }
- static char text[JSON_MAX]; // only ever touched on the reader task
- memcpy(text, payload, payload_len);
- text[payload_len] = '\0';
-
- cJSON *root = cJSON_Parse(text);
+ // Parse directly from the bounded frame. cJSON owns its decoded strings;
+ // none of the tree retains this buffer after the callback returns.
+ if (!cable_json_guard(payload, payload_len)) { s_bad++; return; }
+ const char *end = NULL;
+ cJSON *root = cJSON_ParseWithLengthOpts((const char *)payload, payload_len, &end, false);
+ if (root) {
+ const char *limit = (const char *)payload + payload_len;
+ while (end < limit && (*end == ' ' || *end == '\t' || *end == '\n' || *end == '\r')) end++;
+ if (end != limit || !cJSON_IsObject(root)) { cJSON_Delete(root); root = NULL; }
+ }
if (!root) { s_bad++; return; }
+ s_last_rx_us = esp_timer_get_time();
handle_message(root);
cJSON_Delete(root);
}
// ── session task ────────────────────────────────────────────────────────────────────────────────────
+static void session_tick(void *ctx)
+{
+ (void)ctx;
+ fw_update_tick();
+ if (s_session && esp_timer_get_time() - s_last_rx_us > (int64_t)SILENCE_MS * 1000) {
+ session_down("silence");
+ }
+}
+
static void session_task(void *arg)
{
(void)arg;
+ // Reserve the handshake task before exposing the reader. It must not send
+ // until the USB driver is ready, and a failed start can delete it safely.
+ ulTaskNotifyTake(pdTRUE, portMAX_DELAY);
int64_t next_hello_us = 0;
while (1) {
const int64_t now = esp_timer_get_time();
- if (s_session && now - s_last_rx_us > (int64_t)SILENCE_MS * 1000) {
- session_down("silence");
- }
-
if (now >= next_hello_us) {
send_hello();
next_hello_us = now + (int64_t)(s_session ? HELLO_SESSION_MS : HELLO_ALONE_MS) * 1000;
@@ -876,24 +1231,36 @@ static void session_task(void *arg)
bool cable_client_start(void)
{
+ if (s_started) return true;
+ TaskHandle_t hello_task = NULL;
cable_machines_init(&s_machines);
s_agents = calloc(CABLE_MAX_AGENTS, sizeof(cable_agent_t));
s_agents_lock = xSemaphoreCreateMutex();
s_models_sem = xSemaphoreCreateBinary();
if (!s_agents || !s_agents_lock || !s_models_sem) {
ESP_LOGE(TAG, "no memory for the agent list — link disabled");
- return false;
+ goto failed;
}
- if (!cable_link_start(on_frame, NULL)) return false;
-
s_last_rx_us = esp_timer_get_time();
ui_set_connected(false);
- if (xTaskCreate(session_task, "cable_session", 4096, NULL, 4, NULL) != pdPASS) {
+ if (xTaskCreate(session_task, "cable_session", 4096, NULL, 4, &hello_task) != pdPASS) {
ESP_LOGE(TAG, "session task create failed — no handshake");
- return false;
+ goto failed;
+ }
+ if (!cable_link_start(on_frame, session_tick, NULL)) {
+ vTaskDelete(hello_task);
+ goto failed;
}
+ s_started = true;
+ xTaskNotifyGive(hello_task);
ESP_LOGI(TAG, "cable client started (fw %s, proto %d)", cable_fw_version(), CABLE_PROTO_VERSION);
return true;
+failed:
+ free(s_agents); s_agents = NULL;
+ if (s_agents_lock) vSemaphoreDelete(s_agents_lock);
+ if (s_models_sem) vSemaphoreDelete(s_models_sem);
+ s_agents_lock = s_models_sem = NULL;
+ return false;
}
bool cable_client_is_connected(void) { return s_session; }
diff --git a/devices/harness-device/firmware/main/cable_client.h b/devices/harness-device/firmware/main/cable_client.h
index 6e0488ef2..62433874f 100644
--- a/devices/harness-device/firmware/main/cable_client.h
+++ b/devices/harness-device/firmware/main/cable_client.h
@@ -24,16 +24,19 @@
#include <stdint.h>
#include "cJSON.h"
+#include "cable_features.h"
+
+bool cable_client_supports(uint32_t features);
// ── the shapes the UI's tile list is built from ─────────────────────────────────────────────────────
// These lived in http_api.h, which existed for the REST calls this firmware no longer makes. They are
// the protocol's own vocabulary now, so they live with it.
#define ID_MAX 48 // agentId (uuid or 32-hex) + nul
-#define NAME_MAX 40
+#define CABLE_NAME_MAX 40
typedef struct {
char id[ID_MAX];
- char name[NAME_MAX];
+ char name[CABLE_NAME_MAX];
char engine[12]; // claude|codex|cursor|opencode|… ; empty when the daemon did not say
char selected_model[192]; // opaque runtime-v1:<sid>:<engine>:<model>@<effort>; "" if none
// WHERE THIS AGENT LIVES. The carousel holds every machine's agents at once, so an agent that does
@@ -42,7 +45,7 @@ typedef struct {
// Both are empty against a daemon that predates the fields, and every reader falls back rather than
// showing an empty line.
char machine_id[ID_MAX];
- char machine[NAME_MAX];
+ char machine[CABLE_NAME_MAX];
} project_t;
@@ -111,7 +114,18 @@ const char *cable_client_machine_name(void);
// The list is whatever the daemon last pushed; there is no request/response to wait on, which is the
// point — a spoken turn must never block on a round trip. app_main's refresh reads this the way it used
// to read the backend's RPC answer.
+typedef struct {
+ char tab[ID_MAX];
+ uint32_t generation;
+ int total;
+ bool window;
+} cable_agent_snapshot_t;
+// A complete roster and its workspace identity are copied under the same lock.
+// Returns -1 while a new roster is being assembled, leaving the UI intact.
+int cable_client_list_agents_snapshot(project_t *out, int max, cable_agent_snapshot_t *snapshot);
int cable_client_list_agents(project_t *out, int max);
+uint32_t cable_client_agent_generation(void);
+bool cable_client_request_agents(void);
// How many agents the account has across every machine (`agents.end.total`) — the overview's number. The
// list above is the active tab; this is the fleet it was cut from.
@@ -152,7 +166,7 @@ const char *cable_client_machine_id(void);
#define SWARMS_MAX 24 // the window's own ceiling (AppNotifier.maxSwarms)
typedef struct {
char id[SWARM_ID_MAX];
- char name[NAME_MAX];
+ char name[CABLE_NAME_MAX];
int agents; // how many agents it holds — drawn as a count, never as members
// How many TILES it holds, of any kind: agents, shells, viewers. A tab with a terminal and no
// agent has agents=0 and panes=1, and the difference is what keeps it in the switcher — see
@@ -180,13 +194,14 @@ typedef struct {
char agent_id[ID_MAX];
} cable_tile_t;
-// One row of the window's unread list, as `notif.replace` carries it. `summary` is the last recap for
-// a finished turn and empty for a question — the dial kept that question's own text from when it asked.
+// One row of the window's unread list, as `notif.replace` carries it. `summary` is
+// the finished turn's recap or the question's own words. Match the home preview's
+// byte capacity so an 80-character recap with UTF-8 punctuation arrives intact.
typedef struct {
char agent_id[ID_MAX];
- char name[NAME_MAX];
- char machine[NAME_MAX];
- char summary[100];
+ char name[CABLE_NAME_MAX];
+ char machine[CABLE_NAME_MAX];
+ char summary[240];
bool question;
} cable_notif_t;
@@ -235,6 +250,14 @@ typedef enum {
// `velocity` is device px/s, signed like `dy`, and is only read on CABLE_SCROLL_UP — it becomes the fling.
void cable_client_send_scroll(cable_scroll_phase_t phase, int dy, int velocity);
+// Local desktop text selection; never sends keys into a terminal.
+void cable_client_form(const char *id, uint32_t request, const char *op, uint32_t revision, int delta);
+void cable_client_carry(const char *id, const char *agent, const char *selection,
+ uint32_t request, uint32_t revision, bool cancel);
+void cable_client_visit(const char *id, uint32_t request, const char *op, const char *agent);
+void cable_client_select_text(const char *agent_id, const char *selection_id, uint32_t request,
+ uint32_t revision, const char *op, int delta, bool extend);
+
// Answer a `question`. `request_id` is the DAEMON'S, opaque here, and is echoed back byte for byte.
// `answers` is the UI's own object, one entry per question asked, and travels verbatim — re-deriving it
// from what is on screen is how a rename at the far end becomes an answer nobody gave. Not owned here.
@@ -263,7 +286,8 @@ int cable_client_models_list(const char *agent_id, const char *picker_mode, cons
//
// `sample_rate` travels because the daemon has to state it to the transcriber, and a rate assumed on that
// side is a rate that silently doubles or halves the speech when this side changes.
-void cable_client_voice_begin(const char *agent_id, const char *cmd, const char *lang, int sample_rate);
+// False means no valid begin frame was sent; do not send uncorrelated PCM.
+bool cable_client_voice_begin(const char *agent_id, const char *cmd, const char *lang, int sample_rate);
// One PCM frame's worth of bytes. Raw, not base64 — the framing carries a length, so there is no reason to
// spend a third of the wire escaping binary into text the way a line-delimited protocol had to.
@@ -274,6 +298,7 @@ bool cable_client_voice_pcm(const uint8_t *pcm, size_t len);
void cable_client_voice_end(void);
void cable_client_voice_abort(const char *why);
+void cable_client_voice_cancel(const char *upload_id);
// Answer a `voice.transcript` that arrived with `needsConfirm`.
void cable_client_voice_confirm(const char *route_id, const char *agent_id);
@@ -293,3 +318,10 @@ void cable_client_fw_error(const char *message);
// separate because they mean opposite things: `bad` is corruption or a bug, `unknown` is a daemon running
// ahead of this firmware — a version mismatch someone can act on rather than a fault.
void cable_client_counters(uint32_t *bad, uint32_t *unknown);
+
+// Read one host-owned question; review selections are exact option bitmasks.
+void cable_client_question_read(const char *agent_id, const char *request_id);
+bool cable_client_answer_reviewed(const char *agent_id, const char *request_id, const char *token,
+ const uint8_t *choices, const char drafts[][48], int count);
+
+void cable_client_draft(const char *id, const char *op, uint32_t request, uint32_t revision, int delta);
diff --git a/devices/harness-device/firmware/main/cable_features.c b/devices/harness-device/firmware/main/cable_features.c
new file mode 100644
index 000000000..07aea4eb0
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_features.c
@@ -0,0 +1,24 @@
+#include "cable_features.h"
+#include "cJSON.h"
+#include <string.h>
+
+uint32_t cable_features_parse(const cJSON *welcome)
+{
+ const cJSON *features = cJSON_GetObjectItemCaseSensitive(welcome, "features");
+ if (!cJSON_IsArray(features)) return 0;
+ static const struct { const char *name; uint32_t bit; } names[] = {
+ {"form", CABLE_FEATURE_FORM}, {"selection", CABLE_FEATURE_SELECTION},
+ {"visit", CABLE_FEATURE_VISIT}, {"voice.draft", CABLE_FEATURE_DRAFT},
+ {"question.review", CABLE_FEATURE_QUESTIONS},
+ {"agents.refresh", CABLE_FEATURE_AGENTS_REFRESH},
+ };
+ uint32_t result = 0;
+ const cJSON *item;
+ unsigned count = 0;
+ cJSON_ArrayForEach(item, features) {
+ if (++count > 16 || !cJSON_IsString(item)) return 0;
+ for (unsigned i = 0; i < sizeof names / sizeof names[0]; i++)
+ if (!strcmp(item->valuestring, names[i].name)) result |= names[i].bit;
+ }
+ return result;
+}
diff --git a/devices/harness-device/firmware/main/cable_features.h b/devices/harness-device/firmware/main/cable_features.h
new file mode 100644
index 000000000..935c04fba
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_features.h
@@ -0,0 +1,16 @@
+#pragma once
+#include <stdint.h>
+
+typedef struct cJSON cJSON;
+enum {
+ CABLE_FEATURE_FORM = 1u << 0,
+ CABLE_FEATURE_SELECTION = 1u << 1,
+ CABLE_FEATURE_VISIT = 1u << 2,
+ CABLE_FEATURE_DRAFT = 1u << 3,
+ CABLE_FEATURE_QUESTIONS = 1u << 4,
+ CABLE_FEATURE_AGENTS_REFRESH = 1u << 5,
+};
+
+// Optional welcome field. Older daemons omit it and retain the core voice,
+// pane, tab, scroll, machine and model controls. Unknown names are ignored.
+uint32_t cable_features_parse(const cJSON *welcome);
diff --git a/devices/harness-device/firmware/main/cable_frame.c b/devices/harness-device/firmware/main/cable_frame.c
index 044b4d7b1..524a19fc8 100644
--- a/devices/harness-device/firmware/main/cable_frame.c
+++ b/devices/harness-device/firmware/main/cable_frame.c
@@ -1,9 +1,18 @@
#include "cable_frame.h"
#include <string.h>
+#ifdef ESP_PLATFORM
+#include "esp_rom_crc.h"
+#endif
uint16_t cable_crc16(const uint8_t *data, size_t len)
{
+#ifdef ESP_PLATFORM
+ // CRC-16/CCITT-FALSE: Espressif's ROM API complements both ends.
+ // Init 0xffff and xorout zero therefore use input 0 and a final complement.
+ // No table in application flash and no RAM allocation.
+ return (uint16_t)~esp_rom_crc16_be(0, data, (uint32_t)len);
+#else
uint16_t crc = 0xFFFF;
for (size_t i = 0; i < len; i++) {
crc ^= (uint16_t)data[i] << 8;
@@ -12,6 +21,7 @@ uint16_t cable_crc16(const uint8_t *data, size_t len)
}
}
return crc;
+#endif
}
int cable_frame_encode(uint8_t type, const uint8_t *payload, size_t payload_len,
@@ -146,12 +156,30 @@ static bool take_front(cable_decoder_t *d, cable_frame_cb cb, void *ctx)
void cable_decoder_feed(cable_decoder_t *d, const uint8_t *data, size_t n,
cable_frame_cb cb, void *ctx)
{
- for (size_t i = 0; i < n; i++) {
+ while (n) {
// Full and still no frame means the head was never a real one. Making room by dropping the oldest
// byte keeps the link alive; refusing the new byte instead would wedge it permanently.
if (d->len == sizeof(d->buf)) discard(d, 1);
- d->buf[d->len++] = data[i];
+ // Once a valid header is waiting for its payload, no intermediate
+ // byte can complete a frame. Copy directly to that boundary instead
+ // of rechecking the same header for every byte. Noise still reaches
+ // take_front at the original six-byte boundary, preserving resync and
+ // counters even when magic, payload or CRC straddles USB reads.
+ size_t needed = CABLE_HEADER_BYTES;
+ if (d->len >= CABLE_HEADER_BYTES && d->buf[0] == CABLE_MAGIC_0 &&
+ d->buf[1] == CABLE_MAGIC_1) {
+ size_t payload_len = (size_t)d->buf[4] | ((size_t)d->buf[5] << 8);
+ if (payload_len <= CABLE_MAX_PAYLOAD)
+ needed += payload_len + CABLE_CRC_BYTES;
+ }
+ size_t take = needed > d->len ? needed - d->len : 1;
+ if (take > n) take = n;
+ if (take > sizeof d->buf - d->len) take = sizeof d->buf - d->len;
+ memcpy(d->buf + d->len, data, take);
+ d->len += take;
+ data += take;
+ n -= take;
// Only worth attempting once a header could be complete. This also keeps the magic scan
// amortised: it runs on resync, not per byte.
diff --git a/devices/harness-device/firmware/main/cable_json_guard.c b/devices/harness-device/firmware/main/cable_json_guard.c
new file mode 100644
index 000000000..96eeae764
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_json_guard.c
@@ -0,0 +1,43 @@
+#include "cable_json_guard.h"
+
+bool cable_json_guard(const uint8_t *bytes, size_t length)
+{
+ if (!bytes || !length || length >= CABLE_JSON_MAX) return false;
+ uint8_t stack[CABLE_JSON_DEPTH];
+ unsigned depth = 0, tokens = 0;
+ bool string = false, escaped = false, started = false, finished = false, atom = false;
+ for (size_t i = 0; i < length; i++) {
+ const uint8_t c = bytes[i];
+ if (string) {
+ if (c < 0x20) return false;
+ if (escaped) escaped = false;
+ else if (c == '\\') escaped = true;
+ else if (c == '"') string = false;
+ continue;
+ }
+ if (c == ' ' || c == '\t' || c == '\n' || c == '\r') { atom = false; continue; }
+ if (c < 0x20 || finished) return false;
+ if (!started) {
+ if (c != '{') return false;
+ started = true;
+ }
+ if (c == '"') {
+ if (++tokens > CABLE_JSON_TOKENS) return false;
+ string = true; atom = false;
+ }
+ else if (c == '{' || c == '[') {
+ if (++tokens > CABLE_JSON_TOKENS || depth == CABLE_JSON_DEPTH) return false;
+ stack[depth++] = c;
+ atom = false;
+ } else if (c == '}' || c == ']') {
+ if (!depth || stack[depth - 1] != (c == '}' ? '{' : '[')) return false;
+ if (!--depth) finished = true;
+ atom = false;
+ } else if (c == ':' || c == ',') atom = false;
+ else if (!atom) {
+ if (++tokens > CABLE_JSON_TOKENS) return false;
+ atom = true;
+ }
+ }
+ return finished && !string && !depth;
+}
diff --git a/devices/harness-device/firmware/main/cable_json_guard.h b/devices/harness-device/firmware/main/cable_json_guard.h
new file mode 100644
index 000000000..1b5cb0971
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_json_guard.h
@@ -0,0 +1,16 @@
+#pragma once
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include "cable_frame.h"
+
+enum { CABLE_JSON_MAX = CABLE_MAX_PAYLOAD + 1, CABLE_JSON_DEPTH = 12,
+ CABLE_JSON_TOKENS = 512 };
+
+// Bound recursive JSON parsing before it reaches cJSON. The cable vocabulary
+// uses at most a few object/array layers; the parser's default 1000-level limit
+// cannot fit the device's 6 KiB reader stack. No allocation or recursion here.
+// Lexical values/keys/containers also have a budget: a flat array must not
+// spend the whole internal heap on cJSON nodes. No extra payload copy is needed.
+// This checks framing/shape only; cJSON still validates the complete grammar.
+bool cable_json_guard(const uint8_t *bytes, size_t length);
diff --git a/devices/harness-device/firmware/main/cable_link.c b/devices/harness-device/firmware/main/cable_link.c
index f771bf702..7a72f9805 100644
--- a/devices/harness-device/firmware/main/cable_link.c
+++ b/devices/harness-device/firmware/main/cable_link.c
@@ -1,11 +1,13 @@
#include "cable_link.h"
#include <stdarg.h>
+#include <stdatomic.h>
#include <stdio.h>
#include <string.h>
#include "driver/usb_serial_jtag.h"
#include "esp_log.h"
+#include "esp_timer.h"
#include "last_words.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
@@ -50,6 +52,11 @@ static const char *TAG = "cable";
// anything arrives. It only bounds how long the task sleeps with nothing to do.
#define READ_WAIT_MS 100
+// A stopped host can leave a legal-length header followed by only half its
+// payload. Magic inside the next welcome cannot escape that pending payload.
+// Expire only an idle gap, not the total duration of a slowly fragmented frame.
+#define FRAME_IDLE_US INT64_C(15000000)
+
// How long a write waits for the host to make room. Finite, and that is the point: an unplugged cable or
// an unopened port fills the TX FIFO and never drains it, and portMAX_DELAY there parks whatever task
// called send() forever. This device is unplugged or in front of a machine with no daemon most of the
@@ -79,8 +86,9 @@ static const char *TAG = "cable";
static cable_decoder_t s_decoder;
static cable_frame_cb s_cb;
+static cable_tick_cb s_tick;
static void *s_ctx;
-static bool s_running;
+static atomic_bool s_running;
// Serialises the shared encode buffer AND the write, so two tasks sending at once cannot interleave
// halves of two frames onto the wire. A frame split down the middle by a second sender is not something
@@ -97,11 +105,11 @@ static uint8_t s_tx_frame[CABLE_MAX_FRAME];
// ── log framing ─────────────────────────────────────────────────────────────────────────────────────
-static vprintf_like_t s_prev_vprintf;
-// Reentrancy guard. Every path below can log, and a log emitted from inside the log sink would recurse
-// until the stack ran out. One flag is enough because the sink holds the TX lock for its whole body, so
-// only one task is ever inside it.
-static volatile bool s_in_log_sink;
+// Hooks can still be executing on the other core when the session ends. Keep
+// the previous function valid for their whole lifetime; never clear it to NULL.
+static _Atomic(vprintf_like_t) s_prev_vprintf = vprintf;
+static atomic_bool s_log_framing;
+static atomic_uint s_dropped_logs;
static bool send_locked(uint8_t type, const uint8_t *payload, size_t payload_len, TickType_t wait)
{
@@ -112,17 +120,19 @@ static bool send_locked(uint8_t type, const uint8_t *payload, size_t payload_len
static int log_vprintf(const char *fmt, va_list args)
{
- // From an ISR there is nothing safe to do here — the mutex below would abort — and ESP_EARLY_LOG /
- // panic output does not come through this hook anyway. Hand it back to the plain console.
- if (xPortInIsrContext() || s_in_log_sink) {
- return s_prev_vprintf ? s_prev_vprintf(fmt, args) : 0;
- }
+ // ESP_EARLY_LOG/panic output bypasses this hook. Ordinary logs from an ISR
+ // cannot take a mutex or safely fall back to the libc console.
+ if (xPortInIsrContext()) return 0;
+ if (!atomic_load(&s_log_framing)) return atomic_load(&s_prev_vprintf)(fmt, args);
static char line[LOG_LINE_MAX]; // guarded by s_tx_lock, like s_tx_frame
- if (!s_running || xSemaphoreTake(s_tx_lock, pdMS_TO_TICKS(LOG_WRITE_WAIT_MS)) != pdTRUE) {
- return s_prev_vprintf ? s_prev_vprintf(fmt, args) : 0;
+ if (!s_running || xSemaphoreGetMutexHolder(s_tx_lock) == xTaskGetCurrentTaskHandle() ||
+ xSemaphoreTake(s_tx_lock, pdMS_TO_TICKS(LOG_WRITE_WAIT_MS)) != pdTRUE) {
+ // Recursion or congestion costs one diagnostic, never a raw console
+ // write mixed into a protocol frame or an unbounded wait by the caller.
+ atomic_fetch_add_explicit(&s_dropped_logs, 1, memory_order_relaxed);
+ return 0;
}
- s_in_log_sink = true;
int n = vsnprintf(line, sizeof(line), fmt, args);
if (n > 0) {
size_t len = (size_t)n < sizeof(line) - 1 ? (size_t)n : sizeof(line) - 1;
@@ -130,9 +140,9 @@ static int log_vprintf(const char *fmt, va_list args)
while (len > 0 && (line[len - 1] == '\n' || line[len - 1] == '\r')) len--;
// Into the RTC ring first — that copy survives the reboot the next line may be the last before.
if (len > 0) last_words_add(line, len);
- if (len > 0) send_locked(CABLE_TYPE_LOG, (const uint8_t *)line, len, pdMS_TO_TICKS(LOG_WRITE_WAIT_MS));
+ if (len > 0 && !send_locked(CABLE_TYPE_LOG, (const uint8_t *)line, len, pdMS_TO_TICKS(LOG_WRITE_WAIT_MS)))
+ atomic_fetch_add_explicit(&s_dropped_logs, 1, memory_order_relaxed);
}
- s_in_log_sink = false;
xSemaphoreGive(s_tx_lock);
return n;
}
@@ -141,14 +151,16 @@ void cable_link_set_log_framing(bool on)
{
if (!s_running) return;
if (on) {
- if (!s_prev_vprintf) s_prev_vprintf = esp_log_set_vprintf(log_vprintf);
+ if (!atomic_load(&s_log_framing)) {
+ atomic_store(&s_prev_vprintf, esp_log_set_vprintf(log_vprintf));
+ atomic_store(&s_log_framing, true);
+ }
return;
}
// Restore the plain console FIRST, then say so — so the line explaining what happened is written the
// way whoever is now watching the port with a serial monitor can read it.
- if (s_prev_vprintf) {
- esp_log_set_vprintf(s_prev_vprintf);
- s_prev_vprintf = NULL;
+ if (atomic_exchange(&s_log_framing, false)) {
+ esp_log_set_vprintf(atomic_load(&s_prev_vprintf));
}
}
@@ -158,20 +170,30 @@ static void reader_task(void *arg)
{
(void)arg;
uint8_t chunk[READ_CHUNK];
+ int64_t last_rx_us = 0;
while (1) {
int n = usb_serial_jtag_read_bytes(chunk, sizeof(chunk), pdMS_TO_TICKS(READ_WAIT_MS));
- if (n <= 0) continue;
+ const int64_t now = esp_timer_get_time();
+ // This task owns the decoder. Reset before feeding a newly arrived
+ // read too: scheduling need not provide an intervening empty read.
+ if (s_decoder.len && now - last_rx_us >= FRAME_IDLE_US)
+ cable_decoder_reset(&s_decoder);
// Never fails and never rejects: everything arriving here is untrusted, starts mid-stream after
// every boot, and the only useful response to a byte that makes no sense is to step over it.
- cable_decoder_feed(&s_decoder, chunk, (size_t)n, s_cb, s_ctx);
+ if (n > 0) {
+ cable_decoder_feed(&s_decoder, chunk, (size_t)n, s_cb, s_ctx);
+ last_rx_us = now;
+ }
+ if (s_tick) s_tick(s_ctx);
}
}
-bool cable_link_start(cable_frame_cb cb, void *ctx)
+bool cable_link_start(cable_frame_cb cb, cable_tick_cb tick, void *ctx)
{
if (s_running) return true;
s_cb = cb;
+ s_tick = tick;
s_ctx = ctx;
cable_decoder_init(&s_decoder);
@@ -196,7 +218,11 @@ bool cable_link_start(cable_frame_cb cb, void *ctx)
return false;
}
+ // The new task may receive a welcome before xTaskCreate returns. Make the
+ // installed driver/send path visible before that callback can run.
+ s_running = true;
if (xTaskCreate(reader_task, "cable_link", READER_STACK, NULL, 5, NULL) != pdPASS) {
+ s_running = false;
ESP_LOGE(TAG, "reader task create failed — no link to the daemon");
usb_serial_jtag_driver_uninstall();
vSemaphoreDelete(s_tx_lock);
@@ -204,7 +230,6 @@ bool cable_link_start(cable_frame_cb cb, void *ctx)
return false;
}
- s_running = true;
ESP_LOGI(TAG, "usb link up on the native port (frame v%d, max frame %d B)",
CABLE_FRAME_VERSION, CABLE_MAX_FRAME);
return true;
@@ -246,6 +271,8 @@ void cable_link_counters(uint32_t *corrupt_frames, uint32_t *discarded_bytes)
if (discarded_bytes) *discarded_bytes = s_decoder.discarded_bytes;
}
+uint32_t cable_link_dropped_logs(void) { return atomic_load(&s_dropped_logs); }
+
void cable_link_reset_decoder(void)
{
cable_decoder_reset(&s_decoder);
diff --git a/devices/harness-device/firmware/main/cable_link.h b/devices/harness-device/firmware/main/cable_link.h
index 9225fa162..1f9f3b0c2 100644
--- a/devices/harness-device/firmware/main/cable_link.h
+++ b/devices/harness-device/firmware/main/cable_link.h
@@ -41,7 +41,11 @@
// Returns false if the driver would not install, which leaves the dial running with no link rather than
// failing to boot: a device that shows "Not connected" is diagnosable from across the room, and a device
// stuck in a boot loop is not.
-bool cable_link_start(cable_frame_cb cb, void *ctx);
+// `tick` also runs on the reader, after each read/feed (including idle reads).
+// Keep connection expiry here so it cannot race a welcome/frame callback on
+// another core. It must be bounded and must not retain decoder payloads.
+typedef void (*cable_tick_cb)(void *ctx);
+bool cable_link_start(cable_frame_cb cb, cable_tick_cb tick, void *ctx);
// Frame `payload` and write it to the port. Returns true when the whole frame went out.
//
@@ -78,11 +82,14 @@ bool cable_link_host_present(void);
// boot is the bootloader's parting words and is expected, while a steady trickle during a session means
// the two sides disagree about the format or the cable is bad. Without a count those look identical.
void cable_link_counters(uint32_t *corrupt_frames, uint32_t *discarded_bytes);
+// Logs skipped because the transport was busy or stalled; diagnostic only.
+uint32_t cable_link_dropped_logs(void);
// Drop any half-received frame. For the layer above to call when it decides a session has ended and a
// new one begun — leftover bytes belong to the old one, and carrying them across puts a stale half-frame
// in front of the first real frame of the new session.
//
-// Call it FROM THE FRAME CALLBACK. The decoder has one reader — the link task — and no lock; resetting
-// it from another task while that task is mid-feed corrupts the very buffer meant to be cleared.
+// Call it only from the reader's frame or tick callback. The decoder has one
+// reader and no lock; another task must not reset it during a feed. The reader
+// also expires a partial frame after a 15-second gap in received bytes.
void cable_link_reset_decoder(void);
diff --git a/devices/harness-device/firmware/main/cable_scroll.c b/devices/harness-device/firmware/main/cable_scroll.c
new file mode 100644
index 000000000..9a49956ae
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_scroll.c
@@ -0,0 +1,45 @@
+#include "cable_scroll.h"
+#include <limits.h>
+#include <stdint.h>
+#include <string.h>
+
+_Static_assert(INT_MAX == INT32_MAX && INT_MIN == INT32_MIN, "scroll uses signed 32-bit integers");
+_Static_assert(CABLE_SCROLL_JSON_MAX >= sizeof("{\"t\":\"scroll\",\"phase\":\"down\",\"dy\":,\"v\":}") + 22,
+ "room for every literal, two INT_MIN values, and NUL");
+
+static char *decimal(char *out, int value)
+{
+ // Unsigned subtraction handles INT_MIN without signed overflow.
+ uint32_t n = value < 0 ? 0u - (uint32_t)value : (uint32_t)value;
+ char digits[10];
+ unsigned used = 0;
+ do { digits[used++] = (char)('0' + n % 10); n /= 10; } while (n);
+ if (value < 0) *out++ = '-';
+ while (used) *out++ = digits[--used];
+ return out;
+}
+
+size_t cable_scroll_encode(char *out, size_t capacity, int phase, int dy, int velocity)
+{
+ if (!out || !capacity) return 0;
+ out[0] = 0;
+ static const char *const names[] = {"down", "move", "up"};
+ if ((unsigned)phase >= sizeof names / sizeof names[0]) return 0;
+ // Only fixed literals and integers enter this message. No escaping, locale,
+ // varargs formatter, allocator or persistent buffer is needed on this path.
+ char wire[CABLE_SCROLL_JSON_MAX], *p = wire;
+#define PUT(literal) do { memcpy(p, literal, sizeof(literal) - 1); p += sizeof(literal) - 1; } while (0)
+ PUT("{\"t\":\"scroll\",\"phase\":\"");
+ size_t name_bytes = phase == 2 ? 2 : 4;
+ memcpy(p, names[phase], name_bytes); p += name_bytes;
+ PUT("\",\"dy\":");
+ p = decimal(p, dy);
+ if (phase == 2) { PUT(",\"v\":"); p = decimal(p, velocity); }
+ *p++ = '}';
+ *p = 0;
+#undef PUT
+ size_t n = (size_t)(p - wire);
+ if (n >= capacity) return 0;
+ memcpy(out, wire, n + 1);
+ return n;
+}
diff --git a/devices/harness-device/firmware/main/cable_scroll.h b/devices/harness-device/firmware/main/cable_scroll.h
new file mode 100644
index 000000000..a22b56a2f
--- /dev/null
+++ b/devices/harness-device/firmware/main/cable_scroll.h
@@ -0,0 +1,8 @@
+#pragma once
+#include <stddef.h>
+
+// Complete scroll JSON, including two signed 32-bit values and a terminator.
+// Phase is the wire order down=0, move=1, up=2. No allocation or retained state.
+#define CABLE_SCROLL_JSON_MAX 96
+// Returns payload bytes (excluding NUL), or 0 with an empty output on failure.
+size_t cable_scroll_encode(char *out, size_t capacity, int phase, int dy, int velocity);
diff --git a/devices/harness-device/firmware/main/config_store.c b/devices/harness-device/firmware/main/config_store.c
index 5e629211d..13c6d7d16 100644
--- a/devices/harness-device/firmware/main/config_store.c
+++ b/devices/harness-device/firmware/main/config_store.c
@@ -140,6 +140,51 @@ void config_save_brightness(uint8_t level)
ESP_LOGI(TAG, "save_brightness 0x%02x: %s", level, ok ? "ok" : "FAILED");
}
+bool config_load_muted(void)
+{
+ nvs_handle_t h;
+ // The prototype starts quiet; a stock build keeps its previous default.
+#ifdef DEVICE_HABITAT
+ uint8_t muted = 1;
+#else
+ uint8_t muted = 0;
+#endif
+ if (nvs_open(NS, NVS_READONLY, &h) == ESP_OK) {
+ nvs_get_u8(h, "muted", &muted);
+ nvs_close(h);
+ }
+ return muted != 0;
+}
+
+bool config_save_muted(bool muted)
+{
+ nvs_handle_t h;
+ if (nvs_open(NS, NVS_READWRITE, &h) != ESP_OK) return false;
+ bool ok = nvs_set_u8(h, "muted", muted ? 1 : 0) == ESP_OK && nvs_commit(h) == ESP_OK;
+ nvs_close(h);
+ ESP_LOGI(TAG, "save_muted %d: %s", (int)muted, ok ? "ok" : "FAILED");
+ return ok;
+}
+
+uint8_t config_load_habitat_options(void)
+{
+ nvs_handle_t h;
+ uint8_t options = 0; // Curved title; straight scrolling; reactions enabled
+ if (nvs_open(NS, NVS_READONLY, &h) == ESP_OK) {
+ nvs_get_u8(h, "habitat", &options);
+ nvs_close(h);
+ }
+ return options & 15;
+}
+bool config_save_habitat_options(uint8_t options)
+{
+ nvs_handle_t h;
+ if (nvs_open(NS, NVS_READWRITE, &h) != ESP_OK) return false;
+ bool ok = nvs_set_u8(h, "habitat", options & 15) == ESP_OK && nvs_commit(h) == ESP_OK;
+ nvs_close(h);
+ return ok;
+}
+
// --- scroll direction ---------------------------------------------------------------------------
// Which way a drag moves the window's scrollback. A habit, not a fact about the hardware: some hands
// expect the text to follow the finger, others expect the VIEW to follow it, and neither is wrong.
diff --git a/devices/harness-device/firmware/main/config_store.h b/devices/harness-device/firmware/main/config_store.h
index fdb611979..7e9bb5996 100644
--- a/devices/harness-device/firmware/main/config_store.h
+++ b/devices/harness-device/firmware/main/config_store.h
@@ -1,7 +1,7 @@
// The dial's own settings, in NVS.
//
-// Four things, and that is the whole list: screen brightness, the voice language, the screen-lock pattern,
-// and nothing else. Everything this file used to hold — the WiFi networks, the backend URL, the device
+// Local display, sound, gesture, voice-language and screen-lock preferences. Everything this file
+// used to hold — the WiFi networks, the backend URL, the device
// token, the SDS provisioning blob, the E2EE identity and its pinned peers, the last-selected machine —
// existed so the device could find a network and prove who it was to a backend. A cable answers both, and
// the account lives on the computer at the other end of it.
@@ -20,6 +20,15 @@ void config_store_init(void);
uint8_t config_load_brightness(void);
void config_save_brightness(uint8_t level);
+// Habitat starts muted. The saved preference survives firmware updates.
+bool config_load_muted(void);
+bool config_save_muted(bool muted);
+
+// Local Habitat experiments: bit 0 = legacy focus face, bit 1 = rim scroll,
+// bit 2 = quiet reactions, bit 3 = straight title (default: curved).
+uint8_t config_load_habitat_options(void);
+bool config_save_habitat_options(uint8_t options);
+
// The voice language the dial captures in. The daemon PROPOSES one from the computer's locale on every
// `welcome`; once the user has picked here, this wins — the person holding the dial may well speak
// something other than the laptop is set to.
diff --git a/devices/harness-device/firmware/main/fw_update.c b/devices/harness-device/firmware/main/fw_update.c
index 786ce2a45..c818a25d8 100644
--- a/devices/harness-device/firmware/main/fw_update.c
+++ b/devices/harness-device/firmware/main/fw_update.c
@@ -9,6 +9,7 @@
#include "esp_ota_ops.h"
#include "esp_partition.h"
#include "esp_system.h"
+#include "esp_timer.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "mbedtls/sha256.h"
@@ -25,6 +26,7 @@ static const char *TAG = "fw";
// Read-back buffer for the hash. Small on purpose: this runs on the link's reader task, whose stack also
// carries esp_ota_write().
#define VERIFY_CHUNK 1024
+#define TRANSFER_IDLE_US INT64_C(15000000)
static const esp_partition_t *s_target;
static esp_ota_handle_t s_handle;
@@ -33,6 +35,8 @@ static uint32_t s_written;
static uint32_t s_expected;
static char s_sha_hex[65];
static char s_version[32];
+// Owned by the cable reader, just like the OTA handle and every slice.
+static int64_t s_last_slice_us;
static void reset_state(void)
{
@@ -41,6 +45,7 @@ static void reset_state(void)
s_handle = 0;
s_written = 0;
s_expected = 0;
+ s_last_slice_us = 0;
}
static void fail(const char *why)
@@ -61,7 +66,11 @@ void fw_mark_valid(void)
if (!run || esp_ota_get_state_partition(run, &st) != ESP_OK) return;
if (st != ESP_OTA_IMG_PENDING_VERIFY) return; // not a fresh install — nothing to confirm
- esp_ota_mark_app_valid_cancel_rollback();
+ esp_err_t err = esp_ota_mark_app_valid_cancel_rollback();
+ if (err != ESP_OK) {
+ ESP_LOGE(TAG, "could not confirm image: %s", esp_err_to_name(err));
+ return;
+ }
const esp_app_desc_t *me = esp_app_get_description();
ESP_LOGW(TAG, "image confirmed (%s) — rollback cancelled", me ? me->version : "?");
}
@@ -75,13 +84,27 @@ void fw_update_abort(const char *why)
ui_show_projects();
}
+void fw_update_tick(void)
+{
+ // USB pings prove the host is alive, not that an image is still arriving.
+ // Abandon a stalled transfer without rebooting or changing the boot slot.
+ if (s_active && esp_timer_get_time() - s_last_slice_us >= TRANSFER_IDLE_US)
+ fail("firmware transfer stalled");
+}
+
bool fw_update_offer(const char *version, int size, const char *sha256_hex)
{
if (s_active) return false; // one at a time; the daemon will offer again
- if (!version || !sha256_hex || strlen(sha256_hex) != 64 || size <= 0) {
+ if (!version || !version[0] || strnlen(version, sizeof s_version) >= sizeof s_version ||
+ !sha256_hex || strnlen(sha256_hex, sizeof s_sha_hex) != 64 || size <= 0) {
ESP_LOGW(TAG, "ignoring a malformed offer");
return false;
}
+ for (unsigned i = 0; i < 64; i++) {
+ char c = sha256_hex[i];
+ if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')))
+ return false;
+ }
// Never mid-turn. The user is watching a turn run; a reboot in the middle of it loses the thread and
// looks like a crash. The daemon offers again on the next hello, which is 15 seconds away.
if (audio_client_active()) {
@@ -91,7 +114,7 @@ bool fw_update_offer(const char *version, int size, const char *sha256_hex)
const esp_partition_t *target = esp_ota_get_next_update_partition(NULL);
if (!target) { ESP_LOGE(TAG, "no OTA slot"); return false; }
- if ((int)target->size < size) {
+ if (target->size < (uint32_t)size) {
ESP_LOGE(TAG, "image %d B does not fit the %u B slot", size, (unsigned)target->size);
return false;
}
@@ -102,9 +125,12 @@ bool fw_update_offer(const char *version, int size, const char *sha256_hex)
// The screen goes up BEFORE the erase, which takes seconds: without it the dial looks frozen at
// exactly the moment a user must not power it off.
ui_ota_boot_show(version);
+ s_handle = 0;
esp_err_t err = esp_ota_begin(target, size, &s_handle);
if (err != ESP_OK) {
ESP_LOGE(TAG, "esp_ota_begin: %s", esp_err_to_name(err));
+ if (s_handle) esp_ota_abort(s_handle);
+ reset_state();
ui_show_projects();
return false;
}
@@ -114,7 +140,10 @@ bool fw_update_offer(const char *version, int size, const char *sha256_hex)
s_written = 0;
s_active = true;
snprintf(s_sha_hex, sizeof(s_sha_hex), "%s", sha256_hex);
+ for (unsigned i = 0; i < 64; i++)
+ if (s_sha_hex[i] >= 'A' && s_sha_hex[i] <= 'F') s_sha_hex[i] += 'a' - 'A';
snprintf(s_version, sizeof(s_version), "%s", version);
+ s_last_slice_us = esp_timer_get_time();
cable_client_fw_accept();
return true;
}
@@ -151,7 +180,7 @@ void fw_update_slice(const uint8_t *data, size_t len)
{
if (!s_active || !data || len == 0) return;
- if (s_written + len > s_expected) {
+ if (s_written > s_expected || len > s_expected - s_written) {
fail("more bytes than the offer promised");
return;
}
@@ -160,6 +189,7 @@ void fw_update_slice(const uint8_t *data, size_t len)
return;
}
s_written += (uint32_t)len;
+ s_last_slice_us = esp_timer_get_time();
cable_client_fw_progress(s_written);
ui_ota_boot_pct((int)((uint64_t)s_written * 100 / s_expected));
@@ -172,6 +202,17 @@ void fw_update_slice(const uint8_t *data, size_t len)
// Over what was WRITTEN, not what was received — see written_hash_matches().
if (!written_hash_matches()) { reset_state(); cable_client_fw_error("sha256 mismatch"); ui_show_projects(); return; }
+ // The manifest's label must name the image we actually verified. A wrong
+ // version string otherwise makes an apparently successful OTA loop forever.
+ esp_app_desc_t candidate;
+ if (esp_ota_get_partition_description(s_target, &candidate) != ESP_OK ||
+ strncmp(candidate.version, s_version, sizeof candidate.version) != 0) {
+ reset_state();
+ cable_client_fw_error("image version does not match offer");
+ ui_show_projects();
+ return;
+ }
+
if (esp_ota_set_boot_partition(s_target) != ESP_OK) {
reset_state();
cable_client_fw_error("could not set the boot partition");
diff --git a/devices/harness-device/firmware/main/fw_update.h b/devices/harness-device/firmware/main/fw_update.h
index 4d7c30d7a..fec0f1d71 100644
--- a/devices/harness-device/firmware/main/fw_update.h
+++ b/devices/harness-device/firmware/main/fw_update.h
@@ -48,3 +48,6 @@ bool fw_update_active(void);
// Abandon an update in flight (the session dropped mid-transfer). The old image keeps running; the slot is
// left dirty and is erased again by the next accepted offer.
void fw_update_abort(const char *why);
+
+// Reader-owned idle check; USB keepalives must not keep a half-image open forever.
+void fw_update_tick(void);
diff --git a/devices/harness-device/firmware/main/ram_telemetry.c b/devices/harness-device/firmware/main/ram_telemetry.c
index bdd8498e7..ebefa8d53 100644
--- a/devices/harness-device/firmware/main/ram_telemetry.c
+++ b/devices/harness-device/firmware/main/ram_telemetry.c
@@ -111,11 +111,13 @@ void ram_telemetry_checkpoint(const char *tag)
{
lv_mem_monitor_t lv = { 0 };
bool have_lvgl = s_lvgl_ready;
+#ifndef DEVICE_HABITAT
if (have_lvgl) {
display_lock();
lv_mem_monitor(&lv);
display_unlock();
}
+#endif
uint32_t json_fallbacks = __atomic_load_n(&s_json_fallback_count, __ATOMIC_RELAXED);
uint64_t json_fallback_bytes = __atomic_load_n(&s_json_fallback_bytes, __ATOMIC_RELAXED);
diff --git a/devices/harness-device/firmware/main/ui/display.c b/devices/harness-device/firmware/main/ui/display.c
index e9bf373ab..4d7b21ed9 100644
--- a/devices/harness-device/firmware/main/ui/display.c
+++ b/devices/harness-device/firmware/main/ui/display.c
@@ -12,6 +12,7 @@
#include "esp_log.h"
#include "esp_task_wdt.h"
#include "lvgl.h"
+#include "ui_perf.h"
static const char *TAG = "display";
diff --git a/devices/harness-device/firmware/main/ui/habitat/arc_geometry.inc b/devices/harness-device/firmware/main/ui/habitat/arc_geometry.inc
new file mode 100644
index 000000000..a4bd121a7
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/arc_geometry.inc
@@ -0,0 +1,36 @@
+// Generated fixed-point sin/cos for half-cell steps on the 205 px title radius.
+// angle = index * (12 / 2 / 205) radians; Q14. No runtime trigonometry.
+static const int16_t arc_trig[HT_ARC_COLS][2] = {
+ {0, 16384},
+ {479, 16377},
+ {959, 16356},
+ {1437, 16321},
+ {1914, 16272},
+ {2389, 16209},
+ {2862, 16132},
+ {3333, 16041},
+ {3801, 15937},
+ {4266, 15819},
+ {4727, 15687},
+ {5184, 15542},
+ {5637, 15384},
+ {6085, 15212},
+ {6527, 15028},
+ {6964, 14830},
+ {7395, 14620},
+ {7820, 14397},
+ {8238, 14162},
+ {8649, 13915},
+ {9052, 13656},
+ {9448, 13385},
+ {9836, 13103},
+ {10215, 12810},
+ {10585, 12505},
+ {10947, 12190},
+ {11299, 11865},
+ {11641, 11529},
+ {11974, 11183},
+ {12296, 10828},
+ {12607, 10464},
+ {12908, 10090},
+};
diff --git a/devices/harness-device/firmware/main/ui/habitat/ascii_clip.c b/devices/harness-device/firmware/main/ui/habitat/ascii_clip.c
new file mode 100644
index 000000000..2db4c30a8
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/ascii_clip.c
@@ -0,0 +1,46 @@
+#include "ascii_clip.h"
+#include <string.h>
+
+#ifdef DEVICE_LAYOUT_BENCH
+static bool short_runs = true;
+void ht_ascii_clip_short_runs(bool enabled) { short_runs = enabled; }
+#endif
+
+bool ht_ascii_clip_row(const ht_ascii_clip_t *clip, unsigned frame, unsigned row,
+ char *out, size_t capacity)
+{
+ if (!out || !capacity) return false;
+ out[0] = 0;
+ if (!clip || !clip->cols || capacity <= clip->cols || !clip->symbols ||
+ clip->symbols > 16 || frame >= clip->frames || row >= clip->rows ||
+ !clip->alphabet || !clip->frame_rows || !clip->row_offsets || !clip->data)
+ return false;
+ unsigned key = clip->frame_rows[frame * clip->rows + row];
+ if (key >= clip->unique_rows) return false;
+ unsigned begin = clip->row_offsets[key], end = clip->row_offsets[key + 1];
+ if (begin > end || end > clip->data_bytes) return false;
+ unsigned used = 0;
+ for (unsigned i = begin; i < end; i++) {
+ unsigned code = clip->data[i] & 15, count = (clip->data[i] >> 4) + 1;
+ if (code >= clip->symbols || count > clip->cols - used) goto invalid;
+ unsigned char ink = clip->alphabet[code];
+ if (ink < 32 || ink > 126) goto invalid;
+ // Most authored strokes are one cell. Avoid a variable-length library
+ // fill for those without retaining a decoded frame or adding RAM.
+#ifdef DEVICE_LAYOUT_BENCH
+ if (short_runs && count == 1)
+#else
+ if (count == 1)
+#endif
+ out[used] = (char)ink;
+ else
+ memset(out + used, ink, count);
+ used += count;
+ }
+ if (used != clip->cols) goto invalid;
+ out[used] = 0;
+ return true;
+invalid:
+ out[0] = 0;
+ return false;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/ascii_clip.h b/devices/harness-device/firmware/main/ui/habitat/ascii_clip.h
new file mode 100644
index 000000000..2795fc4f7
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/ascii_clip.h
@@ -0,0 +1,26 @@
+#pragma once
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+// Immutable, generated text artwork. Frames refer to shared rows; each row is
+// nibble RLE: high nibble = repeat count minus one, low nibble = alphabet slot.
+// At most 16 printable ASCII symbols and 65535 encoded bytes per clip. Each
+// creature owns its palette/frames; the renderer and decoder remain shared.
+// Arrays are generated with these exact lengths, not loaded from the wire.
+typedef struct {
+ uint8_t cols, rows, symbols;
+ uint16_t frames, unique_rows, data_bytes;
+ const char *alphabet; // symbols bytes
+ const uint16_t *frame_rows; // frames * rows entries
+ const uint16_t *row_offsets; // unique_rows + 1 entries
+ const uint8_t *data; // data_bytes bytes
+} ht_ascii_clip_t;
+
+// Decodes only the requested row into caller storage, including a terminator.
+// Rejects invalid indices, row lengths and symbols. No heap or mutable cache.
+bool ht_ascii_clip_row(const ht_ascii_clip_t *clip, unsigned frame, unsigned row,
+ char *out, size_t capacity);
+#ifdef DEVICE_LAYOUT_BENCH
+void ht_ascii_clip_short_runs(bool enabled);
+#endif
diff --git a/devices/harness-device/firmware/main/ui/habitat/carry.c b/devices/harness-device/firmware/main/ui/habitat/carry.c
new file mode 100644
index 000000000..bc02808cb
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/carry.c
@@ -0,0 +1,55 @@
+#include "carry.h"
+#include <stdio.h>
+#include <string.h>
+
+void ht_carry_close(ht_carry_t *s)
+{
+ if (s->id[0] && s->emit) {
+ ht_carry_command_t c = {.id=s->id, .agent="", .selection="", .cancel=true};
+ s->emit(&c, s->ctx);
+ }
+ uint32_t serial = s->serial;
+ memset(s, 0, sizeof(*s));
+ s->serial = serial;
+}
+void ht_carry_open(ht_carry_t *s, const char *id, const char *agent, const char *selection,
+ uint32_t revision, uint32_t now, ht_carry_emit_t emit, void *ctx)
+{
+ ht_carry_close(s);
+ if (!id || !*id || strlen(id) >= sizeof(s->id) || !agent || !*agent ||
+ !selection || !*selection || !revision) return;
+ snprintf(s->id, sizeof(s->id), "%s", id);
+ s->emit=emit; s->ctx=ctx; s->request=++s->serial;
+ ht_carry_command_t c = {.id=s->id, .agent=agent, .selection=selection,
+ .request=s->request, .revision=revision};
+ if (!emit || !emit(&c, ctx)) {
+ snprintf(s->error, sizeof(s->error), "Device busy. Choose the text again.");
+ return;
+ }
+ s->pending=true; s->deadline=now+3500;
+}
+bool ht_carry_reply(ht_carry_t *s, const char *id, uint32_t request, bool ok,
+ const char *source, const char *excerpt, int rows, uint32_t ttl,
+ const char *error, uint32_t now)
+{
+ if (!s->pending || !id || strcmp(s->id,id) || s->request!=request) return false;
+ if (ok && (!source || !excerpt || rows<1 || rows>16 || !ttl || ttl>300000)) return false;
+ s->pending=false;
+ if (!ok) {
+ snprintf(s->error,sizeof(s->error),"%s",error && *error ? error : "Choose the text again.");
+ return true;
+ }
+ s->active=true; s->rows=rows; s->deadline=now+ttl;
+ snprintf(s->source,sizeof(s->source),"%s",source);
+ snprintf(s->excerpt,sizeof(s->excerpt),"%s",excerpt);
+ return true;
+}
+bool ht_carry_tick(ht_carry_t *s, uint32_t now)
+{
+ if ((!s->pending && !s->active) || (int32_t)(now-s->deadline)<0) return false;
+ bool pending=s->pending;
+ ht_carry_close(s);
+ snprintf(s->error,sizeof(s->error),"%s",pending ? "No reply. Choose the text again." :
+ "Carried text expired. Select it again or drop text.");
+ return true;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/carry.h b/devices/harness-device/firmware/main/ui/habitat/carry.h
new file mode 100644
index 000000000..2dfadd5f0
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/carry.h
@@ -0,0 +1,26 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef struct {
+ const char *id, *agent, *selection;
+ uint32_t request, revision;
+ bool cancel;
+} ht_carry_command_t;
+typedef bool (*ht_carry_emit_t)(const ht_carry_command_t *, void *);
+typedef struct {
+ char id[48], source[96], excerpt[241], error[160];
+ uint32_t serial, request, deadline;
+ int rows;
+ bool pending, active;
+ ht_carry_emit_t emit;
+ void *ctx;
+} ht_carry_t;
+
+void ht_carry_open(ht_carry_t *, const char *id, const char *agent, const char *selection,
+ uint32_t revision, uint32_t now, ht_carry_emit_t, void *ctx);
+void ht_carry_close(ht_carry_t *);
+bool ht_carry_reply(ht_carry_t *, const char *id, uint32_t request, bool ok,
+ const char *source, const char *excerpt, int rows, uint32_t ttl,
+ const char *error, uint32_t now);
+bool ht_carry_tick(ht_carry_t *, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/command_face.c b/devices/harness-device/firmware/main/ui/habitat/command_face.c
new file mode 100644
index 000000000..fe52e151e
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/command_face.c
@@ -0,0 +1,47 @@
+#include "command_face.h"
+#include <string.h>
+
+const ht_rect_t ht_command_targets[4] = {
+ {93, 78, 280, 66}, {57, 161, 352, 118}, {93, 298, 280, 66}, {113, 369, 240, 60}
+};
+static void centered(ht_scene_t *scene, int y, int width, const ht_font_t *font,
+ uint16_t fg, uint16_t bg, const char *text)
+{
+ const char *p = text ? text : "";
+ int cells = 0;
+ while (*p) { ht_utf8_next(&p); cells++; }
+ if (cells * font->width > width) cells = width / font->width;
+ ht_text(scene, (HT_WIDTH - cells * font->width) / 2, y, cells * font->width,
+ font, fg, bg, text ? text : "");
+}
+void ht_command_face(ht_scene_t *scene, const ht_command_face_t *face)
+{
+ centered(scene, 97, 280, &ht_mono_20, face->foreground,
+ face->pressed == 0 ? face->selection : scene->background, face->heading);
+ const char *subject = face->subject ? face->subject : "";
+ bool one = ht_can_display(subject, &ht_mono_20, 340, 1);
+ int start = scene->count;
+ ht_wrap(scene, 63, one ? 192 : 171, 340, 2, 0, &ht_mono_20, face->foreground, subject);
+ // One text size throughout; long task names wrap before showing continuation.
+ if (!ht_can_display(subject, &ht_mono_20, 340, 2) && scene->count > start) {
+ ht_run_t *last = &scene->runs[scene->count - 1];
+ char *p = last->text;
+ int cells = 0;
+ while (*p && cells < 340 / ht_mono_20.width - 3) { const char *next = p; ht_utf8_next(&next); p = (char *)next; cells++; }
+ strcpy(p, "...");
+ }
+ for (int i = start; i < scene->count; i++) {
+ ht_run_t *r = &scene->runs[i];
+ const char *p = r->text;
+ int cells = 0;
+ while (*p) { ht_utf8_next(&p); cells++; }
+ r->w = cells * r->font->width;
+ r->x = (HT_WIDTH - r->w) / 2;
+ if (face->pressed == 1) r->bg = face->selection;
+ }
+ centered(scene, 257, 320, &ht_mono_20, face->dim, scene->background, face->context);
+ centered(scene, 315, 280, &ht_mono_20, face->enabled ? face->accent : face->dim,
+ face->pressed == 2 ? face->selection : scene->background, face->primary);
+ centered(scene, 386, 240, &ht_mono_20, face->foreground,
+ face->pressed == 3 ? face->selection : scene->background, face->secondary);
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/command_face.h b/devices/harness-device/firmware/main/ui/habitat/command_face.h
new file mode 100644
index 000000000..e4477fecd
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/command_face.h
@@ -0,0 +1,12 @@
+#pragma once
+#include "terminal.h"
+
+// Shared by the device and the pixel-exact host preview. One subject, one primary action.
+typedef struct {
+ const char *heading, *subject, *context, *primary, *secondary;
+ uint16_t foreground, dim, accent, selection;
+ int pressed; // 0 heading, 1 subject, 2 primary, 3 secondary; -1 none
+ bool enabled;
+} ht_command_face_t;
+extern const ht_rect_t ht_command_targets[4];
+void ht_command_face(ht_scene_t *scene, const ht_command_face_t *face);
diff --git a/devices/harness-device/firmware/main/ui/habitat/creature_art.inc b/devices/harness-device/firmware/main/ui/habitat/creature_art.inc
new file mode 100644
index 000000000..17c71c989
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/creature_art.inc
@@ -0,0 +1,684 @@
+// Generated by gen_creature_art.py; original drawings. Printable ASCII only.
+static const char *const names[HT_ORIGINAL_CREATURES] = {"Miso","Hopper","Pip","Rook","Moo","Boo","Sprout","Drift","Bolt","Echo"};
+static const char art[HT_ORIGINAL_CREATURES][6][HT_CREATURE_ROWS][HT_CREATURE_COLS+1] = {
+ { // Miso
+ {
+ " ",
+ " /\\ /\\ ",
+ " / \\_____/ \\ ",
+ " ( % % ) ",
+ " (= ? =) ",
+ " / \\__ ",
+ " /| | ) ",
+ " (_|____/ \\____|_/ ",
+ " ",
+ },
+ {
+ " ",
+ " /\\_____/ \\ ",
+ " / \\_____/ \\ ",
+ " ( % % ) ",
+ " (= ? =) ",
+ " / \\ ) ",
+ " /| |__/ ",
+ " (_|____/ \\____|) ",
+ " ",
+ },
+ {
+ " * ",
+ " /\\ /\\ ",
+ " / \\_____/ \\ ",
+ " ( % % ) ",
+ " (= ? =) ",
+ " / / \\ \\ ",
+ " (_/| |\\_) ",
+ " |___/ \\___| ",
+ " . . ",
+ },
+ {
+ " ",
+ " /\\ /\\ ",
+ " / \\_____/ \\ ",
+ " \\ ( % % ) / ",
+ " \\(= ? =)/ ",
+ " / \\ ",
+ " | | ",
+ " |___/ \\___| ",
+ " * * ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " /\\____/\\ ",
+ " ( % % )___ ",
+ " (= ? =) `. ",
+ " (_________ ) ",
+ " `--------\\_/ ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " /\\____/\\ ",
+ " ( % % )____ ",
+ " (= ? =) ) ",
+ " (_________ / ",
+ " `--------\\/ ",
+ " ",
+ },
+ },
+ { // Hopper
+ {
+ " ",
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\ ._______. / ",
+ " / / \\ \\ ",
+ " _/ / \\ \\_ ",
+ " (___) (___) ",
+ },
+ {
+ " ",
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\ ._______. / ",
+ " / / \\ \\ ",
+ " (_/ \\_) ",
+ " ) ( ",
+ },
+ {
+ " * * ",
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\ ._______. / ",
+ " _/ / \\ \\_ ",
+ " (__/ \\__) ",
+ " ",
+ },
+ {
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\ ._______. / ",
+ " / / \\ \\ ",
+ " | | | | ",
+ " \\_) (_/ ",
+ " . . ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\_____________/ ",
+ " (___) (___) ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " .--. .--. ",
+ " ( % ) ( % ) ",
+ " / `--' `--' \\ ",
+ " ( ? ) ",
+ " \\_______________/ ",
+ " (___) (___) ",
+ },
+ },
+ { // Pip
+ {
+ " /\\ /\\ ",
+ " / \\ / \\ ",
+ " | | | | ",
+ " | |_| | ",
+ " / % % \\ ",
+ " \\ ? / ",
+ " /| |\\ ",
+ " (_|__u_u__|_) ",
+ " ",
+ },
+ {
+ " /\\ ",
+ " / \\ __ ",
+ " | | / / ",
+ " | |/ / ",
+ " / % % \\ ",
+ " \\ ? / ",
+ " /| |\\ ",
+ " (_|__u_u__|_) ",
+ " ",
+ },
+ {
+ " /\\ /\\ ",
+ " / \\ / \\ ",
+ " | |_| | ",
+ " / % % \\ ",
+ " \\ ? / ",
+ " _/ / \\ \\_ ",
+ " (__/| |\\__) ",
+ " |__u_u__| ",
+ " . . ",
+ },
+ {
+ " /\\ /\\ ",
+ " / \\ / \\ ",
+ " \\ \\_/ / ",
+ " / % % \\ ",
+ " \\ ? / ",
+ " /| |\\ ",
+ " (_| |_) ",
+ " |__u_u__| ",
+ " * * ",
+ },
+ {
+ " ",
+ " ",
+ " ____ ____ ",
+ " / __\\/__ \\ ",
+ " \\ ( % % ) / ",
+ " \\( ? )/ ",
+ " / \\ ",
+ " (___u_u___) ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " ____ ____ ",
+ " / __\\/__ \\ ",
+ " \\ ( % % ) / ",
+ " \\( ? )/ ",
+ " / \\ ",
+ " (____u_u____) ",
+ " ",
+ },
+ },
+ { // Rook
+ {
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " | ? | ",
+ " /| |\\ ",
+ " / | | \\ ",
+ " \\_| |_/ ",
+ " / ___ \\ ",
+ " (_/ \\_) ",
+ },
+ {
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " | ? | ",
+ " /| |\\__ ",
+ " / | |___) ",
+ " \\_| | ",
+ " / ___ \\ ",
+ " (_/ \\_) ",
+ },
+ {
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " __ | ? | ",
+ " ( \\_| |\\ ",
+ " \\___| | \\ ",
+ " | |_/ ",
+ " / ___ \\ ",
+ " (_/ \\_) ",
+ },
+ {
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " | ? | __ ",
+ " /| |_/ ) ",
+ " / | |___/ ",
+ " \\_| | ",
+ " / ___ \\ ",
+ " (_/ \\_) ",
+ },
+ {
+ " ",
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " | ? | ",
+ " /| |\\ ",
+ " ( | | ) ",
+ " \\|_____|/ ",
+ " (___ ___) ",
+ },
+ {
+ " ",
+ " .---. ",
+ " / \\ ",
+ " | % % | ",
+ " | ? | ",
+ " / | | \\ ",
+ " ( | | ) ",
+ " \\_|_____|_/ ",
+ " (___ ___) ",
+ },
+ },
+ { // Moo
+ {
+ " ",
+ " /) (\\ ",
+ " __/ \\_______/ \\__ ",
+ " (___ % % ___) ",
+ " | _____ | ",
+ " | (o o) | ",
+ " | \\_?_/ | ",
+ " / \\ ",
+ " (____/ \\____) ",
+ },
+ {
+ " ",
+ " /) (\\ ",
+ " ___/ \\_______/ \\___ ",
+ " (____ % % ____) ",
+ " | _____ | ",
+ " | (o o) | ",
+ " | ( ? ) | ",
+ " / \\ ",
+ " (____/ \\____) ",
+ },
+ {
+ " * * ",
+ " /) (\\ ",
+ " __/ \\_______/ \\__ ",
+ " (___ % % ___) ",
+ " | _____ | ",
+ " | (o o) | ",
+ " | \\_?_/ | ",
+ " __/ \\__ ",
+ " (___/ \\___) ",
+ },
+ {
+ " * * ",
+ " /) (\\ ",
+ " __/ \\_________/ \\__ ",
+ " (____ % % ____) ",
+ " | _____ | ",
+ " | (o o) | ",
+ " | ( ? ) | ",
+ " / \\ ",
+ " (____/ \\____) ",
+ },
+ {
+ " ",
+ " ",
+ " /) (\\ ",
+ " __/ \\_______/ \\__ ",
+ " (___ % % ___) ",
+ " | _____ | ",
+ " | (o ? o) | ",
+ " \\_______/ ",
+ " (____/ \\____) ",
+ },
+ {
+ " ",
+ " ",
+ " /) (\\ ",
+ " ___/ \\_______/ \\___ ",
+ " (____ % % ____) ",
+ " | _____ | ",
+ " | (o ? o) | ",
+ " \\_______/ ",
+ " (____/ \\____) ",
+ },
+ },
+ { // Boo
+ {
+ " ",
+ " .-------. ",
+ " .' '. ",
+ " / % % \\ ",
+ " | ? | ",
+ " | | ",
+ " | | ",
+ " \\_/\\___/\\___/\\_/ ",
+ " ",
+ },
+ {
+ " ",
+ " .-------. ",
+ " .' '. ",
+ " / % % \\ ",
+ " | ? | ",
+ " | | ",
+ " | | ",
+ " \\___/\\___/\\___/ ",
+ " ",
+ },
+ {
+ " * * ",
+ " .-------. ",
+ " .' '. ",
+ " __/ % % \\__ ",
+ " ( ? ) ",
+ " \\ / ",
+ " | | ",
+ " \\_/\\___/\\___/\\_/ ",
+ " ",
+ },
+ {
+ " * ",
+ " .-------. ",
+ " .' '. ",
+ " _/ % % \\_ ",
+ " ( ? ) ",
+ " | | ",
+ " | | ",
+ " \\___/\\___/\\___/ ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " .-------. ",
+ " .' % % '. ",
+ " / ? \\ ",
+ " | | ",
+ " \\_/\\___/\\___/\\_/ ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " ",
+ " .-------. ",
+ " .' % % '. ",
+ " / ? \\ ",
+ " | | ",
+ " \\__/\\___/\\___/\\__/ ",
+ " ",
+ },
+ },
+ { // Sprout
+ {
+ " .-. ",
+ " .-. \\ / ",
+ " \\ / | ",
+ " \\_____| ",
+ " | () ",
+ " .------|---. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ {
+ " .-. ",
+ " .-. \\ / ",
+ " \\ / | ",
+ " \\_____| ",
+ " | () ",
+ " .-----|----. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ {
+ " .-@-. ",
+ " (@ @ @) ",
+ " '-@-' ",
+ " (\\ | /) ",
+ " \\___|__/ ",
+ " .---|------. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ {
+ " .-@-. * ",
+ " (@ @ @) ",
+ " '-@-' ",
+ " (\\ | /) ",
+ " \\____|___/ ",
+ " .---|------. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ {
+ " ",
+ " ",
+ " .----. ",
+ " ( ) \\ () ",
+ " | / ",
+ " .------|---. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ {
+ " ",
+ " ",
+ " .---. ",
+ " ( ) \\ () ",
+ " | / ",
+ " .------|---. ",
+ " | % % | ",
+ " | ? | ",
+ " '----------' ",
+ },
+ },
+ { // Drift
+ {
+ " ",
+ " .-------. ",
+ " .' . . . . '. ",
+ " / % % \\ ",
+ " ( ? ) ",
+ " '---.---.---.-' ",
+ " / | | \\ ",
+ " \\ | | / ",
+ " J U J U ",
+ },
+ {
+ " ",
+ " .-----. ",
+ " .' . . . '. ",
+ " / % % \\ ",
+ " ( ? ) ",
+ " '--.---.---.' ",
+ " \\ | / ",
+ " / | \\ ",
+ " U J U ",
+ },
+ {
+ " o o ",
+ " .-----. ",
+ " .' . . . '. ",
+ " / % % \\ ",
+ " ( ? ) ",
+ " '--.---.---.' ",
+ " __/ | | \\__ ",
+ " ( __/ \\__ ) ",
+ " ( ) ",
+ },
+ {
+ " o ",
+ " .-------. ",
+ " .' . . . . '. ",
+ " / % % \\ ",
+ " ( ? ) ",
+ " '---.---.---.-' ",
+ " / | | \\ ",
+ " ( / \\ ) ",
+ " ) U J ( ",
+ },
+ {
+ " ",
+ " ",
+ " .-------. ",
+ " .' % % '. ",
+ " ( ? ) ",
+ " '---.---.---' ",
+ " / | | \\ ",
+ " U U J U ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " .-------. ",
+ " .' % % '. ",
+ " ( ? ) ",
+ " '----.---.----' ",
+ " \\ | | / ",
+ " JUUJ ",
+ " ",
+ },
+ },
+ { // Bolt
+ {
+ " o ",
+ " | ",
+ " .----'----. ",
+ " | % % | ",
+ " | [?] | ",
+ " o-+---------+-o ",
+ " | [=] | ",
+ " '----+----' ",
+ " / \\ ",
+ },
+ {
+ " o ",
+ " / ",
+ " .----'----. ",
+ " | % % | ",
+ " | [?] | ",
+ " o-+---------+--o ",
+ " | [=] | ",
+ " '----+----' ",
+ " / \\ ",
+ },
+ {
+ " * ",
+ " | ",
+ " o .----'----. ",
+ " | | % % | ",
+ " \\__| [?] | ",
+ " +---------+--o ",
+ " | [=] | ",
+ " '----+----' ",
+ " _/ \\_ ",
+ },
+ {
+ " o ",
+ " | ",
+ " .----'----. o ",
+ " | % % | | ",
+ " | [?] |__/ ",
+ " o--+---------+ ",
+ " | [=] | ",
+ " '----+----' ",
+ " /\\ ",
+ },
+ {
+ " ",
+ " ",
+ " .----o----. ",
+ " | % % | ",
+ " | [?] | ",
+ " +---------+ ",
+ " o| [-] |o ",
+ " '----+----' ",
+ " / \\ ",
+ },
+ {
+ " ",
+ " ",
+ " .----o----. ",
+ " | % % | ",
+ " | [?] | ",
+ " +---------+ ",
+ " o| [ ] |o ",
+ " '----+----' ",
+ " / \\ ",
+ },
+ },
+ { // Echo
+ {
+ " ",
+ " /\\ /\\ ",
+ " / \\ /\\_/\\ / \\ ",
+ " / \\_(% %)___/ \\ ",
+ "( \\ ? / )",
+ " \\ /\\ \\_/ /\\ / ",
+ " \\/ \\ / \\ / \\__/ ",
+ " \\_/ \\_/ ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " /\\_/\\ ",
+ " /\\___(% %)___/\\ ",
+ " / \\ ? / \\ ",
+ "( /\\ \\_/ /\\ ) ",
+ " \\_/ \\ / \\ / \\_/ ",
+ " \\/ \\/ ",
+ " ",
+ },
+ {
+ " /\\ /\\ ",
+ " / \\ /\\_/\\ / \\ ",
+ "/ \\__(% %)____/ \\",
+ "\\ \\ ? / /",
+ " \\ /\\ \\_/ /\\ / ",
+ " \\/ \\ / \\ / \\__/ ",
+ " \\_/ \\_/ ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " /\\_/\\ ",
+ " (% %) ",
+ " ___/\\ ? /\\___ ",
+ " / \\_/ \\ ",
+ " / /\\ / \\ /\\ \\ ",
+ " \\/ \\_/ \\_/ \\/ ",
+ " ",
+ },
+ {
+ " ",
+ " ",
+ " /\\_/\\ ",
+ " (% %) ",
+ " / \\ ? / \\ ",
+ " /\\ \\_/ /\\ ",
+ " \\ \\ / \\ / / ",
+ " \\ V V / ",
+ " '-----' ",
+ },
+ {
+ " ",
+ " ",
+ " /\\_/\\ ",
+ " (% %) ",
+ " / \\ ? / \\ ",
+ " /\\ \\_/ /\\ ",
+ " \\ \\ / \\ / / ",
+ " \\ V V / ",
+ " '-------' ",
+ },
+ },
+};
diff --git a/devices/harness-device/firmware/main/ui/habitat/creature_clips.inc b/devices/harness-device/firmware/main/ui/habitat/creature_clips.inc
new file mode 100644
index 000000000..8e4720d73
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/creature_clips.inc
@@ -0,0 +1,272 @@
+// Generated from prototype/habitat/assets/creature-references/clips.json.
+// Source/artist/adaptation credits are preserved there and in CREATURE_GALLERY_02.md.
+static const char *const clip_0_frames[] = {
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .o@@@@@@############%;,. \n .:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n ;xoo, .;o%####x:%####o;#####xo: xxox. \n ,o#;, oo :;o%####;::::x###%x;:. x:.:%x; \n o@#: .. ..,oxx#######%xx:., ,. x@@ \n ;@@x:. .:::oo;;oooooooo;oo;,:,. .%@@ \n .@@#x;;;;;;oo.o%#%oo%%#@%%%%;%#%;,;o;;;;;;o#@x: \n .,o@@%%@@;,:%#@@,o%##@@%###%,o##%o;@@#x@@%,.. \n ;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n ,x#@@%@@x,:. o##@; @@##. .:,x@@@@%@#%%;, \n ;@%, o#@%: %@@#. ,%@x: \n ;@::, .:o, o@@. %@#. .oo: @@x \n xo; :#, .x@@. x@@,. .o% o;:o#; \n :@@;:o#@%: ,o@@%;:#@% ,:: \n ..x#@#x: .x#@#x:. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########xo;, \n .o@@@@@##############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###x.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n .oxxx,. ,;o%####%:%###%o;#####o;: ,xxx,. \n ,x#;. ;: :;o%####;::::x###%x;:. ;,.,%%o \n o@#, ...oox#######%oo:.. %@@ \n ;#@x:. .:::oo;;oooooooo;oo;,;,. .#@# \n .@@#o;;;;;;ox.o%#%oo##@@%##%;%#%;,;x;;;;;;o#@o, \n ..o@@%%@@;::%#@@.o%##@@####%,o@#%o;@@#x@@%,. \n .;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n o%#@##@@@x,,. o##@; @@##. .,,x@@@@%@#%%;, \n #@% o#@%: %@@#. .%x#:. \n @#::. o@@. %@#. :@#: \n ,xo, .xxo .x@@. x@@,. xxx ,x:;x%, \n :@# ,;@@%: ,o@@x: x@ ::: \n :%%#@#x, .x#@#%%o \n \n ",
+ " \n oooooooooooo:. \n .;%@@@@###########%o. \n .:@@@@@@###########@@#x;, \n :o#@@@###############@@##%; \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x####x,;x%######%xo,o#####%;, \n :;;;. :o%##x.%::######;,#.o####%;. :;; \n .xo;,,o: .,o###%%%%%#####%x%%%###x;. x;:ox: \n ;@#: .,;x%###%;ooooo;o####x;:, %@@ \n ;@#: .:;o####xxxxx%###xo;.. %@@ \n .@#; ....;;o%%%%%%%x;;,.... .,@o \n o@@x......,:::o%xooxxxxxxxo;x%o.;;:......;@x: \n .x@@#@@o;;;;%#@xox##@@%##%ox%#%:;;%@@#@@#. \n .,:::::%%%##@#o o##@@@@####.x@#@#%#;::;,,, \n ,o%@@#@@@@xo%o,. o###o,,@@##...o%oo@@@@#@@@%o: \n o@%;,.,,,,. o##@; @@##. ,,,,.,,,:@@x, \n x@,:o o@@:. :#@#. o@#. \n .:xo: o@@. %@#. ;o.,x@. \n x@@. #@#. .;o; \n oo: :#@%. o@@;, ,;x, \n %#x;;x%@x: .o@@%;:o%@, \n ,;oooo,. ,:oxoo; \n ",
+ " .. .. \n .,:@@@#########x;:. \n :#@@@@@############%:. \n .:o@@@##############@@@#x;. \n :x#@@#################@##%;. \n :x#########################%;, \n ;%##########################o, \n ;%##########################o, \n ;%####%xo%########%oo%######o, \n :xxx, ,ox###o.@xo######[email protected]####%o,. oxx. \n .%#o. ,;x##x:::;######o:::x###%x: :..:#%; \n ,@@; ,;x%####%;#####xo#####xo: #@@ \n ,@#; .:;x%###%:::::o%###%o;, ##x \n @@; ,,,xx%########xx;,, ,x@o \n x@@:. :,,:;;;oooooooo;;;:,:, :x@:. \n :%@##@xxxo:ox##oo%%##%%%x;##%,.;xx###@@x. \n o;;ooooo##@@:ox#%@@%##%x:%@#%xooo;:o, \n .,x%##%###@%%@%,., o##@@##@###.;%o##x@###%##%%o, \n :%@o;ox:oooo. o##@; @@##. oooo;oo;o#@o. \n %@#,. o#@@: @@@#. .:@#o \n ,;;, o@@. %@#. .;..o@o \n o@@. %@#. ,ox%,. \n o@@. %@#. \n o@@. %@#. \n %x, .,:#@x. :@@x;, .:@, \n :x#%#@@o, ;%@@%%%;. \n ..... ..... ",
+ " ;;;;;;;;;;;;,. \n :o%@@@#########%%x;. \n .,#@@@@@###########@@#x;. \n ,o%@@@###############@@#%x: \n .;x#######################%o, \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ,,, ;%####x,:x########x:,o######;, . \n .x#x:.. :o%##o.@;:######;:@.o####%; ,;#x: \n ,@@; .:o##%xxxx######%xxx%###x;. %@@ \n ,@#; .:;x%###x:xxxxx;;####%;;, %@@ \n ,@#: ,:ox####ooooo%###%o;,. .;@x. \n %@#, ....;;o%%%%%%%%;;:... ,o@x: \n x@%o;;;;;;,:;xxo;oooooooo;xxo.,:;;;;;;##x \n .,@%#@::::x%%#%oo##@@%##%;%%#xx;::x%x#o, \n ..oooooo;o##@@%##% o%#@@@####%.o#o@@##xooooooo;, \n o%#%%@#x@@@#,::, o###o::@@##. ::,;#@##x##%@@x, \n @#x o##@;. @@##. .:%@#,\n ,:: o@@o, o#@#. .::@#:\n o@@. %@#. ,:;: \n o@@. %@#. \n o@@. %@#. \n o@@. %@#. \n ,, :#@o :%@o:. .: \n o%x,;x%@x, .,@@#x,:x@. \n :oxxo ,;ooo: ",
+ " .%%%%%%%%%%%%;,. \n ,x@@@@@############x,. \n .:@@@@@############@@#%o: \n :x#@@################@@##%;. \n :o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n :x%###o.xxx######xxx.o#####x:. \n .,xx: :o%##o.o,:######;,o.o####%; ;o \n o@:. ,;%#####%x#####%x#####%o: .:@, \n x@;. .,;o%###%o;;;;;ox###%x;:. ,o@, \n ;@@x;. .::;%%%#%%%%%##%%o;:. .o#@. \n .x@#x,. ,.,,;;oxxxxxxxo;;:,.,. .:x@%; \n ,x@%xxxxxxx.:o%%ooxx%xxxxx;%%x..;xxxxxx%#@:. \n ::::::::::::###@oox##@@%##%oo%@##o::,,,::,:,. \n ox%#@@#@@@@@@@@@o:; o##@@@@####.,o#@@#@@@@#@@#@%oo. \n @x, . . .. o###; @@##. ... .. o#x@#:\n :, o@@o, o#@#. .o##:\n %@#. .:@#: ... \n #@# ,@@; \n #@# :@@; \n #@# ,@@; \n #@# ,@#; \n .,@#o .%@o, \n :x ;@;. :%#;.:o \n .x%xo ,#xoo ",
+ " ..###%%%%%%%%%;:.. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%%######o, \n ,o%###o.%xx######xo%.o#####x:. \n .:xx; :o%##x.;,:######;,;.o###%x; ;x. \n o@,. ,;%#####%o#####xx#####%o: :@, \n x@;. ..;ox###%x:::::ox###%o;:. ,o@: \n ;#@%;. ,::%%%########%%o::. .o@@ \n .o@@x:. ,,,:;;oxxxxxxxo;;:,.,. ,;%@%; \n .o@%xxxxxxx,;x%%oo%%%%%%%x;%#x,,;xxxxxxx%@:. \n .;::::::::::;##@@;ox#%@@%##%o;%@##o::::::::::, \n x%%%@@%@@@@@#@@@o:: o##@@@@####.,;#@@#@@@@%@@%@@%%x: \n @x. o#@@: @@##. .o@@:\n ,. ;%@@;. ;#@#o, .:::.\n #@@ ,@#; \n #@# ,@#; \n #@# ,@#; \n #@# ,@#; \n #@# ,@#; \n .,@%; .x@x: \n ,x..;@:. ,x@o.;o \n oxo; .%oo; ",
+ " .,###%%%%%%%%%;:.. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%%######o, \n ,o%###x.xxx######xo%.o#####x:. \n :o%##x.o,:######;,o.o###%x; \n ,,: ,;%#####%o#####xx#####%o: . \n @x: .,;ox###%x:::::ox###%o;:. ,;## \n @#o. ,::%%%########%%o::. .:@#.\n o#@%;, ,,,,;;oxxxxxxxo;;:,.,. ,o#@x, \n .;@@#x,,,,,,:;,;x#%oo%%%%%%%x;%#x,;;;,,,,,,:x@@#, \n .:;:,@##@@@%;;%#@;ox##@@%##%o;x##:;x@@@#@@%;.::. \n :#xo%x .,,,::o#@%: o##@@@@####.x@##xo,:,.,:;##xxx%, \n ,;, ;#@###@#@@#, :x#@x, #@@#;.,@x#@@@@#@@@#. ,ox. \n ;;;:o;o; .#@#; :x@#x; :;;;;:o;: \n ;@#; #@%:. \n ;@, %@# \n o@, %@# \n o@. %@# \n o@:. .%@% \n ,x@; ##% \n ;x%;. :x%x. \n ",
+ " oooooooooooo:. \n .;%@@@@###########%o. \n .:@@@@@@###########@@#x;, \n :o#@@@###############@@##%; \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x####x,;x%######%x;,o#####%;, \n :o%##o.%::######;:#.o####%; \n .,o###%%%%%#####%x%%%###x;. \n .:;x%###%;ooooo;o####x;:, \n .:;o####xxxxx%###xo;,. \n,#o ,..,;;o%%%%%%%x;;:.... ;o,\n.@x, .:::o%%ooxxxxxxxo;x%o.;:: #@:\n %%#@%%%%%%%%xxx,x#@xox##@@%##%ox%#%,;%%%%%%%%%%%%%#x,\n .;.;%xooxx, .%@#x o##@@@@###%.x@#x:.xxx;%xxx%x:. \n .. .:@#o.x#@@#;,,@@##%oo@#x: ,%%: \n ;#;. .o@%,:%@@@x ;#@@#x @@%;. ,;ox. \n :x@#%%%#x: x#@%;. .:#@@#x::@#%x@@% \n :@@; ,o@@x \n %@% ,@# \n %@% :@% \n .%%o. .,@%; \n ,oo, :xo. \n \n ",
+ " ::::::::::::,. \n ,;x@@@#########%xo: \n ..%@@@@@###########@@#o:. \n ,;%@@@##############@@@#%x: \n .;x#@#####################%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n :x###o.@;:######;;@.o####%;. \n .:o##%ooox######xooo%###%o, \n .:o%####x:%%%%%o;####%o;: \n ,;ox####;;;;;%###%x;,. \n ....oox#######%oo:.. \no%; ,:,;:;xxo;oooooooo;xxo,;:::. oo,\nx#x. :ooo%@@.o%#%oo##@@%##%;%#%o,x@#xoo .##:\n ;%@@%#@@%%@#: .%#@#.o%##@@####%.x@#x:. ##x@@#%%##@%;.\n .,,,:;;. ,;@%: o%#@@%oo@@##oox@#o: :::;:::: \n ;#:;x%#@@#, .%@@@%x:@#x. \n .,%@@@x: ,x@@@@o:,o. \n o.:@@x:, .,:o@@@o. \n ,;x@::@@;. x@#.:: \n ::::..:@%x; .:o#@: ,: \n oxx :%%;. \n \n \n ",
+ " \n oooooooooooo:. \n .o%@@@@###########%o.. \n .:@@@@@@###########@@#%;, \n :o#@@@###############@@##%; \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x####x.;x%######%x;.o#####%;, \n :o%##o.%::######;,%.o####%;. \n .,o###%%%%%#####%x%%%###x;. \n .,;x%###%;ooooo;o####x;:, \n .:;o####xxxxx%###xo;,. \n ....;;o%%%%%%%x;;:.... \n... ;;;::o%%ooxxxxxxxo;x%o.;;;;. .. \n%#o .o%#%%##,x#@xox##@@%##%ox%#%:x@%#%%... %%:\n:##%xo%@@@@xo. .%@#o o##@@@@###%.x@##x: oxo@@%;;::x@#,\n ,;;::;:. :%@o:,%#@@#;,,@@##x;;@@#%. o::o;;oo. \n .,,ox#@@@o ;#@@%x.::;. \n :ox@@#o%: .:@@@@#%x:. \n %@#o#; ,:;@@@@x, \n ., :%o;, ,;o@o. \n , ::, ,:::. \n \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:o@@@#########xo;, \n .o@@@@@@#############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n ,;o%####x:%####oo#####oo: \n :;o%####;::::x###%x;:. \n .,,oox#######%xo:,, \n %#xo,. .;::oo;;oooooooo;oo;,;,. .;ox@, \n oox@#%;;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o%@@@o. \n ,,o@@##@@;::%#@@,o%##@@####%,x##%o;@@@%@@@,,,, \n ,;;;%##@%; o##@#xx@@##.;%@##%;;;;;. \n x%@@@@%,:. o%@@:. @@##. .:,x@@@@@#%; \n @@x ,;;;..,@@@o o#@o, ::: ,@@x \n @%::,,@%:;x@@o, :#@%; o%% .@@x \n ;xx: #@@@@x o%#@@@# xx%#: \n ,:;:, .;;:, ::: \n \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .;@@@@@@############%;, \n .:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######o;@.o####%o. \n ,;x##%;;;o######o;;;x###%o: \n ,;o%####%:#####o;#####xo: \n :;o%####;::::x###%x;:. \n :xoo: .,,oxx#######%xx:,, .;oxo \n ;@%o:. .:::;o;;oooooooo;o;;,:, .,o%@@ \n ,;@@@@@@@@#@#%.o%##oo%%#@%%%%;%#%;,;%#@##@@@@@x: \n ..,,,,:#;::x#@@,o%##@@%###x,o##%o;%o;,:,, . \n ;;;;;%##@%; o##@#%%@@##.;#@##%:;;;;;: \n :x#@@#@@%,:. o##@; @@##. .:,x@@@@#@@#o \n o@#, x@@:. x@@#. o#@:. \n o@;:, xooo. x@@, x@@;, xo;: o@#: \n .xx; @@%,,x@#;. .:%@#x:,o#@,.oxx%# \n :x@@@@o. ;%@@@@@:. .;;, \n .... ..,,.. \n \n ",
+ " \n ::::::::::::,. \n ,;o@@@#########%xo: \n .x@@@@@###########@@#o:. \n ,;x@@@##############@@@#%x, \n .;x#@##################@##%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n :x###o.@;:######;;@.o####%;. \n ,:o##%ooox######xooo%###%o, \n .;xxx; .:o%#######x,;#######%o;: %xx%, \n @@% xo ,;ox#####%;o#####%x;,. %::%@o \n @@#.,. ...oox#######%oo:.. ,.:#@o \n :%@@x;;;;;;::;ooo;oooooooo;ooo,;;;;;;;;%@@;, \n ..,##x@@#%.o%#%oo##@@%##%;%#%o,o@@@#%@o,. \n o;;;#@@#.o%##@@####%.o@##x;;. \n ,x%%####@%%@#x: o##@%oo@@##.:x@#%##%#%%%%%,,. \n .#@#;x;;xo, o##@; @@##. :xxxo;xo;@#o \n ,@o,. o#@%: x@@#. .#@%. \n .;x%% o@@. %@#. :: ,@@: \n .. oxx ,%@@. %@@,. xxo, .;x%;, \n #%: ,;@@%: ,o@@x: ,x@, \n ;%@x#@#x, .x%@@%@@x. \n .:o;, \n ",
+ " \n oooooooooooo:. \n .o%@@@@###########%o,. \n .:@@@@@@###########@@#%;, \n :o#@@################@@##%; \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.;x%######%x;.o#####%;, \n ::: :o%##o.%::######;,%.o####%;.,;;. \n .o%%% .,o%##%%%%###%%#%%%%%###x;. ;o#%o \n .@@o. .,;x%######x.:#######x;:, .%@@ \n .@#; .:;o#####%x%#####xo;,. ;@@ \n .@#x:::::....;;o%%%%%%%x;;:...,::::o#@% \n ,;%@@@@#::o%%ooxxxxxxxo;x%o.:%@@@@%o, \n :%::::x%#@xox##@@%##%oo%##;:,,. . \n ..;oooooo##@@#xoo o##@@@@####.x@%@@##x;;;;;;,.. \n ,o##x%#%###%,... o###o,,@@##. ..,,,@@@@%#@@###;. \n #@o. o##@; @@##. ,;@%o \n ,;oo. o@@:. :#@#. ,. .o@x \n o@@. %@#. ,;x%x: \n o@@. #@#. \n o; :#@@. %@@:. : \n ##x:;x#@%: ,%@@x,..:@, \n ,;oooo,. :;o@##%;. \n ",
+ " \n ..,@@@#########o:,. \n ,%@@@@@############%:. \n .,o@@@@@############@@@#x;. \n :x#@@#################@##%;. \n :x%########################%;. \n ;%##########################o, \n ;%##########################o, \n ;%####%xx%#########xx%######o, \n ,o%###o.#xo######xo#.o#####x,. \n :x% :o%##x,::;######;,;,o###%x; ;%:. \n .%#x: ,;x########%ox########xo: .:#%o \n .@@o .;ox######x.:######%o;,. .%@@ \n .@%;. ,::x%%########%%;::. .,x@# \n o@@xoooo:,,:;;;oooooooo;;:,,:;ooo%@@x: \n .;#@@%x,;x#%oo%%%%%%%x;%#%,,o#@@x:. \n ;;;;##@@:ox#%@@%##%x:%@##x;;. \n :oxx%%x%%%#%#@%:,, o##@@@@@###.;#x@#%#%%%x%%xx;, \n %#%%ox%;xx%x. o##@; @@##. .x%%x;x%o%#@#:. \n @#o o##@; @@##. ,:o@#,\n o@@. %@#. .:,:x@; \n o@@. %@#. oo; \n o@@. %@#. \n ;: :#@@. %@#:. \n %%o:;x%@%;. .:@@%o. .:#. \n :ooxxo,. ;%@@%%%o. \n ..,,,. ",
+ " ,,,,,,,,,,,,.. \n ,:o@@@#########%x;, \n .o@@@@@############@#o:. \n ,;x@@@##############@@@#%x, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;#%; .;x###o.@o;######;;@.o####%o. .%x, \n o@#: ,;x##%;;;o######x;;;x###%o, o@@ \n o@%, ,;o%#######x,;########o;: %@ \n o@x, :;ox#####%;o#####%x;:. .%@ \n o@%;, ...oox#######%oo:.. .%@@ \n ,o@#x:::,,::;oo;;oooooooo;oo;,::,:;;;@#x \n o#@@@%::o%#%oo##@@%%#%;%#%;.:##@%xo, \n ,::, ,o%#@@,o%##@@####%,o##x;. \n o%%o#@#;::,o%#@@#o o##@%xx@@##. ,%@@##%%x##%oxxxo. \n %x, ,;@@@@@o:;:. o##@; o@@#. ;;o@@@#x;:%;;x@#; \n o#@%: o#@%: ,:;@; \n o@@. ,@#; .::, \n o@@. :@@; \n o@@. ,@@; \n x@@. ,@@; \n ox.,:;##x .%@x, \n ,:%#%::. :%@x;o: \n .,,. ",
+ " oooooooooooo:. \n .;x#@@@##########%%;. \n .,@@@@@@###########@@#x;, \n :o#@@@###############@@##%: \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x####x,;x%######%x;,o#####%;, \n :x%##o.#::######;:#.o####%;. ,,, \n ,@%x .:o##%xxx%###%##%xxx%###x;. :x@o, \n @@o .:;x%######x.:#######%;:, :#@x \n @@o .:oo#####%x%#####xo;,. :#@o \n ;#@x. ....;;o%%%%%%%x;;:.... .:%@x, \n o#@%oooooo;,:;xxooxxxxxxxo;xxo.;;oo;;oo#@; \n .:@%%@@@x,x%##xox##@@%##%;x%#%,x@@@#%@o, \n .oo; ,;x@@#xx o##@@@@###%.x@##x: ,, ... \n o,x#%,,:x##@@;, o##@o::@@##x;o@#######@@#@#@@%:. \n . :%@@%o%, o##@; o#@#o, ,oxxoo:::; ..o@#,\n ,,. o@@;. .;@@#. :x##,\n o@@. %@% \n o@@. x@# \n o@@. x@#. \n ;%@@, .#@: \n ,%xoo%@#x. ##%: \n .oooo;. ,,,, \n ",
+ " xxxxxxxxxxxx:. \n .o#@@@@############x,. \n .:@@@@@@###########@@#%o, \n :o#@@################@@##%; \n ,o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###o.ox%######%xo.o#####%:. \n :o%##o.x::######;,%.o####%;. \n %%o ,o%##%%%%##%x%##%%%###%x; :x%#: \n @#: .,;x%######x.:#######x;:, ,;#@; \n %@#x,. .:;;%#####%%#####x;;. .o%@#, \n :%@#o, ,..,;;oxxxxxxxx;;:,.,. ,;%@#o \n .:@@%xxxoooo;.:o%%ooxxxxxxxx;%%x.;oxooxxx#@@;. \n ;##x%@#;;x#@@@oox##@@%##%oo%##:x#@@%x@x; \n o%@@#xoo o##@@@@####.x@##x; .:oooooo;; \n .;%x#x.. o###;..@@@#%;:@%###x%#@#%@x#@#@o.\n :%#o o##@; ;%@@%; :xxxxx:. .;##:\n .:@@x o@@,. .,@@@%,. ,,..\n o@#, o@@. ,o@@%: \n ;@%x; .;#@: ,@@% \n ,%@; ,;%@%; \n o; :x@@: o%#;,. \n ;ox%%%o \n \n ",
+ " ..,#@#%%%%%%%%%o:,. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%x:. \n :x#@@#################@##%;. \n :x%########################%;. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%%######o, \n ,o%###o.%xx######xo#.o#####x:. \n :o%##x.;,:######;,;,o###%x;. \n ,;x########%ox########%o: \n ..;ox######x.:######%o;:. oo.\n;x; ,::%%%########%%o::. .@@:\nx@o :,,:;;oxxxxxxxo;;:,,,. ,x@x,\n;@#x:,,,x%%##xxx,;x##oo%%%%%%%x;%#%,:x####%#%%o#@@@, \n ,oxxoo%@xoxooox#@@@;ox##@@%##%o;x##;oxxxo;%xoxoo: \n :ox%%%@@#;:: o##@@@@####.x@##%o. ,o%xx%x%x;. \n .:@@#x%, o##@: %@@##:,%o%@@@@@%xo%ox%x@x.\n :%@x:, o@@o. ,x@#x; ,:;::: .o##:\n ,#%. x@@@ %@@#;:, \n ;#%:;. :%@@. ,;%#@@ \n ,,,,. o@@, .,%@ \n .:;#@o. ,x%#@. \n ;@@o, .,,,. \n \n \n ",
+ " ..,@@@#########o:,. \n ,%@@@@@############x:. \n .,o@@@@@############@@@#x;. \n :x#@@#################@##%;. \n :x%########################%;, \n ;%##########################o, \n ;%##########################o, \n ;%####%xx%#########xx%######o, \n ,o%###o.#xo######xo#.o#####x,. \n :o%##x,;:;######;,;,o###%x: \n ,;x#####%o#####xx#####xo: \n .;ox###%x:::::o%###%o;,. \n ,::x%%########%%;:: \n :,,:;;;oooooooo;;::,:. :;.\n;%o. ;oo%xxxxxxo,;x##oo%%##%%%x;##%,:ox###%@#%,.;xo@#:\n;%%;.,;xoo;;;;;o##@@;ox#%@@%##%x:x##o;;oxo;xo;;:;;oxo,\n .:%#####@@@@#%#:,, o##@@@@@###.x@@#####%%##%%#%o. \n @#;;, o#@o, %@@#. .o:;xxxo;xxo,xxx@o, \n ##o: ;%@@. %@#;, ,##; \n ... .#@# :@@x;,,. \n .#@% .o#@@@%;, \n .,:@@x ..,;%@, \n x%%#;. ., \n .,,. \n \n \n ",
+ " ..%%%%%%%%%%%%;,. \n ,x@@@@@############x,. \n ,;@@@@@@###########@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n :x%###o.xxx######xxx.o#####x:. \n :o%##x.o,:######;,o.o####%;. \n ,;%#####%x#####%x#####%o: \n .,;ox###%o;;;;;ox###%x;:. \n ::;%%%#%%%%%##%%o::. \n ,,:: ,,,,;;oxxxxxxxx;;:,.,. .::: \n .####x%%x%xxx,;o%%oo%%%%x%xx;%%x.;ox%%%x%%%@@@% \n .:;::;:%x:xo;;##@@oox##@@%##%o;x##;:;%%xo%%o \n x%##@@@@#%%%###@o:: o##@@@@####.x@@###xxxxxxxxx: \n @o :xxo%x; o#@o, @@##. ;%#%%o#xx###%:. \n :, x@@. @@##. ,o@; \n .:#@x x@@:. :xx, \n ;@@; ,%@#o :;;o. \n ,x%%, :x#@@@#x. \n .@#x, ..,;. \n %%%x \n \n \n ",
+ " :::::::::::;,. \n ,;x@@@#########%xo: \n .,%@@@@@###########@@#x:. \n ,;%@@@##############@@@#%x: \n .;x#######################%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n :x###x.@;:######;:@.o####%;. \n .:o##%ooox######xooo%###%o, \n .:;x%###%:x%%%%;;####%o;: \n ,:ox####o;;;;%###%x;,. \n :,,, ....ooo##%##%%%oo:... .,,, \n .@@@@;:::::::::;xxo;oooooooo;xxo.;;:::::::o#@@% \n ,:::@@#%@o::xx%#%oo##@@%##%;%##x,,:@@@%@@#::,. \n :;;#@@#:::::%##@%x# o%#@@@####%.o@@##%::::::::,. \n @%:,;::%@@#@@%:;. o##@x;;@@##.:;;:%@@@@#@@#@@%o \n o: . .. o@@. @@##. .. ..;%@, \n ;#@o o@@#. ox%@, \n .:@#o %@@:. .,,. ... \n ;%@;. ,;x#%x;:o#@, \n .@#o, .o%@@##o. \n .@#%x \n ,,,. \n \n ",
+ " \n xxxxxxxxxxxx:. \n .o#@@@@###########%o,. \n .:@@@@@@###########@@#%;, \n :o#@@################@@##%;. \n ,o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.ox%######%xo.o#####%;. \n :o%##x.%::######;,x.o####%;. \n ,o%##%%%%%#####%x%%###%x; \n .,;x%###%;oo;oooo####x;:, \n .... .:;;####%%%%%%###xo;, ,xo;, \n o@#x: ,..,;;o%%%%%%%x;;:,.,. .,o@@. \n :#@#x;......,;,:o%%ooxxxxxxxx;%%x.;;:......,x#@@. \n ooox@@#@@#x;:x#@oox##@@%##%oo%##::o@@@#@@@xx: \n .:%%%x.,,;:,;o#@@o o##@@@@####.x@##%x:::,::: \n o@x;x@@#xx%%#@@o. o##@;..@@##. ,#o%@@@@#@@#o;: \n ;%x, .,%#x##%, o#@#; @@##. ,::::,;:,@@@x. \n x@@. ,#@#. ,;.;@@: \n ... #@@% %@@, :;;, ,%%%%: \n o@%:o#@x: :o@@x:,x#@; \n o@@@#%,. .;#@@@@o. \n .;:, \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .o@@@@@@#############;,. \n .:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n ;xxx, ,;o%####x:%####o;#####oo: xxxx. \n ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; \n x@#, .. .,,oox#######%oo:,,. .. %@@ \n ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ \n .@@#x;;;;;;ox.o%#%oo#%@@%%%%;%#%;,;x;;;;;;o#@x: \n .,o@@%%@@o::%#@@.o%##@@%###%,o##%o;@@@x@@%,.. \n .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: \n :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, \n ;@%, o@@%: %@@#. ,#@x: \n o@::, .:x, o@@. %@#. .xx: . @@% \n .xx; ;@, .%@@. %@@,. .o% o;:x#; \n ;@@o:;@@%: ,o@@%;:#@# ,:: \n .x#@#x: .x#@#%;. \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .o@@@@@@#############o,. \n ,:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n oxxx, ,;o%####x:#####o;#####oo: xxxx. \n ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; \n o@#, .. .,,oox#######%oo:,, ,. %@@ \n ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ \n .@@#x;;;;;;ox.o%#%oo##@@%#%%;%#%;,;x;;;;;;o#@x: \n .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. \n .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, \n ;@%, o@@%: %@@#. ,#@x: \n o@::, .:x, o@@. %@#. .xx: @@% \n .xx; ;@, .%@@. %@@,. .o% o;;x#; \n ;@@;:o@@%: ,o@@%;:#@% ,:: \n .x#@#x:. .x#@#%:. \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .o@@@@@@#############;,. \n .:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n oxxx, ,;o%####x:%####o;#####oo: xxxx. \n ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; \n o@#, .. ...oox#######%oo:.. .. %@@ \n ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ \n .@@#x;;;;;;ox.o%#%oo#%@@%#%%;%#%;,;x;;;;;;o#@x: \n .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. \n .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@#%%o, \n ;@%, o#@%: %@@#. ,%@x: \n o@::, .:x, o@@. %@#. .xx: @@% \n oo; ;@, .%@@. %@@,. .o% o;;x%; \n ;@@;:o@@%: ,o@@%;:#@% ,:: \n .x#@#x:. .x#@#%:. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########xo;, \n .o@@@@@@#############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n :;;;. ,;x##%;;;o######x;;;x###%o, :;;. \n .,%o:,,o: ,;o%####x:%####o;#####oo: x:,o%;. \n o@#, :;o%####;::::x###%x;:. %@@ \n o@#, ...oox#######%oo:.. %@@ \n ,;@x:. .:::oo;;oooooooo;oo;,;,. .#%; \n .@@#x;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o#@o \n .,o@@%%@@;::%#@@,o%##@@####%,x@#%o;@@@x@@%,.. \n ,;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n o##@##@@@x,,. o##@;. @@##. .:,x@@@@%@#%%;, \n #@% o#@%: %@@#. ,%@%; \n @#::. o@@. %@#. #@@. \n :xx, oxx .%@@. %@@,. xxx: ;;:o##; \n ##, ,;@@%: ,o@@%; ,x@. .::, \n ;%@x#@#x: .x#@#%%%: \n \n ",
+ " \n ;;;;;;;;;:;;,. \n ,;x@@@#########%%x:. \n .,%@@@@@###########@@#x:. \n ,;%@@@##############@@@#%x: \n .;x#######################%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n ,,,. :x###x.@;:######;:@.o####%;. .,, \n .oxo;o;. .:o##%ooox######xooo%###xo, ;;;xo, \n ;@#: . .:;x%###x:xxxxx;;####%o;: . %@# \n o@#, ,:ox####ooooo%###%x;,. %@@ \n .:@o, ....ooo#######%oo:... .##x \n .@@%; .,::;xxo;oooooooo;xxo.;:. .:%@o \n ;%@#%%##xxx,x%#%oo##@@%##%;%##x,;x###%#@#o,. \n .:x;oxo;;o#@@% o%#@@@####%.o@##x;xxo;%o: \n .;x%%%##%#%#@;, o##@x;;@@##.,;@#%#%#%%%#%%,.. \n ,#@%%o;x%xx, o##@;. @@##. oxxxo;xxo@@% \n ,@o, o@@o, o@@#. ,x@x, \n ,#xoo. o@@. %@#. ., .o@%, \n ,,, .,. o@@. %@#. ., .:o%%o \n %o. .;#@%. ;#@x:. ,;o. \n %%%;o%#@x: .:@@@o;x##, \n ,;oooo,. ..:ooo; \n ",
+ " \n xxxxxxxxxxxx:, \n .o#@@@@############o,. \n .:@@@@@@###########@@#%o, \n :x#@@################@@##%;. \n ,o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.ox%######%xo.o#####%:. \n ,xx;. :o%##o.x::######;,x.o####%;. .xxo \n x@:..: ,;%##%%%%%#####%x%%###%x; .: :x@, \n x@o, .,;o%###%oo;;;;;o####x;:, :%@, \n ,@%;. .:;;%###%%%%%%###x;;. .%##. \n .x@#x,. ,..,;;oxxxxxxxx;;:,.,. .;#@o. \n ,x@%xooxxxx,:o%%ooxxxxxxxx;%%x.;oooooox%#@,. \n .@%%@#;::%##@oox##@@%##%oo%##:::#@#x@#o \n :o;;;oo%@@@x;; o##@@@@####.x@#@@#o;;;;;;;. \n .:#x%@@##@@;.,. o###;..@@##....,,:@@@@%@@%##%, \n .%@x, o##@;. @@##. :%@o, \n ;#@,,,, o@@,. ,#@#. . :@#; \n :o;;, o@@. %@#. .o;ox%, \n o@@. %@#. ::, \n :, ,%@@. ;#@%;. .;. \n #%;..:o@@%, .:@@@o,:o@, \n :%%%%%;, :o#%%x. \n ",
+ " \n .,:@@@#########x;:. \n :#@@@@@############%:. \n .:o@@@##############@@@#%o. \n :x#@@#################@##%;. \n ;x#########################%;, \n ;%##########################o, \n ;%##########################o, \n ;%####%xx%########%xx%######o, \n ,o%###x.@xo######[email protected]#####x,. \n ,;x##x,::;######o:;:x###%x: \n oxx: ,;x%####%;#####xo#####xo: \n @%, .;;x%###%:::::o%###%o;,. ::oo \n %##o,. ,,,xx%########xx;,,. ,:;@@. \n :x@%o, :,,:;;;oooooooo;;;:,:, ,%@@@; \n .x##%%%%%xo,,ox##oo%%##%%%x;##%,:;%xxxxx#@@#%;. \n ,::::;;x%##@@@:ox#%@@%##%x:%@####;;;;;;;;:. \n .,#@@#@@@#%#@,,,. o##@@##@###..,,@#x#@@@@@@@@%x. \n ,x#%o;, o##@; @@##. o%#x: \n @#: .x@@;. o@@#. ;@@:\n %x:,:, %@@ ;@%: :;o%o,\n ,::. #@@ :@@o, .,,. \n #@# ,@@x. \n #@# :#@%. \n .. .,@#o .;@@x:, \n ,;oo%@@x, o%%%, \n .,,,, ",
+ " ::::::::::::,. \n ,;x@@@#########%xo: \n ..%@@@@@###########@@#x:. \n ,;%@@@##############@@@#%x: \n .;x#@#####################%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n :x###x.@;:######;;@.o####%;. \n ,:o##%ooox######xooo%###%o, \n .:o%####x:%%%%%o;####%o;: \n ;;: ,;ox####;;;;;%###%x;,. \n @@o ...oox#######%oo:... \n ;%#o;: ,::. ::;xxo;oooooooo;oxo,:,,:,. .,x##% \n .:@o:,,,::::;oox%#%oo##@@%##%;%#%ooxx:::,,,::ooo \n ,x##%###%##@x#@#.o%##@@####%.o#x@##%#######%o,. \n ,o@xox;xxx::;o o##@%oo@@##. ;;:;ooxo;ox;%@#;, \n x##, x#@@; @@##. .,o@#:\n @%. ;#@x o#@;, .;##:\n :o%x, ,o@@o ,@@o, ,,,.\n :#@o @@% \n :@@o o#@o. \n :#@; :%@o, \n :x@; ,#@%; \n .,o#x, o%%x. \n :o;: ... ",
+ " xxxxxxxxxxxx:. \n .o#@@@@###########%o,. \n .:@@@@@@###########@@#%o, \n :o#@@################@@##%;. \n ,o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.ox%######%xo.o#####%;. \n :o%##o.x::######;,%.o####%;. \n .,o%##%%%%%#####%x%%###%x;. \n .,;x%###%;ooooo;o####x;:, \n .:;o####%xxxx%###xo;, ..,. \n @#%% ,..,;;oxxxx%%%x;;:,.,. ,;%@# \n @@#o;;, ,:o%%ooxxxxxxxx;%%x..,:oox%@%; \n ,,,,::,:;x##@@@oox##@@%##%oo%@###%:::::,,,,. \n ;%@@#@@@##@@:ooo o##@@@@####.:o:@#%#@@@@@@@#x;: \n ,o#@:.......... o%@@%;.,@@##x: ............x@@%;.\n @#o ,:#@@o o#@#o, ,@@;\n @%:. .;%@@;, .;@@@o. ,x%%:\n :oo. .%@@@ ,x@@o, \n .#@%, ,@@#% \n #@%, .;@@% \n ,o%#%; @@% \n ,;, x%x \n ;%x. \n ",
+ " ..,###%%%%%%%%%o:,. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%x: \n :x#@@#################@##%;. \n :x%########################%;. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%%######o, \n ,o%###o.xxx######xx%.o#####x:. \n :o%##x.;,:######;,;,o###%x; \n ,;%#####%o#####xx#####%o: \n ..;ox###%x:::::ox###%o;:. \n xxo; ,::%%%########%%o::. ,ox%x \n .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@# \n ,%#xxx;.,;x##oo%%%%%%%x;%#x,,;oxx%#@o. \n :::;;;;;;;o#@@@;ox##@@%##%o;%@###o;;;;;;;;;, \n ,o%@@@%@@@@@@@@;:: o##@@@@####.,:x@@%@@@@#%@@###x. \n x#@,. .,#@@@o, #@@##; ,%@#,\n @x. :o%@x:, :x@#x; .;@@:\n ;xxo. .,%#@#. .#@@#:. .,,,.\n ... ,o@@x: :x@@%; \n x@,. .,#@x. \n %@ ;@@; \n o#o;: .o@o \n .;;; o%#, \n \n ",
+ " .,#@#%%%%%%%%#o:,. \n ,%@@@@@############x:. \n ,;@@@@@############@@@#x:. \n :x#@@#################@##%;. \n :x%########################%;. \n ;%##########################o, \n ;%##########################o, \n ;%####%%%##########%%%######o, \n ,o%###o.%xx######xo#.o#####x:. \n :o%##x.;,:######;,;,o###%x;. \n ,;%#####%o#####xx#####%o: \n ..;ox###%x:::::ox###%o;:. \n .@#%x ,::%%%########%%o:: :x%@# \n .@#o, :,,:;;oxxxxxxxo;;:,.:. .:%@# \n ,%@@#%%%.;x##oo%%%%%%%x;%#x.,;x#%#@@;. \n .:. ,:o%@@;ox##@@%##%o;x###o;xx:..,, ,:::. \n .:ooxxxxxxxxx%##@%:.o##@@@@####.x@@###%%%%@@#@@#%##; \n @@x:;x#xx%###%o%,.,#@@@o, %@@##; ;%%%xo .:##:\n :x%x. :x#@x:, ,x@#%; .,,,.\n ,,:%@@#. #@@#:, \n .;%#@@@x: ,o@@@#;. \n :@#;... ...,@@x \n :@%o .;;@% \n ... ;;;, \n \n \n ",
+ " .%%%%%%%%%%%%;,. \n ,x@@@@@############x,. \n .:@@@@@@###########@@#%o: \n :x#@@################@@##%;. \n :x%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%###################o, \n :x%###o.oxx######xxx.o#####%:. \n :o%##o.o,:######;,o.o####%;. \n ,;%#####%x#####%x#####%x: \n . .,;o%###%o;;;;;ox####x;:, \n @#xo: .:;;%%%#%%%%%##%%o;:. ;x%@% \n .@#o,: ,.,,;;oxxxxxxxx;;:,.,. .:%@# \n :#@@xxxx,;o%%ooxx%%xxxx;%%x.;oxxx#@@o, \n .##x;:%#@oox##@@%##%oox##;:;#%o. ,,,, \n .;oooo; ;ox#@#; o##@@@@####.x@@###oooxxxx#@@@@%: \n @@x::x@@@#%@@@##,.,%#@@x: .@@@##;.. o###%x@;.....:##:\n :;;;. xxo;xxo, :o%@%;, :%@#x; .:::.\n .,,,o#@@,. ,@@@%,... \n .:@@@@@%: :x@@@@@;. \n :@%;,,. .,,,%@x \n :@%x. ,;@x \n ... .::, \n \n \n ",
+ " ;;;;;;;;;;;;,. \n .:o%@@@#########%%x;. \n .,#@@@@@###########@@#x;, \n ,o%@@@##############@@@#%x: \n .;x########################o,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x,:x########x:,x######;, \n :o###o.@;:######;:@.o####%;. \n .:o##%xxxx######%xxx%###x;. \n :::: .:;x%###x:xxxxx;;####%o:: :::::, \n ;%#;o# ,:ox####ooooo%###%o;,. %x::%%# \n x@%::x ....;;o%%%%%%%%o;:... o; o#@ \n :x@#x;;;;;::;xxo;oooooooo;xxo.;;;;;;ox#@x \n .::,. ,,o@@@#x.x%#%oo##@@%##%;%%#x,,:@@@@;:,.,:;:. \n ;@x#x, .:#@@% o%#@@@@###%.o@@##%::::::;#@x;x%, \n :xx:o@o;;:;ox#@o, o%@@@x;;@@##::;:@@@@@@#@@#o:..oo, \n .#xo;:::: .:#@@x. x@@#; ,,::.. \n ;;.@#%x :x@@x, ,#@#o ox#@;, \n .@####@@%. x@@@%%@@@o \n :oo;:. .:;ooo,;, \n \n \n \n \n ",
+ " \n .,:@@@#########o;,. \n :#@@@@@############%:. \n .,o@@@##############@@@#x;. \n :x#@@#################@##%;. \n :x#########################%;, \n ;%##########################o, \n ;%##########################o, \n ;%####%xx%########%xx%######o, \n ,o%###x.#xo######[email protected]#####x,. \n :ox##x,::;######o::,x###%x: \n ,;x%####%;#####xo#####xo; .,,,, \n .o%xx%o .;ox####%:::::o%###%o;,. ,#xx%:. \n :@@#: ;o ,,,xx%########xx;,, .x, .#@# \n ;@@%: .. :,,:;;;oooooooo;;;:,:, %@@ \n ,@%o;;;;;;;ox,;x##oo%%##%%%%;##%::;o::::::;%@#o \n ,o@@##@@x;;o%@@:ox#%@@%##%x:x##o;o@@@#@@@;:, \n .,,,x%%@@x. o##@@@#@###.o@@##%:::,:. \n :x#@@@#;o, o##@:. @@##. .o;%@@@@@#o, \n %@@:,,. o@@;. #@@#. .,,,;@@#; \n @@,,. :oo; :#@@ o@@:. ooo ,@@; \n :o%%: %@o..;@@x, .;#@%:,x#@.;ox@:. \n :x@@@@%. o#@@@@x :o; \n ,:,. .,,,. \n \n \n ",
+ " \n ::::::::::::,. \n ,:o@@@#########%xo, \n .x@@@@@############@#o:. \n ,;x@@@##############@@@#%x, \n :x#@##################@##%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;x########%;;x######o, \n :x###x.@o:######;;@.o####%;. \n .,,,. ,:x##%;;oo######xooox###%o, .,,: \n ;xo;;;: .;o%####%:%%%%%o;#####o;: %o;xo: \n ;@#: :, ,:ox####;;;;;x###%x;:. . %@@ \n o@#: ...oox#######%oo:.. %@@ \n ,x@%o, .,;:;ooo;oooooooo;ooo,;:. .,@@@ \n .#@@xoooooxxx.o%#%oo##@@%##%;%#%o,;xoooooox@@o. \n ;@@%%@#o::#@@@.o%##@@####%.o@##o;#@#x@@% \n .ooooo%##@%: o##@%oo@@##.:x@###ooo;oo, \n :%@@#%@@x.. o##@o. @@##. ..o@@@#%@@#x \n o@x, o@@%: x@@#. o%@;, \n o@;;, .%%o o@@, %@#. ,xx: . .;@%: \n .oo: :@#;..;#@@. o@@o,.,%@% .;ox%x. \n .:@###@#; ,o@@@#@x: ,,, \n ;xo:. :;o;. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########xo;, \n .o@@@@@##############o:. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n :;;; ,;x##%;;;o######x;;;x###%o, ;;;, \n .;#;,,x, ,;o%#######x:o#xx#####o;: :x,,ooo \n o@%, :;ox#####%:o#####%x;:. .#@ \n o@#: ...oox#######%oo:.. x@@ \n ,:@%;. ..;::oo;;oooooooo;oo;,;:. .,@x, \n .#@@x;;;;;oox.o%#%oo##@@%%%%;%#%o,;x;;;;;;x@@; \n .o@@%%@@o::%#@@.o%##@@####%,x@#%o;@@#x@@%. \n .:;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n :%#@@@#@@%,,. o##@;. @@##. .,,x@@@@%@#%%o, \n x@#, o#@%: %@@#. o#@o, \n x@::. .;x: o@@. %@#. ,xx: .@@o \n ,xo: :@,. ,%@@. %@@:. ,#% .x;;x#: \n :@@o;o@@%, .;@@#x;@@% ::: \n x###o, o%#%o, \n \n ",
+ " \n oxxxxxxooooo:. \n .o%@@@@###########%o,. \n .:@@@@@@###########@@#%;, \n :o#@@################@@##%; \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.ox%######%xo.o#####%;. \n :o%##x.%::######;,%.o####%;. \n .,o%##%%%%###%%#%%%%###%x;. \n .,,: .,;x%######x.:#######x;:, :oo,. \n @%; .:;o%####%x%#####xo;,. .,x@o \n @#: ,...;;o%%%%%%%x;;:.... .:#@o \n x#@%;, .:::o%%ooxxxxxxxo;x%x.;:: ,o%@#, \n .;x@@##%#@#xxo:%#@xox##@@%##%oo%##:;x###%#####x; \n ,;;::;;xox#@#o o##@@@@####.x@##%o;;;:oo; \n ::x#@#@@@@%x#:. o###;,,@@##..,@xx@@@@#@@@%:,. \n ,#@%:o:;oo;, o##@o. @@##. .oooo:;o;;@@x \n ,@;. : o@@:. ,#@#. .o@#, \n .x%xo. o@@. %@#. .; ,o@;. \n .,. ,,. x@@. #@#. .,,, ,x%x, \n #%, .,%@@x. :%@#;. ,;@. \n ;%@%#@@%;, .,%@@#x#@o. \n .,:::, .:;;:, \n ",
+ " ............. \n .,:@@@#########xo:, \n :@@@@@@############%;, \n .:x@@@##############@@@#%o. \n :x#@@#################@##%;. \n ;%##########################;, \n ;%##########################o, \n ;%##########################o, \n ;%####%oo%########%oo%######o, \n .;x###x.@xo######[email protected]####%o,. \n ,;x##x:::o######o:::x###%o: \n ,;x%#######%;o########xo: \n :;o%#####x:;#####%%o:, \n ,,,xx%#######%xx;,,. \nxx; ....;,:;;;;oooooooo;;;:,:,.. %%:\no@%:,,:::::;oooo:ox##oo%%##%%%%;%#%;:;o#o;::::,,:::@@:\n :x@@;::::::oxxx##@@,o%#%@@%##%x:x##xxox;;::::,;@@@;,.\n .,:%#@%#@@@%%@x,:, o##@@##@@##.;%o##x@@####@##o:. \n ;%@@oox:oooo. o##@;. @@##. oooo;oo;o#@@;. \n @#: o#@@:. @@@#. ..,@#:\n @%, :, o@@. %@#. ;..,@x,\n :xo:. o@@. %@#. ,ox%:. \n o@@. %@#. \n ,x@@. %@#,. \n %x, .:o@@x :#@%;, .:@. \n ,o##@@@:. ;%@@##%;. \n ",
+ " ;ooooooooooo,. \n .;x%@@@#########%%%;. \n .,#@@@@@###########@@#x;, \n ,o%@@@##############@@@#%x: \n .;%########################o,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x,;x%######%x;,o######;, \n :o%##x.@;:######;:#.o####%;. \n .:o##%xxx%######%xxx%###x;. \n .:;x%######x.:#######%o:, \n ,:oo#####%xx#####%o;,. \n ....;;o%%%%%%%x;;:.... \n.,. :;;,:;xxooxxxxxxxo;xxo.,:;;. ,, \nx#o ,:;.:::%%##%oo##@@%##%;x%#xxo:,xx, .%%:\n:xo:x%%xxxxxo@@@#%%% o##@@@@###%.o##@@##%xxxxxxxxo;#x,\n ;%@#%#@x@@@@;::, o##@o::@@##. :;::o###x%#x@##@o, \n @%, o##@; x#@#. .,@@;\n x%x:. o#@x. ,o@x: .:;@%,\n ,,, %@@ ,@#; ,::, \n %@@ :@@; \n %@@ ,@@; \n ;@@, :@#; \n ..%@@; ,%@x, \n ;x::x@@o, ;#@o,;x. \n .;:, ,xoo; ",
+ " ..###%%%%%%%%%o:.. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n ,o%###o.%ox######xx%.o#####x:. \n :o%##x.o,:######;,o.o####x;. \n ,;%#####%x#####%x#####%o: \n .,;ox###%o;;:::ox####o;:. \n ,::%%%########%%o::. \n :,,,;;oxxxxxxxo;;:,.,. \n ,. .oxo,;o#%oo%%%%%%%x;%#x.,;xx, .o%x \n :::::::::::;#@@@;ox##@@%##%o;%@##x::::::::::::, \n ,;x@@@@@#@@@#@@@o:: o##@@@@####.,;%@@@#@@@@@@#@@#x. \n @@% o#@x, @@@#:. ,x@%,\n @#o x@@. :x@%: .o@@;\n ... .#@# .@@x ... \n #@% @@% \n #@x @@% \n #@x @@% \n %@% @@% \n .,##o @@x \n ,..;@o, :#@;. \n :xx; ,xx: ",
+ " .,,@@@#########o;,. \n :#@@@@@############%:. \n .,o@@@@@############@@@#x;. \n :x#@@#################@##%;. \n :x#########################%;, \n ;%##########################o, \n ;%##########################o, \n ;%####%xx%#########xx%######o, \n ,o%###o.#oo######xo#.o#####x,. \n :o%##x,:,;######;:;,o###%x: \n ,;x%####%o#####xx#####xo: \n .;ox####x;::::o%###%o;,. \n .,,, ,::xx%########%%;::. .,,. \n o@@%, :,,:;;;oooooooo;;::,:. ;%@@: \n .,;@@@#@@#%.;x##oo%%##%%%x;##%,:x@@@@#@@#... \n .;;;, ,::;;:,o%@@:ox#%@@%##%x:x##o;ooo;..,:,;;: \n %%%x@@%###%###%@@x, o##@@@@@###,x@@#%%%%%x@%%@####%o.\n @x .o;;;ooo;x. :x@@o, x@@##; oxx%xxox, .;##:\n ,. .#@#: ,o@@#x. ,,,.\n ;#@: x%@@. \n ;@o. :@x: \n o@ :@@; \n o@,. ,@#; \n ;@@: :x@, \n ,o@; .o%o \n ;%%,. \n .,: ",
+ " ..###%%%%%%%%%o:. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%o: \n :x#@@################@@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n ,o%###o.%xx######xo%.o#####x:. \n :o%##x.o,:######;,o.o###%x;. \n ,;%#####%x#####xx#####%o: \n .,;ox###%x;::::ox####o;:. \n @#xo ,::%%%########%%o::. :x%@% \n .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@@ \n ,%@@%%%%,;x#%oo%%%%%%%x;%#x,;x%%%#@@o. \n .:::, .o%%xo;%@@;ox##@@%##%o;x##;ox%xo; .,::: \n xxx:@@#ooxxxxxx#@%: o##@@@@####.x@##%o ;ooxxx#@@##x: \n @x .##%x##%x#, ,x#@x, #@@##;:#x%@@@@@#o, .:##:\n :. #@#; :x@@#x ,;;;;: .:::.\n ,;#@: x#@@;, \n ##o .o@#o \n @# ;#@ \n @#, .:@@# \n x#@;. :##o. \n ,ox, \n \n ",
+ " oooooooooooo:. \n .;x#@@@##########%%;. \n .,@@@@@@###########@@#x;, \n :o%@@@###############@@##%: \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;x####x,;x%######%x;,o#####%;, \n :o%##x.#::######;:#.o####%;. \n .:o##%xxx%######%xxx%###x;. \n :::;..:;x%###%:ooooo;o####%;:, .:::. \n @#%x: .:oo####xxxxx%###xo;,. :xx#o: \n @@x: ....;;o%%%%%%%x;;:.... ,;#@# \n o#@#;;;;::oxxooxxxxxxxo;xxo.;;;;;x#@x: \n .,,;: ..,@@#%,x##xoo##@@%##%;x%#%:x@@@#x,. ...., \n o#%o%@%;:, :;;#@#x o##@@@@###%.x@##x: ,:;x@@xo%x. \n ;x. ,:,%@@###%@;, %####o,:@@##x;o@###%%%##@#:,.,x%, \n ,xoo: #@@% o#@@%o .x%%%xx:. \n ..:x@x, .;@@@x;:. \n ,#@@@ .:##@@;. \n :@x;, ,o#@, \n ,@o;, ox#@. \n ::;; ::,, \n \n \n ",
+ " ............. \n .:;@@@#########xo;, \n ;@@@@@@############%;, \n .:x@@@##############@@@#%o, \n :x#@@#################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%oo%########%oo%######o, \n .;x###x.@o;######[email protected]#####o, \n ,;x##x:::o######o:::x###%o: \n ,;o%####%:#####oo#####xo; \n ,x%x#, :;o%####:::::x###%%;:, #%x%;, \n .@@o #, .,,xxx#######%xx;,,. %;.o@# \n .@@%;:,..;::;o;;oooooooo;o;;,;,..:;o#@% \n ::, o%%@@@#.o%##oo####%%%%;%#%::x@@@@#x, ,:: \n :xx#%; ::::x#@@,o%##@@%###x,x##xo:::,, .;%%%x, \n :xo,;@@#x::x##@#o :x##@@%%@@##:o#@##%:::::x#@#:,x, \n .o;x@#x;:;. %#@@:. ;@@##:.;::;;@@@@x;: \n ;xxx.,;@@x ;@@x: x%%;..:. \n @@x::x@@, .,@@@;ox#@,o% \n o@@@@#x .;#@@#%.., \n \n \n \n \n ",
+ " \n oooooooooooo:. \n .;%#@@@##########%%o. \n .,@@@@@@###########@@#x;, \n :o%@@@###############@@##%: \n ,o%########################x,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;x####x.;x%######%x;,o#####%;, \n :o%##o.#::######;,#.o####%;. \n .,o##%xxx%%#####%xxx%###x;. \n .;;;; .:;x%###%;ooooo;o####x;:, :;;;o: \n ;#%;;# .:;o####xxxxx%###xo;,. xx,:%#@ \n x@x,,x ,...;;o%%%%%%%x;;,.... ;: o@@ \n ;#@xo;;;;;::;xxooxxxxxxxo;xxo.;;;;;;;x##;.,. \n xo;;xo%@@@@%,x#@xoo##@@%##%;x%#%:x@@@@@#:.:;xx \n .:x#o, .:;#@#x o%#@@@@###%.x@##x: ..:o@o:: \n ;@@#%x%###@;. o##@o,,@@##..;@###%xxx%@@%. \n .oxxo%x;, ;x@@, o@@#. :o;@@@@x: \n x%x:...#@@. ,x@#o, xxx; ,@x \n #@x::o@@x: .;@@#;:x@% :o@; \n ;%@#@@%. .;%@@@% xxo, \n .:;:, \n \n \n ",
+ " \n .,,,...,,,,,. \n .:;@@@#########xo;, \n .;@@@@@@############%;, \n .:x@@@##############@@@#%o. \n :x#@@#################@##%;. \n ;%##########################;, \n ;%##########################o, \n ;%##########################o, \n ;%####%oo%########%oo%######o, \n .;x###x.@o;######o;@.o####%o, \n ,;x##x:::o######o:::x###%o: \n ;xxx, ,;o%####%:#####oo#####xo: xxxx. \n ,;#;, oo :;o%####:::::x###%x;:. %:.:#x: \n x@#, .. .,,,xxx#######%xx;,,. ,. %@@ \n ;@@o:. .:,:;o;;oooooooo;o;;,:,. .%@@ \n .@@#x;;;;;;oo.o%#%oo%%##%%%%;%#%;:;x;;::;;o#@%: \n ,:x@@##@@o::x#@@,o%##@@%###x,o##xo;@@@%@@#:,. \n :::::%##@#o o##@#%%@@##.;#@##%::::::: \n ,x#@@#@@%,:. o##@; @@##. .:,%@@@@#@@%x;, \n ;@#: o#@#: #@@#. ,#@x: \n o@::, ,;x, o@@. %@#. ,xx: . @@% \n .xx; ;@,. .x@@. %@@,. ,x% x;:o#; \n ;@@o:;#@%: ,o@@x;:#@# :;; \n .x#@@%:. .x#@#x:. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########%x;, \n .x@@@@@############@#o:. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;x########%;;x######o, \n :x###x.@o:######;;@.o####%;. \n ;oo;. ,;x##%;;;o######x;;;x###%o, :oo. \n .:%o:.,;. ,;o%####%:%%%%%o;#####o;: x:,;%o, \n o@#, ,;ox####;;;;;x###%x;:. %@@ \n o@#, ...oox#######%oo:... %@@ \n ..@%;. .;::oo;;oooooooo;oo;,;:. .:@%: \n %@@xooooooox.o%#%oo##@@%%#%;%#%o,;xoooooox@#; \n ;@@%%@#;::%#@@.o%##@@####%.o@#%o:@@#x@@x. \n .;;;;;;%##@%; o##@%ox@@##.:%@##%;;;;;;: \n o%#@##@@@x.,. o##@; @@##. .,.x@@@#%@#%%o: \n #@% o@@%, %@@#. ,%@%; \n @#;:. o@@. %@#. @@# \n :oo, oxx. .x@@. %@@,. ;oo: :o:x%x \n %@o .;@@#: ,o@@x: ,x@. .::. \n .;##@@#x: .x#@@@@@: \n \n ",
+ " \n xxxxxxxxxxxx:. \n .o#@@@@############o,. \n .:@@@@@@###########@@#%o, \n :o#@@################@@##%;. \n ,o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n :x%###x.;o%######%xo.o#####%;. \n .xx; :o%##x.x::######;,x.o####%;. ,xxo, \n o@%,,; ,;%##%%%%%#####%x%%###%x; :: ,x#x \n x@%, .,;x%###%;o;oo;oo####x;:, o@@. \n ;#@;. .:;;%###%%%%%%###x;;, o#@. \n .@@%, ,..,;;oxxxxxxxx;;:,.,. ,x@x. \n ,#@%;;;;oo;:::o%%ooxxxxxxxo;%%x.;;:;;;;;x%@;, \n :@@%#@@%xo:x#@oox##@@%##%oo%##:;x@@@%@@%. \n oooo#@#o o##@@@@####.x@##xoo, \n ,,;%#####@#x#:. o###;..@@##..:@x%@###%##x,,. \n .%@#;x;;ooo: o##@o @@##. :oxoo;xoo@@; \n ,@o. ,. o@@,. ,#@#. ..%@: \n .xxoo;. o@@. %@#. :: ,#@: \n ,,, .x@@. %@@. .;x%o, \n o; .,#@#; :x@#o, .o. \n %#%;x%@#;. .,#@@#:;x@, \n ,o%%; .%%%x \n ",
+ " ............. \n .:;@@@#########xo:, \n ;@@@@@@############%;, \n .:x@@@##############@@@#%o, \n :x#@@#################@##%;. \n ;%##########################;, \n ;%##########################o, \n ;%##########################o, \n ;%####%oo%########%oo%######o, \n .;x###x.@o;######[email protected]####%o,. \n .. ,;x##x:::o######o:::x###%o: .. \n o%%o, ,;o%####%:#####oo#####xo: .;ox: \n @@: :;o%####:::::x###%x;:, .## \n x@#o,. ,,,xxx#######%xx;,,. .;%@% \n ,x@%;. :::;o;;oooooooo;o;;,:, .:#@@; \n .x@@x::::::o%,ox##oo%%##%%%%;%#%::ox;:::::o@#;. \n :%@##@@o::x%@@,o%##@@%###x,x##x;;@@@%@@x. \n .,:::::x##@#o o##@#%%@@##.o#@##%::::::, \n .;o#@@@@@@@%:;. o##@; @@##. .;:%@@@@#@@%x;, \n :#@#,.. x@@%. #@@#. .. . ,@@##,. \n x@, ., o@@: ;#@;, %@o \n ,o%xo: ,o@@x :@@;. o:.;##. \n ,o#@x, .:@@#; ;oo, \n ;:;o@@%:. ,;%@#xo \n .##%:,. .;x%##, \n ,,,: .. .. \n ",
+ " oooooooooooo:. \n .;x#@@@##########%%;. \n .,#@@@@@###########@@#x;, \n ,o%@@@###############@@##%: \n ,o%########################o,. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x,;x%######%x;,o#####%;, \n :x%##x.#::######;:#.o####%;. \n .:o##%xxx%######%xxx%###x;. \n ::: .:;x%###%:oxooo;o####%;:, .:::.\n @x, .:oo####xxxxx%###%o;,. .,#@:\n @@o, ,...;;o%%%%%%%x;;:..,. .:x@#:\n ;#@#o, :;:::;xxooxxxxxxxo;xxo.;;;;. ;%@@o, \n .:#@#%%%%%%%##,x##xoo##@@%##%;x%#%:o##%%x%%%#@#x, \n :x%oo%x;:;#@#x o##@@@@###%.x@##x;x%x;%%o \n ,oxxxxx%##@o, o##@o::@@##.,o@###xxxxxxo. \n :%@#%##xx##%o ,%@@, %@@#. ;###%o#xx#@@%, \n ;#@;. .#@# o@@o, :;x@o, \n ##, ,, :x@@o ,@@#x, .: .;@x, \n :x%x;, .:x@@@#,. x%#@%o: ,;ox%o. \n .. ,x@@#;. .x@@#,. ... \n :@#o, ,:x@o \n :@x:, ,,:@o \n ;;: :;;. \n ",
+ " ..###%%%%%%%%%;:. \n ,x@@@@@############x,. \n ,;@@@@@############@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n ,o%###o.xox######xox.o#####x:. \n :o%##x.o,:######;,o.o###%%; \n ,;%#####%x#####%x#####%o: \n .,;ox###%o;::::ox###%x;:. \n .:::%%%########%%o::. \nx%; ,,,,;;oxxxxxxxo;;:,.,. xx,\n%@%;. ..oxx:;o%%oo%%%%%%%x;%%x.;oxx, .;#@;\n x#####@@##@@xx%:%#@;ox##@@%##%o;x##.;%o@@#@@@####@#;.\n .oooo;::;;.,o#@#; o##@@@@####.x@#xo, ;;:;;;oooo; \n .,;oxx#####@#%#: :x#@x, @@##,.,@x#@@##%@#%%%xo, \n ;%@@oxxx;;xxo;. ,;#@#; ,%@##; :oxo;;ooooo%@@o: \n @%:. ,o@@: :@@#x, ..;@# \n x%xo:. ,;x%@@o ,o@@@o;: ;oo#%; \n .,,. .:#@@@o:. .,o#@##;, ,,,, \n o@%, .o@# \n ;@%, .@# \n . .;;: \n \n ",
+ " .,###%%%%%%%%%o:.. \n ,%@@@@@############x:. \n ,;@@@@@############@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n ,o%###o.%xx######xo%.o#####x:. \n :o%##x.;,:######;,;.o###%x;. \n ,;%#####%o#####xx#####%o: \n .,;ox###%x;::::ox###%o;:. \n .,::%%%########%%o::. \n :,,,;;oxxxxxxxo;;:,.,. \nox: ...x%%:;x#%oo%%%%%%%x;%#x,:o%%,.. ox,\n%#x,,,,::x#@@xx%:%@@;ox##@@%##%o;x##.;%o@@%:::,,,,,##:\n:;;::::;;xx;:.,;%@#: o##@@@@####.x@#x: ::::;;:,,::;:.\n ,x@%##%%x;,,x#@@o,,%@@@x, %@@##:,#@#%:,:;########:, \n @#o:;ooo#@@@@#o,:o%@@%: :x@#x; ;%@@@@@o;;ooooo@#,\n @%o,. ..,::::%#@@x, .o@@@#:,::,,. .:o@#:\n ,;;. :o@#@@@@x;: :;o@@@@#@%: :;;. \n %@x..... .....o#@ \n ;xx ;%@ \n . ... \n \n \n ",
+ " ..%%%xxxxxxxxx;,. \n ,x#@@@@############x,. \n .:@@@@@@###########@@#%o: \n :x#@@################@@##%;. \n :o%########################x:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%####################o, \n :x%###o.xxx######xxx.o#####%:. \n :o%##x.o,:######;,o.o####%;. \n ,;%#####%x#####%x#####%x: \n .,;o%###%o;;;;;ox####x;:. \n .:;;%%%#%%%%%##%%o;:. \n ,..,;;oxxxxxxxx;;:,.,. \n . .xxxx:;o%%ooxxxxxxxx;%%x.;o%x;, ,;:. \n x##:,;%%#@@@#%%,x#@oox##@@%##%oo%##,o#x@@#xx;,;%#@: \n ::::::ox;:::..:%@#; o##@@@@####.x@#x: ::;@x::;;;:. \n x##%#x,.....;x#@o,,%#@@x: .@@@#%;:@@#x.....,,;#%%@o:.\n @#:.;%@@@#%@@#o::o%@@#; :%@#x; o#@@@@@@@#xo;:%@@:\n .,::..,,:::::,,x#@@%:. ,x@@#%,,::::,,,. :oo,. \n x#@#@@@@%o: :ox@@@@#@#x \n ;o,.,,,. .,,,.,x@ \n \n \n \n \n ",
+ " :::::::::::;,. \n ,;x@@@#########%xo: \n .,%@@@@@###########@@#x:. \n ,;%@@@##############@@@#%x: \n .;x#######################%o. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####x::x########%::x######o, \n :x###x.@;:######;:@.o####%;. \n .:o##%ooox######xooo%###%o, \n .:ox%###x:x%x%%o;####%o;: \n ::, ,:ox####ooooo%###%x;,. ::, \n .@#; ....oox%%%%%%#%oo:... .%@@ \n .##%o::::;:;xxo;oooooooo;xxo,;;:::;x#@% \n :x@@@@#.o%#%oo##@@%##%;%##x,x@@@@@o, \n .,. ..%@@#.o%#@@@####%.x@##;. .. ... \n o@o. ,o@x: o##@x;;@@##.:x@#x; :x##, \n ;#x, . :x@, x@@, @@##. .##%o. . ;%#; \n ,;% :;: o#@%. ;%@:. :;;.:%,. \n x#% #@%..,o@@x :@@%:.,o#@,;#%: \n ;%@@@@@o, o#@@@@@o. \n .,;::, .,::,, \n \n \n \n ",
+ " \n .,###%%%%%%%%%;:.. \n ,%@@@@@############x:. \n ,;@@@@@@###########@@#%o: \n :x#@@#################@##%;. \n :x%########################%:. \n ;%##########################o, \n ;%##########################o, \n ;%#####%%##########%%#######o, \n ,o%###x.%xx######xo%.o#####x:. \n :o%##x.;,:######;,;.o###%x;. \n ,;%#####%x#####%x#####%o; \n .,,,..,;ox###%x;::::ox###%o;:. .,, \n ;##xx, ,::%%%########%%o::. .xx#; \n %@#o.. :,,,;;oxxxxxxxo;;:,.,. ;x@o \n ;xo#@##,;x%%oo%%%%%%%x;%%x,;x#@@#xx. \n ;%%o. :;;;;%@@;ox##@@%##%o;x##;::;;, .xxx, \n ;#x, ;%#@%: o##@@@@####.x@###% .;%@, \n ,;:. ;%@x, o##@; @@##. ,%;%@x. .::. \n o@#, o#@@; @@##. ,:#@o. \n .;%,. ;oo. o@@, %@#.,oo;, .x%; \n ,x##: @#x .x@@. %@@,,;x@; xx%o \n @@%;@@#: ,x@@%x@@; \n ,%@@#;. ,#@@@, \n \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:;@@@#########xo;, \n .o@@@@@@############%;, \n .:x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;ox######o, \n .;x###x.@o;######[email protected]####%o. \n ,;x##%;;;o######o;;;x###%o: \n ,;o%####%:#####oo#####xo: \n .;%o%: :;o%####;::::x###%x;:. .xxo:. \n @@x #: .,,xxx#######%xx:,,. %o:@%; \n @@x.o, .:::;o;;oooooooo;oo;,;,. o:,%@% \n ,o;: x#@%;;ox.o%##oo##@@%%%%;%#%;,;x;;x@@%; ;;: \n :%%:x; ,,,@@%:x#@@,o%##@@%###x,x##%o;@@x,,. %oox%. \n ;; ,o#@%; o##@#%%@@##.;#@##%: ,x;. \n ;%@@:. o##@; @@##. .:,x@@o: . \n ,#@#: .: o#@#: #@@#... :@@o \n ,@@, :x% o@@. %@#.;x; ,::%x \n ,@#;. x@%.x@@. %@@,x@@ oxxx: \n ,,,. x#x#@#: ,o@@### .,. \n .;@%:. .%#%. \n \n ",
+ " \n ,,,,,,,,,,,,. \n .:o@@@#########xo;, \n .o@@@@@@#############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n .. ,;o%####x:%####o;#####oo: ... \n ,;#x%@, :;o%####;::::x###%x;:. x%o%x; \n x@%,:@, .,,oox#######%oo:,,. xx ,%@, \n .o@x:,o. .:::oo;;oooooooo;oo;,;,. ,, .x@:... \n :,xoo@@%o;;ox.o%#%oo##@@%%%%;%#%;,;x;;;x@#o %%%, \n ,, ,,ox@@x:%#@@.o%##@@####%,o##%o;@@#%,. .., \n .,;;x#@%; o##@%xx@@##.;%@##%;;:, \n :o#@@@@:. o##@; @@##. .:,x@@@##o,. \n ;@@%. .,, o#@%: %@@#.., :#@#o \n @@%.. :xxx o@@. %@#.;%o. .@@o \n ;xxx, #@x,,%@@. %@@,.:@%; .%xx#: \n :@@x@@%: ,o@@#%@;. ;:: \n .;#x:. .x##. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########xo;, \n .o@@@@@@#############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n .;xxx, ,;o%####x:%####o;#####o;: xxxx. \n ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; \n o@#, .. ...oox#######%oo:,,. ,. %@@ \n ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ \n .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@%: \n .,o@@%#@@;::%#@@,o%##@@####%,o##%o;@@#x@@%,.. \n .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: \n :x#@@%@@x,,. o##@; @@##. .:,x@@@#%@#%%o, \n ;@%, o#@%: %@@#. ,%@x: \n o@::, .:x, o@@. %@#. .xx: @@x \n .xo: ;@, .x@@. %@@,. ,x# x;;o#; \n ;@@o;o@@%: ,o@@x;:#@% ,:: \n .x#@#x: .x#@#x:. \n \n ",
+ " \n ,,,,,,,,,,,,. \n ,:o@@@#########xo;, \n .o@@@@@@#############o,. \n ,;x@@@##############@@@#%o, \n :x#@##################@##%;. \n ;%##########################o, \n ;%##########################o, \n ;%##########################o, \n ;%####%;;%########%;;x######o, \n .;x###o.@o;######;;@.o####%o. \n ,;x##%;;;o######x;;;x###%o, \n .;xxx, ,;o%####x:%####o;#####o;: xxxx. \n ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; \n o@#, .. ...oox#######%oo:,, .. %@@ \n ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ \n .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@x: \n .,o@@%#@@o::%#@@,o%##@@####%,o##%o;@@#x@@%,.. \n .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: \n :x#@@%@@x,,. o##@; @@##. .:,x@@@@%@#%%o, \n ;@%, o#@%, %@@#. ,%@x: \n o@::, .:x, o@@. %@#. .xx: @@x \n .xo: ;@, .%@@. %@@,. ,x# x;;x#; \n ;@@o;o@@%: ,o@@x;:#@# ,:: \n .x@@#x: .x#@#x:. \n \n ",
+};
+static const uint32_t clip_0_ends[] = {100,170,270,330,430,500,600,670,770,830,930,1000,1100,1170,1270,1330,1430,1500,1600,1670,1770,1830,1930,2000,2100,2170,2270,2330,2430,2500,2600,2670,2770,2830,2930,3000,3100,3170,3270,3330,3430,3500,3600,3670,3770,3830,3930,4000,4100,4170,4270,4330,4430,4500,4600,4670,4770,4830,4930,5000,5100,5170,5210};
+static const char *const clip_1_frames[] = {
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓█▓ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒░▒▒ \n ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░░░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒▓▓░ \n ░▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓▓▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▒█▒ \n ▒▓▒░ ░▒ ██ ▒█▒ ░▒░ ░ ▓▓░ \n ░░ ▓▓░░▒█▒ ░▓█▒░░▓▒ ░▒░ \n ░▒▓▓▒░ ░▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░░░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░░░▒▒ \n ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒▓▓░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░░ ██▓ ░██▒ ░░░░░░▒▓▒░ \n ▒▓▒░ ░░ ██ ▒█▒ ░░ ░ ░█▒ \n ░ ▒▓░ ░▒█▒ ░▓█▒ ▒▒ ░▒▒░ \n ▒▒▓▓▒░ ░▓▓▒▓░ \n ",
+ " \n ░▒████████▓▒░░ \n ░██████████████▓▒ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▒░ \n ░▒▒ ▒▓██ ▓░████▓░▒▒██▓▒░ ░▒░ \n ░▓▒░ ░ ▒▓███▓▒███▓▒███▓▒░ ░░░▓▓░ \n ▒█▒ ░▒▓▓█▓▒▒▒▓██▓▒░ ▒█░ \n ▒█▒ ░░░▒▒▓▓▓▓▓▒▒░░░ ░█▒ \n ▒█▓▓▓▒▒▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▓▓▓▓▓░ \n ▒▒▒▒▓▓▓██▒ ▓█████▓▒▒██▓▓▓▒▒▒░░ \n ▒█▓▓▓▓▓░░░ ██▓ ░██▒ ░░▒▓▓▓▓▓▓▓░ \n █▒░░ ██▒ ░▓█▒ ░█▓ \n ▒▒ ██ ▒█▒ ▒░▒▓░ \n ░░ ░██ ▒█▓░ ░░░ \n ▓▓▒▒▓█▒ ░▓█▓▒▒▓░ \n ░░░░ ░░░ ",
+ " ░░░░░░░░░ \n ░▓█████████▓▓▓░ \n ░▒███████████████▓░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▒░ \n ░▒░ ░▓▓██░▓▓████▓▓▒▒███▓▒ ░▒░ \n ░▓▒ ░▒▓█░▒▒████▓▒▒▒██▓▒ ░░░▓▓░ \n ▓█░ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ▒█░ \n ░▓▓ ░▒▓▓▓▓▓▓▓▓▓▒░░ ░█▒ \n ░█▓░░░░░░░▒▒▒▓▒▒▒▒▒▒▒░░░░░░░▒▓▒ \n ░▒▓▓▒▒▒▓▓█▒▒▓▓█▓▓▓▒▓█▒▒▒▓▓▓▒ \n ▒▓▓▓▓▓█▓▓▓░░ ▓██▓▓█▓▒░▓▓▓▓█▓▓▓▓▓▒ \n ░█▓░░░░░░ ▓██ ░█▓▒ ░░░░░░▒█▒ \n ▒▒░ ██░ ▒█▒ ░ ▒█░\n ██ ▒█▒ ▒▒░ \n ██ ▒█▒ \n ▓░ ░▒▓▓░ ▒▓▓▒ ▒░ \n ▒▓▓▓░ ░▓▓▒░ ",
+ " ▓▓▒▒▒▒▒▒▒░ \n ▒████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▒░ \n ░▒▒░ ░▒▓█▓ ▓▒████▓▒▒▒██▓▓░ ░▒░ \n ▓█░ ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ ▒█▒ \n ▒█▒ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ▓█░ \n ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▓█░ \n ▓█▓▓▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░░▒▒▒▓▓▓░ \n ░░░▒▒▒▒▒▓▓██░▓███▓█▓▒▒█▓▓▒▒▒▒▒░░░ \n ░▓▓▓▓▓▓▓▓░▒░ ▓██▒▓█▓▒ ░▒░▓▓▓▒▓▓█▓░ \n ▒▓░ ██▓ ░██▒ ░█▓\n ██ ▒█▒ ░▒▒░\n ██ ▒█▒ \n ██ ▒█▒ \n ░ ▒█▒ ░▓█░ ░░ \n ░▒▒▓█▓ ░▓█▓▒▓░ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▒░ \n ░▓███▒▒██████▓▒▓████▒░ \n ░░░ ▒▓██ ▓░████▓▒▒▒██▓▓░ ░ \n ▒▓░ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░▓░ \n ▒█▒ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░▒▓░ \n ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ \n ▒▓▒▒▒▒▒▒▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▒▒▓▒ \n ░░▒▓▓▓▓▓▓▓▓█▓▓░▓█████▓▒▒▓█▓▓▓▓▓▓▓▓▒░ \n ▒▓░░░░░░░░░░ ███░▒██▒ ░░░░░░░░░▒▓█▒\n ░█▓░ ▒▓▓░ ░▒▒\n ██ ▒█▒ \n ██ ▒█▒ \n ██ ░█▒ \n ░█▓ ░▓▓░ \n ▒▒▒█ ░▓▓▓░ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▒░ \n ░▓███▒▒██████▓▒▓████▒░ \n ░▒░ ▒▓██ ▓░████▓░▒▒██▓▓░ ░░ \n ▒▓░ ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ ▓░ \n ▒█▒ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░▓▓░ \n ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ \n ▒▒▒▒▒▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▒▒▓░ \n ░▒▓███▓██▓██▒▓░▓█████▓▒░▓██▓██▓█▓█▓▒░ \n ▒▓░ ░░ ░░ ███ ▒██▒ ░ ░ ▒█▓\n ▓█▓ ░▓█▒ ░░\n ██ ░█▒ \n ██ ░█▒ \n ██ ░█▒ \n ░█▒ ░▓▓░ \n ░▒▒█ ░▓▓▓▒ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▒░ \n ░▓███▒▒██████▓▒▓████▒░ \n ▒▓██ ▓░████▓░▒▒██▓▓░ \n ░░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░░ \n ▓▓░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░█▒\n ▒█▓▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒▓▓░\n ▒▓▒▒▒▒▒▒▒░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▒▒▒▒▒▓▓▓░ \n ░▓▓▒▒▒▓▓▓░▓█▓░▓█████▓▒▒█▓▒▒▓▒▒▒▒▒▓▒▒ \n ░░ ▒██▓█▓█▓░ ░██▒ ░██▓░▒▓▓█▓▓▓█▓░ ▒▒ \n ░░░░░ ▒█▓ ░▓█▒ ░░░░░ \n █░ ▓█▒ \n █░ ▒█▒ \n █ ▒█▒ \n ▓█ ░█▒ \n ▒▒ ░▒░ ",
+ " ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ \n ▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░\n ▓▓░░░░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░░░░░█▓\n ░▒▒▓█▓▓▓▒░▒█▓░▓█████▓▒▒█▓░▒█▓▓███▓▒░ \n ░ ░█▓░▓██▓░▒██▓▒▓█▓░ ▒▓░ \n ▒▓▒░░▒▓▒▒██▓░ ▒██▓▒▓▓▒░▒▓▒ \n ░░░░░ ░█▒░ ░▓█▒ ░░░░ \n ▓█ ▓▓ \n ▒█░ ░█▒ \n ▒▒ ░▒░ \n ",
+ " ▒▒▒▒▒▒▒▒▒░ \n ░████████████▓▒░ \n ░▓███████████████▓▒ \n ░▒▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ░▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▒▒▒▓███▓▒▒▓██▓░ \n ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ \n ░░▓▓▓▓▓▓▓▓▓▒░░ \n░▓▒ ▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░ ▒▒\n ▒▓▒▒▒▒▓██▒▒▒▓█▒▓███▓█▓▒▒█▒▒▒▓█▓▒▒▒▒▒█▒\n ░░░▒▒░ ░█▓ ▒███▒▓██▓▒▓█▒░ ░▒▒▒▒▒ \n ▒▒▓██▓▒ ░▓██▓▒▒▒░ \n ░ ▓█▓░ ░▒▓██▓░ \n ░▓█░▓█░ ▓█░▒░ \n ▒▓▓ ▒▓▓░ \n \n ",
+ " \n ░▒████████▓▒░░ \n ░██████████████▓▒ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▒░ \n ▒▓██ ▓░████▓░▒▒██▓▒░ \n ▒▓███▓▒███▓▓███▓▒░ \n ░▒▓▓█▓▒▒▒▓██▓▒░ \n ░░░▒▒▓▓▓▓▓▒▒▒░░░ \n ▒░ ░▒▒▓█░▓█▓▒▓▓█▓▓▓▒▓▓░▓█▓▒░ ▒▒\n ▒▓▓▒▓██▓▒ ▓█▓ ▓█████▓▒▒█▓▓░▒▒▓█▓▒▒▒▓▒\n ░░ ▒▓░▒███░ ░▓██▒▒▓▓▒ ░░░░ \n ░▒▓█▓█░ ░▓██▓▒▒░ \n ▒█▒▒ ░▒▓█▓░ \n ░ ░▒▒ ░▒▒░ \n \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ \n ░░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░ \n ▒▓▓▓░░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░░▓▓█░ \n ░░▓█▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓█▒░░ \n ░▒▓▓█▓▓░ ░██▓░▒██▒░▒▓▓▓▓▓▓▒ \n ▒█▒░▒░░ ░██▒ ▒█▓░ ░▒▒░░██░ \n ▒▓▒░▒█▒▓█▓░ ░▓█▒▒▓▒░░▓█░ \n ░░░ ▓▓▓░ ░▒▓▓░▒▒▒░ \n \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ \n ▒▓▒░ ░░▒▒▓▓▓▓▓▓▒▒░░ ░▒▓░ \n ░▓█▓▓▒▒▒▒▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▒▒▓█▓░ \n ░░░░░▓▒▒▓██░▓███▓█▓▒▒█▓▒▓▒▒░░░░ \n ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓▓▓▓▓▓░ \n ▓█▒░░░ ██▒ ░██▒ ░░░░░▓█▒ \n ▒▓▒░ ▓▓▒ ░▓█░ ░██▒ ░▒▒░ ░░█▓░ \n ░░ ▓█▓▓█░ ▒██▓▓▓░ ▒▒▒ \n ░░░ ░░░ \n ",
+ " \n ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░░░ \n ▒█▒▓░ ░▒▓████░▓███▓▓▒░ ▒▒▓█░ \n ▓█▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█░ \n ░▒█████░▒▓▓▒▓▓▓▓▓▓▒▓▒░▓████▓▒░ \n ▒▒▒▓█▓░▓█████▓▒▒█▓▓▒░ \n ░▓██▓██▒▒▒░ ███░▒██▒ ▒▒▒███▓█▓▓▒ \n ▓█░ ██▓ ░██▒ ░█▓ \n ░▒▒░ ░░ ██ ▒█▒ ░ ░░░█▒ \n ▓▒ ░▓█▒ ░▓█▒ ░▒▓░ ░░ \n ▒▓▒▓▓▒░ ░▓▓▓█▓░ \n ░░ ",
+ " \n ░▒████████▓▒▒░ \n ░██████████████▓▒ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▒░ \n ░▓███▒▒▓█████▓▒▓████▒░ \n ░▒ ▒▓██ ▓░████▓░▒▒██▓▒░░▒░ \n ▓▓▒░ ▒▓▓█████▒▓█████▓▒░ ░▒█▒ \n ▓█░ ░▒▓▓▓██▒▓███▓▒░ ░█▒ \n ▒█▓▒▒▒░░░▒▒▓▓▓▓▓▒▒░░░▒▒▒▒▓▓░ \n ▓▓▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒░ \n ░▒▒▒▒▒▓▓█▓▒▒ ▓█████▓▒▒███▓▓▒▒▒▒░░ \n ░▓▓▒▒▒▒▒▒ ▓██ ░██▒ ░▒▒▒▒▒▒▓▓▒ \n ░▒▒░ ██▒ ░▓█▒ ▒█░\n ██ ▒█▒ ░▒▒░ \n ░ ░██ ▒█▓ ░ \n ▓▓▒▒▓█▒ ░▓█▒░░▓▒ \n ░░░░ ░▒▒░ ",
+ " ░░░░░░░░░ \n ▒▓████████▓▓▒░ \n ▒███████████████▓░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓▓██░▓▓████▓▓▒▒███▓▒ \n ░▓░░▓▓█░▒░████▓▒▒▒██▓▒░▒▒░ \n ▓█░ ░▒▓█████░▒████▓▓▒░ ▒█▒ \n ▓█░ ░░▒▓▓██▓▓█▓▓▓▒░ ▒█▒ \n ░▓▓▓▓▓░░▒▒▒▓▓▓▓▓▒▒▒░░▒▓▓▓▓▒ \n ░▒▒▒▓▓█▒▒▓██▓▓▓▒▓▓▒▒▒▒░ \n ░▓▓▓▓▓▓█▓▓▓░░ ▓███▓█▓▒░▓▓▓▓▓▓▓▓▓▓▒░ \n ▒▓▒░░░░░░ ▓██ ░█▓▒ ░░░░░░░▓█▓░\n ░░░ ██░ ▒█▒ ░░▒█░\n ██ ▒█▒ ░░ \n ░ ░██ ▒█▓ \n ▓▓▒▒▓█▒░ ▒█▓▒ ▒░ \n ░░░░ ░▓▓▓▒ ",
+ " ▒▒▒▒▒▒▒▒░░ \n ░████████████▓▒ \n ░▒███████████████▓▒ \n ░▒▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▒░░▒▓██ ▓▒████▓▓▒▒███▓▒ ░░ \n ▓█░ ░▒▓█▒▒▒████▓▒▒▓██▓▒ ░█▒ \n ▓█░ ░▒▓█████░▒████▓▒░ ▓▒ \n ▓█▒ ░░▓▓██▓██▓▓▒░░ ░█▒ \n ░▒█▓▒▒▒░░▓▓▒▒▒▒▒▒▒▒▓▒░░▒▓▓█▓░ \n ░ ░▒▒░▓▓█▒▒███▓█▓▒▒▓▓░░░░ \n ░▓▓▓▓▒░░▒▓██▓ ███▓▓██▒ ▒██▓▓▓▓▓▓▒▓▒ \n ░░ ▒▒▓▓░░ ▓██ ▒█▓░ ░░▒▒▒░░░░▒█░\n ██ ▒█▒ ░▒░ \n ██ ▒█▒ \n ██ ▒█▒ \n ▓░░▒▓▓░ ░▓▓░ \n ▒▒░ ░▒▒▒ ",
+ " ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒███▓░ \n ▓▓░ ░▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▓▓░ \n ░█▒ ░▒▓████░▒███▓▓▒░ ▓█▒ \n ░█▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ░██░ \n ░▓█▓▓▓▓▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▓▓▓▓█▒ \n ░░░░░░▒▒▒▓██░▓███▓█▓▒▒█▓▒▒▒░░░ \n ▒▒▓▒░▒▓▓▓▒ ███▒▒██▓▒▓▓▓█▓▓▓██▓▓▓▒ \n ░▓▓▒░ ██▓ ░▒█▓░ ░░░░ ░ ▒█▓\n ██ ▓█░ ░░░\n ██ ▒█▒ \n ░██ ▒█░ \n ▒▒▒▓█▓░ ░█▓░ \n ░░░ ",
+ " ░░▓▓▓▓▓▓▓▓▓▒░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▓▓ \n ▓█▒ ░▒▓████░▒███▓▓▒░ ░▒▓▓ \n ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ \n ░▒██▓▓▓▒▒▒▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▓▓▓▓█▓▒ \n ░░░░▒▓███▓░▓█████▓▒▒█▓▒▒░░▒▒░░░░ \n ░▒▓▓▒░ ███░▒██▓▒▒▓▓▓▓▓█▓▓▓▓▓▓░\n ▒█▒ ██▓ ▒██▒░░░░░░ ░▒▒\n ▓█▒ ██ ▒▓█▒░ \n ▒▓▒░ ░██ ░▓█▒ \n ░ ░██ ▒▓▓░ \n ▒▒▒▓▒ \n ",
+ " ░▒██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▓░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓██▒▓▓▓▓▓█▓▒░ \n ░░ ░▒▓████▒▓███▓▒▒░ ▓▒\n █▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒\n ▒█▓▒▒▒▓██▒▒▒▓▓▓▒▓▓█▓▓▓▒▓▓░▓█████▓██▓░ \n ░▒▒▒▒▓██▓▓ ▓█████▓▒▒█▓▓░ ░▒▒▒▒▒░ \n ░▓█▓▓░ ███ ░▓█▓▒▒▒▓███▓▒▓▒▓▓█▒\n ▒▓▒ ░██ ░▓█▓░ ░▒▒\n ░▓▒░ ▒██ ░▓██▒ \n ░░ ██ ░▓▓ \n ▓█▓ ░▒▒░ \n \n ",
+ " ░▒████████▓▒░ \n ░▓█████████████▓▒ \n ▒▓████████████████▓░ \n ░▓██████████████████▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓░▒▒██▓▒░ \n ▒▓█▓▓▓▒███▓▒▓██▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▒░░ \n ░░░▒▒▓▓▓▓▓▒▒░░░ ░░\n ▓▓░░▒█▒▒▒▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓░░▓████▓░▒▓█▓\n ░░░▒▓▒▓███▓█▒▓ ▓█████▓▒▒█▓▓▓▒▒▒▒▒▒▒░░ \n ▓▓▒░░ ██▒ ░██▒ ░▒▒▓▓▒▒▓▒▒▒▓▒ \n ▒▒░ ▓█▒ ░▓█▒ ▒▒ \n ██ ▒▓█▓▒░ \n ░▒█▓ ░▓▒ \n ▒▒▒ \n \n ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▓▒░ \n ░░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░ \n ░▒▒▓█▓█▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▒░░▓█▓▓█▓▓▓░ \n ░▒▓██▓▓▒▒▓▓█▒▓░▓█████▓▒▒██▓▓▒▒▒▒▒░ \n ▓▒░░░░▓▒▓▓░░ ██▒░▒██▒ ░░▒▓▓▓▓▓▓▓▓▒░ \n ░█▓ ░▓█▒ ░█▒ \n ██ ▒█▓░░░░░ \n ▒▓▒ ▒▓▓▓▓░ \n █▓▓ \n \n ",
+ " ▒▒▒▒▒▒▒▒▒░ \n ░████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ░▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ \n ░▒▓▓█▓▒▒▒▒▒▓█▓▓▒░ \n ░░ ░░▓▓▓▓▓▓▓▓▓▒░░ ░░ \n ▒██▓▒▒▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▒▒▒▒▓█▓░ \n ░░▒▒▒▒▒▒▒▒█▓█░▓███▓█▓▒▒█▓▒▒▒▒▒▒░ \n ▒▓░▒▒▒█▓██▒▒ ███▒▓█▓▒░▒▒▓██▓████▓░ \n ░░ ░██ ░██▒ ▒█░ \n ░█▓ ▒█▓ ░ ░░░ \n ░▓▓░ ░▒▓▓▒▓█▒ \n █▓▒ ░▒▒░ \n ░░░ \n ",
+ " \n ░▒████████▓▒▒░ \n ░██████████████▓▒░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒▓█████▓▒▒████▒░ \n ░▓██░▓░████▓░▒▒██▓▒░ \n ░▓▓██▓▒▓▓▓▓▒███▓▒░ \n ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ░▒░ \n ▒█▓░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▒█▒ \n ▒▓▓▓▓▓▓▓▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▓▓▓▓▓▓▓▒░ \n ░▒▓▓▒░▒▒░▒▓█▓ ▓█████▓▒▒██▓▒▒▒▒▒░ \n ▒█▒▒▓█████▓ ███ ░██▒ ░░▒▓▓▓▓▓▓▓▒ \n ░ ██ ░▓█▒ ░░▒█▓ \n ░░ ░██▒ ▒█▓░ ░▒▒ ░▒▒▒ \n ██▓█▒ ░▒█▓▓█▓ \n ▒▒ ░░░ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ \n ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ \n ░▓▓▓▓░ ░▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ \n ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ \n ░▓▓▓▓░ ░▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ███░▒█▓▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ \n ░ █▓░░▒█▒ ░▓█▒░░▓▒ ░▒░ \n ░▒▓▓▓░ ░▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░▒▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒▒ \n ▒█▒ ░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░ ▒█░ \n ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█░ \n ▒█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▒ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░░ ██▓ ░██▒ ░░░░░░▒█▒░ \n ▒▓▒░ ░░ ██ ▒█▒ ░░ ░ ▓█░ \n ░ ▓▒ ░▒█▒ ░▓█▒ ░▓░ ░▒▒░ \n ▒▓▒▓▓▓░ ░▓▓▒▓▒ \n ",
+ " \n ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▒░ \n ░▓███▒▒██████▓▒▓████▒░ \n ░░░ ▒▓██ ▓░████▓▒▒▒██▓▓░ ░░ \n ░▒▒░░▒ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░░░▒▒ \n ▒█▒ ░▒▓██▓▒▒▒▒▓█▓▓▒░ ▒█▒ \n ▓▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓▓░ \n ░▓█▓▒▒▒▒▒░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▒▒▒▒▒▓▒░ \n ░▒▒▓▓▒▒▓█▓░▓█████▓▒▒█▓▓▒▓▒▒▒░ \n ░▒██▓███▒▒ ███░▒██▒ ░▒▒███▓██▒▒ \n ▒▓░ ██▒ ░██▒ ░█▓░ \n ░▓▒░ ██ ▒█▒ ░░░▓▓░ \n ▒░ ░██ ░█▓░ ░▒░ ░▒░ \n ▓▓▒▓██▒ ░▒█▓▒▓▓░ \n ░░░░ ░░ ",
+ " \n ░▒████████▓▓▒░ \n ░██████████████▓▒░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒▓████▓▓▒▒███▓▒░ \n ▒▒░ ░▓██░▓░████▓░▒▒██▓▒░ ▒▒░ \n ▓▓░ ░▒▓██▓▒▓▓▓▓▒███▓▒░ ░█░ \n ░▓▓░ ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ▒▓▒ \n ░▓█▒░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▓█░ \n ░▓███▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓▒░▓████▒░ \n ░▒▒▒▒▓██▒▒ ▓█████▓▒▒███▓▒▒▒▒▒░ \n ░▓▓▒▒▒▒▒░ ███ ░██▒ ░▒▒▒▒▒▒▓▓░ \n ░█▓░░ ██▒ ░▓█▒ ██░\n ░░░░ ██ ▒█▒ ░▒▒▒░ \n ░ ██ ░█▓░ \n ▓▒░░▒█▓░ ░▒█▓▒▒▓▒ \n ░░░░░ ░▒░░ ",
+ " ░░░░░░░░░ \n ░▓█████████▓▓▓░ \n ░▒███████████████▓░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓▓██░▓▓████▓▓▒▒███▓▒ \n ░▓▓█░▒▒████▓▒▒▒██▓▒ \n ▒▓▒ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ░░ \n ▒█▒░ ░▒▓▓▓▓▓▓▓▓▓▒░░ ░▓█ \n ░▒▓▒░░░░░ ░░▒▒▒▓▓▓▓▓▒▒▒░░░░░░░░▒▓██░ \n ░▒▒▒▒▒▒▓▓██▒▒▓██▓▓▓▒▓█▓▓▓▒▒▒▒▒▒░ \n ░▓████▓▓▓░░░ ▓██▓▓█▓▒░░▒▓▓▓██▓█▓▓░ \n ░▓▓░ ██▓ ░██▒ ░▒▓▒\n ▒▓░░ ▓█░ ░▓█░ ░▒▓▒\n ░░ ▓█ ░█▓░ ░ \n ▓█ ░█▓░ \n ░░ ░█▒ ▒█▓░ \n ▒▒▓▓░ ░▒░ ",
+ " ▒▒▒▒▒▒▒▒▒░ \n ░████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓███████▓▓████▒░ \n ░▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▒▒▒▓███▓▒▒▓██▓░ \n ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ \n ▒█░ ░░▓▓▓▓▓▓▓▓▓▒░░ \n ░▒▓▓░░░▒▒░ ░▒▓▓▒▓▓▓▓▓▒▒▓▒░░░▒░░░▒▓█░ \n ░▒▒▒▒▒▒▒▓▓██▒▓███▓█▓▒▓███▓▒▒▒▒▒▒░ \n ░▓▓▒▒▒▓▒░▒ ███▒▓██▒ ░▒░▒▒▓▒▒▒▓█▒ \n ▒▓░ ░██▒ ░▓█▓ ░█▓\n ░▓▒░ ▒█▓ ░█▓ ░▒░\n ██ ▒█▒ \n ██ ▒█▒ \n ▓█ ▒█▓░ \n ░▒▓░ ▒▒░ ",
+ " ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ \n ▒▓▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█░ \n ▒▓▒░▒░░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▓▒░ \n ▒▓▓▓▓▓▓█▓▓▓░▓█████▓▒▒▓▓█▓▓▓▓▓▓▓▒░ \n ░▒▓▒░░░░░░░ ▒██▓░▒██▓░ ░░░░░░░░░▓▓▓░\n ▓▓░ ░▓█▓░ ░▒█▓▒ ░▓▓\n ▒▒░ ▒██░ ░▓█▓░ ░ \n ▓█░ ▒██▒ \n ▒█▓▒ ▒█▒ \n ░▒ ░▓░ \n ░▒░ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▒░ \n ░▓██████████████████▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ \n ░░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░░ \n ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ \n ▒▒▒▒░▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▓░ \n ░▓████████▓▓ ▓█████▓▒░▓██████▓██▓▒ \n ▒▓▒░░ ░▓██▒ ░▓█▓▒ ▒█▒\n ▒▓░ ░▓█▓░ ░▓█▓░ ░▓▒\n ░░░ ░▓█▓░ ░██▒░ \n █▒ ░▓█▒ \n █▒░ ▒█░ \n ░▒░ ░▓▒ \n ",
+ " ░▒██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▓░ \n ░▓██████████████████▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ \n ░▒░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░▒░ \n ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ \n ▒▓▓▒▒░▓▓▓▒▓▓█▓▓▓▒▓▓▒▒▓█▓▓░ \n ░░░░░░░░░▓▓█▓ ▓█████▓▒▒██▓▓▒▒▓▓▓▓▓▓▒ \n ▒█▒▒▓▓▒▓▓▓▒▓░░▓██▒ ░▓█▓▒ ▒▓▓▒░░ ░ ▒▓▓\n ░▒░ ░▓█▓░ ░▓█▓░ \n ░▒▓██▓ ░▓█▓▒░ \n ▓█░ ▒█▒ \n ░▒░ ▒▓░ \n \n ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░░░░ ░▒▓██▓▒▒▒▒▓█▓▓▒░ ░░░░ \n ▓█▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█▒ \n ░▒▓▓█▓░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▓▓▓▓▒ \n ░░░░ ░▒▒▓█▓░▓█████▓▒▒██▓▒▒▒░░▒▓▓▓▒ \n ▒█▒▒▓▓█▓███▓░░▓██▒░░██▓▒░░▒▓▓▓▓▒░░░▒▓▓\n ░░ ░░░░░ ▓█▓░ ▒██▒░ ░ \n ░▓▓██▓░ ▒███▓▒ \n ▓▓░░ ░░░█▒ \n ░▒░ ▒▒░ \n \n ",
+ " ░▓▓▒▒▒▒▒▒▒░ \n ▒████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ░▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ \n ░▒▒▒░ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒▒░ \n ▓█░▒░ ░░▒▓▓▓▓▓▓▓▒▒░░ ▒░ ▒█░ \n ░▓▓▓▓▓▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▓▓▓▓▓░ \n ▒▓▓░ ░▒▒▒▒██░▓███▓█▓▒▒█▓▒▒▒▒░ ▒▓▓▓▒ \n ░▒▒▓▓▒▒░▒▓█▒ ▒███▒▒██▓▒▒▓██████▓▒ ▒▒ \n ░▒░▒▒▒ ░▒█▓░ ░▓█▓░░▒▒░ \n ░ ▓█▓▓██░ ▒██▓▓██░ \n ░▒░░ ░▒▒░░░ \n \n \n ",
+ " ░░░░░░░░░ \n ░▓▓████████▓▓▒░ \n ▒███████████████▓░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓▓██░▓▓████▓▓▒▒███▓▒ \n ░▓▓█░▒░████▓▒▒▒██▓▒ \n ░░░░ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ▒▒▒░ \n ░█▓░░▒░ ░▒▓▓▓▓▓▓▓▓▓▒░░ ▒░░▓▓░ \n ▒█▓░ ░░░▒▒▒▓▓▓▓▓▒▒▒░░░ ▓█░ \n ░▒▓████▓▒░▓█▒▒▓██▓▓▓▒▓▓▒▒▓█▓▓█▓▓▒ \n ░░▒▓▓█▓░ ▓██▓▓█▓▒░██▓▒▒▒▒░ \n ░▓█▓▓░░ ██▓ ░██▒ ░▒▓▓██▓░ \n ▒█░ ▒▒░ ░██ ░█▓ ░▒░ ██░ \n ░▒▒░ █▓░▒█▒ ░▓█▒▒█▓░▓▓░ \n ░▓▓▓░ ░▓▓▒ \n \n ",
+ " \n ░▓▓▓▓▓▓▓▓▓▒░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒░ \n ░▓▒ ░░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░░ ▓▓░ \n ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ▒█▓▒░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒░░░░▒█▓░ \n ░▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓██▓▓░ ███░▒██▒ ▒▓▓██▓▓▓░ \n ▓█▒░░░ ██▓ ░██▒ ░░░░▓█▒ \n ▒▓▒░ ░▓▓ ██ ▒█▓ ░▒▒ ░ ░█▓░ \n ░ ▒█▒▒██░ ▒█▓▒▓█░ ░▒░ \n ▒▒░ ▒▒░ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░▒▒░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▒▒░ \n ▒█▒ ░ ░▒▓████░▒▓▓█▓▓▒░ ░ █▒ \n ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█░ \n ▒█▓░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▒ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▓░░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒▒ ░ █▓ \n ░ █▓░░▓█▒ ░▓█▒░▒█▒ ░▒▒░ \n ▒▓▓▒ ░▓▓▒░ \n ",
+ " \n ░▒████████▓▒▒░ \n ░██████████████▓▒░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒▓█████▓▒▓███▓▒░ \n ░▓██░▓░████▓░▒▒██▓▒░ \n ░▓▓█████▒▓█████▓▒░ ░ \n ▒▓░ ░▒▒▓▓██▒▓██▓▓▒░ ░▒▓░\n ▓█▒ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▓█░\n ▒▓█▒▒▒▒▒▒▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▒▒▓█▓▒ \n ▒▓▒▒▒▒▒██▒ ▓█████▓▒▒██▓▒▓▒▒▓▒ \n ░▓▓█▓███░▒ ███ ░██▒ ░▒▒███▓█▓▓▒░ \n ▓▓░░ ██▒ ░▓█▒ ░▓▓░ \n ░▒▒░ ██ ▒█▒ ░░░▓▓ \n ▓░ ▒██ ░█▓░ ░▒░ ░░░ \n ▒▓▓▓█▓░ ░▒▓█▓▓▓░ \n ",
+ " ░░░░░░░░░ \n ░▓██████████▓▓▒ \n ░▒███████████████▓░ \n ░▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▒░ \n ░▓▓██░▓▒████▓▓▒▒███▓▒ \n ░▒▓█▒▒▒████▓▒▒▒██▓▒ \n ░▒▓█████░▒████▓▓▒░ \n ░░▓▓██▓▓█▓▓▒░░ \n░▓▒ ░░░░░▒▒▒▓▒▒▒▒▒▒▒░░░░░ ▓▓\n ▒▓█▒▒▒▒▒▒▒▒▓▓█▒▒███▓▓▓▒▓▓▒▒▒▓▒▒▒░▒▓█▓▒\n ░▒▓▓▓▓██▓▓▓░▒ ▓██▓▓██▒░▓▓▓▓█▓▓▓▓▓▓░ \n ▒█▓░░░░░░ ███ ░██▒ ░░░░░░▒▓▓░\n ▓▓ ░░ ██ ▒█▒ ░ ░█▒\n ░▒░ ██ ▒█▒ ░▒▒░ \n ░██ ▒█▒ \n ▓▒ ░▓█▓░ ▒▓▓▒░░▓░ \n ▒▓▓▒ ░▒▓▒░ ",
+ " ░▓▓▒▒▒▒▒▒▒░░ \n ▒████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▓▒▓██▓▓▓▒▒▓█▓▓░ \n ░░▒▓████░▒███▓▓▒░ \n ░░▒▒▓▓▓▓▓▓▒▒░░ \n ▒░ ░▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░░ ░░\n░▓▒░▒▒▒▒▒▒▓▓███░▓███▓█▓▒▒██▓▒▒▒▒░░░░░█▓\n ░▓█▓▓▓▓▓▓▒▒░ ███▒▒██▒ ▒▒▒▓▓▓▓▓▓▓█▒░\n ▓▓░ ░██▒ ▒█▓░ █▓\n ░▒░ ▓█ ▒█▒ ░▒░ \n ▓█ ▒█▒ \n ▓█░ ▒█▒ \n ░▓█░ ░█▓░ \n ▒▒▒▓▒ ░▓▓▓▒ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▒▒░ \n ░░░▒▒▓▓▓▓▓▓▒▒░░ \n ▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒░ ▒▒ \n ░▒▓▓█▓██▓██▓▓░▓█████▓▒▒▓██▓██▓█▓▓▓▒ \n ▒█▒░░░░░░ ░░ ██▒░░██▓░ ░░░░░░░░░░▒█▒\n ▒▒░ ▒█▓ ▒▓▓░ ▒▓▒\n ██ ▒█▒ \n ██ ▒█▒ \n ▓█ ▒█▒ \n ░█▓ ▒█▒ \n ░▒▒▓░ ░▓▒░ ",
+ " ░▒████████▓▒░ \n ░▓█████████████▓▒ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓░▒▒██▓▒░ \n ▒▓███▓▒███▓▓███▓▒░ \n ░▒▓██▓▒▒▒▒██▓▒░ \n ░▓▓░ ░░░▒▒▓▓▓▓▓▒▒░░░░ ░▓▓░ \n ░▒▓███▓░▓█▓▒▓▓█▓▓▓▒▓▓░▓███▓▓░ \n ░▒▓██▒▒▒▒▒▒▓█▓ ▓█████▓▒▒██▓▒▒▒▒▓▓██▓▒ \n ▒▒ ▒▒▒▒▒▒▒ ▒██▒ ░▓█▓▒ ░▓▓▓▒▒░ ░█▓\n ▒█▒ ░▓█▓░ \n █▒ ▓▓░ \n █ ▒█▒ \n █▓ ▓▓░ \n ▒█ ▒▓░ \n ▒▓ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░░░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░▒░ \n ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ \n ▒▓██▓░▒▓▓▒▓▓█▓▓▓▒▓▓░▓███▓░ \n ░▒▒▓▓▒░▒▒▒▒▓█▓░▓█████▓▒▒█▓▓░░▒░░▒▓▓▒▒ \n ▒▓ ░▒▓▓▓▓▒▓░ ░██▒ ░██▓▒▒▓▓███▓▒░░░▒█▓\n ░█▓░ ░▓█▓░ ░░░ \n █▓░ ▒▓▓░ \n █ ░█▒ \n █▓░ ▒█▓░ \n ▒▒ \n ",
+ " ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒███▓░ \n ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▒▒ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒░ \n ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█▒ \n ░▓▓▓▓▓░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▓▓▓█▒░ \n ▒▓▓▓▒░░░▒▒▓██░▓███▓█▓▒▒█▓▒▒▒░░░▒▓▒▒░ \n ░▒ ░▒▓█▓█▓▓▒ ▓██▓░▒██▓▒▓▓█▓▓▓▓▓▒░ ▒▓ \n ░░░ ░█▓░ ░▒██▒░░░░░░ \n ▓██░ ░▓▓▓▒ \n █▒░ ▒█▒ \n ▓▒▒ ░▒▒░ \n \n ",
+ " ░░░░░░░░░ \n ░▓██████████▓▓▒ \n ░▒███████████████▓░ \n ░▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓▓██░▓▒████▓▓▒▒███▓▒ \n ░▒▓█▒▒▒████▓▒▒▒██▓▒ \n ░░░ ░▒▓██▓▒▒▒▒▒▓██▓▒▒░░░░ \n ▓█░▓░ ░░▓▓█▓▓▓▓▓▓▒░░ ▒▒▒█░ \n ▒█▓▒▒░░░▒▓▒▒▒▒▒▒▒▒▒▒░▒░▒▓█▓░ \n ░▒▓▒ ░▒▓▒▒▓█▒▒███▓█▓▒▓▓▒▒▓▓▒░ ░▒▓▒ \n ░▒░▒█▓▒░▓▓█▓░░▓██▓▓█▓▓▒██▓▒░░░▒█▓░▒░ \n ░░▒▒▒░▒ ░▓█▓ ░██▒ ░▒▒▒▓▓░░ \n █▓▒░██ ░▓█▓▒▓█▒▓░ \n ▒▓▓▓▒ ▒▓▓▒░░ \n \n \n ",
+ " \n ░▒████████▓▒░░ \n ░██████████████▓▒ \n ░▓████████████████▓░ \n ░▓██████████████████▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▒░ \n ▒▓██ ▓░████▓░▒▒██▓▒░ \n ▒▓██▓▓▒███▓▒▓██▓▒░ \n ▒▓▒▓░ ░▒▓▓█▓▒▒▒▓██▓▒░░ ▒▒▒▓▓░ \n ▓█░░░ ░░░▒▒▓▓▓▓▓▒▒░░░░ ░░ ▒█░ \n ░░▓▓███▓░▓█▓▒▓▓█▓▓▓▒▓▓░▓████▓░░▒░ \n ░▓▓░ ░░▒▓█▓ ▓█████▓▒▒█▓▓░░░░░▓▓░░ \n ▒▓████▓▓ ░██▒ ░██▒ ░▒▓█████▓░ \n ▒▒░ ▓█▒ ░▓█▒ ░▒▒░░▓▒ \n ██▒▒█▓░ ▒█▓▒▓▓░▒▓░ \n ░▒▓▓░ ▒▒▒░░░ \n \n ",
+ " \n ░▓▓▒▒▒▒▓▒▒░░ \n ▒████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓▒████▓▒▒▒██▓▓░ \n ░░ ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒▒░▒░ ░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░░░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒░░░░░▒▓█░ \n ░▓▓▓▓█▒▒▒██░▓███▓█▓▒▒█▓▒▓█▓▓█▒░ \n ░▒▓▓▓█▓▓▒ ███░▒██▒░▓▓▓▓▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ ░█▓░ \n ░░ █▓░░▒█▓ ░▓█▒░▒▓▒ ░▒▒▒ \n ░▓▓▓▓░ ▒▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▓▒░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░▒▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒▒ \n ▒█▒ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒█░ \n ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▓█░ \n ▒█▓░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▓█▒ \n ▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒ \n ░▒▓▓▓▓█▓▓░ ▓██░▒██▒ ▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░░ ██▓ ░██▒ ░░░░░▒█▒░ \n ▒▓▒░ ░ ██ ▒█▒ ░ ░ ▓█░ \n ░ ▓▓ ░▒█▒ ░██▒ ░▓░ ░▒▒░ \n ░▓▓▓▓▓░ ▒▓▓▓▓▒░ \n ",
+ " \n ░▒████████▓▓▒░ \n ░██████████████▓▒░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███▒▒▓████▓▓▒▒███▓▒░ \n ░▒░ ░▓██░▓░████▓░▒▒██▓▒░ ▒▒▒ \n ▒█▒ ░▒▓██▓▒▓▓▓▓▒███▓▒░ ░ ▓█░ \n ▒█▒ ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ░▓▓ \n ▒█▓░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ▒█▒ \n ░▓████▓▓░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▓████▓░ \n ▒▒▒▓█▒ ▓█████▓▒▒██▓▒▒░ \n ░▒▓█▓███▒▒ ▓██ ░█▓▒ ░▒▓██▓██▓▒░ \n ▓▓░ ██▒ ░▓█▒ ░▒▓▒ \n ░▒▒▒ ██ ▒█▒ ░░░█▒ \n ░ ▒█▓ ░██░ ░ ░▒ \n ▓▓▒▓▓▓░ ▒▓▓▓▒▓░ \n ░░░ ░░░░ ",
+ " ░░░░░░░░░ \n ░▓█████████▓▓▓▒ \n ░▒███████████████▓░ \n ░▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▒░ \n ░▓▓██░▓▒████▓▓▒▒███▓▒ \n ░ ░▒▓█▒▒▒████▓▒▒▒██▓▒ ░ \n ▒▓▒░ ░▒▓██▓▒▒▒▒▒▓██▓▒▒ ░▓▒ \n ▒█▓░ ░░▓▓█▓▓▓▓▓▓▒░░ ░█▓ \n ░▓█▒ ░░░▒▓▒▒▒▒▒▒▒▒▒▒░░░ ▒▓█▒ \n ░▓█▓██▒▒▒▓█▒▒███▓▓▓▒▓▓▒▒▓█▓▓█▓░ \n ░▒▒▒▒▓▓█▓░ ▓██▓▓██▒░██▓▓▒▒▒░░ \n ░▒▓▓▓▒▓▓▓░░ ▓█▓ ░█▓▒ ▒▓▓▒▓▓▓█▒░ \n ▒▓░░ ▒█▒ ░█▓░ ░░█▒ \n ░▒▒▒ ░▓█▒ ░█▓░ ▒░▒▓ \n ░░░▓█▓░ ░▓█▓░░ ░ \n ▓▓▒░░ ░░▓▓▓ \n ",
+ " ░▓▓▓▓▓▓▓▓▒░░ \n ▒████████████▓▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓▒████▓▒▒▒██▓▓░ \n ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ▒▒░ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒\n ▓▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▓\n ░▓█▓░░░░░▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░░░░░▒▓█▒ \n ░░▓█▓██▒▒▓██░▓███▓█▓▒▒█▓▒▓█▓▓█▒▒░ \n ░▒▒▒▓▓▓▓█▒ ██▓▒▒█▓▒░▓▓▓▓▓▒▓▓░░░ \n ▒█▓▒▒░▒▒▒ ▒█▓ ▓█▓ ░▒▒░▒░▒▓▓▓░ \n ▒█░░ ░▓█░ ▒█▓░ ░ █▓ \n ░▒▒▒ ░▓█▓▓░ ░▒▓▓▓░ ░▒▒▒ \n ▒▓▓▒░ ░▒▓▓░ \n ▒▓▒ ░▒▓░ \n ░ ░ ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▓▒░ \n ▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒░\n░▓█▒░░░░░░▓▓░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▓▒░░░░░░▒█▓\n ░░▒▓▓▓▓▓▓░▒▓█▓░▓█████▓▒▒█▓▒░▒▓▓▓▓▓▓▓░ \n ░░▒▓▓▓▓▓▓▓▓░ ▒██▒░▒██▓░▒▓▓█▓▓▓▓▓▓▓░ \n ▒▓▓░░░░░░░ ▓█▓░ ░▓█▓░ ░░░░░░░░▒▓█░\n ▒▓▒░ ░▒▒█▓░ ▒██▓░░ ░▒▓█░\n ░ ▒█▓▓▒░ ░▒▓█▓░ ░░ \n █▓░ ▓▓ \n ░ ░▒░ \n ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓▒ \n ░▓████████████████▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▒▒░ \n ░░░▒▒▓▓▓▓▓▓▒▒░░ \n░▓░ ░░░▓█░▒▓▓▒▓▓█▓▓▓▒▓▓░▓█▒░░ ▒▒\n░▓▓▒▒▒▒▓▓▓░░▓█▓░▓█████▓▒▒█▒░░▒▓▒▒▒░░▒▓▒\n ░▒▓▓▓▓▓▒░▓██░░▓██▒ ░▓█▓▒▒██▒░▒▓▓▓▓▓▓▒ \n ▓▓░░░░▒▓▓▓░░▓██▒ ▒██▒░▒▓▓▓▒░░░░░█▓\n ░▒░ ░▓▓███▓▒ ░▒▓███▓▒░ ▒▒░ \n ▓▓░ ░█▒ \n ░░ ░▒░ \n \n ",
+ " ░░██▓▓▓▓▓▓▓▒░ \n ░▓█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓█████████████████▓▒░ \n ░▓██████████████████▓░ \n ░▓███▒▒██████▓▒▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ \n ░▒▓██▓▒▒▒▒▓█▓▓▒░ \n ░░░▒▒▓▓▓▓▓▓▒▒░░ \n ░░░ ░░░▓▓▓░▒▓▓▒▓▓▓▓▓▓▒▓▒░▓▓▓▒░ ▒▒░ \n ░▒▒▒▒▓▓▓▓░░▒█▓░▓█████▓▒▒█▓▒░▒▓█▓▒▒▓▓░ \n ░▓▓▓▒░░░░▒▓█▒░▓██▒░░██▓▒▒█▓▒░░░░▒▓▓▓▒░\n ░▒░░▒▓▓▒▓▓░░▒██▒░ ▒██▒░▒▓▓▓▓▓▒░░▒▓▒\n ▒▓▓███▓▒ ░▓▓██▓▓▓░ \n ░░ ░░ ░ ░▒░ \n \n \n ",
+ " ▒▒▒▒▒▒▒▒▒░ \n ░████████████▓▒░ \n ░▓███████████████▓▒ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ░▒▓██ ▓▒████▓▒▒▒███▓░ \n ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ \n ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ \n ▓▓░ ░░▓▓▓▓▓▓▓▓▓▒░░ ▒█▒ \n ▒▓▓▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▒▓█▓░ \n ░▒▒▒▒██░▓███▓█▓▒▒█▓▒▒▒▒░ \n ▒▓░ ▒█▒ ███▒▓██▒░▓█▓░ ▒▓▓ \n ░▒░ ░ ░▒ ░██ ░▓█▒ ░▒▒░░░ ░▒░ \n ▒▓░█▓░ ░██ ▒█▓░ ▒█▒▒▓░ \n ░████▒ ░▒███▓░ \n \n \n ",
+ " ░░░░░░░░░ \n ▒▓████████▓▓▒░ \n ░██████████████▓▒░ \n ▒▓████████████████▓░ \n ░▓██████████████████▓░ \n ░▓██████████████████▓░ \n ░▓███░▓▓████▓▓▒▒███▓▒░ \n ░▓▓█░▓░████▓░▒▒██▓▒░ \n ░▒▓██▓▒▓▓▓▓▒██▓▓▒░ \n ░▓▓▓░ ░░▒▓▓▓▓▓▓▓▓▓▓▒░ ▒▓░ \n ░█▓▒░░░░▒▒▒▓▓▓▓▓▒▒▒░░░░░▓█▒ \n ░▒░ ▒▓▓░▓█▓▒▓██▓▓▓▒▓▓▒▒▓▓░ ▒▒░ \n ▒▓▒ ▓██▒ ▓█████▓▒▒██▓░ ░▓▓ \n ░ ░▓▓▒ ███ ░██▒ ░░▒█▒░ \n ░▓▒ ░▒░ ██░ ▒█▒ ▒▒░ ▓▓░ \n ░▓▓░ █▓░░██ ░█▓░▒█▒░▒▒░ \n ▒███▒ ░▓██▓░ \n \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▒░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▓░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒░ \n ▓█░▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒▒▓█░ \n ░░ ▒█▓▒░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░▒▓█░░░ \n ▓▒▒░ ░░▓▓▒▓██░▓█████▓▒▒█▓▒▓▓▒░ ▒▒▒▒ \n ░░ ▒█▓░ ▓██░▒██▒░▒▓▓▓░ ░░ \n ▒█▓░ ░ ██▓ ░██▒ ░▒█▓░ \n ▓█░ ▓▓ ██ ▒█▒░▓░ ▒▒▓░ \n ▒▒░ █▓▒█▓ ░██▓█░ ▒░░ \n ░▓▓░ ▒▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ \n ░▒▒▓░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒░ \n ██░▒▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒▒ ▓▓ \n ░▒▓█▓▒░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░▒▓▒▒▒░ \n ░░░░▒▓▓▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▒░ ░░░ \n ░▓▓█▓░ ▓██░▒██▒░▒▓▓█▓▒░ \n ░▓█▒░░ ░ ██▓ ░██▒ ░░░▒█▓░ \n ▒█▒░ ▒▓▒ ██ ▒█▒░▓▒░ ░░▓█░ \n ░░░ ▒█▒▓█▒ ░▓█▒▓▓░ ▒▒▒░ \n ░▓▓░ ░▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▒░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒██░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ▓██░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▒█▒░░░ ██▓ ░██▒ ░░░░░░▒█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒▒ ░░ █▓░ \n ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ \n ░▒▓▓▓░ ░▓▓▓▒ \n ",
+ " \n ░▓▓▓▓▓▓▓▓▒░░ \n ▒█████████████▓░ \n ░▓███████████████▓▒░ \n ░▓▓████████████████▓▒ \n ░▓██████████████████▓░ \n ░▓███▓▓██████▓▓▓████▒░ \n ▒▓██ ▓░████▓▒▒▒██▓▓░ \n ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ \n ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ \n ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ \n ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ \n ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ \n ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ \n ▓█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ \n ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ \n ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ \n ░▒▓▓▓░ ░▓▓▓▒ \n ",
+};
+static const uint32_t clip_1_ends[] = {100,170,270,330,430,500,600,670,770,830,930,1000,1100,1170,1270,1330,1430,1500,1600,1670,1770,1830,1930,2000,2100,2170,2270,2330,2430,2500,2600,2670,2770,2830,2930,3000,3100,3170,3270,3330,3430,3500,3600,3670,3770,3830,3930,4000,4100,4170,4270,4330,4430,4500,4600,4670,4770,4830,4930,5000,5100,5170,5210};
+static const char *const clip_2_frames[] = {
+ " /\\_/\\ \n( o.o )\n > ^ < ",
+ " /\\_/\\ \n( -.- )\n > ^ < ",
+ " /\\_/\\ \n( o.o )\n > ^ < ",
+ " /\\_/\\ \n( o.O )\n > ^ < ",
+ " /\\_/\\ \n( ^.^ )\n > ^ < ",
+ " /\\_/\\ \n( o.o )\n > ^ < ",
+};
+static const uint32_t clip_2_ends[] = {2300,2420,4820,5470,6270,7770};
+static const char *const clip_3_frames[] = {
+ " .cccc;;cc;';c. \n .,:dkdc:;;:c:,:d:. \n .loc'.,cc::::::,..,:. \n .cl;....;dkdccc::,...c; \n .c:,';:'..ckc',;::;....;c. \n .c:'.,dkkoc:ok:;llllc,,c,';:. \n .;c,';okkkkkkkk:,lllll,:kd;.;:,. \n co..:kkkkkkkkkk:;llllc':kkc..oNc \n .cl;.,okkkkkkkkkkc,:cll;,okkc'.cO; \n ;k:..ckkkkkkkkkkkl..,;,.;xkko:',l' \n .,...';dkkkkkkkkkkd;.....ckkkl'.cO; \n .,,:,.;oo:ckkkkkkkkkkkdoc;;cdkkkc..cd, \n .cclo;,ccdkkl;llccdkkkkkkkkkkkkkkkd,.c; \n .lol:;;okkkkkxooc::loodkkkkkkkkkkkko'.oc \n .c:'..lkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.oc \n .lo;,ccdkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.c; \n,dx:..;lllllllllllllllllllllllllllllllloc'... \ncNO;........................................ ",
+ " .ckx;'........':c. \n .,:c:c:::oxxocoo::::,',. \n .odc'..:lkkoolllllo;..;d, \n ;c..:o:..;:..',;'.......;. \n ,c..:0Xx::o:.,cllc:,'::,.,c. \n ;c;lkXXXXXXl.;lllll;lXXOo;':c. \n ,dc.oXXXXXXXXl.,lllll;lXXXXx,c0: \n ;Oc.oXXXXXXXXo.':ll:;'oXXXXO;,l' \n 'l;;OXXXXXXXXd'.'::'..dXXXXO;,l' \n 'l;:0XXXXXXXX0x:...,:o0XXXXk,:x, \n 'l;;kXXXXXXKXXXkol;oXXXXXXXO;oNc \n ,c'..ckk2XXXXXXXXXX00XXXXXXX0:;o:. \n .':;..:dd::ooooOXXXXXXXXXXXXXXXo..c; \n .',',:co0XX0kkkxx0XXXXXXXXXXXXXXX0c..;l. \n .:;'..oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXko;';:. \n.cdc..:oOXXXXXXXXKXXXXXXXXXXXXXXXXXXXXXXo..oc \n:0o...:dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo,.:, \ncNo........................................;' ",
+ " .cc;. ... .;c. \n .,,cc:cc:lxxxl:ccc:;,. \n .lo;...lKKklllookl..cO; \n .cl;.,;'.okl;...'.;,..';:. \n .:o;;dkx,.ll..,cc::,..,'.;:,. \n co..lKKKkokl.':lllo;''ol..;dl. \n .,c;.,xKKKKKKo.':llll;.'oOxo,.cl,. \n cNo..lKKKKKKKo'';llll;;okKKKl..oNc \n cNo..lKKKKKKKko;':c:,'lKKKKKo'.oNc \n cNo..lKKKKKKKKKl.....'dKKKKKxc,l0: \n .c:'.lKKKKKKKKKk;....oKKKKKKo'.oNc \n ,:.,oxOKKKKKKKOxxxxOKKKKKKxc,;ol:. \n ;c..'':oookKKKKKKKKKKKKKKKKKk:.'clc. \n ,dl'.,oxo;'';oxOKKKKKKKKKKKKKKKOxxl::;,,. \n .dOc..lKKKkoooookKKKKKKKKKKKKKKKKKKKxl,;ol. \n cx,';okKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKl..;lc. \n co..:dddddddddddddddddddddddddddddddddl:;''::.\n co...........................................\"",
+ " .ccccccc. \n .,,,;cooolccol;;,,. \n .dOx;..;lllll;..;xOd. \n .cdo,',loOXXXXXkll;';odc. \n ,oo:;c,':oko:cccccc,...ckl. \n ;c.;kXo..::..;c::'.......oc \n,dc..oXX0kk0o.':lll;..cxxc.,ld, \nkNo.'oXXXXXXo'':lll;..oXXOd;cOd. \nKOc;oOXXXXXXo.':lol,..dXXXXl';xc \nOl,:k0XXXXXX0c.,clc'.:0XXXXx,.oc \nKOc;dOXXXXXXXl..';'..lXXXXXd..oc \ndNo..oXXXXXXXOx:..'lxOXXXXXk,.:; .. \ncNo..lXXXXXXXXXOolkXXXXXXXXXkl;..;:.;. \n.,;'.,dkkkkk0XXXXXXXXXXXXXXXXXOxxl;,;,;l:. \n ;c.;:''''':doOXXXXXXXXXXXXXXXXXXOdo;';clc. \n ;c.lOdood:'''oXXXXXXXXXXXXXXXXXXXXXk,..;ol. \n ';.:xxxxxocccoxxxxxxxxxxxxxxxxxxxxxxl::'.';;. \n ';........................................;l' ",
+ " .;:;;,.,;;::,. \n .;':;........'co:. \n .clc;'':cllllc::,.':c. \n .lo;;o:coxdlooollc;',::,,. \n.c:'.,cl,.'lc',,;;'......cO; \ndo;';oxoc::l;;llllc'.';;'.';. \nc..ckkkkkkkd,;llllc'.:kkd;.':c. \n'.,okkkkkkkkc;llllc,.:kkkdl,cO; \n..;xkkkkkkkkc,ccll:,;okkkkk:,cl, \n..,dkkkkkkkkc..,;,'ckkkkkkkc;ll. \n..'okkkkkkkko,....'okkkkkkkc,:c. \nc..ckkkkkkkkkdl;,:okkkkkkkkd,.',';. \nd..':lxkkkkkkkkxxkkkkkkkkkkkdoc;,;'..'.,. \no...'';llllldkkkkkkkkkkkkkkkkkkdll;..'cdo. \no..,l;'''''';dkkkkkkkkkkkkkkkkkkkkdlc,..;lc. \no..;lc;;;;;;,,;clllllllllllllllllllllc'..,:c. \no..........................................;' \n ",
+ " .,,,,,,,,,. \n .ckKxodooxOOdcc. \n .cclooc'....';;cool. \n .loc;;;;clllllc;;;;;:;,. \n .c:'.,okd;;cdo:::::cl,..oc \n .:o;';okkx;';;,';::;'....,;,. \n co..ckkkkkddk:,cclll;.,c:,:o:. \n co..ckkkkkkkk:,cllll;.:kkd,.':c. \n.,:;.,okkkkkkkk:,cclll;.:kkkdl;;o:. \ncNo..ckkkkkkkkko,.;llc,.ckkkkkc..oc \n,dd;.:kkkkkkkkkx;..;:,.'lkkkkko,.:, \n ;c.ckkkkkkkkkkc.....;ldkkkkkk:.,' \n,dc..'okkkkkkkkkxoc;;cxkkkkkkkkc..,;,. \nkNo..':lllllldkkkkkkkkkkkkkkkkkdcc,.;l. \nKOc,l;''''''';lldkkkkkkkkkkkkkkkkkc..;lc. \nxx:':;;;;,.,,...,;;cllllllllllllllc;'.;oo, \ncNo.....................................oc \n ",
+ " .ccccccc. \n .ccckNKOOOOkdcc. \n .;;cc:ccccccc:,::::,,. \n .c;:;.,cccllxOOOxlllc,;ol. \n .lkc,coxo:;oOOxooooooo;..:, \n .cdc.,dOOOc..cOd,.',,;'....':c. \n cNx'.lOOOOxlldOl..;lll;.....cO; \n ,do;,:dOOOOOOOOOl'':lll;..:d:.'c, \n co..lOOOOOOOOOOOl'':lll;.'lOd,.cd. \n co.,dOOOOOOOOOOOo,.;llc,.,dOOc..dc \n co..lOOOOOOOOOOOOc.';:,..cOOOl..oc \n .,:;.'::lxOOOOOOOOOo:'...,:oOOOc..dc \n ;Oc..cl'':llxOOOOOOOOdcclxOOOOx,.cd. \n .:;';lxl''''':lldOOOOOOOOOOOOOOc..oc \n,dl,.'cooc:::,....,::coooooooooooc'.c: \ncNo.................................oc \n \n ",
+ " .cccccccc. \n .,,,;;cc:cccccc:;;,. \n .cdxo;..,::cccc::,..;l. \n ,oo:,,:c:cdxxdllll:;,';:,. \n .cl;.,oxxc'.,cc,.',;;'...oNc \n ;Oc..cxxxc'.,c;..;lll;...cO; \n .;;',:ldxxxdoldxc..;lll:'...'c, \n ;c..cxxxxkxxkxxxc'.;lll:'','.cdc. \n .c;.;odxxxxxxxxxxxd;.,cll;.,l:.'dNc \n .:,''ccoxkxxkxxxxxxx:..,:;'.:xc..oNc \n .lc,.'lc':dxxxkxxxxxxxdl,...',lx:..dNc \n .:,',coxoc;;ccccoxxxxxxxxo:::oxxo,.cdc. \n .;':;.'oxxxxxc''''';cccoxxxxxxxxxkxc..oc \n,do:'..,:llllll:;;;;;;,..,;:lllllllll;..oc \ncNo.....................................oc \n \n \n ",
+ " .ccccc. \n .cc;'coooxkl;. \n .:c:::c:,;,,,;c;;,.'. \n .clc,',:,..:xxocc;...c; \n .c:,';:ox:..:c,,,,,,...cd, \n .c:'.,oxxxxl::l:.;loll;..;ol. \n ;Oc..:xxxxxxxxx:.,llll,....oc \n .,;,',:loxxxxxxxxx:.,llll;.,;.'ld, \n .lo;..:xxxxxxxxxxxx:.'cllc,.:l:'cO; \n .:;...'cxxxxxxxxxxxxol;,::,..cdl;;l' \n .cl;':;'';oxxxxxxxxxxxxx:....,cooc,cO; \n .,,,::;,lxoc:,,:lxxxxxxxxxxxo:,,;lxxl;'oNc \n .cdxo;':lxxxxxxc'';cccccoxxxxxxxxxxxxo,.;lc. \n .loc'.'lxxxxxxxxocc;''''';ccoxxxxxxxxx:..oc \nocc'..',:cccccccccccc:;;;;;;;;:ccccccccc,.'c, \nOl;......................................;l' \n \n ",
+ " ,ddoodd, \n .cc' ,ooccoo,'cc. \n .ccldo;....,,...;oxdc. \n .,,:cc;.''..;lol;;,'..lkl. \n .dkc';:ccl;..;dl,.''.....oc \n .,lc',cdddddlccld;.,;c::'..,cc:.\n cNo..:ddddddddddd;':clll;,c,';xc\n .lo;,clddddddddddd;':clll;:kc..;'\n .,:;..:ddddddddddddd:';clll;;ll,.. \n ;Oc..';:ldddddddddddl,.,c:;';dd;.. \n .''',:lc,'cdddddddddddo:,'...'cdd;.. \n .cdc';lddd:';lddddddddddddd;.';lddl,.. \n .,;::;,cdddddol;;lllllodddddddlcodddd:.'l,\n .dOc..,lddddddddlccc;'';cclddddddddddd;,ll.\n .coc,;::ldddddddddddddl:ccc:ldddddddddlc,ck; \n,dl::,..,cccccccccccccccccccccccccccccccc:;':xx,\ncNd.........................................;lOc\n ",
+};
+static const uint32_t clip_3_ends[] = {100,200,300,400,500,600,700,800,900,1000};
+static const char *const clip_4_frames[] = {
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n ' \\ |, <o> (. )| \n / , )'| (_\\ || \n / : /|||\\`Vvv' || \n (, : \\'|| `^^' _'|| \n ( : / |' _ -' \\'| \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`- \n //'/,-''`\\ \n _/, // __ \\\\ \n ' \\ |,<o> (. )| \n / , )'| (_\\ | \n / : /|||\\`Vvv' || \n (, : \\'|| `^^' _'|| \n ( : / |' _ -' \\'| \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,-' _ `- \n ///`'-''\\\\\\ \n _/,/ _ _ \\`\\ \n ' \\!|<o>|<o>|:| \n / , )' /_\\ ||| \n / : /||\\`vvv' !|| \n (, : \\'||`^^^' _'|| \n ( : / |' _ -' \\'| \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _// _ \\\\ :\\ \n ' \\| .) <o>\\:|| \n / , ) /_) ||| \n / : /| `vvV'/ !|| \n (, : \\|| `^^' _'| \n ( : /'|! _ -' \\' \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _// _ \\\\ :\\ \n ' \\| .) <o>\\:|| \n / , ) /_) ||| \n / : /| `vvV'' !|| \n (, : \\|| `' _'| \n ( : /'|! _ -' \\' \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//_ \\\\ :\\ \n ' \\|.) <o> \\:|| \n / , )/_) ||| \n / : /| `vvV'' !|| \n (, : \\|| _'| \n ( : /'|! _ -' \\' \n ( : | ' -' ' ( \\ \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//| \\\\ :\\ \n ' --+--<o> \\:|| \n / , )|_) ||| \n / : /| `vvV'' !|| \n (, : \\|| _'| \n ( : /'|! _ -' \\' \n ( : | ' -' ' ( \\ \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//_ \\\\ :\\ \n ' \\|+) <o> \\:|| \n / , )/_) ||| \n / : /| `vvV'' !|| \n (, : \\|| _'| \n ( : /'|! _ -' \\' \n ( : | ' -' ' ( \\ \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//_ \\\\ :\\ \n ' \\| ) <o> \\:|| \n / , )/_) ||| \n / : /| `vvV'' ||| \n (, : \\|| _'|| \n ( : /'|! _ -' \\'| \n ( : | ' ' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / _/|| \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//_ \\\\ :\\ \n ' \\|.) <o> \\:|| \n / , )/_) ||| \n / : /| `vvV'' ||| \n (, : \\|| _ ||| \n ( : /'|!_ -' \\'||' \n ( : |,-' ' ( \\'| \n \\ : ' ' ( \\' \n ) `-' ___ - `,)) \n ,( ' , ) / ||\\ \n ( `- _ ( / / '' \n _| `- ---_/ / ( : \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _//_ \\\\ :\\ \n ' \\|.) <o> \\:|| \n / , )/_) ||| \n / : /| `vvV'' ||| \n (, : \\|| `' _ |||` \n ( : /'|!_ -' \\'||-' \n ( : |,-' ' ( \\'| \n \\ : ' ' ( \\' \n ) `-' ___ -`,)) \n ,( ' , ) /||\\ \n ( `- _ ( / / '' \n _| `- ---_/ / ( : \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " ______ \n --'_,`: :`: \n // `'- \\`\\\\ \\ \\\\ \n _|/_ \\\\ :\\ \\'\\ \n / '.).,o.o.ooo> | || \n | /_,_,__,_,'| | ||_ \n _ -'' `vvvvvvvvV\\ | |',`- \n -' \\ ,-,^\\\\`',''_ -' \n ^^'' ,' \n ( ,'| \n _, --- - , __ _ ( `-' \n'' ) `` ___`- \\ \n ,( ' , ) / ' \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n ' / `vvV'| |' \\ - _ ,`- \n / | \\ \\\\ / ' \\\\` --'_ -' \n _ '' ! \\^^' \\\\ / )' \n' / | \\\\\\` \\( ,' \n | \\ _/`\\\\\\_ /\\```- \n ! ) `` ___`- \\ \n ` ) ,( ' , ) / \\ \n ,___, -' ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n \\ | `vvV'| |' \\ - _ ,`- \n / |\\ \\\\ / ' \\\\` --'_ -' \n / ! \\^^' \\\\ / )' \n |_/ | \\\\\\` \\( ,' \n | | \\ _/`\\\\\\_ /\\```- \n , | ) `` ___`- \\ \n /(__)) ,( ' , ) / \\ \n `--' ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n \\ | `vvV'| |' \\ - _ ,`- \n / |\\ \\\\ / ' \\\\` --'_ -' \n / ! \\^^' \\\\ / )' \n |_/ | \\\\\\` \\( ,' \n | | \\ _/`\\\\\\_ /\\```- \n \\,| ) `` ___`- \\ \n /(__)),( ' , ) / \\ \n `--'( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n \\ | `vvV'/ |' \\ - _ ,`- \n / |\\ \\`^^' ' \\\\` --'_ -' \n / ! \\\\ \\\\ / )' \n |_/ | \\\\\\` \\( ,' \n | | \\ _/`\\\\\\_ /\\```- \n \\,| ) `` ___`- \\ \n /(__)),( ' , ) / \\ \n `--'( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n \\ | `vvV'/ |' \\ - _ ,`- \n / |\\ \\`^^' ' \\\\` --'_ -' \n / ! \\\\ \\\\ / )' \n |_/ | \\\\\\` \\( ,' \n | | \\ _/`\\\\\\_ /\\```- \n \\,\\ ) `` ___`- \\ \n /(__))( ' , ) / \\ \n `--( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/_ \\\\ :\\ \n / |.) <o> :| ||- \n | '/_) |||'| `- _ \n \\ | `vvV'/ |' \\ - _ ,`- \n / |\\ \\`^^' ' \\\\` --'_ -' \n | | \\\\ \\\\ / )' \n \\_| | \\\\\\` \\( ,' \n | | \\ _/`\\\\\\_ /\\```- \n \\,\\ ) `` ___`- \\ \n /(__)) ' , ) / \\ \n `--' `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n --'_,`: \n // `'- \\`\\\\ \n _|/__ \\\\ :\\ \n / | .) <o>:| ||- \n | ' /_) |||| `- _ \n \\ | `vvV'/ |' \\ - _ ,`- \n | |\\\\`^^' ' \\\\` --'_ -' \n / '\\\\\\\\ \\\\ / )' \n | ,- '\\\\\\` \\( ,' \n \\ /(__/,'\\\\\\_ /\\```- \n \\_ --/ `` ___`- \\ \n ' , ) / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,-' _ `- \n ///`'-''\\\\\\ \n _/,/ _ _ \\`\\ \n / |||<o>|<o>|:|- \n | ,|| /_\\ ||| `- _ \n \\ '||\\`vvv'/||' - _ ,`- \n | \\'\\\\`^^^' |\\\\` --'_ -' \n | ' '\\ \\\\\\/ )' \n / ,' ` '\\` \\( ,' \n \\ /( \\'\\\\_ /\\```- \n '-' '-\\\\ ` ___`- \\ \n ,( ' ' , ) / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`- \n //'/,-' \\` \n _/, // __ \\`\\ \n / ||,<o> (. )|| \n | ,|| (_\\ || `- _ \n \\ '||\\`Vvv' |'- _ ,`- \n : \\|\\ `^^' |\\\\` -' -' \n : |' ' \\ \\\\\\/ )' \n | ,' /( \\` \\( ,' \n \\ / ( \\\\_ /\\```- \n '-' , `,)) ___`- \\ \n ,( '' , ) / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _ \\`\\ \n / ||,<o> (. )|| \n ( ,'|| (_\\ ||`- _ \n \\ !||\\`Vvv' || _ ,`- \n : \\|\\ `^^' ||| -' -' \n : |' ' \\ ||/ )' \n : ,' /( \\ \\( ,' \n \\ ' ( \\ /\\```- \n '-', `,))__`- \\ \n ,( ' , ) / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n / ||, <o> (. )| \n ( ,'|| (_\\ ||`- _ \n \\ !||\\`Vvv' || _ ,`- \n : \\'\\ `^^' ||| -' -' \n : | ' _ ' \\ |/ )' \n : ',' '( \\\\( ,' \n \\ ' ( \\\\```- \n '-' `,))`- \\ \n ,( ' , ) / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n / ||, <o> (. )| \n ( )||| (_\\ ||- _ \n \\ \\'||\\`Vvv' ||_ ,`- \n : \\'\\ `^^'_ ||!-' -' \n : |'\\ _ ' \\||| )' \n ' \\,' '( \\\\\\' \n \\ ' ' ( \\\\\\ \n '-' _`,)) \\ \n ,( ' , ') / \\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n / \\||, <o> (. )| \n |, )|| (_\\ || \n : |'|\\`Vvv' ||_ \n : \\ | `^^' _|||,`- \n : \\' _ ' \\|| -' \n ' |,-' '( \\|' \n : ' ' ( \\ \n / `-' ___ `,)) \n ,( ' , ) '\\\\ \n ( `- _ ( / / \\ \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n / \\|, <o> (. )| \n \\, )| (_\\ || \n : |||\\`Vvv' || \n (: \\'| `^^' _|||- \n (: |'|'_ -' \\|||-' \n ( : |,-' ' ( \\| \n ): ' ' ( \\ \n / `-' ___ - `,)) \n ,( ' , ) -'' \n ( `- _ ( / / | \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n ( \\|, <o> (. )| \n /, )| (_\\ || \n / : /||\\`Vvv' || \n (, : \\|| `^^' _'|| \n ( : /'|! _ -' \\'|' \n ( : | ' ' ' ( \\' \n \\ : '' ' ( \\ \n / `-' ___`- `,)) \n ,( ' , ) /-'// \n ( `- _ ( / / ' | \n _| `- ---_/ / ( ' \\ \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+ " _ \n ,:',_`-- \n //'/,-'' \\` \n _/, // _\\`\\ \n ' \\ |, <o> (. )| \n / , )'| (_\\ || \n / : /|||\\`Vvv' || \n (, : \\'|| `^^' _'|| \n ( : / |' _ -' \\'| \n ( : | ' -' ' ( \\' \n \\ : '' ' ( \\ \n ) `-' ___ - `,)) \n ,( ' , ) / -'// \n ( `- _ ( / / ' \n _| `- ---_/ / ( : || \n /_' ( (',,) , |'\\ \n ` ` ,- ),,)\\' ` ' `_`'- --,\n ,- ''' \\ \n _' / ` `- \n `-' ",
+};
+static const uint32_t clip_4_ends[] = {850,960,1040,1160,1260,1340,1450,1650,1840,1950,2030,2140,2240,2320,2630,2810,2920,3000,3110,3190,3290,3400,3480,3590,3670,3770,3880,4720};
+static const char *const clip_5_frames[] = {
+ " \n \n _ \n /,\\__ \n ,-o( /,\\\\ /| \n ,-o(/\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n __// //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n _ /,\\__ \n ,\\`o,- \\\\ /| \n ''\\//\\\\\\/_'-- _ \n ,-o( //|// _ /\\ __` _ \n __// //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n , _ \n |o,____ \n ,' `- \\\\ /| \n \\//\\\\\\/_'-- _ \n ,-o( //|// _ /\\ __` _ \n __// //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n , \n /o, \n `'\\` _ \n ,-o(\\\\' \\\\ /| \n \\//|\\\\\\/_'-- _ \n ,-o( //\\|// _ /\\___` _ \n __// //\\/ |/\\\\--(\\/ \n ,-`- ) // //||/|| -'|| \n _/ (' '/'// // \\\\ \n // /o- )o-\n /o- ",
+ " \n ____ \n _ \\o-' \n /,\\ \\\\ \n ,-o(\\\\\\||| /| \n \\//|||\\/_'-- _ \n ,-o( //\\|// _ /\\___` _ \n __// //\\/ |/\\\\--(\\/ \n ,-`- ) // //||/|| -'|| \n _/ (' '/'// // \\\\ \n // /o- )o-\n /o- ",
+ " \n ____ \n _ _ \\o-' \n \\`o,- \\ \\\\ \n '' /\\\\\\||| /| \n ,;'\\//|||\\/_'-- _ \n ,-o( //\\|// _ /\\___` _ \n __// //\\/ |/\\\\--(\\/ \n ,-`- ) // //||/|| -'|| \n _/ (' '/'// // \\\\ \n // /o- )o-\n /o- ",
+ " \n , ____ \n |o,___ \\o-' \n ' `- \\ )) \n /\\\\//|\\ /| \n ,;'\\ /||\\\\/_'-- _ \n ,-o( /||||/ _ /\\___` _ \n __/|| \\/ |/\\\\--(\\/ \n ,-`- )|| //||/|| -'|| \n _/ \\' '/'// // \\\\ \n // /o- )o-\n /o- ",
+ " , \n 'o ' \n ' o \\ \n o '\\ \n |\\\\ /| \n / o | |//\\/_'-- _ \n / |\\/// _ /\\___` _ \n ' o ' \\/ |/\\\\--(\\/ \n : \\ //||/_\\\\-'`: \n ;-o' ` - '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " ____ \n \\o-' \n \\\\ \n || \n ,\\\\ ||| /| \n ||\\\\ |//\\/_'-- _ \n ,-o( \\\\/// _ /\\___` _ \n _ / \\/ |/\\\\--(\\/ \n , --- ,______ //||/_\\\\-'`: \n ,-o/ ` - -- '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " ____ \n \\o-' \n )) \n //_ \n ,\\\\ /||\\ /| \n ||\\||||\\\\/_'-- _ \n ,-o( ||||/ _ /\\___` _ \n _ / \\/ |/\\\\--(\\/ \n _, -- ----- //||/_\\\\-'`: \n ,-o/ '- '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " 'o ' \n ' o \\ \n o ' \n _ \n / o |\\ ||\\ /| \n / |\\\\ ||\\\\/_'-- _ \n ' o ,-o( \\\\||/ _ /\\___` _ \n : __ _\\/ \\/ |/\\\\--(\\/ \n;-o' _, ' - `' - //||/_\\\\-'`: \n ,-o/ _/`'\\- '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " \n \n \n _ \n ,\\\\ ||\\ /| \n ||\\\\ ||\\\\/_'-- _ \n ,-o( \\\\||/ _ /\\___` _ \n , --- - _ __/ \\/ |/\\\\--(\\/ \n,-o/ ,;'`` ,`'- //||/_\\\\-'`: \n ,-o/ _/ `'- '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " \n \n \n _ \n ,\\\\ ||\\ /| \n _ ||\\\\ ||\\\\/_'-- _ \n ,; -o( \\\\||/ _ /\\___` _ \n ,,-o( ,` ` _/ \\/ |/\\\\--(\\/ \n,-o/ `,-`` ` //||/_\\\\-'`: \n _/ `'- '/'|| || \\\\ \n || /o- )o-\n /o- ",
+ " \n \n \n _ \n _ /\\ ||\\ /| \n ,; \\ //\\\\ ||\\\\/_'-- _ \n ,-o( ,\\` \\\\||/ _ /\\ __` _ \n _, - ` \\ / \\/ |/\\\\--(\\/ \n,-o/ ,-o8\\` _ //||/_\\\\-'\\\\ \n _/ `'- '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n \n _ _ \n ,; \\ /\\ ||\\ /| \n ,-o( \\\\/\\\\ ||\\\\/_'-- _ \n ,-o\\\\ \\\\||/ _ /\\ __` _ \n _, ' - _\\\\/ \\/ |/\\\\--(\\/ \n,-o/ ,-o8 \\\\_ //||/_\\\\-'\\\\ \n _/ `- '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n ,; \\ _ \n ,-o( || ||\\ /| \n //:\\ ||\\\\/_'-- _ \n - _,-o( ||\\||/ _ /\\ __` _ \n ,;' ` __ : \\/ |/\\\\--(\\/ \n ,-o/ ,-o8 )|| //||/_\\\\-'\\\\ \n _/ '- '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n ,; | _ \n _ ,-o(\\||||\\ /| \n ,; \\||||\\\\/_'-- _ \n ,-o( ` `,-o( ||||/ _ /\\ __` _ \n __ || \\/ |/\\\\--(\\/ \n ,-o8 )|| //||/_\\\\-'\\\\ \n _/ \\` '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n \n _ _ _ \n ,; \\ //,\\||\\ /| \n ,-o( \\` ,-o(\\\\\\|\\\\/_'-- _ \n ,- \\|||/ _ /\\ __` _ \n ___/|' \\/ |/\\\\--(\\/ \n ,-o8 ),: //||/_\\\\-'\\\\ \n _/ \\` '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n ,; \\ __ \n ,-o( \\\\ /\\ /,\\\\ /| \n \\\\/,-o(|\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n ___/ //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n _ \n ,; \\ \n ,-o( || __ \n :/\\ /,\\\\ /| \n |,-o(|\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n __|/ //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n _ \n ,; | \n ,-o( || __ \n || /,\\\\ /| \n /,-o(|\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n __|/ //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n /,\\ __ \n ,-o(/\\\\/,\\\\ /| \n ,-o(|\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n __:/ //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+ " \n \n _ \n /,\\__ \n ,-o( /,\\\\ /| \n ,-o(/\\\\\\/_'-- _ \n ,-o( |// _ /\\ __` _ \n __// //\\/ |/\\\\--(\\/ \n ,-o8 ) // //||/_\\\\-'\\\\ \n _/ (' '/'|| // \\\\ \n // /o- )o-\n /o- ",
+};
+static const uint32_t clip_5_ends[] = {490,520,590,620,690,720,790,820,920,990,1020,1090,1120,1190,1220,1290,1320,1390,1420,1490,1520,1590,1620};
+static const char *const clip_6_frames[] = {
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n } / :} {: \\ { \n / { } { } \\ \n } } ) } { ( { { \n / { /|\\}!{/|\\ } \\ \n } } ( (.\"^\".) ) { { \n / { (d\\ /b) } \\ \n } } |\\~ ~/| { { \n / / | ) ( | \\ \\ \n { { _)(, ,)(_ } } \n } } // `\";\"` \\\\ { { \n / / // ( \\\\ \\ \\ \n{ { {( -=) )} } }\n \\ \\ /) -=(=- (\\ / / \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n } / :} {: \\ { \n / { } { } \\ \n } } ) } { ( { { \n / { /|\\}!{/|\\ } \\ \n } } ( (.\"^\".) ) { { \n / { (-\\ /-) } \\ \n } } |\\~ ~/| { { \n / / | ) ( | \\ \\ \n { { _)(, ,)(_ } } \n } } // `\";\"` \\\\ { { \n / / // ( \\\\ \\ \\ \n{ { {( -=) )} } }\n \\ \\ /) -=(=- (\\ / / \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n } / :} {: \\ { \n / { } { } \\ \n } } ) } { ( { { \n / { /|\\}!{/|\\ } \\ \n } } ( (.\"^\".) ) { { \n / { (d\\ /b) } \\ \n } } |\\~ ~/| { { \n / / | ) ( | \\ \\ \n { { _)(, ,)(_ } } \n } } // `\";\"` \\\\ { { \n / / // ( \\\\ \\ \\ \n{ { {( -=) )} } }\n \\ \\ /) -=(=- (\\ / / \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n }/ :} {: \\{ \n /{ } { }\\ \n }} ) } { ( {{ \n /{ /|\\}!{/|\\ }\\ \n }} ( (.\"^\".) ) {{ \n /{ (d\\ /b) }\\ \n }} |\\~ ~/| {{ \n // | ) ( | \\\\ \n {{ _)(, ,)(_ }} \n }} // `\";\"` \\\\ {{ \n // // ( \\\\ \\\\ \n {{ {( -=) )} }} \n \\\\ /) -=(=- (\\ // \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n } / :} {: \\ { \n / { } { } \\ \n } } ) } { ( { { \n / { /|\\}!{/|\\ } \\ \n } } ( (.\"^\".) ) { { \n / { (d\\ /b) } \\ \n } } |\\~ ~/| { { \n / / | ) ( | \\ \\ \n { { _)(, ,)(_ } } \n } } // `\";\"` \\\\ { { \n / / // ( \\\\ \\ \\ \n{ { {( -=) )} } }\n \\ \\ /) -=(=- (\\ / / \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n }/ :} {: \\{ \n /{ } { }\\ \n }} ) } { ( {{ \n /{ /|\\}!{/|\\ }\\ \n }} ( (.\"^\".) ) {{ \n /{ (d\\ /b) }\\ \n }} |\\~ ~/| {{ \n // | ) ( | \\\\ \n {{ _)(, ,)(_ }} \n }} // `\";\"` \\\\ {{ \n // // ( \\\\ \\\\ \n {{ {( -=) )} }} \n \\\\ /) -=(=- (\\ // \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+ " \\(______ ______)/ \n /`.----.\\ /.----.`\\ \n } / :} {: \\ { \n / { } { } \\ \n } } ) } { ( { { \n / { /|\\}!{/|\\ } \\ \n } } ( (.\"^\".) ) { { \n / { (d\\ /b) } \\ \n } } |\\~ ~/| { { \n / / | ) ( | \\ \\ \n { { _)(, ,)(_ } } \n } } // `\";\"` \\\\ { { \n / / // ( \\\\ \\ \\ \n{ { {( -=) )} } }\n \\ \\ /) -=(=- (\\ / / \n `\\\\ /'/ /-=|\\-\\ \\`\\ //' \n `\\{ | ( -===- ) | }/' \n ` _\\ \\-===-/ /_ ' \n jgs (_(_(_)'-=-'(_)_)_) \n `\"`\"`\" \"`\"`\"` ",
+};
+static const uint32_t clip_6_ends[] = {2200,2340,4140,4490,4890,5240,6540};
+static const char *const clip_7_frames[] = {
+ " .---. \n ( ) \n [ -|- ] \n \\ _ / \n |`-'| \n_.-' '-._",
+ " .---. \n ( / \n [ -| \n \\ > \n |`-J \n_.-' '-._",
+ " .---. \n / ) \n | [ | \n \\ > \n | J \n_.-' '-._",
+ " .---. \n ( ) \n [ ] \n L J \n / \\ \n_.- -._",
+ " .---. \n ( \\ \n | ] | \n < / \n L | \n_.-' '-._",
+ " .---. \n \\ ) \n |- ] \n < / \n L-`| \n_.-' '-._",
+ " .---. \n ( ) \n [ -|- ] \n \\ _ / \n |`-'| \n_.-' '-._",
+};
+static const uint32_t clip_7_ends[] = {1600,2000,2700,3700,4400,4800,5700};
+static const char *const clip_8_frames[] = {
+ " \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ \n ███ █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ \n ░░██ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █░░███▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n ██░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ \n ██░░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ \n ████▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ \n ██▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ \n █▓▓▓▒▒▒▒▒▒█░░░██████░░█ \n ███▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░░███████████████████ \n █░░██ █░█ █░█ █░░█ \n ████ ██ ██ ██ \n ",
+ " \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █ █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █░█ █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n █░████▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n ░░░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n ██░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n ███▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░████████████████████ \n █░░█ █░█ ░░█ █░░█ \n ███ ██ ███ ███ \n ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n ██▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n █████▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n █░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n ███ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░████████████████████ \n █░░█ ░░█ ░░█ █░░█ \n ███ ███ ███ ███ ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n ███▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n ██░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n ░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n █░█ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █ █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░████████████████████ \n █░░█ █░█ █░█ █░░█ \n ███ ██ ██ ███ ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ \n █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ \n ███ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ \n█░░████▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n█░░░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ \n ████░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ \n ███▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ \n █▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ \n ██▓▓▓▒▒▒▒▒▒█░░░██████░░█ \n ████▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░░████████████████████ \n █░░█ █░░ █░░ █░░█ \n ███ ██ ██ ███ ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒██▒▒▒▓▓█ ██ \n █▓▒▒▓▒▒▒▒▒█░░█▓▒▒▓██░░█ \n █▓▒▒▒▒▒▒▒▒█░░░▒▒▒▓█░░░█ \n █ █▓▒▒▒▒▒▓▒▒█░░░████░░░░█ \n █░█ █▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n █░████▓▒▒▒▒▒▒▒█░░░░░░░░░░░░░█ \n ░░░░█▓▒▒▒▒▒▒▓█░░░██░░░░██░░█ \n ██░░█▓▒▓▒▒▒▒▒█░░░██░░█░██░░█ \n ███▓▒▒▒▒▒▒▒█░▓▓░░░░░░░░▓▓█ \n █▓▓▒▒▒▓▒▒▒█░░░██████░░█ \n ██▓▓▓▒▒▒▒▒▒▒█░░░░░░░░░█ \n █░██▓▓▓▓▓▓▓▓▓▓█████████ \n █░░░████████████████░█ \n █░░█ █░░ █░░ █░░█ \n ███ ███ ███ ███ ",
+ " \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ \n ███ █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ \n █░██ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █░░███▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n █░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ \n ██░░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ \n ████▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ \n ██▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ \n █▓▓▓▒▒▒▒▒▒█░░░██████░░█ \n ███▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░░███████████████████ \n █░░██ █░█ █░░ █░░█ \n ████ ██ ██ ██ \n ",
+ " █ \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █ █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █░█ █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n █░████▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n ░░░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n ██░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n ███▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░████████████████████ \n █░░█ █░█ ░░█ █░░█ \n ███ ██ ███ ███ █ \n ",
+ " █ \n █ \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n ██▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n █████▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n █░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n ███ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░████████████████████ \n █░░█ ░░█ ░░███░░█ \n ███ ███ ███ ███ ",
+ " █ \n █ \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ \n █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ \n █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n ███▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█\n ██░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█\n ░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█\n █░█ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█\n █ █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ \n ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░████████████████████ \n █░░█ █░█ ██ █░░█ █░░█ \n ███ ██ █ ███ ███ ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ \n █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ \n █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ \n █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ \n ███ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ \n█░░████▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n█░░░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ \n ████░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ \n ███▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ \n █▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ \n ██▓▓▓▒▒▒▒▒▒█░░░██████░░█ \n ████▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ \n █░░░████████████████████ \n █░░███░░██ █░░██░░█ \n ███ ██ ███ ███ ",
+ " \n \n ███████████████ \n █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ \n █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ \n █▓▓▒▒▒▒▒▓▒▒██▒▒▒▓▓█ ██ \n █▓▒▒▓▒▒▒▒▒█░░█▓▒▒▓██░░█ \n █▓▒▒▒▒▒▒▒▒█░░░▒▒▒▓█░░░█ \n █ █▓▒▒▒▒▒▓▒▒█░░░████░░░░█ \n █░█ █▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ \n █░████▓▒▒▒▒▒▒▒█░░░░░░░░░░░░░█ \n ░░░░█▓▒▒▒▒▒▒▓█░░░██░░░░██░░█ \n ██░░█▓▒▓▒▒▒▒▒█░░░██░░█░██░░█ \n ███▓▒▒▒▒▒▒▒█░▓▓░░░░░░░░▓▓█ \n █▓▓▒▒▒▓▒▒▒█░░░██████░░█ \n █ ██▓▓▓▒▒▒▒▒▒▒█░░░░░░░░░█ \n ██░██▓▓▓▓▓▓▓▓▓▓█████████ \n █░░░████████████████░█ \n █░░█ █░░ █░░██░░█ \n ███ ███ ███ ███ ",
+};
+static const uint32_t clip_8_ends[] = {90,180,270,360,450,540,630,720,810,900,990,1080};
+static const char *const clip_9_frames[] = {
+ " \n \n ░ ░░░ \n ░▒▓▓▒ \n ░░░ ░▒▒░ ░░ \n ░▒░░░░▓▓▓▓▓▓▓▓░ \n ░▒░▒▒░░░░░░░░░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓░ \n ░░░▒▓████████▓▒█░ \n ░░█▒▓██▓█████▓ █░ \n ░▓▒▓██ ▒████▓▓█▒▒▒░ \n ░▒▒▓██▓▓███████████░ \n ░▒▒▓███████████▒ \n ▒▒▓██░░░░░░▒▒░ \n ▒▓██▒▒▒▒▒▒▒▒▒ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ \n ░ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓░░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒░\n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+ " ░ ░░ \n ░░░░░ \n ░ ░▒▓▓▒ \n ░░░ ░▒▒▒░▒░ \n ░▒░░░░▒▒▒▒▒▒▒▒░ \n ░▒░▒▒▒▒▒▒▒▒▒▒▒░ ▓░ \n ░░▒▓▓▓▓▓▓▓▓▓▓▓▓░ ▒▒▒\n ░░░▒▓███████████░ ░░\n ░░█▒▓████████▓▓█░░░ \n ░▒▒▓██▒▓███████▒▒▒▒ \n ░▒▒▓███████████████░ \n ░▒▒▓███████████░ ░▓▓\n ░▒▒▓██ ░░ ▓░ \n ▒▒▓██ ░ \n ▒▓██▒▒▒▒▒▒▒▒▒ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ \n ░ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ▒▒▒ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓ ░ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░█████▒░\n ░░ ░▒▒▒▒▒▒▒▒░ ░░░░░░░▒░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+ " \n \n ░ ░░░ \n ░▒▓▓▒ \n ░░░ ░▒▒░ ░░ ▓░ \n ░▒░░░░▓▓▓▓▓▓▓▓░ ▓░ \n ░▒░▒▒░░░░░░░░░ ▒▒░\n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓░ ░ \n ░░░▒▓█████████▓█░ \n ░░█▒▓█████████ █░ \n ░▓▒▓██▒▓████▓▓█▒▒▒░ \n ░▒▒▓██▓▓███████████░ ░▒ \n ░▒▒▓███████████▒ ░░░ \n ▒▒▓██░░░░░░▒▒░ ░ \n ▒▓██▒▒▒▒▒▒▒▒▒ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ \n ░ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓░░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒░\n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+ " \n \n \n ░ ░ \n ░▒▓▓▒ ░▒░ \n ░░░ ░▒▓▒ ░░ ▓ \n ░░░░░░▒▒▒▓▒▒▒▓░ \n ░▒░▒░░░░▒▒▒▒▒▒░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ \n ░░░▒▓█████████▓█░ \n ░░▓▒▓████████▒ █░ \n ░▓▒▓██ ▒████▓▓█▒▒▒░ \n ▒▒▓██▒▓███████████░ ░ \n ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ \n ▒▓██▓▓▓▓▓▓▓▓▓░ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ \n ░ ░ ▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ \n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+ " \n \n \n ░ ░ \n ░▒▓▓▒ \n ░░░ ░▒▓▒ ░░ \n ░░░░░░▒▒▒▓▒▒▒▓░ \n ░▒░▒░░░░▒▒▒▒▒▒░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ \n ░░░▒▓█████████▓█░ \n ░░▓▒▓████████▒ █░ \n ░▓▒▓██ ▒████▓▓█▒▒▒░ \n ▒▒▓██▒▓███████████░ \n ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ \n ▒▓██▓▓▓▓▓▓▓▓▓░ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ \n ░ ░ ▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ \n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒▒░░░ ░░░░░░░░░░\n░░ ▓████▓▓░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▓░▒░░░░░░░░░░░░░ ",
+ " \n \n \n ░ ░ \n ░▒▓▓▒ \n ░░░ ░▒▓▒ ░░ \n ░░░░░░▒▒▒▓▒▒▒▓░ \n ░▒░▒░░░░▒▒▒▒▒▒░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ \n ░░░▒▓█████████▓█░ \n ░░▓▒▓████████▒ █░ \n ░▓▒▓██ ▒████▓▓█▒▒▒░ \n ▒▒▓██▒▓███████████░ \n ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ \n ▒▓██▓▓▓▓▓▓▓▓▓░ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ \n ░ ░ ▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ \n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+ " \n \n \n ░ ░ \n ░▒▓▓▒ \n ░░░ ░▒▓▒ ░░ \n ░░░░░░▒▒▒▓▒▒▒▓░ \n ░▒░▒░░░░▒▒▒▒▒▒░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ \n ░░░▒▓███████████░ \n ░░▓▒▓████████▓▓█░ \n ░▓▒▓██▓▓███████▒▒▒░ \n ▒▒▓███████████████░ \n ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ \n ▒▓██▓▓▓▓▓▓▓▓▓░ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ \n ░ ░ ▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ \n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒▒░░░ ░░░░░░░░░░\n░░ ▓████▓▓░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▓░▒░░░░░░░░░░░░░ ",
+ " \n \n \n ░ ░ \n ░▒▓▓▒ \n ░░░ ░▒▓▒ ░░ \n ░░░░░░▒▒▒▓▒▒▒▓░ \n ░▒░▒░░░░▒▒▒▒▒▒░ \n ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ \n ░░░▒▓█████████▓█░ \n ░░▓▒▓████████▒ █░ \n ░▓▒▓██ ▒████▓▓█▒▒▒░ \n ▒▒▓██▒▓███████████░ \n ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ \n ▒▓██▓▓▓▓▓▓▓▓▓░ \n ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ \n ░ ░ ▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ \n ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ \n ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ \n ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░\n ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ \n ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ \n ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░\n░░ ▓████▒ ░░░░░░░░░░░░░░\n░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ ",
+};
+static const uint32_t clip_9_ends[] = {140,280,420,560,700,840,980,1120};
+static const ht_gallery_clip_t clips[] = {
+ {"Octopus / ASCII",54,27,63,5210,&ht_ascii_art_12,0xc8a9f0,clip_0_frames,clip_0_ends},
+ {"Octopus / blocks",39,19,63,5210,&ht_block_art_16,0xc8a9f0,clip_1_frames,clip_1_ends},
+ {"Tiny cat",7,3,6,7770,&ht_ascii_art_48,0xd4edbe,clip_2_frames,clip_2_ends},
+ {"Party Parrot",48,18,10,1000,&ht_ascii_art_14,0xc6ef8c,clip_3_frames,clip_3_ends},
+ {"Stone giant",38,20,28,4720,&ht_ascii_art_16,0xe6e1ca,clip_4_frames,clip_4_ends},
+ {"Stone spider",36,12,23,1620,&ht_ascii_art_20,0xc9dfbd,clip_5_frames,clip_5_ends},
+ {"Stark dragon",35,20,7,6540,&ht_ascii_art_16,0xe8ca91,clip_6_frames,clip_6_ends},
+ {"Turning face",11,6,7,5700,&ht_ascii_art_48,0xdeddd1,clip_7_frames,clip_7_ends},
+ {"Nyan / blocks",31,20,12,1080,&ht_block_art_square_10,0xb6dceb,clip_8_frames,clip_8_ends},
+ {"Desk companion",28,30,8,1120,&ht_block_art_square_10,0xc4b8f2,clip_9_frames,clip_9_ends},
+};
+_Static_assert(sizeof(clips)/sizeof(clips[0]) == HT_CREATURES-HT_ORIGINAL_CREATURES, "gallery clip count");
diff --git a/devices/harness-device/firmware/main/ui/habitat/creature_font.c b/devices/harness-device/firmware/main/ui/habitat/creature_font.c
new file mode 100644
index 000000000..90b27394f
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/creature_font.c
@@ -0,0 +1,2129 @@
+// Generated by gen_creature_font.py. Habitat ASCII Art 28.
+// Derived from Jgs7, (c) 2022 Adel Faure, Velvetyne; SIL OFL 1.1.
+// This atlas remains OFL-licensed; see fonts/Jgs-OFL.txt.
+#include "creature_gallery.h"
+static const uint8_t ht_ascii_art_12_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,192,12,0,192,
+ 12,0,192,0,0,64,12,0,64,0,0,0,0,0,136,12,192,204,0,0,0,0,0,0,
+ 0,0,0,0,0,0,48,195,12,186,227,12,48,195,12,48,195,12,186,227,12,48,193,4,
+ 0,0,0,11,130,56,51,0,184,3,194,56,11,128,48,0,0,0,8,34,44,8,128,48,
+ 3,0,48,12,0,128,34,136,32,192,0,0,0,0,160,50,3,48,34,12,168,194,12,48,
+ 42,128,0,0,0,0,0,0,8,2,0,128,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,48,12,0,128,48,3,0,48,3,0,48,0,192,2,0,48,0,192,3,0,32,0,192,
+ 12,0,192,12,0,192,48,8,0,192,0,0,0,0,0,3,2,56,15,202,254,35,128,48,
+ 0,0,0,0,0,0,3,0,48,3,0,48,3,6,186,3,0,48,3,0,48,3,0,32,
+ 0,0,0,0,0,0,0,0,0,0,0,8,2,0,128,0,0,0,0,0,0,0,0,0,
+ 0,10,170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 8,0,192,0,0,0,0,48,12,0,128,48,3,0,48,12,0,128,48,8,0,192,0,0,
+ 0,0,0,10,131,12,48,195,60,50,195,12,10,128,0,0,0,0,0,0,0,0,192,44,
+ 8,192,12,0,192,12,0,192,0,0,0,0,0,0,0,10,130,12,0,192,40,8,2,0,
+ 42,128,0,0,0,0,0,0,0,10,130,12,0,128,44,0,194,12,10,128,0,0,0,0,
+ 0,0,0,2,128,204,8,195,12,42,224,12,0,64,0,0,0,0,0,0,0,42,131,0,
+ 48,2,168,0,194,12,10,128,0,0,0,0,0,0,0,10,131,8,48,3,168,48,195,12,
+ 10,128,0,0,0,0,0,0,0,42,128,12,0,192,8,10,2,0,48,0,0,0,0,0,
+ 0,0,0,10,131,12,32,130,172,48,195,12,10,128,0,0,0,0,0,0,0,10,131,12,
+ 48,192,172,0,194,12,10,128,0,0,0,0,0,0,0,8,0,192,0,0,0,0,0,0,
+ 8,0,192,0,0,0,0,0,0,2,0,48,0,0,0,0,0,8,2,0,128,0,0,0,
+ 0,0,0,0,160,32,40,12,0,40,0,32,0,160,0,0,0,0,0,0,0,170,160,0,
+ 0,0,0,0,0,0,170,160,0,0,0,0,0,0,0,160,0,160,0,128,3,0,128,160,
+ 160,0,0,0,0,0,0,0,168,48,194,12,0,128,48,2,0,0,2,0,48,0,0,0,
+ 0,0,0,10,130,12,194,204,204,130,2,0,10,128,0,0,0,0,0,0,0,10,131,12,
+ 48,195,12,58,195,12,48,192,0,0,0,0,0,0,0,42,3,12,48,131,168,48,195,12,
+ 42,0,0,0,0,0,0,0,0,10,131,8,48,3,0,48,2,8,10,128,0,0,0,0,
+ 0,0,0,42,3,12,48,195,12,48,195,12,42,0,0,0,0,0,0,0,0,42,147,0,
+ 48,3,164,48,3,0,42,144,0,0,0,0,0,0,0,42,147,0,48,3,164,48,3,0,
+ 48,1,0,0,0,0,0,0,0,10,131,8,48,3,40,48,195,12,10,128,0,0,0,0,
+ 0,0,0,48,131,8,48,131,172,48,131,8,48,128,0,0,0,0,0,0,0,43,128,48,
+ 3,0,48,3,0,48,43,128,0,0,0,0,0,0,0,0,192,12,0,192,12,32,195,12,
+ 10,128,0,0,0,0,0,0,0,48,131,8,50,3,128,50,3,8,32,128,0,0,0,0,
+ 0,0,0,32,3,0,48,3,0,48,3,0,42,144,0,0,0,0,0,0,0,48,51,139,
+ 50,51,3,48,51,3,48,48,0,0,0,0,0,0,0,48,195,140,56,195,60,50,195,44,
+ 48,192,0,0,0,0,0,0,0,10,131,12,48,195,12,48,195,12,10,128,0,0,0,0,
+ 0,0,0,0,2,168,48,195,12,58,3,0,48,1,0,0,0,0,0,0,0,10,131,12,
+ 48,195,12,50,195,8,10,128,0,0,0,0,0,0,0,42,3,12,48,195,176,50,3,8,
+ 32,128,0,0,0,0,0,0,0,10,131,8,32,0,168,0,194,12,10,128,0,0,0,0,
+ 0,0,0,63,192,48,3,0,48,3,0,48,2,0,0,0,0,0,0,0,0,48,195,12,
+ 48,195,12,48,195,12,10,128,0,0,0,0,0,0,0,32,131,12,48,192,204,12,192,32,
+ 3,0,0,0,0,0,0,0,0,48,51,3,48,51,3,50,51,139,48,48,0,0,0,0,
+ 0,0,0,32,131,12,8,128,48,8,130,12,48,192,0,0,0,0,0,0,0,32,131,12,
+ 12,192,136,3,0,48,3,0,0,0,0,0,0,0,0,42,128,12,0,128,48,8,2,0,
+ 42,128,0,0,0,0,0,0,0,10,144,192,12,0,192,12,0,192,10,144,0,0,0,0,
+ 192,3,0,32,0,192,2,0,48,3,0,32,0,192,2,0,48,0,0,0,0,172,0,192,
+ 12,0,192,12,0,192,172,0,0,0,0,0,2,0,240,10,3,12,128,44,3,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,170,
+ 0,0,128,2,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 10,130,172,32,195,12,10,128,0,0,0,0,0,0,0,48,3,0,58,131,12,48,195,12,
+ 10,128,0,0,0,0,0,0,0,0,0,0,10,131,8,48,2,8,10,128,0,0,0,0,
+ 0,0,0,0,192,12,10,195,12,48,195,12,10,128,0,0,0,0,0,0,0,0,0,0,
+ 10,195,168,48,2,8,10,128,0,0,0,0,0,0,0,10,131,8,48,3,168,48,3,0,
+ 48,0,0,0,0,0,0,0,0,0,0,0,10,131,12,48,192,172,0,194,12,10,128,0,
+ 0,0,0,48,3,0,58,3,12,48,195,12,48,192,0,0,0,0,0,0,0,8,0,192,
+ 0,0,0,12,0,192,12,0,0,0,0,0,0,0,0,0,16,2,0,16,0,0,192,12,
+ 0,194,12,10,128,0,0,0,0,48,3,0,48,131,168,56,3,40,32,128,0,0,0,0,
+ 0,0,0,12,0,192,12,0,192,12,0,192,12,0,0,0,0,0,0,0,0,0,0,0,
+ 8,131,60,51,195,44,48,192,0,0,0,0,0,0,0,0,0,0,10,131,12,48,195,12,
+ 48,192,0,0,0,0,0,0,0,0,0,0,10,131,12,48,195,12,10,128,0,0,0,0,
+ 0,0,0,0,0,0,10,131,12,48,195,12,58,131,0,48,0,0,0,0,0,0,0,0,
+ 10,131,12,48,195,12,10,192,12,0,192,0,0,0,0,0,0,0,10,131,8,48,3,0,
+ 48,0,0,0,0,0,0,0,0,0,0,0,10,130,172,0,130,12,10,128,0,0,0,0,
+ 0,0,0,48,3,0,48,3,168,48,2,8,10,128,0,0,0,0,0,0,0,0,0,0,
+ 48,195,12,48,195,12,10,128,0,0,0,0,0,0,0,0,0,0,48,194,12,12,192,32,
+ 3,0,0,0,0,0,0,0,0,0,0,0,48,195,44,51,195,60,8,128,0,0,0,0,
+ 0,0,0,0,0,0,32,128,168,3,0,136,32,128,0,0,0,0,0,0,0,0,0,0,
+ 48,195,12,48,192,172,0,194,12,10,128,0,0,0,0,0,0,0,43,128,48,3,0,128,
+ 46,128,0,0,0,0,0,0,10,0,192,12,10,3,0,32,0,168,0,192,12,0,32,0,
+ 12,0,192,12,0,192,12,0,192,12,0,192,12,0,192,12,0,0,0,10,0,12,0,192,
+ 2,0,12,0,128,160,12,0,192,160,0,0,130,0,34,0,128,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_12 = {32,126,6,12,ht_ascii_art_12_pixels};
+static const uint8_t ht_ascii_art_14_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,3,0,12,0,48,0,192,3,0,12,0,48,0,192,0,0,0,0,48,0,192,0,0,
+ 0,0,0,0,0,0,204,3,48,12,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,48,48,192,195,3,63,255,48,48,192,195,3,12,12,48,48,192,207,255,204,12,
+ 48,48,192,192,0,0,0,0,48,3,240,51,48,204,0,252,0,204,3,48,204,192,252,0,
+ 192,0,0,0,0,0,12,48,51,51,3,12,0,192,3,0,48,0,192,12,0,48,3,12,
+ 12,204,192,195,0,0,0,0,0,0,240,12,48,48,192,204,12,195,48,204,192,195,3,3,
+ 243,0,0,0,0,0,0,0,0,0,0,12,0,192,12,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,12,0,48,3,0,12,0,192,3,0,12,0,48,0,192,
+ 3,0,3,0,12,0,12,0,48,192,3,0,3,0,12,0,12,0,48,0,192,3,0,12,
+ 0,48,3,0,12,0,192,3,0,0,0,0,0,0,0,0,192,51,48,63,15,255,195,240,
+ 51,48,12,0,0,0,0,0,0,0,0,3,0,12,0,48,0,192,3,0,12,15,255,192,
+ 192,3,0,12,0,48,0,192,3,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,3,0,48,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,48,0,192,0,0,0,0,0,12,0,48,3,0,12,0,192,
+ 3,0,48,0,192,12,0,48,3,0,12,0,192,3,0,0,0,0,0,0,0,3,240,48,
+ 48,192,195,51,12,204,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,0,48,
+ 3,192,51,0,12,0,48,0,192,3,0,12,0,0,0,0,0,0,0,0,0,0,0,3,
+ 240,48,48,0,192,12,0,192,12,0,192,3,255,0,0,0,0,0,0,0,0,0,0,0,
+ 3,240,48,48,0,192,60,0,12,0,48,192,192,252,0,0,0,0,0,0,0,0,0,0,
+ 0,0,240,12,192,51,3,12,12,48,63,240,3,0,12,0,0,0,0,0,0,0,0,0,
+ 0,0,15,252,48,0,192,3,252,0,12,0,48,192,192,252,0,0,0,0,0,0,0,0,
+ 0,0,0,3,240,48,48,192,3,252,12,12,48,48,192,192,252,0,0,0,0,0,0,0,
+ 0,0,0,0,15,252,0,48,0,192,12,0,192,12,0,192,3,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,240,48,48,192,192,252,12,12,48,48,192,192,252,0,0,0,0,0,
+ 0,0,0,0,0,0,3,240,48,48,192,195,3,3,252,0,48,192,192,252,0,0,0,0,
+ 0,0,0,0,0,0,0,0,192,3,0,0,0,0,0,0,0,0,0,0,48,0,192,0,
+ 0,0,0,0,0,0,0,0,0,192,3,0,0,0,0,0,0,0,0,3,0,48,3,0,
+ 0,0,0,0,0,0,0,0,0,0,15,3,192,240,12,0,48,0,60,0,15,0,3,192,
+ 0,0,0,0,0,0,0,0,0,0,63,255,0,0,0,0,0,0,0,0,0,0,15,255,
+ 192,0,0,0,0,0,0,0,0,0,0,60,0,15,0,3,192,0,192,3,0,240,60,15,
+ 0,0,0,0,0,0,0,0,0,63,3,3,12,12,0,48,3,0,48,0,192,0,0,0,
+ 0,48,0,192,0,0,0,0,0,0,0,0,0,3,240,48,51,15,204,195,51,12,195,192,
+ 192,0,252,0,0,0,0,0,0,0,0,0,0,0,3,240,48,48,192,195,3,15,252,48,
+ 48,192,195,3,0,0,0,0,0,0,0,0,0,0,0,15,240,48,48,192,195,252,12,12,
+ 48,48,192,195,252,0,0,0,0,0,0,0,0,0,0,0,3,240,48,48,192,3,0,12,
+ 0,48,0,192,192,252,0,0,0,0,0,0,0,0,0,0,0,15,240,48,48,192,195,3,
+ 12,12,48,48,192,195,252,0,0,0,0,0,0,0,0,0,0,0,15,252,48,0,192,3,
+ 252,12,0,48,0,192,3,255,0,0,0,0,0,0,0,0,0,0,0,15,252,48,0,192,
+ 3,252,12,0,48,0,192,3,0,0,0,0,0,0,0,0,0,0,0,0,3,240,48,48,
+ 192,3,0,12,252,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,12,12,48,
+ 48,192,195,255,12,12,48,48,192,195,3,0,0,0,0,0,0,0,0,0,0,0,15,252,
+ 3,0,12,0,48,0,192,3,0,12,3,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 12,0,48,0,192,3,0,12,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,
+ 12,12,48,192,204,3,192,15,0,51,0,195,3,3,0,0,0,0,0,0,0,0,0,0,
+ 0,12,0,48,0,192,3,0,12,0,48,0,192,3,255,0,0,0,0,0,0,0,0,0,
+ 0,0,12,12,60,240,204,195,3,12,12,48,48,192,195,3,0,0,0,0,0,0,0,0,
+ 0,0,0,12,12,60,48,240,195,51,12,204,48,240,195,195,3,0,0,0,0,0,0,0,
+ 0,0,0,0,3,240,48,48,192,195,3,12,12,48,48,192,192,252,0,0,0,0,0,0,
+ 0,0,0,0,0,15,240,48,48,192,195,3,15,240,48,0,192,3,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,240,48,48,192,195,3,12,12,51,48,195,0,243,0,0,0,0,
+ 0,0,0,0,0,0,0,15,240,48,48,192,195,3,15,240,51,0,195,3,3,0,0,0,
+ 0,0,0,0,0,0,0,0,3,240,48,48,192,0,252,0,12,0,48,192,192,252,0,0,
+ 0,0,0,0,0,0,0,0,0,15,252,3,0,12,0,48,0,192,3,0,12,0,48,0,
+ 0,0,0,0,0,0,0,0,0,0,12,12,48,48,192,195,3,12,12,48,48,192,192,252,
+ 0,0,0,0,0,0,0,0,0,0,0,12,12,48,48,192,192,204,3,48,12,192,12,0,
+ 48,0,0,0,0,0,0,0,0,0,0,0,12,12,48,48,192,195,3,12,12,51,48,243,
+ 195,3,0,0,0,0,0,0,0,0,0,0,0,12,12,48,48,51,0,48,0,192,12,192,
+ 192,195,3,0,0,0,0,0,0,0,0,0,0,0,12,12,48,48,51,0,204,0,192,3,
+ 0,12,0,48,0,0,0,0,0,0,0,0,0,0,0,15,252,0,48,3,0,48,0,192,
+ 12,0,192,3,255,0,0,0,0,0,0,0,0,0,0,0,0,255,3,0,12,0,48,0,
+ 192,3,0,12,0,63,192,0,0,0,0,0,192,3,0,3,0,12,0,12,0,48,0,48,
+ 0,192,0,192,3,0,3,0,12,0,12,0,48,0,0,0,0,0,63,192,3,0,12,0,
+ 48,0,192,3,0,12,15,240,0,0,0,0,0,0,3,0,51,0,204,12,12,48,51,0,
+ 60,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,240,0,0,0,0,192,0,192,0,
+ 192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,63,3,3,3,252,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,12,
+ 0,48,0,255,3,3,12,12,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,63,3,3,12,0,48,0,192,192,252,0,0,0,0,0,0,0,0,0,0,
+ 0,0,12,0,48,63,195,3,12,12,48,48,192,192,252,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,63,3,3,15,252,48,0,192,192,252,0,0,0,0,0,0,0,0,
+ 0,0,0,3,240,48,48,192,3,252,12,0,48,0,192,3,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,3,3,12,12,48,48,63,192,3,12,12,15,192,0,0,
+ 0,0,0,0,0,12,0,48,0,255,3,3,12,12,48,48,192,195,3,0,0,0,0,0,
+ 0,0,0,0,0,0,0,192,3,0,0,0,0,0,192,3,0,12,0,48,0,0,0,0,
+ 0,0,0,0,0,0,0,0,12,0,48,0,0,0,0,12,0,48,0,192,3,12,12,15,
+ 192,0,0,0,0,0,0,0,12,0,48,0,192,195,60,15,0,60,0,207,3,3,0,0,
+ 0,0,0,0,0,0,0,0,0,0,192,3,0,12,0,48,0,192,3,0,12,0,48,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,3,51,12,204,51,48,192,195,3,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,3,3,12,12,48,48,192,195,
+ 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,3,3,12,12,48,48,192,
+ 192,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,3,3,12,12,48,48,
+ 192,195,252,12,0,48,0,0,0,0,0,0,0,0,0,0,0,0,63,3,3,12,12,48,
+ 48,192,192,255,0,12,0,48,0,0,0,0,0,0,0,0,0,0,0,63,3,3,12,0,
+ 48,0,192,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,3,3,3,
+ 240,0,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,12,0,48,0,192,3,252,
+ 12,0,48,0,192,192,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,195,
+ 3,12,12,48,48,192,192,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,
+ 195,3,3,48,12,192,12,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 192,195,3,12,204,51,48,204,192,204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,192,192,204,0,192,3,0,51,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,192,195,3,12,12,48,48,63,192,3,12,12,15,192,0,0,0,0,0,0,0,0,
+ 0,0,0,255,192,12,0,192,3,0,48,3,255,0,0,0,0,0,0,0,0,0,240,12,
+ 0,48,0,192,60,3,0,12,0,15,0,3,0,12,0,48,0,60,0,0,3,0,12,0,
+ 48,0,192,3,0,12,0,48,0,192,3,0,12,0,48,0,192,3,0,12,0,0,3,192,
+ 0,192,3,0,12,0,15,0,3,0,12,3,192,48,0,192,3,0,240,0,0,0,60,3,
+ 12,0,48,192,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_14 = {32,126,7,14,ht_ascii_art_14_pixels};
+static const uint8_t ht_ascii_art_16_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
+ 0,192,0,0,0,0,0,128,0,192,0,64,0,0,0,0,0,0,0,0,12,192,12,192,
+ 12,192,12,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 32,8,48,12,48,12,48,12,255,254,117,92,48,12,48,12,48,12,48,12,48,12,48,12,
+ 255,254,117,92,48,12,48,12,0,0,0,0,3,0,15,192,7,64,51,12,51,0,15,192,
+ 3,12,3,12,51,12,3,0,15,192,7,64,0,0,0,0,0,3,12,3,51,12,12,12,
+ 0,0,0,48,0,32,3,0,3,0,12,0,12,0,48,48,51,12,0,0,192,48,192,0,
+ 0,0,0,0,0,0,15,0,48,48,48,48,51,0,204,0,195,12,192,128,192,48,192,48,
+ 63,12,21,0,0,0,0,0,0,0,0,0,0,0,0,192,3,0,12,0,4,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,12,0,12,
+ 0,48,0,48,0,48,0,48,0,48,0,48,0,48,0,12,0,12,0,0,0,3,0,3,
+ 192,0,192,0,48,0,48,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,48,0,
+ 48,0,0,0,192,0,192,0,0,0,0,0,0,0,0,0,3,0,51,12,15,192,255,254,
+ 95,212,15,192,51,12,19,0,0,0,0,0,0,0,0,0,0,128,0,192,0,192,0,192,
+ 0,192,0,192,0,192,191,255,21,213,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,
+ 3,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
+ 85,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,192,0,0,0,0,
+ 0,3,0,3,0,12,0,12,0,0,0,48,0,32,3,0,3,0,12,0,12,0,48,0,
+ 48,0,0,0,192,0,192,0,0,0,0,0,0,0,0,0,15,192,48,12,48,12,48,12,
+ 51,12,51,12,48,12,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,192,3,192,13,192,4,192,0,192,0,192,0,192,0,192,0,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,192,48,28,0,12,0,192,3,0,0,0,24,0,48,0,
+ 63,252,21,80,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,28,16,12,3,192,
+ 0,12,0,12,0,12,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,3,192,
+ 1,192,12,192,12,192,48,192,48,192,63,240,21,208,0,192,0,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,252,53,80,48,0,63,192,0,12,0,12,0,12,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,11,192,52,12,52,0,63,192,
+ 52,12,52,12,52,12,52,12,11,192,1,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,252,21,92,0,12,0,192,3,0,12,0,0,0,48,0,48,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,192,48,12,48,12,15,192,48,12,48,12,48,12,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,48,12,48,12,
+ 15,252,5,92,0,12,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,192,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,192,0,0,0,0,
+ 0,0,0,0,0,0,1,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,192,
+ 2,0,13,0,4,0,0,0,0,0,0,0,0,0,0,0,0,15,2,192,60,0,20,0,
+ 192,0,192,0,60,0,3,192,0,15,0,5,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,85,85,0,0,0,0,0,0,0,0,0,0,0,0,255,255,85,85,0,0,0,0,
+ 0,0,0,0,0,0,0,0,240,0,15,0,0,60,0,20,0,3,0,3,0,60,11,0,
+ 240,0,80,0,0,0,0,0,0,0,15,192,48,12,48,12,0,12,0,12,0,192,3,0,
+ 3,0,0,0,0,0,0,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,192,48,60,195,252,193,92,204,12,204,12,195,192,48,0,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,11,192,52,12,52,12,52,12,63,252,53,92,52,12,52,12,
+ 52,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,224,48,12,48,12,63,240,
+ 48,12,48,12,48,12,48,12,63,240,21,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,192,48,12,48,0,48,0,48,0,48,0,48,0,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,224,48,12,48,12,48,12,48,12,48,12,48,12,48,12,
+ 63,240,21,64,0,0,0,0,0,0,0,0,0,0,0,0,63,248,53,80,48,0,63,208,
+ 53,64,48,0,48,0,48,0,63,248,21,80,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,248,53,80,48,0,63,208,53,64,48,0,48,0,48,0,32,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,192,48,12,48,0,48,0,51,252,49,92,48,12,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,48,12,48,12,48,12,63,252,
+ 53,92,48,12,48,12,48,12,48,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,252,23,84,3,0,3,0,3,0,3,0,3,0,23,84,63,252,21,84,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,12,0,12,0,12,0,12,0,12,0,12,48,12,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,52,12,52,192,54,0,52,0,
+ 61,0,61,0,54,0,52,192,52,12,0,0,0,0,0,0,0,0,0,0,0,0,16,0,
+ 48,0,48,0,48,0,48,0,48,0,48,0,48,0,48,0,63,248,21,80,0,0,0,0,
+ 0,0,0,0,0,0,0,0,48,48,56,240,51,112,48,48,48,48,48,48,48,48,48,48,
+ 48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,12,60,12,60,12,50,12,
+ 50,12,48,92,48,124,48,124,48,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,192,48,12,48,12,48,12,48,12,48,12,48,12,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,63,224,53,64,52,12,52,12,52,12,63,240,53,64,52,0,52,0,
+ 36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,48,12,48,12,
+ 48,12,48,12,51,12,48,192,15,12,5,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,224,52,12,52,12,52,12,63,224,59,64,53,0,52,192,52,12,16,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,192,48,12,48,0,15,192,0,12,0,12,0,12,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,63,252,23,84,3,0,3,0,
+ 3,0,3,0,3,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 48,12,48,12,48,12,48,12,48,12,48,12,48,12,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,48,12,48,12,48,12,48,12,12,192,12,192,12,192,9,128,3,0,
+ 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,
+ 48,48,51,48,48,48,56,240,48,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 48,12,48,12,12,192,3,0,3,0,12,192,16,32,48,12,48,12,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,48,12,48,12,12,192,12,192,3,0,3,0,3,0,3,0,
+ 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,252,21,92,0,212,0,0,
+ 3,0,3,0,8,0,48,0,63,252,21,80,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,255,0,213,0,192,0,192,0,192,0,192,0,192,0,192,0,255,0,85,0,0,0,0,
+ 192,0,192,0,48,0,48,0,0,0,12,0,8,0,3,0,3,0,0,48,0,48,0,12,
+ 0,12,0,0,0,3,0,3,0,0,0,0,0,0,0,0,191,192,21,192,0,192,0,192,
+ 0,192,0,192,0,192,0,192,191,192,21,64,0,0,0,0,3,0,12,48,12,48,0,0,
+ 48,12,32,8,192,3,192,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,255,255,0,0,0,0,0,0,12,0,3,0,0,192,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,192,48,28,15,252,5,92,48,12,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,52,0,52,0,63,192,52,12,52,12,52,12,52,12,52,12,
+ 11,192,1,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,
+ 48,0,48,0,48,0,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,12,0,12,15,252,48,12,48,12,48,12,48,12,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,63,252,53,80,48,0,48,12,
+ 15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,11,192,48,12,48,0,63,192,
+ 53,64,48,0,48,0,48,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,192,48,12,48,12,48,12,15,252,5,92,0,12,48,12,15,192,5,64,
+ 0,0,0,0,0,0,0,0,48,0,48,0,63,224,48,12,48,12,48,12,48,12,48,12,
+ 48,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,192,0,0,0,0,
+ 0,192,0,192,0,192,0,192,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,16,
+ 0,52,0,36,0,0,0,0,0,12,0,12,0,12,0,12,0,12,48,12,15,192,5,64,
+ 0,0,0,0,0,0,0,0,52,0,52,0,52,12,54,192,52,64,61,0,61,0,54,192,
+ 52,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,192,0,192,0,192,
+ 0,192,0,192,0,192,0,192,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,12,192,51,12,51,12,51,12,51,12,48,12,48,12,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,48,12,48,12,48,12,48,12,
+ 48,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,
+ 48,12,48,12,48,12,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,192,52,12,52,12,52,12,52,12,63,192,53,64,52,0,52,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,48,12,48,12,48,12,15,252,
+ 5,92,0,12,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,48,12,
+ 48,0,48,0,48,0,48,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,192,48,12,15,192,5,96,0,12,48,12,15,192,5,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,52,0,52,0,52,0,63,192,53,64,52,0,52,0,52,12,
+ 11,192,1,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,12,48,12,
+ 48,12,48,12,48,12,48,12,15,192,5,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,48,12,48,12,12,192,12,192,0,0,3,0,3,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,48,12,48,12,51,12,51,12,51,12,51,12,
+ 12,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,12,12,192,
+ 4,0,3,0,3,0,12,192,48,12,16,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,48,12,48,12,48,12,48,12,15,252,5,92,0,12,48,12,15,192,5,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,63,252,21,116,0,80,3,0,6,0,12,0,
+ 63,252,21,84,0,0,0,0,0,0,0,15,0,128,0,128,0,128,0,128,15,0,48,0,
+ 48,0,15,0,0,128,0,128,0,128,0,128,0,15,0,5,0,192,0,192,0,192,0,192,
+ 0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,
+ 0,0,240,0,90,0,15,0,15,0,15,0,0,240,0,12,0,12,0,240,8,0,8,0,
+ 8,0,8,0,240,0,80,0,60,0,20,0,194,0,2,3,0,60,0,20,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_16 = {32,126,8,16,ht_ascii_art_16_pixels};
+static const uint8_t ht_ascii_art_20_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,
+ 0,7,0,0,112,0,0,0,0,0,0,0,0,0,116,0,7,64,0,116,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,113,192,7,28,0,113,192,7,28,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,28,1,193,192,28,28,1,193,192,28,191,255,246,229,110,28,1,193,
+ 192,28,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,110,86,235,255,255,28,1,
+ 193,192,28,28,1,193,192,28,0,0,0,0,0,0,112,0,27,128,3,252,1,199,28,28,
+ 112,65,199,0,3,252,0,7,28,0,113,192,7,28,4,113,193,199,28,3,252,0,27,128,
+ 0,112,0,0,0,0,0,0,0,0,2,0,112,112,7,48,195,1,104,48,7,3,0,1,
+ 192,0,28,0,1,192,0,192,0,12,0,0,192,0,112,0,7,0,0,112,0,48,28,3,
+ 5,160,48,195,12,1,192,192,8,12,0,0,0,0,0,0,0,6,128,0,252,0,48,28,
+ 3,1,192,48,28,3,12,0,194,3,12,112,48,192,195,12,1,192,192,28,12,1,192,26,
+ 145,3,252,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,192,
+ 0,192,0,40,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,3,0,
+ 0,48,0,3,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,
+ 0,1,192,0,3,0,0,48,0,3,0,0,7,0,0,112,0,7,192,0,12,0,0,48,
+ 0,3,0,0,48,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,
+ 7,0,0,112,0,48,0,3,0,0,48,0,12,0,0,192,0,12,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,112,1,199,28,3,252,0,63,192,191,255,246,191,234,3,252,1,
+ 199,28,8,112,128,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,
+ 0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,106,186,171,255,255,0,
+ 112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,20,0,1,192,0,192,0,40,0,7,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,170,
+ 175,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,112,0,0,
+ 0,0,0,0,0,0,0,0,112,0,7,0,3,0,0,48,0,3,0,1,192,0,28,0,
+ 1,192,0,192,0,12,0,0,192,0,112,0,7,0,0,112,0,48,0,3,0,0,48,0,
+ 12,0,0,192,0,12,0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,26,144,28,
+ 1,193,192,28,28,113,193,199,28,28,113,193,192,28,28,1,193,192,28,10,168,128,63,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,0,6,
+ 208,0,189,0,112,208,2,13,0,0,208,0,13,0,0,208,0,13,0,0,208,0,13,0,
+ 0,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,252,
+ 0,170,144,28,1,192,0,28,0,5,128,0,192,0,112,0,22,0,3,0,1,192,0,30,
+ 170,129,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 3,252,0,170,144,28,1,192,0,28,0,104,128,15,192,0,1,192,0,28,0,1,193,192,
+ 28,10,168,128,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,188,0,6,192,3,28,0,49,192,10,28,1,193,192,28,28,1,234,228,31,255,
+ 128,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,31,255,193,229,84,28,0,1,192,0,30,84,1,255,192,0,1,192,0,28,
+ 0,1,193,192,28,5,84,64,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,252,0,21,68,28,1,193,192,0,30,84,1,255,192,28,1,193,
+ 192,28,28,1,193,192,28,5,84,64,63,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,31,255,192,170,172,0,1,192,0,28,0,5,128,0,192,0,
+ 112,0,22,0,3,0,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,252,0,26,144,28,1,193,192,28,10,168,128,63,
+ 192,28,1,193,192,28,28,1,193,192,28,10,168,128,63,192,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,26,144,28,1,193,192,28,28,1,
+ 193,192,28,3,255,192,26,172,0,1,193,192,28,9,168,128,63,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,112,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,112,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,160,0,10,0,0,80,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,192,0,128,0,40,0,7,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,10,105,0,
+ 252,3,240,0,192,0,12,0,0,192,0,1,160,0,63,0,0,15,192,0,166,144,0,63,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,250,170,
+ 170,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,170,175,
+ 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,
+ 5,85,0,3,240,0,0,252,0,0,48,0,3,0,0,48,0,84,0,15,192,63,0,85,
+ 80,15,192,0,0,0,0,0,0,0,0,0,0,0,1,168,0,63,192,28,1,193,192,28,
+ 28,1,192,0,28,0,5,0,0,192,0,112,0,7,0,0,112,0,0,0,0,0,0,0,
+ 0,0,112,0,7,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,3,252,1,21,64,48,3,12,15,240,199,3,12,112,48,199,3,12,5,64,192,188,
+ 3,0,0,17,84,0,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,3,252,0,26,144,28,1,193,192,28,28,1,193,192,28,31,255,193,234,172,
+ 28,1,193,192,28,28,1,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,254,1,234,144,28,1,193,192,28,30,170,129,255,224,28,1,193,
+ 192,28,28,1,193,192,28,30,170,129,255,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,252,0,26,136,28,1,193,192,0,28,0,1,192,0,28,
+ 0,1,192,0,28,0,1,192,28,10,168,128,63,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,31,254,1,234,144,28,1,193,192,28,28,1,193,192,
+ 28,28,1,193,192,28,28,1,193,192,28,30,170,129,255,224,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,31,255,129,234,164,28,0,1,192,0,30,168,
+ 1,255,208,28,0,1,192,0,28,0,1,192,0,30,170,65,255,248,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,129,234,164,28,0,1,192,0,
+ 30,168,1,255,208,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,21,68,28,1,193,
+ 192,0,28,0,1,192,0,28,191,193,197,108,28,1,193,192,28,5,84,64,63,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,1,193,192,28,28,
+ 1,193,192,28,30,170,193,255,252,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,255,2,174,
+ 160,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,42,234,3,
+ 255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,193,192,28,28,1,193,192,28,1,
+ 169,0,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 28,1,193,192,88,28,12,1,199,0,31,128,1,248,0,31,128,1,194,0,28,112,1,192,
+ 192,28,5,129,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,
+ 1,192,0,30,170,65,255,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,28,1,193,224,172,31,95,193,199,28,28,33,193,192,28,28,1,193,192,28,
+ 28,1,193,192,28,28,1,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,28,1,193,192,28,31,65,193,244,28,28,113,193,199,28,28,113,193,
+ 192,252,28,15,193,192,252,28,1,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,252,0,26,144,28,1,193,192,28,28,1,193,192,28,28,
+ 1,193,192,28,28,1,193,192,28,10,168,128,63,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,170,144,31,254,1,192,28,28,1,193,192,28,28,1,193,234,
+ 144,31,254,1,192,0,28,0,1,192,0,28,0,0,128,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,26,144,28,1,193,192,28,28,1,
+ 193,192,28,28,1,193,194,28,28,113,193,192,192,9,165,128,63,28,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,252,1,234,144,28,1,193,192,28,
+ 28,1,193,192,28,31,252,1,235,128,28,112,1,192,192,28,5,129,192,28,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,21,68,28,1,193,
+ 192,0,5,84,0,63,192,0,1,192,0,28,0,1,193,192,28,5,84,64,63,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,170,3,255,240,1,
+ 192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,
+ 0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,1,193,192,
+ 28,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,1,169,0,
+ 63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,1,
+ 193,192,28,28,1,193,192,28,3,12,0,48,192,3,12,0,48,192,3,12,0,7,0,0,
+ 112,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,28,1,193,193,28,28,113,193,245,
+ 252,30,6,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,28,1,193,192,28,28,1,192,48,192,0,112,0,7,0,0,112,0,20,64,3,12,
+ 1,192,28,28,1,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,28,1,193,192,28,28,1,192,48,192,3,12,0,48,192,0,112,0,7,0,
+ 0,112,0,7,0,0,112,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,224,170,174,0,0,224,0,208,0,112,0,7,0,0,112,0,
+ 20,0,3,0,1,192,0,30,170,145,255,254,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,127,240,7,149,0,112,0,7,0,0,112,0,7,0,0,
+ 112,0,7,0,0,112,0,7,0,0,121,80,7,255,0,0,0,0,0,0,0,0,0,0,
+ 192,0,12,0,0,48,0,3,0,0,48,0,0,112,0,7,0,0,112,0,0,192,0,12,
+ 0,0,192,0,1,192,0,28,0,1,192,0,3,0,0,48,0,3,0,0,7,0,0,112,
+ 0,7,0,0,0,0,0,0,0,0,0,0,191,240,6,171,0,0,112,0,7,0,0,112,
+ 0,7,0,0,112,0,7,0,0,112,0,7,0,106,176,11,255,0,0,0,0,0,0,0,
+ 0,0,0,0,0,192,0,113,192,7,28,0,113,192,48,3,3,0,48,48,3,12,0,7,
+ 192,0,124,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,170,170,175,255,255,0,0,0,0,0,1,0,0,112,0,0,192,0,5,64,0,
+ 28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,63,192,10,170,193,192,28,3,255,193,192,28,28,1,193,192,28,1,168,0,
+ 63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,
+ 1,192,0,28,0,1,255,192,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,1,
+ 169,0,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,192,28,1,129,192,28,28,0,1,192,0,28,0,1,192,
+ 28,1,168,128,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,192,0,28,0,1,192,63,252,28,1,193,192,28,28,1,193,192,28,28,1,
+ 193,192,28,2,85,0,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,63,192,28,1,193,192,28,31,255,193,234,168,
+ 28,0,1,192,28,2,168,128,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,252,0,170,136,28,1,193,192,0,30,168,1,255,192,28,0,1,
+ 192,0,28,0,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,192,28,1,193,192,28,28,
+ 1,193,192,28,28,1,192,63,252,1,170,192,0,28,28,1,192,42,144,3,252,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,28,0,1,255,224,28,1,193,192,
+ 28,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,112,0,0,0,0,0,
+ 0,0,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,0,56,0,3,128,0,0,
+ 0,0,0,0,0,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,28,1,192,170,
+ 136,3,252,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,28,0,1,
+ 192,28,28,104,129,203,192,31,64,1,244,0,31,64,1,203,192,28,104,129,192,28,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,
+ 112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,48,192,28,113,193,199,28,28,113,193,199,28,28,113,193,192,28,28,1,193,
+ 192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,63,192,28,1,193,192,28,28,1,193,192,28,28,1,193,192,28,28,
+ 1,193,192,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,192,28,1,193,192,28,28,1,193,192,28,28,1,193,192,
+ 28,1,169,0,63,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,192,28,1,193,192,28,28,1,193,192,28,28,1,
+ 193,192,28,30,169,1,255,192,28,0,1,192,0,28,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,63,192,28,1,193,192,28,28,1,193,192,28,
+ 28,1,193,192,28,1,86,192,63,252,0,1,192,0,28,0,1,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,192,28,1,129,192,28,28,0,1,
+ 192,0,28,0,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,192,9,168,129,192,28,3,
+ 252,0,0,28,0,1,193,192,28,1,169,0,63,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,28,0,1,192,0,30,168,1,255,
+ 192,28,0,1,192,0,28,0,1,192,28,1,168,128,63,192,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,192,28,28,1,
+ 193,192,28,28,1,193,192,28,28,1,193,192,28,10,168,128,63,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,192,28,
+ 28,1,193,192,28,3,12,0,48,192,3,12,0,7,0,0,112,0,7,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 192,28,28,1,193,192,28,28,113,193,199,28,28,113,193,199,28,5,85,64,48,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,192,28,10,5,128,48,192,0,112,0,7,0,0,112,0,48,192,10,5,129,192,28,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,192,28,28,1,193,192,28,28,1,193,192,28,28,1,192,63,252,1,170,192,
+ 0,28,28,1,192,170,136,3,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,255,240,42,174,0,1,192,0,192,0,12,0,0,192,0,112,0,43,
+ 170,3,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,1,80,0,192,
+ 0,12,0,0,192,0,12,0,63,0,28,0,1,192,0,28,0,0,21,0,3,240,0,0,
+ 192,0,12,0,0,192,0,12,0,0,85,0,3,240,0,0,0,112,0,7,0,0,112,0,
+ 7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,
+ 0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,0,15,192,0,165,
+ 0,0,48,0,3,0,0,48,0,3,0,0,15,192,0,3,0,0,48,0,3,0,6,128,
+ 0,252,0,48,0,3,0,0,48,0,3,0,10,160,0,252,0,0,0,0,63,0,9,172,
+ 0,192,192,0,12,7,0,26,32,3,240,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_20 = {32,126,10,20,ht_ascii_art_20_pixels};
+static const uint8_t ht_ascii_art_28_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,240,0,15,15,
+ 0,0,240,240,0,15,15,0,0,240,240,0,15,15,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,255,255,255,255,255,255,255,15,0,15,0,240,0,240,15,0,15,0,240,0,240,
+ 15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,
+ 0,240,0,240,255,255,255,255,255,255,255,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 0,0,0,240,0,0,255,240,0,15,255,0,15,15,15,0,240,240,240,15,15,0,0,240,
+ 240,0,0,255,240,0,15,255,0,0,15,15,0,0,240,240,0,15,15,0,0,240,240,15,
+ 15,15,0,240,240,240,0,255,240,0,15,255,0,0,15,0,0,0,240,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,15,0,240,0,240,15,0,15,
+ 15,15,15,0,240,240,240,0,240,15,0,15,0,240,0,0,240,0,0,15,0,0,0,240,
+ 0,0,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,0,15,0,240,0,240,15,0,15,15,15,0,240,240,240,240,0,
+ 240,15,0,15,0,240,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,255,0,0,15,240,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,
+ 15,0,0,240,240,0,240,240,15,15,15,0,240,240,15,15,15,0,240,240,240,0,240,15,
+ 0,15,0,240,0,240,15,0,15,0,15,255,15,0,255,240,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,240,0,0,15,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,240,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,15,0,0,0,240,0,0,15,
+ 0,0,0,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,240,
+ 0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,
+ 0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,
+ 0,0,0,240,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,
+ 15,15,15,0,240,240,240,0,255,240,0,15,255,0,255,255,255,255,255,255,255,0,255,240,
+ 0,15,255,0,15,15,15,0,240,240,240,0,15,0,0,0,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,255,255,255,255,255,255,255,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,15,0,0,15,
+ 0,0,0,240,0,0,240,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
+ 255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,15,0,
+ 0,0,240,0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,0,240,0,0,15,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,0,240,0,
+ 0,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,
+ 0,240,15,15,15,0,240,240,240,15,15,15,0,240,240,240,15,0,15,0,240,0,240,15,
+ 0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,240,0,0,15,0,0,15,240,0,0,255,0,0,240,240,
+ 0,15,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,
+ 0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,0,
+ 0,15,0,0,0,240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,240,0,0,
+ 15,0,0,15,0,0,0,240,0,0,15,255,255,0,255,255,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,
+ 240,0,0,15,0,0,0,240,0,15,240,0,0,255,0,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,240,0,0,255,0,0,240,240,0,
+ 15,15,0,0,240,240,0,15,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,
+ 15,255,255,0,255,255,240,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,0,255,255,240,15,0,
+ 0,0,240,0,0,15,0,0,0,240,0,0,15,255,240,0,255,255,0,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,
+ 15,0,15,0,240,0,240,15,0,0,0,240,0,0,15,255,240,0,255,255,0,15,0,15,
+ 0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,0,255,
+ 255,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,
+ 15,0,0,0,240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,
+ 0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,
+ 0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,
+ 240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,0,255,255,0,15,255,240,0,0,15,0,0,0,240,15,0,15,0,240,0,240,
+ 0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,
+ 0,0,15,0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,240,0,0,255,0,15,240,0,0,255,0,15,240,0,0,255,
+ 0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,15,240,0,0,255,0,0,0,
+ 15,240,0,0,255,0,0,0,15,240,0,0,255,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,255,0,0,15,240,0,0,0,255,0,0,15,240,0,0,
+ 0,255,0,0,15,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,255,0,
+ 0,15,240,0,255,0,0,15,240,0,255,0,0,15,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,
+ 0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,0,15,0,0,0,
+ 240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,
+ 240,0,240,240,15,255,15,0,255,240,240,240,15,15,15,0,240,240,240,15,15,15,0,240,
+ 240,15,240,15,0,255,0,15,0,0,0,240,0,0,0,255,240,0,15,255,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,
+ 15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,255,255,0,255,
+ 255,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,240,0,255,255,0,
+ 15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,255,240,0,255,255,0,15,0,15,
+ 0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,255,240,0,255,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,
+ 255,0,15,0,15,0,240,0,240,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,
+ 0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,15,0,240,0,240,0,255,240,0,
+ 15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,240,
+ 0,255,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,255,
+ 240,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,255,0,255,255,240,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,255,240,0,
+ 255,255,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,255,255,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,15,255,255,0,255,255,240,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,255,
+ 240,0,255,255,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,
+ 0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,15,255,0,240,255,240,15,0,15,0,240,0,240,15,0,15,
+ 0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,
+ 0,240,15,255,255,0,255,255,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,
+ 0,15,0,240,0,240,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,255,255,0,255,255,240,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,
+ 0,0,15,0,0,0,240,0,15,255,255,0,255,255,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,15,0,15,0,
+ 240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,240,0,240,15,
+ 0,15,15,0,0,240,240,0,15,240,0,0,255,0,0,15,240,0,0,255,0,0,15,15,
+ 0,0,240,240,0,15,0,240,0,240,15,0,15,0,15,0,240,0,240,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,255,255,0,255,255,240,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,240,
+ 255,0,255,15,240,15,15,15,0,240,240,240,15,0,15,0,240,0,240,15,0,15,0,240,
+ 0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,
+ 15,240,15,0,255,0,240,15,240,15,0,255,0,240,15,15,15,0,240,240,240,15,15,15,
+ 0,240,240,240,15,0,255,0,240,15,240,15,0,255,0,240,15,240,15,0,15,0,240,0,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,
+ 255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,
+ 0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,240,0,
+ 15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,240,
+ 0,255,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,15,255,240,0,255,255,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,15,0,15,0,240,0,240,15,15,15,0,240,240,240,15,0,240,0,240,15,0,
+ 0,255,15,0,15,240,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,15,255,240,0,255,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,
+ 15,0,240,0,240,15,255,240,0,255,255,0,15,15,0,0,240,240,0,15,0,240,0,240,
+ 15,0,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,0,0,240,0,0,
+ 0,255,240,0,15,255,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,15,0,15,
+ 0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,15,255,255,0,255,255,240,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,
+ 0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,
+ 0,15,0,240,0,240,0,240,240,0,15,15,0,0,240,240,0,15,15,0,0,240,240,0,
+ 15,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,15,
+ 15,0,240,240,240,15,240,255,0,255,15,240,15,0,15,0,240,0,240,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,0,240,240,0,15,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,240,240,0,15,15,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,
+ 15,0,240,0,240,0,240,240,0,15,15,0,0,240,240,0,15,15,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,0,255,255,240,
+ 0,0,15,0,0,0,240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,255,255,0,255,255,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,240,0,
+ 255,255,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,255,240,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,15,0,0,0,240,
+ 0,0,15,0,0,0,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
+ 255,0,15,255,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 255,255,0,15,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,15,0,0,0,240,0,0,240,240,0,15,15,0,0,240,240,0,15,15,
+ 0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,240,0,0,255,0,0,15,240,0,
+ 0,255,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,
+ 0,0,15,0,0,0,15,0,0,0,240,0,0,0,240,0,0,15,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,
+ 0,15,255,0,15,0,15,0,240,0,240,0,255,255,0,15,255,240,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,
+ 255,240,0,255,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,255,255,0,15,255,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,
+ 15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,255,255,0,255,
+ 255,240,15,0,0,0,240,0,0,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,
+ 15,0,15,0,240,0,240,15,0,0,0,240,0,0,15,255,240,0,255,255,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,
+ 0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,255,0,15,255,240,0,0,15,0,
+ 0,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,255,240,0,255,255,0,15,0,15,0,240,0,
+ 240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,
+ 15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,15,0,240,0,240,
+ 15,15,240,0,240,255,0,15,240,0,0,255,0,0,15,240,0,0,255,0,0,15,15,240,
+ 0,240,255,0,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,240,
+ 0,15,15,0,15,15,15,0,240,240,240,15,15,15,0,240,240,240,15,15,15,0,240,240,
+ 240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,
+ 15,0,240,0,240,15,0,15,0,240,0,240,0,255,240,0,15,255,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,0,240,
+ 15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,255,240,0,255,255,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,15,0,240,
+ 0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,0,255,255,0,15,255,240,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,255,240,0,15,255,0,15,0,15,0,240,0,240,0,
+ 255,240,0,15,255,0,0,0,15,0,0,0,240,15,0,15,0,240,0,240,0,255,240,0,
+ 15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,255,240,0,255,255,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,15,0,240,0,240,0,255,
+ 240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,15,0,
+ 240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,
+ 0,255,240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,15,0,
+ 15,0,240,0,240,0,240,240,0,15,15,0,0,240,240,0,15,15,0,0,15,0,0,0,
+ 240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,0,240,
+ 15,0,15,0,240,0,240,15,15,15,0,240,240,240,15,15,15,0,240,240,240,15,15,15,
+ 0,240,240,240,0,240,240,0,15,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,0,240,
+ 0,240,0,240,240,0,15,15,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 240,240,0,15,15,0,15,0,15,0,240,0,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,15,
+ 0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,240,15,0,15,0,240,0,
+ 240,0,255,255,0,15,255,240,0,0,15,0,0,0,240,15,0,15,0,240,0,240,0,255,
+ 240,0,15,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,255,0,255,255,240,0,0,240,0,0,15,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,240,0,0,15,0,0,15,255,255,0,255,255,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 240,0,0,255,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,
+ 0,0,255,0,0,15,240,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,255,
+ 0,0,15,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,15,240,0,0,255,0,0,0,0,0,0,0,0,15,0,0,0,240,0,0,
+ 15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,
+ 0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,
+ 0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,0,0,0,0,0,0,0,
+ 0,255,0,0,15,240,0,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,240,
+ 0,0,15,0,0,0,15,240,0,0,255,0,0,0,15,0,0,0,240,0,0,15,0,0,
+ 0,240,0,15,240,0,0,255,0,0,240,0,0,15,0,0,0,240,0,0,15,0,0,0,
+ 240,0,0,15,0,0,255,0,0,15,240,0,0,0,0,0,0,0,0,0,15,240,0,0,
+ 255,0,0,240,15,0,15,0,240,0,0,15,0,240,0,240,15,0,0,255,0,0,15,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_28 = {32,126,14,28,ht_ascii_art_28_pixels};
+static const uint8_t ht_ascii_art_48_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,224,0,0,0,0,15,224,0,0,
+ 0,0,15,224,0,0,0,0,15,224,0,0,0,0,15,224,0,0,0,0,15,224,0,0,
+ 0,0,15,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,244,15,208,0,
+ 0,3,244,15,208,0,0,3,244,15,208,0,0,3,244,15,208,0,0,3,244,15,208,0,
+ 0,3,244,15,208,0,0,3,244,15,208,0,0,3,244,15,208,0,0,3,244,15,208,0,
+ 0,3,244,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,127,255,255,255,255,255,127,255,255,255,255,255,
+ 127,255,255,255,255,255,85,254,85,85,111,213,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,85,254,85,85,111,213,127,255,255,255,255,255,
+ 127,255,255,255,255,255,127,255,255,255,255,255,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,0,253,0,0,31,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,1,95,229,64,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,21,0,3,244,15,208,0,0,3,244,15,208,0,0,3,244,15,208,0,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,0,0,15,208,63,0,
+ 0,0,15,208,63,0,0,0,15,208,63,0,0,0,15,208,63,0,0,0,15,208,63,0,
+ 0,0,15,208,63,0,0,0,15,208,63,0,1,84,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,1,95,229,64,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,127,0,0,0,0,0,127,0,2,164,0,0,127,0,3,244,0,0,127,
+ 0,3,244,0,0,127,0,3,244,0,0,127,1,252,7,240,63,64,1,252,7,240,63,64,
+ 1,252,7,240,63,64,1,170,166,160,63,64,0,3,244,0,63,64,0,3,244,0,63,64,
+ 0,3,244,0,63,64,0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,
+ 0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,1,252,0,15,192,0,1,252,0,15,192,0,
+ 1,252,0,15,192,0,1,252,6,170,170,64,1,252,7,240,63,64,1,252,7,240,63,64,
+ 1,252,7,240,63,64,253,0,0,15,192,0,253,0,0,15,192,0,253,0,0,15,192,0,
+ 253,0,0,10,128,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,2,170,160,0,0,0,3,255,240,0,0,
+ 0,3,255,240,0,0,0,3,255,240,0,0,1,252,0,15,192,0,1,252,0,15,192,0,
+ 1,252,0,15,192,0,1,252,0,15,192,0,1,252,0,15,192,0,1,252,0,15,192,0,
+ 1,252,0,15,192,0,1,252,7,240,0,0,1,252,7,240,0,0,1,252,7,240,0,0,
+ 253,2,164,0,63,64,253,3,244,0,63,64,253,3,244,0,63,64,253,3,244,0,63,64,
+ 253,0,7,240,63,64,253,0,7,240,63,64,253,0,7,240,63,64,253,0,0,15,192,0,
+ 253,0,0,15,192,0,253,0,0,15,192,0,253,0,0,15,192,0,253,0,0,15,192,0,
+ 253,0,0,15,192,0,253,0,0,15,192,0,1,170,170,160,42,64,0,255,255,240,63,64,
+ 0,255,255,240,63,64,0,255,255,240,63,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,144,0,0,0,0,15,224,0,
+ 0,0,0,15,224,0,0,0,0,15,224,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,2,166,160,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,
+ 0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,31,192,0,0,0,0,31,192,
+ 0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,
+ 0,0,0,0,31,192,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,31,192,0,0,0,0,31,192,
+ 0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,
+ 0,0,0,0,31,192,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,
+ 0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,253,3,244,15,192,0,253,3,244,15,192,0,253,3,244,15,192,
+ 0,0,255,255,240,0,0,0,255,255,240,0,0,0,255,255,240,0,0,0,255,255,240,0,
+ 191,255,255,255,255,255,191,255,255,255,255,255,191,255,255,255,255,255,106,170,255,255,250,170,
+ 0,0,255,255,240,0,0,0,255,255,240,0,0,0,255,255,240,0,0,253,3,244,15,192,
+ 0,253,3,244,15,192,0,253,3,244,15,192,0,169,3,244,10,128,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 106,170,171,250,170,170,191,255,255,255,255,255,191,255,255,255,255,255,191,255,255,255,255,255,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,144,0,0,0,0,15,224,0,
+ 0,0,0,15,224,0,0,0,0,15,224,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,2,166,160,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 170,170,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,
+ 0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,63,64,0,0,0,0,63,64,
+ 0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,
+ 0,0,0,0,63,64,0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,
+ 0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,6,175,192,0,0,0,11,255,192,0,0,0,11,255,192,0,
+ 0,0,11,255,192,0,0,3,244,31,192,0,0,3,244,31,192,0,0,3,244,31,192,0,
+ 0,2,164,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,2,166,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,26,170,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,6,170,144,0,0,
+ 0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,250,170,170,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,2,166,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,10,170,170,0,0,0,15,255,192,0,0,0,15,255,192,0,0,0,15,255,192,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,192,0,0,0,15,255,192,0,
+ 0,0,15,255,192,0,0,0,10,175,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 2,166,160,31,192,0,3,244,0,31,192,0,3,244,0,31,192,0,3,244,0,31,192,0,
+ 3,244,0,31,192,0,3,244,0,31,192,0,3,244,0,31,192,0,3,250,170,175,234,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,249,85,85,85,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,249,85,85,64,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,1,85,85,85,85,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,1,85,85,85,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,253,85,85,64,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,1,85,85,85,85,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,2,170,170,170,191,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,26,170,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,6,170,144,0,0,
+ 0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 2,166,170,170,170,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 0,3,255,255,255,0,0,3,255,255,255,0,0,3,255,255,255,0,0,2,170,170,191,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,5,80,0,0,0,0,11,240,0,0,0,0,11,240,0,0,
+ 0,0,11,240,0,0,0,0,11,240,0,0,0,0,11,240,0,0,0,0,11,240,0,0,
+ 0,0,5,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,144,0,0,0,0,15,208,0,
+ 0,0,0,15,208,0,0,0,0,15,208,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,2,166,160,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,255,0,0,0,0,63,255,
+ 0,0,0,0,63,255,0,0,10,170,170,170,0,0,15,255,192,0,0,0,15,255,192,0,
+ 0,0,15,255,192,0,2,255,240,0,0,0,2,255,240,0,0,0,2,255,240,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,1,170,160,0,0,0,
+ 2,255,240,0,0,0,2,255,240,0,0,0,2,255,240,0,0,0,0,0,15,255,192,0,
+ 0,0,15,255,192,0,0,0,15,255,192,0,0,0,10,170,170,170,0,0,0,0,63,255,
+ 0,0,0,0,63,255,0,0,0,0,63,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,170,170,170,170,170,170,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,170,170,170,170,170,170,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,255,252,0,0,0,0,255,252,0,0,0,0,
+ 255,252,0,0,0,0,85,85,85,80,0,0,0,3,255,240,0,0,0,3,255,240,0,0,
+ 0,3,255,240,0,0,0,0,0,15,255,192,0,0,0,15,255,192,0,0,0,15,255,192,
+ 0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,
+ 0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,5,85,64,
+ 0,0,0,15,255,192,0,0,0,15,255,192,0,0,0,15,255,192,0,3,255,240,0,0,
+ 0,3,255,240,0,0,0,3,255,240,0,0,85,85,85,80,0,0,255,252,0,0,0,0,
+ 255,252,0,0,0,0,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,2,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,26,128,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,1,85,85,85,64,0,1,252,0,0,63,64,1,252,0,0,63,64,
+ 1,252,0,0,63,64,253,0,11,255,255,64,253,0,11,255,255,64,253,0,11,255,255,64,
+ 253,3,244,0,63,64,253,3,244,0,63,64,253,3,244,0,63,64,253,3,244,0,63,64,
+ 253,3,244,0,63,64,253,3,244,0,63,64,253,3,244,0,63,64,253,0,5,85,64,0,
+ 253,0,11,255,192,0,253,0,11,255,192,0,253,0,11,255,192,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,1,252,0,0,0,0,1,85,85,85,64,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,2,170,170,128,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,3,255,255,255,255,0,3,254,170,170,191,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,250,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,250,170,170,170,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,250,170,170,170,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,170,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,250,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,250,170,170,170,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,250,170,170,170,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,250,170,170,64,0,3,255,255,255,128,0,3,255,255,255,128,0,3,255,255,255,128,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,250,170,170,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,250,170,170,170,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,250,170,170,64,0,3,255,255,255,128,0,3,255,255,255,128,0,3,255,255,255,128,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,5,85,85,85,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,11,255,255,0,3,244,11,255,255,0,3,244,11,255,255,0,3,244,5,85,127,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,1,85,85,85,85,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,250,170,170,191,0,3,255,255,255,255,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,2,170,175,234,170,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,2,170,175,234,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,26,170,0,3,252,0,31,192,0,3,252,0,31,192,0,
+ 3,252,0,31,192,0,3,252,11,208,0,0,3,252,11,208,0,0,3,252,11,208,0,0,
+ 3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,
+ 3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,3,252,6,144,0,0,
+ 3,252,11,208,0,0,3,252,11,208,0,0,3,252,11,208,0,0,3,252,0,31,192,0,
+ 3,252,0,31,192,0,3,252,0,31,192,0,3,252,0,26,170,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,250,170,170,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,250,160,26,191,0,3,255,244,47,255,0,3,255,244,47,255,0,
+ 3,255,244,47,255,0,3,244,11,208,63,0,3,244,11,208,63,0,3,244,11,208,63,0,
+ 3,244,6,144,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,127,0,3,244,0,0,127,0,
+ 3,244,0,0,127,0,3,244,0,0,127,0,3,255,244,0,127,0,3,255,244,0,127,0,
+ 3,255,244,0,127,0,3,255,244,0,127,0,3,255,244,0,127,0,3,255,244,0,127,0,
+ 3,244,11,208,127,0,3,244,11,208,127,0,3,244,11,208,127,0,3,244,11,208,127,0,
+ 3,244,11,208,127,0,3,244,11,208,127,0,3,244,11,208,127,0,3,244,0,47,255,0,
+ 3,244,0,47,255,0,3,244,0,47,255,0,3,244,0,47,255,0,3,244,0,47,255,0,
+ 3,244,0,47,255,0,3,244,0,47,255,0,3,244,0,0,127,0,3,244,0,0,127,0,
+ 3,244,0,0,127,0,3,244,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,2,170,170,170,128,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,254,170,170,128,0,
+ 3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,2,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,6,170,170,128,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,10,144,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,0,31,192,0,
+ 3,244,0,31,192,0,3,244,0,31,192,0,2,170,170,154,170,0,0,11,255,192,63,0,
+ 0,11,255,192,63,0,0,11,255,192,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,254,170,170,128,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,3,254,175,234,128,0,
+ 3,252,15,208,0,0,3,252,15,208,0,0,3,252,15,208,0,0,3,252,0,31,192,0,
+ 3,252,0,31,192,0,3,252,0,31,192,0,3,252,0,26,154,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,5,85,85,85,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 1,85,85,85,64,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,1,85,85,85,85,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,170,170,170,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,10,144,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,5,80,63,0,
+ 3,244,11,208,63,0,3,244,11,208,63,0,3,244,11,208,63,0,3,255,244,47,255,0,
+ 3,255,244,47,255,0,3,255,244,47,255,0,3,249,80,21,127,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,6,160,10,128,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,255,252,0,3,255,255,255,252,0,
+ 3,255,255,255,252,0,2,170,170,170,188,0,0,0,0,0,124,0,0,0,0,0,124,0,
+ 0,0,0,0,124,0,0,0,0,31,128,0,0,0,0,31,128,0,0,0,0,31,128,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,6,160,0,0,0,
+ 0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,250,170,170,168,0,3,255,255,255,252,0,
+ 3,255,255,255,252,0,3,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,253,0,0,15,255,255,253,
+ 0,0,15,255,255,253,0,0,15,229,85,85,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,229,85,85,0,0,15,255,255,253,
+ 0,0,15,255,255,253,0,0,15,255,255,253,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,253,0,0,0,0,0,
+ 253,0,0,0,0,0,253,0,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,1,252,0,0,0,0,
+ 1,252,0,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,0,0,15,192,0,
+ 0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,15,192,0,
+ 0,0,0,15,192,0,0,0,0,15,192,0,0,0,0,0,63,64,0,0,0,0,63,64,
+ 0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,
+ 0,0,0,0,63,64,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,
+ 0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,0,0,0,0,0,127,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,191,255,255,244,0,0,191,255,255,244,0,0,
+ 191,255,255,244,0,0,106,170,171,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,
+ 0,0,3,244,0,0,0,0,3,244,0,0,106,170,171,244,0,0,191,255,255,244,0,0,
+ 191,255,255,244,0,0,191,255,255,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,7,240,0,0,0,0,7,240,0,0,0,0,7,240,0,0,0,3,244,15,192,0,
+ 0,3,244,15,192,0,0,3,244,15,192,0,0,3,244,15,192,0,0,3,244,15,192,0,
+ 0,3,244,15,192,0,0,3,244,15,192,0,1,252,0,0,63,64,1,252,0,0,63,64,
+ 1,252,0,0,63,64,1,252,0,0,63,64,1,252,0,0,63,64,1,252,0,0,63,64,
+ 1,252,0,0,63,64,253,0,0,0,0,127,253,0,0,0,0,127,253,0,0,0,0,127,
+ 253,0,0,0,0,127,253,0,0,0,0,127,253,0,0,0,0,127,253,0,0,0,0,127,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 170,170,170,170,170,170,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,84,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,0,7,240,0,0,0,0,7,240,0,0,
+ 0,0,7,240,0,0,0,0,5,85,80,0,0,0,0,15,224,0,0,0,0,15,224,0,
+ 0,0,0,15,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 2,166,170,170,191,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 0,3,255,255,255,0,0,3,255,255,255,0,0,3,255,255,255,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,2,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,42,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,11,255,255,255,0,0,11,255,255,255,0,0,11,255,255,255,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,5,85,85,64,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,3,255,255,255,255,0,3,250,170,170,170,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,2,166,170,170,170,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,250,170,170,128,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,0,11,255,255,255,0,
+ 0,11,255,255,255,0,0,11,255,255,255,0,0,6,170,170,191,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,0,6,170,170,128,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,6,170,170,0,3,252,11,255,192,0,3,252,11,255,192,0,3,252,11,255,192,0,
+ 3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,
+ 3,255,244,0,0,0,3,255,244,0,0,0,3,255,244,0,0,0,3,252,11,255,192,0,
+ 3,252,11,255,192,0,3,252,11,255,192,0,3,252,6,170,170,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,2,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,3,254,170,170,128,0,3,255,255,255,192,0,
+ 3,255,255,255,192,0,3,255,255,255,192,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,5,85,85,127,0,0,3,255,255,255,0,
+ 0,3,255,255,255,0,0,3,255,255,255,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 3,244,0,0,42,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 2,166,170,170,170,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,6,170,170,128,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,254,170,170,128,0,3,255,255,255,192,0,3,255,255,255,192,0,3,255,255,255,192,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,
+ 3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,0,0,3,252,0,0,63,0,
+ 3,252,0,0,63,0,3,252,0,0,63,0,0,2,170,170,154,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,3,244,15,208,63,0,
+ 3,244,15,208,63,0,3,244,15,208,63,0,1,85,85,85,85,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 2,166,160,26,170,0,0,7,240,31,192,0,0,7,240,31,192,0,0,7,240,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,7,240,31,192,0,
+ 0,7,240,31,192,0,0,7,240,31,192,0,2,166,160,26,170,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,0,3,255,255,255,0,
+ 0,3,255,255,255,0,0,3,255,255,255,0,0,2,170,170,191,0,0,0,0,0,63,0,
+ 0,0,0,0,63,0,0,0,0,0,63,0,3,244,0,0,63,0,3,244,0,0,63,0,
+ 3,244,0,0,63,0,2,166,170,170,170,0,0,3,255,255,192,0,0,3,255,255,192,0,
+ 0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,255,255,255,255,0,3,255,255,255,255,0,3,255,255,255,255,0,
+ 2,170,170,175,234,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,7,240,0,0,0,
+ 0,7,240,0,0,0,0,7,240,0,0,0,2,171,250,170,170,0,3,255,255,255,255,0,
+ 3,255,255,255,255,0,3,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,255,
+ 0,0,0,0,63,255,0,0,0,0,63,255,0,0,0,0,21,85,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,11,255,192,0,0,0,11,255,192,0,0,0,11,255,192,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,
+ 3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,0,5,85,64,0,0,
+ 0,11,255,192,0,0,0,11,255,192,0,0,0,11,255,192,0,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,0,0,0,31,192,0,
+ 0,0,0,31,192,0,0,0,0,21,85,85,0,0,0,0,63,255,0,0,0,0,63,255,
+ 0,0,0,0,63,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,0,0,15,208,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,252,0,0,0,0,
+ 255,252,0,0,0,0,255,252,0,0,0,0,170,169,84,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,0,11,255,192,0,0,0,11,255,192,0,0,0,11,255,192,0,
+ 0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,
+ 0,0,0,0,63,64,0,0,0,0,63,64,0,0,0,0,63,64,0,0,6,170,128,0,
+ 0,0,11,255,192,0,0,0,11,255,192,0,0,0,11,255,192,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,0,3,244,0,0,0,
+ 0,3,244,0,0,0,170,170,164,0,0,0,255,252,0,0,0,0,255,252,0,0,0,0,
+ 255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 2,255,240,0,0,0,2,255,240,0,0,0,2,255,240,0,0,0,170,170,171,240,0,0,
+ 253,0,7,240,0,0,253,0,7,240,0,0,253,0,7,240,0,0,0,0,7,240,0,63,
+ 0,0,7,240,0,63,0,0,7,240,0,63,0,0,0,10,170,170,0,0,0,15,255,192,
+ 0,0,0,15,255,192,0,0,0,15,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_ascii_art_48 = {32,126,24,48,ht_ascii_art_48_pixels};
+static const uint8_t ht_block_art_16_pixels[] = {
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,
+ 255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,252,255,252,255,252,255,252,255,252,255,252,255,252,255,252,255,252,255,252,255,252,255,252,
+ 255,252,255,252,255,252,255,252,255,240,255,240,255,240,255,240,255,240,255,240,255,240,255,240,
+ 255,240,255,240,255,240,255,240,255,240,255,240,255,240,255,240,255,192,255,192,255,192,255,192,
+ 255,192,255,192,255,192,255,192,255,192,255,192,255,192,255,192,255,192,255,192,255,192,255,192,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,
+ 252,0,252,0,252,0,252,0,252,0,252,0,252,0,252,0,240,0,240,0,240,0,240,0,
+ 240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,240,0,
+ 192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,
+ 192,0,192,0,192,0,192,0,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,204,204,0,0,204,204,0,0,
+ 204,204,0,0,204,204,0,0,204,204,0,0,204,204,0,0,204,204,0,0,204,204,0,0,
+ 204,204,51,51,204,204,51,51,204,204,51,51,204,204,51,51,204,204,51,51,204,204,51,51,
+ 204,204,51,51,204,204,51,51,255,255,51,51,255,255,51,51,255,255,51,51,255,255,51,51,
+ 255,255,51,51,255,255,51,51,255,255,51,51,255,255,51,51,255,255,255,255,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3,
+ 0,3,0,3,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 0,255,0,255,0,255,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,255,0,255,0,255,0,255,0,
+ 255,0,255,0,255,0,255,0,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+};
+const ht_font_t ht_block_art_16 = {9600,9631,8,16,ht_block_art_16_pixels};
+static const uint8_t ht_block_art_square_10_pixels[] = {
+ 255,255,255,255,255,255,255,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,
+ 255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,
+ 255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,255,255,255,255,255,
+ 255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,0,0,15,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,207,255,252,255,255,207,255,252,255,255,207,255,252,
+ 255,255,207,255,252,255,255,207,255,252,255,255,15,255,240,255,255,15,255,240,255,255,15,255,
+ 240,255,255,15,255,240,255,255,15,255,240,255,240,15,255,0,255,240,15,255,0,255,240,15,
+ 255,0,255,240,15,255,0,255,240,15,255,0,255,192,15,252,0,255,192,15,252,0,255,192,
+ 15,252,0,255,192,15,252,0,255,192,15,252,0,255,0,15,240,0,255,0,15,240,0,255,
+ 0,15,240,0,255,0,15,240,0,255,0,15,240,0,240,0,15,0,0,240,0,15,0,0,
+ 240,0,15,0,0,240,0,15,0,0,240,0,15,0,0,192,0,12,0,0,192,0,12,0,
+ 0,192,0,12,0,0,192,0,12,0,0,192,0,12,0,0,0,63,240,3,255,0,63,240,
+ 3,255,0,63,240,3,255,0,63,240,3,255,0,63,240,3,255,207,48,204,243,12,207,48,
+ 192,0,0,0,0,12,243,12,207,48,192,0,0,0,0,0,0,0,207,48,204,243,12,207,
+ 48,195,12,243,48,207,60,243,12,207,48,195,12,243,48,207,51,12,243,255,255,255,255,255,
+ 255,255,243,12,243,48,207,63,255,255,255,255,243,12,243,48,207,51,12,243,255,255,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,
+ 0,3,0,0,48,0,3,0,0,48,0,3,0,0,48,0,3,0,0,48,0,3,0,0,
+ 0,0,0,0,0,0,0,0,0,0,15,252,0,255,192,15,252,0,255,192,15,252,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,255,0,63,240,3,255,0,63,240,3,255,
+ 255,192,15,252,0,255,192,15,252,0,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,255,192,15,252,0,255,192,15,252,0,255,192,15,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,192,15,252,0,255,192,15,252,0,255,192,0,3,255,0,63,240,3,255,0,63,
+ 240,3,255,255,255,255,255,255,255,255,255,255,255,255,255,255,252,0,255,192,15,252,0,255,
+ 192,15,252,0,255,255,255,255,255,255,255,255,255,255,255,255,240,3,255,0,63,240,3,255,
+ 0,63,240,3,255,0,63,240,3,255,0,63,240,3,255,0,63,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,63,240,3,255,0,63,240,3,255,0,63,255,252,0,255,192,15,
+ 252,0,255,192,15,252,0,0,63,240,3,255,0,63,240,3,255,0,63,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,
+};
+const ht_font_t ht_block_art_square_10 = {9600,9631,10,10,ht_block_art_square_10_pixels};
diff --git a/devices/harness-device/firmware/main/ui/habitat/creature_gallery.c b/devices/harness-device/firmware/main/ui/habitat/creature_gallery.c
new file mode 100644
index 000000000..cd2ac4ab8
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/creature_gallery.c
@@ -0,0 +1,222 @@
+#include "creature_gallery.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "creature_art.inc"
+
+typedef struct {
+ const char *name;
+ uint8_t cols, rows;
+ uint16_t count;
+ uint32_t duration;
+ const ht_font_t *font;
+ unsigned color;
+ const char *const *frames;
+ const uint32_t *ends;
+} ht_gallery_clip_t;
+#include "creature_clips.inc"
+
+static const ht_gallery_clip_t *clip_for(const ht_gallery_t *g)
+{
+ unsigned c = g->creature % HT_CREATURES;
+ return c < HT_ORIGINAL_CREATURES ? NULL : &clips[c-HT_ORIGINAL_CREATURES];
+}
+static uint32_t clip_phase(const ht_gallery_t *g, const ht_gallery_clip_t *c, uint32_t now)
+{
+ uint32_t elapsed = now-g->entered;
+ unsigned mode = g->mood % HT_CREATURE_MOODS;
+ if (mode == 1) return (elapsed/2) % c->duration;
+ if (mode == 2) return (elapsed % c->duration)*2 % c->duration;
+ if (mode == 3) return (elapsed/4) % c->duration;
+ return elapsed % c->duration;
+}
+static unsigned clip_frame(const ht_gallery_clip_t *c, uint32_t phase)
+{
+ unsigned i = 0;
+ while (i+1 < c->count && phase >= c->ends[i]) i++;
+ return i;
+}
+
+static const char *const moods[HT_CREATURE_MOODS] = {"calm", "curious", "playful", "sleepy"};
+const char *ht_gallery_name(unsigned creature)
+{
+ creature %= HT_CREATURES;
+ return creature < HT_ORIGINAL_CREATURES ? names[creature] : clips[creature-HT_ORIGINAL_CREATURES].name;
+}
+const char *ht_gallery_mood(unsigned mood) { return moods[mood % HT_CREATURE_MOODS]; }
+
+void ht_gallery_init(ht_gallery_t *g, uint32_t now)
+{
+ memset(g, 0, sizeof(*g));
+ g->creature = HT_GALLERY_START;
+ g->entered = g->tick = now;
+ g->dirty = true;
+}
+void ht_gallery_cancel(ht_gallery_t *g)
+{
+ // The driver owns the quarantine and hides the damaged/wake contact's UP.
+ // Waiting for that UP here would discard the next healthy gesture too.
+ g->down = false;
+ g->moved = false;
+}
+void ht_gallery_touch(ht_gallery_t *g, bool down, int x, int y, uint32_t now)
+{
+ if (down && !g->down) {
+ g->down = true;
+ g->moved = false;
+ g->start_x = g->last_x = (int16_t)x;
+ g->start_y = g->last_y = (int16_t)y;
+ g->touched = now;
+ return;
+ }
+ if (!g->down) return;
+ // UP coordinates on the CST9217 may be zero/stale; use the last real sample.
+ if (down) {
+ g->last_x = (int16_t)x;
+ g->last_y = (int16_t)y;
+ }
+ int dx = g->last_x-g->start_x, dy = g->last_y-g->start_y;
+ int ax = abs(dx), ay = abs(dy);
+ if (ax > 16 || ay > 16) g->moved = true;
+ if (down) return;
+ g->down = false;
+ bool changed = false;
+ // One decision per contact. Diagonal/short movements never become a tap.
+ if (ax >= 52 && ax*4 >= ay*5) {
+ g->creature = (uint8_t)((g->creature+(dx < 0 ? 1 : HT_CREATURES-1)) % HT_CREATURES);
+ changed = true;
+ } else if (ay >= 52 && ay*4 >= ax*5) {
+ g->mood = (uint8_t)((g->mood+(dy < 0 ? 1 : HT_CREATURE_MOODS-1)) % HT_CREATURE_MOODS);
+ changed = true;
+ } else if (!g->moved && now-g->touched < 650) {
+ if (clip_for(g)) g->entered = now; // Replay the visual clip, with no action.
+ else {
+ g->booped = true;
+ g->boop_until = now+1600;
+ }
+ g->dirty = true;
+ }
+ if (changed) {
+ g->entered = now;
+ g->booped = false;
+ g->dirty = true;
+ }
+}
+uint32_t ht_gallery_wake(const ht_gallery_t *g, uint32_t now)
+{
+ const ht_gallery_clip_t *c = clip_for(g);
+ if (c) {
+ if (g->dirty) return 1;
+ uint32_t phase = clip_phase(g,c,now);
+ uint32_t remaining = c->ends[clip_frame(c,phase)]-phase;
+ unsigned mode = g->mood % HT_CREATURE_MOODS;
+ if (mode == 1) remaining *= 2;
+ else if (mode == 2) remaining = (remaining+1)/2;
+ else if (mode == 3) remaining *= 4;
+ return remaining ? remaining : 1;
+ }
+ uint32_t step = g->mood == 3 && !g->booped ? 250 : 125;
+ uint32_t elapsed = now-g->tick;
+ return elapsed >= step ? 1 : step-elapsed;
+}
+void ht_gallery_tick(ht_gallery_t *g, uint32_t now)
+{
+ const ht_gallery_clip_t *c = clip_for(g);
+ if (c) {
+ if (clip_frame(c,clip_phase(g,c,now)) != clip_frame(c,clip_phase(g,c,g->tick)))
+ g->dirty = true;
+ g->tick = now;
+ return;
+ }
+ if (g->booped && (int32_t)(now-g->boop_until) >= 0) {
+ g->booped = false;
+ g->dirty = true;
+ }
+ uint32_t step = g->mood == 3 && !g->booped ? 250 : 125;
+ if (now-g->tick >= step) {
+ g->tick = now;
+ g->dirty = true;
+ }
+}
+void ht_gallery_render(const ht_gallery_t *g, ht_scene_t *scene, uint32_t now)
+{
+ unsigned species = g->creature % HT_CREATURES;
+ const ht_gallery_clip_t *clip = clip_for(g);
+ if (clip) {
+ uint16_t bg = ht_rgb(0x080c08);
+ ht_scene_clear(scene,bg);
+ const char *p = clip->frames[clip_frame(clip,clip_phase(g,clip,now))];
+ int width = clip->cols*clip->font->width;
+ int x = (HT_WIDTH-width)/2, y = (HT_HEIGHT-clip->rows*clip->font->height)/2;
+ for (unsigned row=0; row<clip->rows; row++) {
+ char line[HT_TEXT_BYTES];
+ const char *end = strchr(p,'\n');
+ size_t len = end ? (size_t)(end-p) : strlen(p);
+ if (len >= sizeof(line)) len=sizeof(line)-1;
+ memcpy(line,p,len);line[len]=0;
+ ht_text(scene,x,y+(int)row*clip->font->height,width,clip->font,ht_rgb(clip->color),bg,line);
+ p += len;
+ if (*p == '\n') p++;
+ }
+ return;
+ }
+ unsigned mood = g->mood % HT_CREATURE_MOODS;
+ uint32_t t = now-g->entered;
+ unsigned q = t/125;
+ bool boop = g->booped && (int32_t)(g->boop_until-now) > 0;
+ bool playing = mood == 2 || boop;
+ unsigned pose;
+ if (playing) {
+ // Anticipation, two distinct action poses, then a rest. Not a metronomic wiggle.
+ static const uint8_t sequence[] = {0,0,2,2,3,3,2,3,3,0,0,1};
+ pose = sequence[(boop ? (1600-(g->boop_until-now))/125 : q) % 12];
+ } else if (mood == 3) {
+ pose = 4+(t%4000 >= 2000);
+ } else if (species == 7) {
+ pose = (q%14 >= 8); // Jellyfish bell contracts, tentacles follow.
+ } else if (species == 9) {
+ pose = (q%16 >= 10); // Bat glides, then closes its wings.
+ } else {
+ pose = ((q+species*3)%29 >= 19); // Ear, tail, leaf, antenna, wing or hem.
+ }
+ bool blink = mood != 3 && !playing && (q%43 == 20 || q%71 == 47);
+ char eye = mood == 3 || blink ? '-' : playing ? '^' : 'o';
+ char mouth = species == 3 ? 'v' : species == 4 ? '_' : species == 8 ? '=' : 'w';
+ if (species == 1 || species == 5 || species == 7) mouth = '_';
+ if (mood == 1) mouth = 'o';
+ if (playing) mouth = species == 3 ? 'v' : 'w';
+ if (mood == 3) mouth = (t%4000 < 2000) ? '_' : 'o';
+ int bob = 0;
+ if (species == 5 || species == 7 || species == 9) {
+ static const int8_t drift[] = {0,-1,-2,-3,-2,-1,0,1,2,3,2,1};
+ bob = drift[(t/375)%12];
+ }
+ uint16_t bg = ht_rgb(0x080c08), fg = ht_rgb(0xc5ec9a), dim = ht_rgb(0x849079);
+ ht_scene_clear(scene, bg);
+
+ // Stable 25-cell runs preserve alignment between poses and enable glyph-level damage.
+ for (unsigned row = 0; row < HT_CREATURE_ROWS; row++) {
+ char line[HT_CREATURE_COLS+1];
+ memcpy(line, art[species][pose][row], sizeof(line));
+ for (unsigned c = 0; c < HT_CREATURE_COLS; c++) {
+ if (line[c] == '%') line[c] = mood == 1 && !blink ? ((q/12+c)%2 ? 'O' : 'o') : eye;
+ else if (line[c] == '?') line[c] = mouth;
+ }
+ ht_text(scene, (HT_WIDTH-HT_CREATURE_COLS*14)/2, 107+(int)row*28+bob,
+ HT_CREATURE_COLS*14, &ht_ascii_art_28, fg, bg, line);
+ }
+ // The accents are also ordinary ASCII glyphs, never sprites or vector drawing.
+ const char *effect = " ";
+ if (mood == 1 && !boop) effect = q%24 < 17 ? "?" : ".";
+ if (mood == 3 && !boop) effect = t%3000 < 1500 ? "z" : "Z";
+ if (boop) effect = "*";
+ ht_text(scene, 366, 112, 28, &ht_ascii_art_28, dim, bg, effect);
+}
+bool ht_gallery_take(ht_gallery_t *g, ht_scene_t *scene, uint32_t now)
+{
+ if (!g->dirty) return false;
+ g->dirty = false;
+ ht_gallery_render(g, scene, now);
+ return true;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/creature_gallery.h b/devices/harness-device/firmware/main/ui/habitat/creature_gallery.h
new file mode 100644
index 000000000..965cc4865
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/creature_gallery.h
@@ -0,0 +1,31 @@
+#pragma once
+// Standalone visual study. No cable, agent, audio, or allocation dependencies.
+#include "terminal.h"
+
+#define HT_ORIGINAL_CREATURES 10
+#define HT_CREATURES 20
+#define HT_GALLERY_START HT_ORIGINAL_CREATURES
+#define HT_CREATURE_MOODS 4
+#define HT_CREATURE_COLS 25
+#define HT_CREATURE_ROWS 9
+
+typedef struct {
+ uint8_t creature, mood;
+ bool down, moved, dirty, booped;
+ int16_t start_x, start_y, last_x, last_y;
+ uint32_t entered, touched, boop_until, tick;
+} ht_gallery_t;
+
+extern const ht_font_t ht_ascii_art_12, ht_ascii_art_14, ht_ascii_art_16, ht_ascii_art_20;
+extern const ht_font_t ht_ascii_art_28, ht_ascii_art_48;
+extern const ht_font_t ht_block_art_16, ht_block_art_square_10;
+const char *ht_gallery_name(unsigned creature);
+const char *ht_gallery_mood(unsigned mood);
+void ht_gallery_init(ht_gallery_t *g, uint32_t now);
+void ht_gallery_touch(ht_gallery_t *g, bool down, int x, int y, uint32_t now);
+// Drop the current contact. The touch driver suppresses its remaining samples/UP.
+void ht_gallery_cancel(ht_gallery_t *g);
+void ht_gallery_tick(ht_gallery_t *g, uint32_t now);
+uint32_t ht_gallery_wake(const ht_gallery_t *g, uint32_t now);
+bool ht_gallery_take(ht_gallery_t *g, ht_scene_t *scene, uint32_t now);
+void ht_gallery_render(const ht_gallery_t *g, ht_scene_t *scene, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/display_habitat.c b/devices/harness-device/firmware/main/ui/habitat/display_habitat.c
new file mode 100644
index 000000000..cc552a723
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/display_habitat.c
@@ -0,0 +1,456 @@
+// Direct text -> RGB565 -> QSPI DMA. No LVGL initialization or object pool.
+#include "runtime.h"
+#include "perf_bench.h"
+#ifdef DEVICE_LAYOUT_BENCH
+#include "layout_bench.h"
+#endif
+#ifdef DEVICE_TRANSPORT_BENCH
+void cable_transport_benchmark(void);
+#endif
+#include "display.h"
+#include "touch.h"
+#include "ui_perf.h"
+#include "audio_capture.h"
+#include "cable_link.h"
+#include "board_pins.h"
+#include "board.h"
+#include "esp_lcd_panel_io.h"
+#include "esp_lcd_panel_ops.h"
+#include "esp_lcd_co5300.h"
+#include "driver/spi_master.h"
+#include "esp_heap_caps.h"
+#include "esp_timer.h"
+#include "esp_task_wdt.h"
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/semphr.h"
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <stdatomic.h>
+#ifdef DEVICE_RENDER_FAULT
+#include "esp_attr.h"
+#include "cable_client.h"
+#endif
+#ifdef DEVICE_RENDER_STRESS
+#include "audio_client.h"
+#endif
+
+#define STRIP_LINES 24
+static esp_lcd_panel_handle_t panel;
+static SemaphoreHandle_t model_lock, dma_done;
+static TaskHandle_t renderer;
+static uint16_t *pixels[2];
+static ht_scene_t scenes[2];
+static bool painted;
+static atomic_bool asleep, force_frame;
+static atomic_uint last_activity;
+static int64_t input_us;
+static portMUX_TYPE stats_lock = portMUX_INITIALIZER_UNLOCKED;
+static habitat_perf_t stats;
+static void (*power_cb)(bool);
+// Watch actual renderer progress independently of the USB and touch tasks.
+// A blocked panel call must not leave a responsive host controlling a frozen screen.
+enum { RENDER_MODEL, RENDER_POWER, RENDER_DAMAGE, RENDER_RASTER, RENDER_DMA,
+ RENDER_SUBMIT, RENDER_HEALTH, RENDER_WAIT };
+static atomic_uint render_stage, render_progress_ms;
+static esp_timer_handle_t render_guard;
+static const co5300_lcd_init_cmd_t init_cmds[] = {
+ {0xFE, (uint8_t[]){0x20}, 1, 0},
+ {0x19, (uint8_t[]){0x10}, 1, 0},
+ {0x1C, (uint8_t[]){0xA0}, 1, 0},
+ {0xFE, (uint8_t[]){0x00}, 1, 0},
+ {0xC4, (uint8_t[]){0x80}, 1, 0},
+ {0x3A, (uint8_t[]){0x55}, 1, 0},
+ {0x35, (uint8_t[]){0x00}, 1, 0},
+ {0x53, (uint8_t[]){0x20}, 1, 0},
+ {0x51, (uint8_t[]){0xFF}, 1, 0},
+ {0x63, (uint8_t[]){0xFF}, 1, 0},
+ {0x2A, (uint8_t[]){0x00, 0x06, 0x01, 0xD7}, 4, 0},
+ {0x2B, (uint8_t[]){0x00, 0x00, 0x01, 0xD1}, 4, 600},
+ {0x11, NULL, 0, 600},
+ {0x29, NULL, 0, 0},
+};
+static uint32_t now_ms(void) { return (uint32_t)(esp_timer_get_time() / 1000); }
+static uint32_t elapsed_since(const atomic_uint *stamp)
+{
+ // Read the shared timestamp FIRST. Sampling time before a concurrent store
+ // can subtract a future millisecond and wrap into a false multi-day stall.
+ uint32_t since = atomic_load(stamp);
+ return now_ms() - since;
+}
+static void render_progress(unsigned stage)
+{
+ atomic_store(&render_progress_ms, now_ms());
+ atomic_store(&render_stage, stage);
+}
+static void render_watch(void *arg)
+{
+ (void)arg;
+ uint32_t elapsed = elapsed_since(&render_progress_ms);
+ if (elapsed < 4000) return;
+ static const char *stages[] = {"model", "panel power", "damage", "raster",
+ "DMA wait", "panel submit", "health", "wake wait"};
+ unsigned stage = atomic_load(&render_stage);
+ ESP_LOGE("habitat", "renderer stalled %lu ms at %s; restarting", (unsigned long)elapsed,
+ stage < sizeof stages / sizeof stages[0] ? stages[stage] : "unknown");
+ // Panic reboot also preserves the stage in the existing last-words log.
+ abort();
+}
+#ifdef DEVICE_RENDER_FAULT
+// Diagnostic image only. One deliberate blocked render task, then normal boot.
+// The RTC marker survives the panic; no settings or NVS writes are involved.
+static RTC_NOINIT_ATTR uint32_t injected_stall[2];
+static void render_fault_once(void)
+{
+ const uint32_t cookie = 0x48524651u;
+ if (injected_stall[0] == cookie && injected_stall[1] == ~cookie) return;
+ if (now_ms() < 12000 || !cable_client_is_connected()) return;
+ injected_stall[0] = cookie; injected_stall[1] = ~cookie;
+ ESP_LOGW("render-test", "INJECT once: blocking renderer at panel submit; guard must recover");
+ render_progress(RENDER_SUBMIT);
+ vTaskDelay(pdMS_TO_TICKS(20000));
+ ESP_LOGE("render-test", "FAIL: renderer stall guard did not restart within 20 seconds");
+ abort();
+}
+#endif
+#ifdef DEVICE_RENDER_STRESS
+// Local display-only soak. No fabricated contacts, app commands or microphone.
+// A real touch or voice session cancels the test immediately.
+static uint32_t render_stress_tick(void)
+{
+ static bool started, finished;
+ static uint32_t due, cycles, rng = 0x41be95;
+ if (finished) return 1000;
+ uint32_t now = now_ms();
+ if (now < 15000) return 20;
+ touch_stats_t touch; touch_stats(&touch);
+ if (touch.presses || audio_client_active()) {
+ finished = true;
+ ESP_LOGW("render-test", "STRESS cancelled by user input at cycle %lu", (unsigned long)cycles);
+ return 1000;
+ }
+ if (!started) {
+ started = true; due = now;
+ ESP_LOGI("render-test", "STRESS begin: 1000 sleep/wake cycles; heap integrity + task stack checks");
+ }
+ if ((int32_t)(now - due) < 0) return 20;
+ bool wake = display_is_asleep();
+ display_lock();
+ if (wake) display_wake(); else display_sleep();
+ display_unlock();
+ if (wake && ++cycles % 50 == 0) {
+ assert(heap_caps_check_integrity_all(true));
+ ESP_LOGI("render-test", "STRESS cycles=%lu int=%u min=%u psram=%u render_stack=%u touch_stack=%u action_stack=%u cable_stack=%u",
+ (unsigned long)cycles, (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
+ (unsigned)uxTaskGetStackHighWaterMark(NULL),
+ (unsigned)uxTaskGetStackHighWaterMark(xTaskGetHandle("habitat_touch")),
+ (unsigned)uxTaskGetStackHighWaterMark(xTaskGetHandle("habitat_actions")),
+ (unsigned)uxTaskGetStackHighWaterMark(xTaskGetHandle("cable_link")));
+ }
+ if (cycles >= 1000) {
+ finished = true;
+ ESP_LOGI("render-test", "STRESS PASS: 1000 complete sleep/wake cycles, no heap corruption; normal control resumes");
+ return 1000;
+ }
+ rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5;
+ due = now + 40 + rng % 181;
+ return 20;
+}
+#endif
+void habitat_render_notify(void)
+{
+ if (renderer)
+ xTaskNotifyGive(renderer);
+}
+void habitat_input_stamp(int64_t us)
+{
+ portENTER_CRITICAL(&stats_lock);
+ input_us = us;
+ portEXIT_CRITICAL(&stats_lock);
+}
+void habitat_perf_get(habitat_perf_t *out)
+{
+ portENTER_CRITICAL(&stats_lock);
+ *out = stats;
+ portEXIT_CRITICAL(&stats_lock);
+}
+static bool color_done(esp_lcd_panel_io_handle_t io, esp_lcd_panel_io_event_data_t *event,
+ void *ctx)
+{
+ (void)io;
+ (void)event;
+ (void)ctx;
+ ui_perf_flush_done();
+ BaseType_t wake = pdFALSE;
+ xSemaphoreGiveFromISR(dma_done, &wake);
+ return wake == pdTRUE;
+}
+void display_lock_at(const char *who)
+{
+ (void)who;
+ if (model_lock)
+ xSemaphoreTakeRecursive(model_lock, portMAX_DELAY);
+}
+void display_unlock(void)
+{
+ if (model_lock)
+ xSemaphoreGiveRecursive(model_lock);
+}
+bool display_is_asleep(void) { return atomic_load(&asleep); }
+void display_set_power_cb(void (*cb)(bool)) { power_cb = cb; }
+void display_bump_activity(void) { atomic_store(&last_activity, now_ms()); }
+void display_sleep(void)
+{
+ if (atomic_exchange(&asleep, true))
+ return;
+ if (power_cb)
+ power_cb(false);
+ habitat_render_notify();
+}
+void display_wake(void)
+{
+ if (!atomic_exchange(&asleep, false))
+ return;
+ display_bump_activity();
+ atomic_store(&force_frame, true);
+ if (power_cb)
+ power_cb(true);
+ habitat_render_notify();
+}
+void display_set_brightness(uint8_t value)
+{
+ (void)value; /* Palette brightness is applied once per scene, not per pixel. */
+}
+static void wait_dma(void)
+{
+ render_progress(RENDER_DMA);
+ if (xSemaphoreTake(dma_done, pdMS_TO_TICKS(250)) != pdTRUE) {
+ ESP_LOGE("habitat", "DMA completion timeout");
+ abort();
+ }
+}
+static uint32_t paint(const ht_scene_t *next, const ht_damage_t *damage)
+{
+ bool pending = false;
+ int buffer = 0;
+ int64_t started = esp_timer_get_time();
+ uint32_t raster_us = 0;
+ for (int n = 0; n < damage->count; n++) {
+ ht_rect_t rect = damage->rect[n];
+ // A small glyph edit fits in one transfer even when taller than a full-width strip.
+ // Keep larger regions pipelined: a 40-row buffer saved a command but delayed their DMA.
+ int step = rect.w * rect.h <= 2048 ? rect.h : STRIP_LINES;
+ for (int y = rect.y; y < rect.y + rect.h; y += step) {
+ int h = rect.y + rect.h - y;
+ if (h > step)
+ h = step;
+ ht_rect_t strip = {rect.x, y, rect.w, h};
+ int64_t t = esp_timer_get_time();
+ render_progress(RENDER_RASTER);
+#ifdef DEVICE_LAYOUT_BENCH
+ ht_layout_raster(next, strip, pixels[buffer]);
+#else
+ ht_raster(next, strip, pixels[buffer]);
+#endif
+ raster_us += (uint32_t)(esp_timer_get_time() - t);
+ // CPU prepares B while DMA owns A. Neither buffer is reused before the ISR fence.
+ if (pending)
+ wait_dma();
+ ui_perf_flush((size_t)rect.w * h * 2);
+ render_progress(RENDER_SUBMIT);
+ ESP_ERROR_CHECK(esp_lcd_panel_draw_bitmap(panel, rect.x, y, rect.x + rect.w, y + h,
+ pixels[buffer]));
+ pending = true;
+ buffer ^= 1;
+ }
+ }
+ if (pending)
+ wait_dma();
+ int64_t finished = esp_timer_get_time();
+#ifdef DEVICE_OCTOPUS_BENCH
+ octopus_perf_paint(raster_us, (uint32_t)(finished - started));
+#endif
+ portENTER_CRITICAL(&stats_lock);
+ stats.frames++;
+ stats.bytes += damage->pixels * 2;
+ if (raster_us > stats.raster_max_us)
+ stats.raster_max_us = raster_us;
+ if (finished - started > stats.frame_max_us)
+ stats.frame_max_us = (uint32_t)(finished - started);
+ if (input_us && input_us <= started) {
+ stats.input_last_us = (uint32_t)(finished - input_us);
+ if (stats.input_last_us > stats.input_max_us)
+ stats.input_max_us = stats.input_last_us;
+ input_us = 0;
+ }
+ portEXIT_CRITICAL(&stats_lock);
+ return raster_us;
+}
+static void heartbeat(void)
+{
+ static uint32_t last;
+ uint32_t now = now_ms();
+ if (!last) {
+ last = now;
+ return;
+ }
+ if (now - last < 60000)
+ return;
+ last = now;
+ touch_stats_t touch;
+ habitat_perf_t perf;
+ touch_stats(&touch);
+ habitat_perf_get(&perf);
+ // The host watches this exact prefix. Emit from the renderer itself, including while asleep,
+ // so a live cable cannot mask a stalled UI. Nothing is drawn for this once-a-minute report.
+ ESP_LOGI("habitat",
+ "alive up=%lus heap=%u/%u psram=%u touches=%lu read_fails=%lu inferred=%lu "
+ "frames=%lu bytes=%lu input_last_us=%lu muted=%d raster_max_us=%lu frame_max_us=%lu log_drops=%lu stack_free=%u%s%s",
+ (unsigned long)(now / 1000),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
+ (unsigned long)touch.presses, (unsigned long)touch.read_failures,
+ (unsigned long)touch.inferred_releases, (unsigned long)perf.frames,
+ (unsigned long)perf.bytes, (unsigned long)perf.input_last_us,
+ (int)audio_notify_is_muted(), (unsigned long)perf.raster_max_us,
+ (unsigned long)perf.frame_max_us, (unsigned long)cable_link_dropped_logs(),
+ (unsigned)uxTaskGetStackHighWaterMark(NULL),
+ touch.controller_ok ? "" : " TOUCH-DEAD",
+ display_is_asleep() ? " asleep" : "");
+}
+static void render_task(void *arg)
+{
+ (void)arg;
+ ESP_ERROR_CHECK(esp_task_wdt_add(NULL));
+#ifdef DEVICE_TRANSPORT_BENCH
+ cable_transport_benchmark();
+#endif
+#ifdef DEVICE_LAYOUT_BENCH
+ ht_layout_benchmark(pixels[0], &scenes[0], &scenes[1], paint);
+ portENTER_CRITICAL(&stats_lock);
+ memset(&stats, 0, sizeof stats);
+ portEXIT_CRITICAL(&stats_lock);
+#endif
+ render_progress(RENDER_MODEL);
+ const esp_timer_create_args_t guard_args = {.callback = render_watch, .name = "render_guard"};
+ ESP_ERROR_CHECK(esp_timer_create(&guard_args, &render_guard));
+ ESP_ERROR_CHECK(esp_timer_start_periodic(render_guard, 1000000));
+ int front = 0;
+ bool panel_on = true;
+ for (;;) {
+ ESP_ERROR_CHECK(esp_task_wdt_reset());
+#ifdef DEVICE_RENDER_FAULT
+ render_fault_once();
+#endif
+#ifdef DEVICE_RENDER_STRESS
+ uint32_t stress_wake_ms = render_stress_tick();
+#endif
+ render_progress(RENDER_MODEL);
+ display_lock();
+#ifdef DEVICE_OCTOPUS_BENCH
+ int64_t model_started = esp_timer_get_time();
+#endif
+ habitat_tick();
+ bool fresh = habitat_scene_take(&scenes[front ^ 1]);
+ uint32_t wake_ms = habitat_next_wake_ms();
+#ifdef DEVICE_RENDER_STRESS
+ if (stress_wake_ms < wake_ms) wake_ms = stress_wake_ms;
+#endif
+#ifdef DEVICE_OCTOPUS_BENCH
+ uint32_t model_us = (uint32_t)(esp_timer_get_time() - model_started);
+ ht_perf_tag_t tag = octopus_perf_capture(&scenes[front ^ 1], fresh);
+#endif
+ display_unlock();
+ bool on = !display_is_asleep();
+ if (on != panel_on) {
+ render_progress(RENDER_POWER);
+ ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel, on));
+ panel_on = on;
+ }
+ // A touch/PWR wake can arrive after we sampled `on`, including during
+ // panel power-off. Keep its repaint request until an awake iteration.
+ bool force = on && atomic_exchange(&force_frame, false);
+ if (on && (fresh || force)) {
+ if (!fresh)
+ scenes[front ^ 1] = scenes[front];
+ ht_damage_t damage;
+ render_progress(RENDER_DAMAGE);
+#ifdef DEVICE_OCTOPUS_BENCH
+ int64_t damage_started = esp_timer_get_time();
+#endif
+ ht_damage(painted && !force ? &scenes[front] : NULL, &scenes[front ^ 1], &damage);
+#ifdef DEVICE_OCTOPUS_BENCH
+ uint32_t damage_us = (uint32_t)(esp_timer_get_time() - damage_started);
+#endif
+ if (damage.count)
+ paint(&scenes[front ^ 1], &damage);
+#ifdef DEVICE_OCTOPUS_BENCH
+ octopus_perf_commit(tag, damage.pixels * 2, model_us, damage_us);
+#endif
+ front ^= 1;
+ painted = true;
+ }
+ if (!on && fresh) {
+ front ^= 1;
+ painted = false;
+ }
+ if (on && elapsed_since(&last_activity) > 300000) {
+ display_lock();
+ // A touch may have refreshed activity while we waited for this
+ // lock. The stale pre-lock idle decision must not swallow it.
+ if (elapsed_since(&last_activity) > 300000)
+ display_sleep();
+ display_unlock();
+ }
+ render_progress(RENDER_HEALTH);
+ heartbeat();
+ // Notifications wake immediately; only finite reactions / voice require the short timeout.
+ render_progress(RENDER_WAIT);
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(wake_ms > 1000 ? 1000 : wake_ms));
+ }
+}
+void display_init(void)
+{
+ model_lock = xSemaphoreCreateRecursiveMutex();
+ dma_done = xSemaphoreCreateBinary();
+ assert(model_lock && dma_done);
+ const spi_bus_config_t bus =
+ CO5300_PANEL_BUS_QSPI_CONFIG(BSP_LCD_QSPI_SCLK, BSP_LCD_QSPI_D0, BSP_LCD_QSPI_D1,
+ BSP_LCD_QSPI_D2, BSP_LCD_QSPI_D3, HT_WIDTH * STRIP_LINES * 2);
+ ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &bus, SPI_DMA_CH_AUTO));
+ esp_lcd_panel_io_spi_config_t io_cfg =
+ CO5300_PANEL_IO_QSPI_CONFIG(BSP_LCD_QSPI_CS, color_done, NULL);
+ io_cfg.trans_queue_depth = 2;
+ esp_lcd_panel_io_handle_t io;
+ ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi(SPI2_HOST, &io_cfg, &io));
+ co5300_vendor_config_t vendor = {.init_cmds = init_cmds,
+ .init_cmds_size = sizeof(init_cmds) / sizeof(init_cmds[0]),
+ .flags = {.use_qspi_interface = 1}};
+ esp_lcd_panel_dev_config_t cfg = {.reset_gpio_num = board()->lcd_rst,
+ .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
+ .bits_per_pixel = 16,
+ .vendor_config = &vendor};
+ ESP_ERROR_CHECK(esp_lcd_new_panel_co5300(io, &cfg, &panel));
+ ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel, 6, 0));
+ ESP_ERROR_CHECK(esp_lcd_panel_reset(panel));
+ ESP_ERROR_CHECK(esp_lcd_panel_init(panel));
+ ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel, true));
+ for (int i = 0; i < 2; i++) {
+ pixels[i] =
+ heap_caps_malloc(HT_WIDTH * STRIP_LINES * 2, MALLOC_CAP_INTERNAL | MALLOC_CAP_DMA);
+ assert(pixels[i]);
+ }
+ display_bump_activity();
+ assert(xTaskCreatePinnedToCore(render_task, "habitat_render", 6144, NULL, 5, &renderer, 1) ==
+ pdPASS);
+ touch_init();
+ ESP_LOGI("habitat",
+ "direct C renderer: two %d-byte internal DMA buffers; 40MHz QSPI; no LVGL heap",
+ HT_WIDTH * STRIP_LINES * 2);
+}
+void display_init_ota(void) { display_init(); }
diff --git a/devices/harness-device/firmware/main/ui/habitat/draft.c b/devices/harness-device/firmware/main/ui/habitat/draft.c
new file mode 100644
index 000000000..8d62b5219
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/draft.c
@@ -0,0 +1,41 @@
+#include "draft.h"
+#include <stdio.h>
+#include <string.h>
+void ht_draft_reset(ht_draft_t *s)
+{
+ uint32_t serial=s->serial;
+ memset(s,0,sizeof *s);s->serial=serial;
+}
+void ht_draft_open(ht_draft_t *s,const ht_draft_page_t *page,ht_draft_emit_t emit,void *ctx)
+{
+ ht_draft_reset(s);s->page=*page;s->emit=emit;s->ctx=ctx;
+}
+bool ht_draft_command(ht_draft_t *s,ht_draft_op_t op,uint32_t revision,int delta,uint32_t now)
+{
+ if (!s->page.active || !s->page.id[0] || s->pending || revision!=s->page.revision) return false;
+ if (op!=HT_DRAFT_STATE && op!=HT_DRAFT_DISCARD && (s->failed || s->page.locked)) return false;
+ if (op==HT_DRAFT_SEND && !s->page.can_send) return false;
+ if (op==HT_DRAFT_UNDO && !s->page.can_undo) return false;
+ if (op==HT_DRAFT_MOVE && (delta!=1 && delta!=-1)) return false;
+ ht_draft_command_t command={s->page.id,++s->serial,revision,op,delta};
+ if (!s->emit || !s->emit(&command,s->ctx)) return false;
+ s->pending=true;s->request=command.request;s->deadline=now+5000;s->op=op;s->delta=delta;
+ return true;
+}
+bool ht_draft_reply(ht_draft_t *s,const char *id,uint32_t request,bool ok,const ht_draft_page_t *page)
+{
+ if (!s->pending || !id || strcmp(s->page.id,id) || s->request!=request) return false;
+ s->pending=false;
+ if (!page->active) { ht_draft_reset(s);return true; }
+ if (strcmp(page->id,s->page.id)) {
+ s->failed=true;snprintf(s->page.error,sizeof s->page.error,"Draft unavailable. Check the terminal.");return true;
+ }
+ s->page=*page;s->failed=!ok;
+ return true;
+}
+bool ht_draft_tick(ht_draft_t *s,uint32_t now)
+{
+ if (!s->pending || (int32_t)(now-s->deadline)<0) return false;
+ s->pending=false;s->failed=true;
+ snprintf(s->page.error,sizeof s->page.error,"No reply. Check the draft status.");return true;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/draft.h b/devices/harness-device/firmware/main/ui/habitat/draft.h
new file mode 100644
index 000000000..c456cc7ce
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/draft.h
@@ -0,0 +1,32 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum { HT_DRAFT_STATE, HT_DRAFT_MOVE, HT_DRAFT_UNDO, HT_DRAFT_DISCARD, HT_DRAFT_SEND } ht_draft_op_t;
+typedef struct {
+ char id[48], agent[48], name[96], context[96], text[512], error[128];
+ uint32_t revision;
+ int position, total;
+ bool active, locked, can_undo, can_send;
+} ht_draft_page_t;
+typedef struct {
+ const char *id;
+ uint32_t request, revision;
+ ht_draft_op_t op;
+ int delta;
+} ht_draft_command_t;
+typedef bool (*ht_draft_emit_t)(const ht_draft_command_t *, void *);
+typedef struct {
+ ht_draft_page_t page;
+ uint32_t serial, request, deadline;
+ bool pending, failed;
+ ht_draft_op_t op;
+ int delta;
+ ht_draft_emit_t emit;
+ void *ctx;
+} ht_draft_t;
+void ht_draft_reset(ht_draft_t *);
+void ht_draft_open(ht_draft_t *, const ht_draft_page_t *, ht_draft_emit_t, void *);
+bool ht_draft_command(ht_draft_t *, ht_draft_op_t, uint32_t revision, int delta, uint32_t now);
+bool ht_draft_reply(ht_draft_t *, const char *id, uint32_t request, bool ok, const ht_draft_page_t *);
+bool ht_draft_tick(ht_draft_t *, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/fonts.c b/devices/harness-device/firmware/main/ui/habitat/fonts.c
new file mode 100644
index 000000000..27aea801a
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/fonts.c
@@ -0,0 +1,6106 @@
+// Generated by scripts/gen_habitat_fonts.py. Do not edit.
+#include "terminal.h"
+static const uint8_t ht_mono_16_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,
+ 0,28,0,1,192,0,28,0,1,192,0,12,0,0,192,0,0,0,0,0,0,28,0,1,
+ 192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,113,192,7,28,0,49,192,3,28,0,49,128,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,24,112,2,134,0,36,160,31,255,129,117,212,7,12,
+ 0,97,192,10,24,3,255,240,29,105,0,195,64,28,48,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,28,0,2,208,1,255,128,57,221,7,92,160,
+ 117,197,2,236,0,11,228,0,30,208,81,203,7,28,112,57,199,1,238,208,6,228,0,28,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 244,12,58,130,71,92,112,113,201,3,109,128,31,116,0,6,105,0,221,160,41,199,3,28,
+ 112,144,234,28,7,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,110,64,14,108,1,193,192,13,44,0,187,64,7,192,1,237,4,
+ 56,181,199,2,232,116,15,67,214,244,11,250,192,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,28,0,1,192,0,
+ 28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,10,0,0,
+ 208,0,44,0,3,128,0,52,0,7,64,0,112,0,7,0,0,52,0,3,64,0,40,0,
+ 1,192,0,13,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,0,0,52,0,1,192,0,13,0,0,160,0,11,0,0,112,0,7,0,0,112,0,
+ 7,0,0,160,0,14,0,1,192,0,40,0,3,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,51,0,2,224,0,255,192,6,228,0,55,0,1,
+ 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,192,0,28,0,1,192,3,255,252,21,213,64,28,0,1,192,0,28,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,28,0,1,192,0,8,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,15,252,0,85,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,160,
+ 0,13,0,1,192,0,40,0,3,64,0,112,0,10,0,0,208,0,28,0,2,128,0,52,
+ 0,7,0,0,160,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,47,128,14,110,2,192,244,52,46,135,67,156,112,177,199,29,28,118,193,
+ 195,180,40,47,3,64,245,224,2,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,176,1,255,0,5,112,0,7,0,
+ 0,112,0,7,0,0,112,0,7,0,0,112,1,91,84,63,255,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,208,15,91,130,
+ 192,44,40,1,192,0,44,0,11,64,7,208,2,224,0,180,0,29,0,2,213,84,63,255,
+ 192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,127,128,46,94,3,64,112,0,7,0,1,224,1,248,0,6,208,0,11,1,0,112,
+ 52,11,2,214,208,11,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,176,0,31,0,7,176,0,167,0,44,112,7,71,0,
+ 208,112,40,7,67,255,252,21,87,64,0,112,0,7,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,255,208,41,84,3,128,0,52,
+ 0,3,191,64,125,109,6,64,176,0,7,1,0,112,116,10,2,214,208,11,228,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,
+ 208,15,91,129,192,24,52,0,3,111,144,126,91,71,128,44,116,1,195,64,28,56,2,129,
+ 229,180,6,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,255,252,21,87,128,0,160,0,28,0,3,64,0,160,0,13,0,2,
+ 192,0,40,0,3,64,0,116,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,47,128,11,94,1,208,112,29,7,0,225,
+ 160,7,252,1,229,180,52,2,199,0,28,52,2,194,229,180,6,249,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,144,30,91,
+ 3,128,40,116,1,199,0,28,52,2,194,209,188,11,250,192,4,40,36,7,66,214,224,11,
+ 248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,192,0,28,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,192,0,28,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,8,0,0,128,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,2,64,6,228,6,228,3,228,0,57,0,1,185,0,1,189,0,0,180,0,0,64,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,63,255,1,85,80,0,0,3,255,240,21,85,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,0,2,244,0,2,248,0,1,244,
+ 0,7,128,11,224,27,208,3,144,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,64,30,109,2,128,160,36,11,0,
+ 0,160,0,44,0,11,0,0,208,0,24,0,0,0,0,28,0,1,192,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,224,7,
+ 151,192,224,13,44,0,179,139,167,54,221,119,116,151,119,73,119,112,215,119,93,163,110,124,
+ 40,0,1,224,64,7,253,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,31,0,2,240,0,55,64,3,40,0,113,192,10,13,0,208,160,31,255,2,
+ 149,116,56,3,67,64,40,112,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,255,144,29,91,129,192,28,28,1,193,192,120,31,
+ 254,1,213,180,28,2,193,192,28,28,2,193,213,184,31,249,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,128,14,94,2,192,
+ 116,52,2,135,64,0,112,0,7,0,0,116,0,3,64,40,44,3,64,229,240,6,248,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,254,64,29,110,1,192,116,28,2,129,192,28,28,1,193,192,28,28,1,193,192,40,28,
+ 7,65,214,224,31,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,255,248,29,85,65,192,0,28,0,1,192,0,31,255,65,213,
+ 80,28,0,1,192,0,28,0,1,213,84,31,255,128,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,248,29,85,65,192,0,28,0,
+ 1,192,0,28,0,1,255,248,29,85,1,192,0,28,0,1,192,0,28,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,128,
+ 14,95,2,192,56,52,1,135,64,0,112,0,7,3,252,116,22,195,64,28,44,3,192,229,
+ 236,2,249,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,7,0,112,112,7,7,0,112,112,7,7,0,112,127,255,7,85,112,112,7,
+ 7,0,112,112,7,7,0,112,112,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,3,255,240,22,213,0,28,0,1,192,0,28,0,
+ 1,192,0,28,0,1,192,0,28,0,1,192,1,109,80,63,255,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,7,0,
+ 0,112,0,7,0,0,112,0,7,0,0,112,0,7,7,64,112,52,10,2,230,208,7,244,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,7,0,180,112,29,7,3,128,112,224,7,44,0,123,128,7,236,0,116,224,7,7,64,
+ 112,44,7,0,224,112,7,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,
+ 192,0,28,0,1,192,0,28,0,1,213,84,31,255,128,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,192,124,125,7,199,208,188,122,
+ 14,199,112,220,115,89,199,38,156,114,181,199,31,28,112,225,199,9,28,112,1,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,192,
+ 112,125,7,7,160,112,119,7,7,36,112,113,135,7,13,112,112,167,7,7,112,112,59,7,
+ 1,240,112,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,128,14,95,2,192,52,52,2,135,64,28,112,1,199,0,28,116,
+ 1,195,64,40,44,3,129,229,240,6,248,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,255,144,29,91,65,192,44,28,1,193,192,
+ 28,28,7,129,255,224,29,80,1,192,0,28,0,1,192,0,28,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,128,14,95,
+ 2,192,52,52,2,135,64,28,112,1,199,0,28,116,1,195,73,40,44,119,65,231,240,6,
+ 254,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,7,254,64,117,109,7,0,176,112,7,7,0,112,112,29,7,255,128,117,94,7,0,
+ 112,112,7,7,0,112,112,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,127,128,46,95,7,64,56,116,1,131,144,0,27,228,
+ 0,27,224,0,7,135,0,28,116,1,194,229,184,6,249,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,252,21,181,64,7,0,
+ 0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,
+ 0,112,112,7,7,0,112,112,7,7,0,112,112,7,7,0,112,112,7,7,64,112,56,10,
+ 1,230,208,7,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,7,0,44,52,2,130,128,52,44,7,1,208,176,13,14,0,160,208,
+ 7,28,0,54,128,2,180,0,47,0,1,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,28,112,145,199,14,44,53,226,131,
+ 95,40,53,179,131,167,116,42,103,66,182,180,43,43,1,241,240,31,31,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,52,29,
+ 11,0,224,208,7,108,0,43,64,1,240,0,31,0,3,180,0,114,192,14,13,1,192,176,
+ 56,3,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,11,0,116,52,10,2,193,208,13,44,0,179,64,3,176,0,45,0,1,192,0,
+ 28,0,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,255,252,21,87,192,0,116,0,13,0,2,128,0,
+ 112,0,29,0,2,128,0,176,0,29,0,3,149,84,63,255,192,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,128,7,84,0,112,
+ 0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,
+ 116,0,7,248,0,21,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,
+ 0,208,0,10,0,0,112,0,3,64,0,40,0,1,192,0,13,0,0,160,0,7,0,0,
+ 52,0,2,128,0,28,0,0,208,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,63,192,1,92,0,1,192,0,28,0,1,192,0,28,0,1,
+ 192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,3,252,0,21,64,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,224,0,43,64,3,104,
+ 0,113,192,10,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,240,21,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,13,0,0,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,244,2,230,224,
+ 36,11,0,1,176,11,255,3,144,112,112,11,3,150,244,27,226,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,192,0,28,0,1,
+ 192,0,29,189,1,249,180,30,2,129,208,28,28,1,193,208,28,30,2,129,249,180,29,189,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,6,244,1,230,208,56,11,7,64,0,112,0,7,64,16,
+ 56,7,1,230,208,6,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,112,0,7,0,0,112,7,231,2,230,240,56,11,7,
+ 64,112,112,7,7,64,112,56,11,2,230,240,7,231,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,
+ 228,1,230,208,56,10,7,64,112,127,255,71,85,80,52,6,1,230,224,7,244,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,
+ 240,0,229,0,28,0,63,255,1,109,80,1,192,0,28,0,1,192,0,28,0,1,192,0,
+ 28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,7,231,2,230,240,52,11,7,64,112,112,
+ 7,3,64,176,45,31,0,191,112,16,71,2,213,224,11,248,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,192,0,28,0,1,192,0,29,184,1,229,
+ 224,29,7,1,192,112,28,7,1,192,112,28,7,1,192,112,28,7,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,16,
+ 0,0,0,47,240,1,91,0,0,112,0,7,0,0,112,0,7,0,0,112,1,91,84,63,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,192,0,4,0,0,0,15,252,0,86,192,0,28,0,1,192,0,28,0,1,
+ 192,0,28,0,1,192,0,28,0,86,192,31,244,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,1,192,0,28,0,1,192,0,28,7,129,192,224,28,56,
+ 1,203,0,30,244,1,246,128,29,13,1,192,116,28,2,128,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,253,0,21,176,0,7,0,
+ 0,112,0,7,0,0,112,0,7,0,0,112,0,7,0,0,112,1,91,84,63,255,192,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,119,109,7,170,176,117,215,7,28,112,113,199,7,28,112,113,199,
+ 7,28,112,113,199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,190,1,233,184,29,2,193,192,28,
+ 28,1,193,192,28,28,1,193,192,28,28,1,192,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,228,1,
+ 230,208,56,10,7,64,112,112,7,7,64,112,56,10,1,230,208,7,228,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,29,189,1,249,180,30,2,129,208,28,28,1,193,208,28,30,2,129,249,180,
+ 29,189,1,192,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,7,231,2,230,240,56,11,7,64,112,112,7,7,
+ 64,112,56,11,1,230,240,7,231,0,0,112,0,7,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,127,1,185,80,7,
+ 64,0,112,0,7,0,0,112,0,7,0,1,181,64,63,252,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,6,244,0,230,208,29,10,0,224,0,7,248,0,1,240,28,7,0,229,176,6,248,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,192,0,28,0,63,255,193,109,84,1,192,0,28,0,1,192,0,28,0,1,
+ 192,0,14,84,0,127,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,7,1,192,112,28,7,1,192,
+ 112,28,7,1,192,112,29,11,0,246,240,6,231,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,3,
+ 130,128,116,28,11,0,208,224,10,29,0,114,192,3,120,0,47,0,1,224,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,176,1,215,9,28,112,226,131,95,40,54,179,66,166,116,27,107,1,241,
+ 240,14,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,44,7,64,224,224,7,108,0,47,64,1,224,
+ 0,43,64,7,28,0,208,160,40,7,64,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,3,66,128,112,
+ 28,10,0,208,208,10,28,0,114,128,3,116,0,47,0,1,224,0,93,0,15,128,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,63,255,1,85,240,0,44,0,7,64,1,208,0,116,0,29,0,3,149,80,63,255,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,7,208,0,228,0,28,0,1,192,0,28,0,2,128,0,160,0,7,64,0,28,0,
+ 1,192,0,28,0,1,192,0,14,0,0,125,0,0,64,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,128,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,
+ 28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,0,5,240,0,7,0,0,
+ 112,0,7,64,0,56,0,0,224,0,45,0,3,64,0,112,0,7,0,0,112,0,26,0,
+ 11,208,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,7,209,192,235,108,28,31,64,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,
+ 112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,
+ 0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,
+ 3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,
+ 176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,
+ 58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,
+ 0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,
+ 3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,
+ 53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,
+ 0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,
+ 155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,
+ 3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,
+ 57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,
+ 155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,
+ 176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,
+ 58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,
+ 0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,
+ 87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,
+ 112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,
+ 0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,
+ 91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,
+ 3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,
+ 240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,
+ 0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,
+ 3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,
+ 53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,
+ 0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,
+ 3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,
+ 53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,
+ 95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,
+ 3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,
+ 176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,
+ 63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,
+ 171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,
+ 112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,
+ 63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,
+ 0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,
+ 103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,
+ 112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,
+ 0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,
+ 3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,
+ 176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,
+ 58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,
+ 0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,
+ 3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,
+ 53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,
+ 0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,
+ 155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,
+ 3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,155,0,53,112,3,171,0,
+ 57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,112,3,
+ 155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,63,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,192,0,28,0,0,0,0,12,0,0,192,0,
+ 28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,9,0,1,224,0,191,208,40,202,3,76,16,113,
+ 192,7,92,0,53,135,2,233,224,15,248,0,40,0,2,64,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,144,11,155,128,208,
+ 44,28,0,0,208,0,14,0,3,255,192,23,84,0,112,0,10,0,2,149,84,63,255,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,2,64,24,46,251,128,182,224,13,10,1,192,112,13,7,0,177,224,30,
+ 251,67,64,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,7,0,116,56,11,1,192,208,13,44,0,179,64,7,176,3,255,
+ 240,22,213,3,255,240,21,213,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,192,0,28,0,1,192,
+ 0,28,0,1,192,0,0,0,0,0,0,28,0,1,192,0,28,0,1,192,0,28,0,1,
+ 192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,128,
+ 14,94,1,208,112,14,64,0,127,64,14,94,1,192,112,14,11,0,111,208,0,30,1,128,
+ 112,30,11,0,127,208,0,80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,113,192,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,47,208,11,91,129,192,29,57,248,163,121,167,
+ 119,65,119,112,23,119,134,115,95,202,44,17,208,228,120,2,254,0,1,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,228,0,
+ 145,128,1,172,0,165,192,12,44,0,190,144,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,117,208,14,56,2,139,0,52,208,2,139,0,
+ 14,56,0,117,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,47,255,1,85,112,0,7,0,0,112,0,1,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,85,0,58,176,3,155,0,53,176,3,95,0,53,
+ 112,3,155,0,53,112,3,171,0,57,112,3,87,0,63,240,3,103,0,58,176,3,91,0,
+ 63,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,
+ 224,15,87,130,255,142,59,108,183,127,135,123,96,115,241,142,30,70,192,111,224,0,16,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,63,192,1,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,31,128,3,154,0,112,112,3,139,0,31,
+ 208,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,28,0,1,192,0,28,0,1,192,3,255,240,21,213,0,28,0,1,192,1,85,80,63,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,1,244,0,49,192,0,24,0,10,0,2,64,0,63,192,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,244,0,17,192,0,180,0,1,128,6,28,
+ 0,47,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,1,192,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,28,7,1,192,112,28,7,1,192,112,28,7,1,192,112,29,11,
+ 1,246,240,30,231,1,192,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,47,240,11,251,1,255,112,31,247,0,255,112,11,247,0,47,112,
+ 0,119,0,7,112,0,119,0,7,112,0,119,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,28,0,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,10,0,0,44,0,38,192,1,244,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,48,0,47,0,0,48,0,3,0,0,48,0,3,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,6,224,0,210,128,12,12,0,210,128,6,
+ 224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,215,64,11,28,0,56,160,1,195,0,56,160,11,28,1,215,64,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,112,28,63,3,65,112,96,7,9,0,112,128,7,0,0,0,112,1,75,0,114,112,13,
+ 103,1,203,252,52,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,96,24,63,3,65,112,96,7,13,0,112,0,7,31,128,19,
+ 108,2,65,192,112,100,13,24,1,195,84,52,63,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,244,10,118,193,192,28,40,11,71,
+ 0,108,144,97,192,2,244,44,0,7,192,52,156,10,37,192,215,255,40,1,192,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,1,192,0,28,0,0,0,0,28,0,2,192,0,180,0,40,0,7,64,
+ 80,116,14,3,214,192,11,224,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,0,
+ 13,0,0,0,0,31,0,2,244,0,55,64,3,40,0,113,192,10,13,0,208,160,31,255,
+ 2,149,116,56,3,67,64,40,112,1,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,52,0,10,0,0,0,0,31,0,2,244,0,55,64,3,40,0,113,192,
+ 10,13,0,208,160,31,255,2,149,116,56,3,67,64,40,112,1,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,240,0,50,128,0,0,0,31,0,2,244,0,
+ 55,64,3,40,0,113,192,10,13,0,208,160,31,255,2,149,116,56,3,67,64,40,112,1,
+ 192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,210,0,117,208,0,
+ 0,0,7,64,0,184,0,13,192,1,205,0,40,160,3,135,0,116,112,11,255,64,229,104,
+ 29,1,194,192,29,56,0,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,7,28,0,16,64,0,0,0,15,0,1,244,0,42,128,3,88,0,113,192,10,13,0,
+ 224,160,15,255,1,213,116,40,3,131,64,40,112,1,192,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,16,0,15,128,1,236,0,11,128,0,0,0,11,64,0,168,0,13,192,1,
+ 141,0,36,160,3,7,0,96,52,11,255,128,213,92,28,0,210,128,10,52,0,176,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,
+ 252,3,181,64,119,0,10,112,0,215,0,28,127,130,199,80,47,240,3,87,0,112,112,10,
+ 7,84,208,127,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,47,144,15,91,2,192,40,52,1,199,64,0,112,0,7,0,0,116,
+ 0,3,64,28,40,2,193,224,116,7,253,0,10,0,0,44,0,33,192,1,244,0,0,0,
+ 0,0,0,0,0,0,208,0,6,0,0,0,1,255,248,29,85,65,192,0,28,0,1,192,
+ 0,31,255,65,213,80,28,0,1,192,0,28,0,1,213,84,31,255,128,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,3,64,0,0,1,255,248,29,85,
+ 65,192,0,28,0,1,192,0,31,255,65,213,80,28,0,1,192,0,28,0,1,213,84,31,
+ 255,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,0,40,208,
+ 0,0,1,255,248,29,85,65,192,0,28,0,1,192,0,31,255,65,213,80,28,0,1,192,
+ 0,28,0,1,213,84,31,255,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,3,28,0,16,64,0,0,1,255,240,29,85,1,192,0,28,0,1,192,0,31,255,
+ 1,213,80,28,0,1,192,0,28,0,1,213,80,31,255,64,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,3,64,0,24,0,0,0,3,255,240,22,213,0,28,0,
+ 1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,1,109,80,63,255,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,13,0,0,0,3,
+ 255,240,22,213,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,0,28,0,1,192,
+ 1,109,80,63,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
+ 224,0,98,64,0,0,3,255,240,22,213,0,28,0,1,192,0,28,0,1,192,0,28,0,
+ 1,192,0,28,0,1,192,1,109,80,63,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,7,28,0,16,64,0,0,3,255,240,21,213,0,12,0,0,192,0,
+ 12,0,0,192,0,12,0,0,192,0,12,0,0,192,1,93,80,63,255,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,144,29,
+ 91,65,192,29,28,0,161,192,7,28,0,115,255,7,29,80,113,192,10,28,1,209,213,184,
+ 31,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,72,1,215,
+ 64,0,0,7,208,112,126,7,7,176,112,119,71,7,40,112,113,199,7,13,112,112,167,7,
+ 7,112,112,43,7,1,240,112,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,2,128,0,13,0,0,0,0,111,128,30,95,2,192,56,52,2,199,64,28,112,
+ 1,199,0,28,116,1,195,64,44,44,3,129,229,240,6,248,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,52,0,6,0,0,0,0,111,128,30,95,2,192,
+ 56,52,2,199,64,28,112,1,199,0,28,116,1,195,64,44,44,3,129,229,240,6,248,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,180,0,49,192,0,0,
+ 0,111,128,30,95,2,192,56,52,2,199,64,28,112,1,199,0,28,116,1,195,64,44,44,
+ 3,129,229,240,6,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 7,137,0,151,128,0,0,0,111,128,30,95,2,192,56,52,2,199,64,28,112,1,199,0,
+ 28,116,1,195,64,44,44,3,129,229,240,6,248,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,7,28,0,16,64,0,0,0,111,128,30,95,2,192,56,52,2,
+ 199,64,28,112,1,199,0,28,116,1,195,64,44,44,3,129,229,240,6,248,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,208,176,11,109,0,47,64,1,240,0,118,192,29,11,0,64,
+ 16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,111,168,14,95,66,192,184,52,30,199,67,92,112,177,199,13,28,118,129,
+ 195,180,40,46,3,129,245,240,58,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,3,64,0,24,0,0,0,7,0,112,112,7,7,0,112,112,7,7,0,112,
+ 112,7,7,0,112,112,7,7,64,112,52,10,2,230,208,7,244,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,96,0,13,0,0,0,7,0,112,112,7,7,
+ 0,112,112,7,7,0,112,112,7,7,0,112,112,7,7,64,112,52,10,2,230,208,7,244,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,3,160,0,99,64,0,
+ 0,7,0,112,112,7,7,0,112,112,7,7,0,112,112,7,7,0,112,112,7,7,64,112,
+ 52,10,2,230,208,7,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,7,28,0,16,64,0,0,7,0,48,112,3,7,0,48,112,3,7,0,48,112,3,7,
+ 0,48,112,3,7,64,48,56,6,2,229,208,7,244,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,112,0,13,0,0,0,11,0,116,52,10,2,193,208,13,
+ 44,0,179,64,3,240,0,45,0,1,192,0,28,0,1,192,0,28,0,1,192,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,192,
+ 0,28,0,1,255,208,29,91,129,192,44,28,1,193,192,28,28,7,129,255,224,29,80,1,
+ 192,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,47,128,11,94,0,208,112,28,7,1,193,224,28,252,1,197,180,28,
+ 2,193,192,28,28,2,193,197,184,28,249,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,1,192,0,0,0,7,248,2,230,
+ 224,36,7,0,1,176,11,255,3,144,112,112,11,3,150,244,27,226,192,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,64,0,160,
+ 0,0,0,7,248,2,230,224,36,7,0,1,176,11,255,3,144,112,112,11,3,150,244,27,
+ 226,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,47,0,6,40,0,0,0,7,248,2,230,224,36,7,0,1,176,11,255,3,144,
+ 112,112,11,3,150,244,27,226,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,184,144,29,120,0,0,0,7,248,2,229,224,40,7,
+ 0,1,176,11,255,3,144,112,112,11,3,150,244,27,226,192,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,193,192,4,4,0,0,0,
+ 7,248,2,230,224,36,7,0,1,176,11,255,3,144,112,112,11,3,150,244,27,226,192,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,3,224,0,
+ 123,0,2,224,0,0,0,7,248,2,230,224,36,7,0,1,176,11,255,3,144,112,112,11,
+ 3,150,244,27,226,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,155,130,159,222,52,116,112,7,71,
+ 11,255,243,155,85,112,116,83,158,158,31,75,128,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,244,1,
+ 230,208,56,11,7,64,0,112,0,7,64,0,52,7,2,209,208,11,244,0,40,0,0,176,
+ 0,87,0,2,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,1,
+ 192,0,0,0,7,244,1,230,208,56,11,7,64,112,127,255,71,85,80,52,6,1,230,224,
+ 7,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,7,0,0,208,0,0,0,7,244,1,230,208,56,11,7,64,112,127,255,71,
+ 85,80,52,6,1,230,224,7,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,46,0,6,36,0,0,0,7,244,1,230,208,56,
+ 11,7,64,112,127,255,71,85,80,52,6,1,230,224,7,244,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,192,1,4,0,0,
+ 0,7,244,1,229,208,56,7,7,64,48,127,255,71,85,80,52,6,1,230,224,7,244,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,29,0,0,160,0,0,0,47,240,1,91,0,0,112,0,7,0,0,112,0,7,0,0,
+ 112,1,91,84,63,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,2,192,0,52,0,0,0,47,240,1,91,0,0,112,0,7,
+ 0,0,112,0,7,0,0,112,1,91,84,63,255,192,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,64,2,141,0,0,0,47,240,
+ 1,91,0,0,112,0,7,0,0,112,0,7,0,0,112,1,91,84,63,255,192,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,192,
+ 1,4,0,0,0,63,240,1,91,0,0,112,0,7,0,0,112,0,7,0,0,112,1,91,
+ 84,63,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,36,0,6,235,64,31,192,1,77,0,190,224,45,111,3,64,176,116,7,
+ 7,64,112,52,10,2,230,208,7,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,45,32,7,94,0,0,0,29,190,1,233,184,
+ 29,2,193,192,28,28,1,193,192,28,28,1,193,192,28,28,1,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,0,1,128,0,
+ 0,0,7,228,1,230,208,56,10,7,64,112,112,7,7,64,112,56,10,1,230,208,7,228,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,6,0,0,208,0,0,0,7,228,1,230,208,56,10,7,64,112,112,7,7,64,112,
+ 56,10,1,230,208,7,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,45,0,6,52,0,0,0,7,228,1,230,208,56,10,7,
+ 64,112,112,7,7,64,112,56,10,1,230,208,7,228,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,128,29,116,0,0,0,7,
+ 228,1,230,208,56,10,7,64,112,112,7,7,64,112,56,10,1,230,208,7,228,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,
+ 192,1,4,0,0,0,7,228,1,230,208,56,6,7,64,48,112,3,7,64,48,56,6,1,
+ 230,208,7,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,0,14,0,0,0,3,255,240,21,
+ 85,0,0,0,0,160,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,233,1,230,
+ 208,56,62,7,74,112,112,199,7,100,112,58,10,1,230,208,43,228,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,0,0,208,
+ 0,0,0,28,7,1,192,112,28,7,1,192,112,28,7,1,192,112,29,11,0,246,240,7,
+ 231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,64,0,96,0,0,0,28,7,1,192,112,28,7,1,192,112,28,7,1,192,
+ 112,29,11,0,246,240,7,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,30,0,2,104,0,0,0,28,7,1,192,112,28,7,
+ 1,192,112,28,7,1,192,112,29,7,0,225,240,7,231,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,192,1,4,0,0,0,
+ 28,7,1,192,112,28,7,1,192,112,28,7,1,192,112,29,11,0,246,240,7,231,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 7,64,0,144,0,0,0,116,3,66,128,112,28,10,0,208,208,10,28,0,114,128,3,116,
+ 0,47,0,1,224,0,93,0,15,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,1,192,0,28,0,1,192,0,29,189,1,249,180,30,2,129,208,28,
+ 28,1,193,208,28,30,2,129,249,180,29,189,1,192,0,28,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,192,1,4,0,0,0,56,2,130,
+ 192,52,29,7,0,224,160,11,13,0,53,192,2,164,0,31,0,0,224,0,89,0,11,128,
+ 0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_mono_16 = {32,255,10,22,ht_mono_16_pixels};
+static const uint8_t ht_mono_20_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,40,0,0,24,0,0,0,0,0,0,0,
+ 0,60,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 3,139,0,3,139,0,3,139,0,2,138,0,2,138,0,2,138,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,112,176,0,160,160,0,208,208,15,255,252,
+ 10,234,232,2,194,192,2,130,128,3,131,128,43,171,160,63,255,240,7,7,0,11,11,0,
+ 10,10,0,14,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,56,0,
+ 6,255,64,31,191,208,45,56,240,56,56,116,60,56,36,46,120,0,11,253,0,1,191,144,
+ 0,57,244,36,56,120,56,56,56,45,56,120,31,190,244,6,255,208,0,125,0,0,56,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,11,224,14,46,184,44,60,60,116,56,44,160,
+ 45,121,192,31,247,128,6,155,0,0,29,189,0,42,219,0,119,195,0,227,131,2,195,195,
+ 3,66,215,10,0,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,190,0,7,235,128,11,67,192,11,3,192,7,75,64,3,238,0,2,244,0,11,184,5,
+ 45,30,14,60,11,93,56,2,252,61,0,248,31,171,252,6,254,94,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,56,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,10,0,
+ 0,29,0,0,44,0,0,120,0,0,116,0,0,176,0,0,240,0,0,224,0,0,224,0,
+ 0,240,0,0,176,0,0,176,0,0,116,0,0,56,0,0,44,0,0,14,0,0,7,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,1,64,0,0,224,0,0,176,0,0,56,0,0,44,0,0,45,0,
+ 0,29,0,0,14,0,0,14,0,0,14,0,0,14,0,0,30,0,0,29,0,0,44,0,
+ 0,56,0,0,116,0,0,160,0,1,208,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,162,128,
+ 0,59,64,2,191,160,3,255,240,0,63,0,0,179,128,0,81,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,
+ 0,56,0,0,56,0,0,56,0,42,190,168,63,255,252,0,56,0,0,56,0,0,56,0,
+ 0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,60,0,0,28,0,0,24,0,
+ 0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,2,170,128,3,255,192,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,60,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,80,0,0,208,0,1,192,0,2,128,0,3,64,0,11,0,
+ 0,14,0,0,29,0,0,44,0,0,56,0,0,116,0,0,176,0,0,224,0,1,208,0,
+ 2,192,0,3,128,0,7,64,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,190,64,7,235,208,15,1,240,29,2,244,44,7,120,60,14,60,56,45,44,56,56,44,
+ 60,176,60,45,208,56,31,128,116,15,64,240,7,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,44,0,0,124,0,31,252,0,26,188,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 42,190,168,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,191,128,11,234,240,31,0,120,45,0,60,20,0,60,0,0,120,0,2,244,0,31,128,
+ 0,189,0,7,224,0,15,64,0,46,0,0,62,170,168,63,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,191,128,7,234,240,15,0,120,4,0,56,
+ 0,0,116,0,26,224,0,47,208,0,1,180,0,0,56,0,0,44,29,0,60,30,0,120,
+ 11,235,240,1,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,224,0,7,224,0,15,224,0,45,224,0,116,224,1,224,224,2,192,224,11,0,224,
+ 29,0,224,62,170,248,63,255,252,0,0,224,0,0,224,0,0,224,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,11,170,160,14,0,0,14,0,0,
+ 30,190,64,31,235,224,30,0,244,4,0,120,0,0,56,0,0,56,45,0,120,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,191,144,7,234,244,11,64,56,29,0,0,44,191,64,47,235,224,62,0,180,60,0,56,
+ 60,0,60,60,0,60,44,0,56,30,0,180,11,235,224,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,63,255,252,42,170,188,0,0,180,0,1,208,
+ 0,3,128,0,11,0,0,29,0,0,44,0,0,56,0,0,116,0,0,176,0,0,176,0,
+ 0,224,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,190,64,7,235,208,11,0,224,14,0,176,11,0,224,2,235,128,2,255,128,30,65,180,
+ 44,0,56,56,0,44,60,0,60,46,0,184,15,235,240,2,190,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,11,235,224,46,0,180,60,0,56,
+ 56,0,44,60,0,60,46,0,188,15,235,252,2,254,56,0,0,56,20,0,180,45,1,224,
+ 15,171,192,2,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,60,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,60,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,
+ 0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,60,0,0,60,0,0,28,0,0,24,0,0,36,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,96,0,7,240,0,191,64,27,228,0,62,64,0,
+ 61,0,0,31,208,0,1,190,0,0,27,224,0,1,176,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,10,170,168,15,255,252,0,0,0,0,0,0,10,170,168,15,255,252,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,36,0,0,63,64,0,7,248,0,0,111,144,0,6,240,
+ 0,1,240,0,31,208,2,249,0,47,144,0,57,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,191,128,7,234,224,11,64,180,30,0,56,
+ 21,0,56,0,0,180,0,2,224,0,11,64,0,29,0,0,44,0,0,20,0,0,0,0,
+ 0,60,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,111,144,1,250,244,7,128,60,15,0,29,30,25,142,29,191,207,45,227,139,61,210,139,
+ 58,194,139,58,194,143,58,195,142,62,219,157,45,249,248,29,16,16,15,0,0,7,235,128,
+ 1,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,125,0,0,190,0,0,235,0,1,215,64,
+ 2,195,128,3,130,192,7,130,192,7,65,208,11,170,224,15,255,240,29,0,116,44,0,56,
+ 56,0,44,120,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,255,128,15,171,240,14,0,120,14,0,56,14,0,56,14,1,180,15,255,144,15,170,224,
+ 14,0,120,14,0,60,14,0,60,14,0,120,15,170,244,15,255,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,191,64,7,235,224,15,64,180,29,0,60,
+ 44,0,20,60,0,0,56,0,0,56,0,0,60,0,0,44,0,24,29,0,60,15,64,180,
+ 7,235,224,1,191,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,254,64,15,171,224,14,0,180,14,0,60,14,0,29,14,0,14,14,0,14,14,0,14,
+ 14,0,14,14,0,29,14,0,44,14,0,184,15,171,224,15,254,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,15,255,248,15,170,164,14,0,0,14,0,0,
+ 14,0,0,14,0,0,15,255,248,15,170,164,14,0,0,14,0,0,14,0,0,14,0,0,
+ 15,170,164,15,255,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,255,252,15,170,168,14,0,0,14,0,0,14,0,0,14,0,0,15,255,248,15,170,164,
+ 14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,7,235,224,15,0,244,29,0,120,
+ 44,0,0,60,0,0,56,10,168,56,15,252,60,0,44,44,0,60,29,0,124,15,0,252,
+ 7,235,172,1,190,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,63,255,248,62,170,184,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,15,255,252,10,190,168,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 10,190,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,
+ 0,0,56,40,0,56,60,0,120,30,0,180,11,235,224,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,56,0,180,56,2,224,56,7,128,56,30,0,
+ 56,60,0,56,240,0,58,224,0,63,180,0,61,61,0,56,30,0,56,11,128,56,2,208,
+ 56,0,240,56,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,
+ 14,0,0,14,0,0,14,0,0,14,0,0,15,170,168,15,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,62,0,188,63,0,252,63,65,252,59,65,236,
+ 58,130,172,57,195,108,57,215,108,56,215,44,56,170,44,56,125,44,56,125,44,56,60,44,
+ 56,20,44,56,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 62,0,176,63,0,176,59,64,176,58,192,176,57,208,176,56,160,176,56,112,176,56,52,176,
+ 56,40,176,56,29,176,56,14,176,56,7,176,56,3,240,56,2,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,191,128,7,234,240,15,64,120,29,0,45,
+ 44,0,30,60,0,14,56,0,14,56,0,14,60,0,14,44,0,30,29,0,45,15,64,120,
+ 7,234,240,1,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,255,128,15,171,240,14,0,120,14,0,60,14,0,44,14,0,60,14,1,180,15,255,224,
+ 15,170,64,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,191,128,7,234,240,15,64,120,29,0,45,
+ 44,0,30,60,0,14,56,0,14,56,0,14,60,0,14,44,20,29,29,30,45,15,71,184,
+ 7,235,240,1,191,240,0,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,254,0,62,171,208,56,1,224,56,0,240,56,0,240,56,1,224,62,171,128,63,255,128,
+ 56,2,208,56,0,224,56,0,224,56,0,176,56,0,176,56,0,176,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,254,64,31,171,208,45,0,244,60,0,120,
+ 60,0,20,46,64,0,7,249,0,0,111,208,0,1,180,100,0,60,56,0,44,46,0,120,
+ 11,234,244,1,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 63,255,252,42,190,168,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,56,0,56,56,0,56,56,0,56,56,0,56,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,60,0,56,44,0,120,30,0,180,
+ 11,235,224,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 120,0,45,60,0,60,45,0,120,29,0,116,14,0,176,11,0,224,7,65,208,3,130,192,
+ 2,195,128,2,215,128,1,235,64,0,235,0,0,190,0,0,125,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,116,0,29,120,20,45,56,60,44,56,125,44,
+ 60,125,60,44,125,56,44,170,56,44,170,120,29,219,116,29,215,116,30,215,180,15,195,240,
+ 15,195,240,15,195,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 45,0,120,15,0,176,11,65,224,3,195,192,1,215,64,0,255,0,0,125,0,0,125,0,
+ 0,255,0,1,215,64,3,131,192,11,65,224,30,0,180,45,0,120,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,60,0,56,45,0,180,15,0,224,11,66,208,
+ 3,195,128,1,219,64,0,254,0,0,125,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,56,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 15,255,252,10,170,188,0,0,116,0,1,224,0,3,192,0,11,64,0,46,0,0,124,0,
+ 0,244,0,2,224,0,11,128,0,31,0,0,63,170,168,63,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,170,128,0,255,192,0,224,0,0,224,0,0,224,0,0,224,0,
+ 0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,
+ 0,224,0,0,224,0,0,250,128,0,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,7,0,0,
+ 3,64,0,2,128,0,1,192,0,0,224,0,0,176,0,0,116,0,0,56,0,0,44,0,
+ 0,29,0,0,14,0,0,11,0,0,7,64,0,3,128,0,2,192,0,1,208,0,0,224,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,170,64,1,255,128,0,3,128,0,3,128,0,3,128,0,3,128,
+ 0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,
+ 0,3,128,0,3,128,0,171,128,1,255,128,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,125,0,0,190,0,0,235,0,1,215,64,3,130,192,7,65,208,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,10,170,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,0,
+ 0,44,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,254,0,
+ 11,171,192,30,2,208,20,0,224,0,22,224,6,254,224,30,80,224,60,1,224,60,2,224,
+ 47,175,248,7,248,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 14,0,0,14,0,0,14,0,0,14,47,144,15,250,244,15,128,60,15,64,29,15,0,14,
+ 14,0,14,15,0,14,15,64,29,15,128,60,15,250,244,14,47,144,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,
+ 11,235,208,30,1,240,45,0,96,60,0,0,56,0,0,60,0,0,45,0,116,30,1,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,56,0,0,56,0,0,56,1,190,56,11,235,184,30,0,248,44,0,120,60,0,56,
+ 56,0,56,60,0,56,44,0,120,30,0,248,11,235,184,1,254,56,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,
+ 11,235,208,30,1,240,44,0,180,62,170,180,63,255,244,60,0,0,44,0,80,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,111,240,0,186,160,0,224,0,63,255,240,42,250,160,0,224,0,0,224,0,0,224,0,
+ 0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,254,56,
+ 11,235,184,30,0,248,44,0,120,60,0,56,60,0,56,44,0,120,30,0,248,11,235,184,
+ 1,190,56,20,0,56,30,0,180,11,235,224,1,190,128,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 14,0,0,14,0,0,14,0,0,14,47,144,14,250,240,15,128,180,15,0,56,14,0,56,
+ 14,0,56,14,0,56,14,0,56,14,0,56,14,0,56,14,0,56,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,9,0,0,0,0,15,254,0,
+ 10,174,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,
+ 10,175,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,3,128,0,2,64,0,0,0,11,255,128,6,171,128,0,3,128,0,3,128,0,3,128,
+ 0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,0,3,128,6,175,64,
+ 11,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,14,0,0,14,0,0,14,0,184,
+ 14,1,224,14,7,192,14,31,0,14,61,0,14,190,0,15,219,64,15,67,192,14,1,224,
+ 14,0,180,14,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 47,224,0,26,184,0,0,60,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,42,190,168,63,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,225,244,
+ 62,187,188,60,61,44,56,44,45,56,44,45,56,44,45,56,44,45,56,44,45,56,44,45,
+ 56,44,45,56,44,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,14,47,144,14,186,240,15,128,180,15,0,56,14,0,56,
+ 14,0,56,14,0,56,14,0,56,14,0,56,14,0,56,14,0,56,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,
+ 11,235,208,30,0,240,44,0,116,60,0,56,56,0,56,60,0,56,44,0,116,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,14,47,144,14,250,244,15,128,60,15,0,29,15,0,14,
+ 14,0,14,15,0,14,15,0,29,15,128,60,15,250,244,14,111,144,14,0,0,14,0,0,
+ 14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,254,56,
+ 11,235,184,30,1,248,45,0,120,60,0,56,56,0,56,60,0,56,44,0,120,30,0,248,
+ 11,235,184,1,190,56,0,0,56,0,0,56,0,0,56,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,15,242,252,10,251,168,0,184,0,0,176,0,0,176,0,
+ 0,176,0,0,176,0,0,176,0,0,176,0,10,250,160,15,255,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,
+ 7,235,224,15,0,180,15,0,20,11,144,0,2,255,144,0,22,244,9,0,120,15,64,120,
+ 7,234,244,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,96,0,0,176,0,0,176,0,63,255,240,42,250,160,0,176,0,0,176,0,0,176,0,
+ 0,176,0,0,176,0,0,176,0,0,176,0,0,122,160,0,47,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,176,
+ 14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,15,0,240,11,65,240,
+ 7,235,176,1,248,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,44,0,56,29,0,116,14,0,176,11,0,224,7,65,208,
+ 3,130,192,2,195,128,1,215,64,0,235,0,0,190,0,0,125,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,0,29,
+ 116,20,29,56,60,44,56,125,44,44,125,56,44,170,56,29,170,116,29,215,116,14,195,176,
+ 11,195,224,11,130,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,30,0,180,11,65,224,3,195,192,1,235,64,0,190,0,
+ 0,125,0,0,190,0,2,215,128,7,130,208,15,0,240,45,0,120,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,44,
+ 14,0,56,11,0,116,7,64,176,3,128,224,2,193,208,1,210,192,0,227,128,0,183,64,
+ 0,127,0,0,62,0,0,29,0,2,184,0,3,228,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,15,255,240,10,170,240,0,1,208,0,7,128,0,30,0,
+ 0,56,0,0,176,0,2,208,0,7,64,0,15,170,160,15,255,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,144,0,31,224,0,45,0,0,60,0,0,56,0,0,56,0,
+ 0,56,0,0,180,0,2,224,0,3,208,0,0,180,0,0,120,0,0,56,0,0,56,0,
+ 0,56,0,0,60,0,0,31,144,0,7,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,0,0,56,0,
+ 0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,2,144,0,3,248,0,0,45,0,0,14,0,0,14,0,0,14,0,
+ 0,15,0,0,11,64,0,2,208,0,1,224,0,7,64,0,15,0,0,14,0,0,14,0,
+ 0,14,0,0,30,0,2,188,0,3,228,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,144,24,7,248,60,11,94,184,
+ 14,7,240,5,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,255,0,30,91,0,
+ 30,111,0,30,111,0,29,111,0,29,91,0,29,91,0,30,107,0,29,87,0,30,171,0,
+ 29,167,0,29,91,0,31,255,0,29,87,0,29,87,0,30,171,0,30,31,0,29,91,0,
+ 31,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,
+ 0,60,0,0,0,0,0,0,0,0,24,0,0,40,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,44,0,0,40,0,2,255,128,11,186,224,29,52,176,44,52,0,56,52,0,60,116,0,
+ 44,112,100,30,112,240,15,251,208,2,254,64,0,160,0,0,160,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,191,144,3,234,244,11,128,124,11,0,20,
+ 11,0,0,7,64,0,63,255,0,43,234,0,2,192,0,3,128,0,7,64,0,14,0,0,
+ 62,170,168,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,40,0,9,46,110,125,11,235,244,7,128,176,11,0,120,14,0,56,
+ 11,0,120,7,128,176,11,235,244,46,110,125,40,0,9,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,45,0,45,14,0,120,7,64,180,3,129,224,
+ 1,211,192,0,231,64,10,255,168,15,255,252,0,44,0,10,190,168,15,255,252,0,44,0,
+ 0,44,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,
+ 0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,0,0,0,0,0,
+ 0,0,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,7,235,224,15,0,180,15,0,36,
+ 7,212,0,2,255,128,11,150,244,15,0,120,15,0,56,7,229,180,1,191,224,0,1,244,
+ 25,0,56,15,0,120,7,234,244,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 2,66,64,3,131,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,111,144,2,250,248,11,128,45,30,46,79,45,250,219,
+ 45,208,167,62,192,19,58,192,3,62,192,83,45,208,167,45,250,219,30,46,79,11,128,45,
+ 2,250,248,0,111,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,190,0,3,150,128,1,1,192,1,191,192,3,145,192,7,70,192,2,253,224,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,180,180,2,226,224,7,135,128,14,14,0,14,14,0,7,135,128,2,226,224,0,180,180,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,170,164,
+ 15,255,248,0,0,56,0,0,56,0,0,56,0,0,36,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,31,255,0,30,91,0,30,111,0,30,111,0,29,111,0,29,91,0,
+ 29,91,0,30,107,0,29,87,0,30,171,0,29,167,0,29,91,0,31,255,0,29,87,0,
+ 29,87,0,30,171,0,30,31,0,29,91,0,31,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,128,
+ 7,64,116,13,254,92,36,193,198,48,193,195,48,255,67,48,199,3,36,194,134,13,64,92,
+ 7,64,116,0,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,2,170,0,3,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,
+ 1,255,128,2,210,224,3,128,224,3,193,224,1,251,208,0,126,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,
+ 0,56,0,0,56,0,42,190,160,63,255,240,0,56,0,0,56,0,0,56,0,0,56,0,
+ 42,170,160,63,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,189,0,2,155,0,2,71,0,0,10,0,0,120,0,1,208,0,3,149,0,3,255,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,189,0,3,155,0,0,7,0,0,61,0,
+ 0,26,0,1,7,0,3,154,0,1,249,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,
+ 0,56,0,0,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,176,
+ 14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,15,0,240,15,65,240,
+ 15,235,176,14,185,176,14,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,191,248,7,255,184,11,254,56,15,254,56,15,254,56,11,254,56,7,254,56,1,190,56,
+ 0,14,56,0,14,56,0,14,56,0,14,56,0,14,56,0,14,56,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,60,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,57,0,0,7,0,
+ 0,131,0,0,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,11,0,0,127,0,0,23,0,
+ 0,7,0,0,7,0,0,7,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,190,0,2,215,64,3,65,192,7,1,192,3,65,192,2,131,128,0,190,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 30,30,0,11,139,128,2,210,208,0,176,176,0,176,176,2,210,208,11,139,128,30,30,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 2,128,44,63,128,116,43,128,224,3,130,192,3,130,64,3,128,0,3,128,240,3,130,240,
+ 0,7,240,2,141,176,7,104,176,10,63,252,28,21,180,56,0,176,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,128,60,63,128,180,43,128,224,3,129,192,
+ 3,130,64,3,128,0,3,130,244,3,137,60,0,12,44,2,192,120,7,130,208,11,6,0,
+ 29,14,84,56,15,252,16,5,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 11,224,14,40,120,44,0,120,52,2,224,160,0,56,128,56,60,0,31,244,60,0,0,188,
+ 0,81,236,0,211,108,2,203,44,3,79,255,11,5,109,13,0,44,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,
+ 0,60,0,0,0,0,0,20,0,0,56,0,0,180,0,2,224,0,11,128,0,45,0,0,
+ 60,0,100,56,0,176,45,1,224,31,175,192,6,254,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,224,0,0,176,0,0,56,0,0,0,0,0,0,0,
+ 0,125,0,0,190,0,0,235,0,1,215,64,2,195,128,3,130,192,3,130,192,7,65,208,
+ 11,170,224,15,255,240,29,0,116,44,0,56,56,0,44,120,0,45,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,
+ 0,14,0,0,44,0,0,0,0,0,0,0,0,125,0,0,190,0,0,235,0,1,215,64,
+ 2,195,128,3,130,192,3,130,192,7,65,208,11,170,224,15,255,240,29,0,116,44,0,56,
+ 56,0,44,120,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,36,0,0,170,0,1,195,64,0,0,0,0,0,0,
+ 0,125,0,0,190,0,0,235,0,1,215,64,2,195,128,3,130,192,3,130,192,7,65,208,
+ 11,170,224,15,255,240,29,0,116,44,0,56,56,0,44,120,0,45,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,80,
+ 2,173,208,2,6,64,0,0,0,0,0,0,0,126,0,0,127,0,0,183,64,0,231,128,
+ 1,211,192,2,194,208,3,129,208,7,64,224,11,170,240,15,255,244,30,0,56,45,0,44,
+ 60,0,29,120,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,131,128,2,66,64,0,0,0,0,0,0,
+ 0,189,0,0,190,0,0,235,0,1,219,64,2,199,128,3,131,128,7,66,192,11,1,208,
+ 15,170,224,31,255,240,45,0,116,60,0,56,120,0,60,180,0,45,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,0,
+ 0,215,0,0,215,0,0,125,0,0,0,0,0,125,0,0,190,0,0,235,0,1,215,64,
+ 2,195,128,3,130,192,7,65,208,11,0,224,15,170,240,31,255,244,45,0,120,60,0,60,
+ 120,0,45,116,0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,191,252,0,255,168,1,222,0,2,206,0,3,142,0,7,78,0,11,15,252,14,15,168,
+ 31,174,0,47,254,0,56,14,0,120,14,0,180,15,168,240,15,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,7,235,208,15,1,240,29,0,180,
+ 44,0,100,60,0,0,56,0,0,56,0,0,56,0,0,60,0,20,45,0,120,30,0,180,
+ 11,66,224,3,255,192,0,121,0,0,45,0,0,7,0,0,135,0,0,189,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,116,0,0,56,0,0,28,0,0,0,0,0,0,0,
+ 15,255,248,15,170,164,14,0,0,14,0,0,14,0,0,14,0,0,15,255,248,15,170,164,
+ 14,0,0,14,0,0,14,0,0,14,0,0,15,170,164,15,255,248,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,128,
+ 0,11,0,0,13,0,0,0,0,0,0,0,15,255,248,15,170,164,14,0,0,14,0,0,
+ 14,0,0,14,0,0,15,255,248,15,170,164,14,0,0,14,0,0,14,0,0,14,0,0,
+ 15,170,164,15,255,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,25,0,0,123,64,0,162,192,0,0,0,0,0,0,
+ 15,255,248,15,170,164,14,0,0,14,0,0,14,0,0,14,0,0,15,255,248,15,170,164,
+ 14,0,0,14,0,0,14,0,0,14,0,0,15,170,164,15,255,248,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,226,192,0,145,128,0,0,0,0,0,0,15,255,248,15,170,164,14,0,0,14,0,0,
+ 14,0,0,14,0,0,15,255,248,15,170,164,14,0,0,14,0,0,14,0,0,14,0,0,
+ 15,170,164,15,255,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,160,0,0,116,0,0,40,0,0,0,0,0,0,0,
+ 15,255,252,10,190,168,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,10,190,168,15,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,64,
+ 0,14,0,0,29,0,0,0,0,0,0,0,15,255,252,10,190,168,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 10,190,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,24,0,0,187,0,1,210,128,0,0,0,0,0,0,
+ 15,255,252,10,190,168,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,10,190,168,15,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 2,194,192,1,129,128,0,0,0,0,0,0,15,255,252,10,190,168,0,44,0,0,44,0,
+ 0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,0,44,0,
+ 10,190,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 11,254,64,11,171,224,11,0,184,11,0,44,11,0,29,11,0,14,63,252,14,47,168,14,
+ 11,0,14,11,0,29,11,0,44,11,0,184,11,171,224,11,254,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,65,64,
+ 10,183,64,8,25,0,0,0,0,0,0,0,61,0,176,62,0,176,59,0,176,58,128,176,
+ 57,192,176,56,208,176,56,96,176,56,52,176,56,40,176,56,28,176,56,14,176,56,7,176,
+ 56,3,240,56,2,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,160,0,0,116,0,0,44,0,0,0,0,0,0,0,
+ 1,191,128,7,234,240,15,64,120,29,0,45,44,0,30,60,0,14,56,0,14,56,0,14,
+ 60,0,14,44,0,30,29,0,45,15,64,120,7,234,240,1,191,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,128,
+ 0,11,0,0,29,0,0,0,0,0,0,0,1,191,128,7,234,240,15,64,120,29,0,45,
+ 44,0,30,60,0,14,56,0,14,56,0,14,60,0,14,44,0,30,29,0,45,15,64,120,
+ 7,234,240,1,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,62,0,0,183,64,1,210,192,0,0,0,0,0,0,
+ 1,191,128,7,234,240,15,64,120,29,0,45,44,0,30,60,0,14,56,0,14,56,0,14,
+ 60,0,14,44,0,30,29,0,45,15,64,120,7,234,240,1,191,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,80,
+ 2,174,208,2,6,64,0,0,0,0,0,0,1,191,128,7,234,240,15,64,120,29,0,45,
+ 44,0,30,60,0,14,56,0,14,56,0,14,60,0,14,44,0,30,29,0,45,15,64,120,
+ 7,234,240,1,191,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,194,192,1,129,128,0,0,0,0,0,0,
+ 1,191,128,7,234,240,15,64,120,29,0,45,44,0,30,60,0,14,56,0,14,56,0,14,
+ 60,0,14,44,0,30,29,0,45,15,64,120,7,234,240,1,191,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 10,0,160,11,130,224,2,235,128,0,190,0,0,190,0,2,235,128,11,130,224,10,0,160,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,191,157,7,235,248,15,64,248,29,1,253,44,3,222,60,11,78,56,30,14,56,60,14,
+ 60,180,14,45,224,30,31,208,45,15,128,120,15,250,240,45,191,128,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,208,0,
+ 0,176,0,0,52,0,0,0,0,0,0,0,56,0,56,56,0,56,56,0,56,56,0,56,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,44,0,120,30,0,180,
+ 11,235,224,1,254,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,10,0,0,29,0,0,40,0,0,0,0,0,0,0,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,
+ 56,0,56,56,0,56,44,0,120,30,0,180,11,235,224,1,254,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,
+ 0,234,0,2,131,64,0,0,0,0,0,0,56,0,56,56,0,56,56,0,56,56,0,56,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,44,0,120,30,0,180,
+ 11,235,224,1,254,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,131,128,2,66,64,0,0,0,0,0,0,
+ 56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,56,0,56,
+ 56,0,56,56,0,56,44,0,120,30,0,180,11,235,224,1,254,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,
+ 0,29,0,0,40,0,0,0,0,0,0,0,60,0,56,45,0,180,15,0,224,11,66,208,
+ 3,195,128,1,219,64,0,254,0,0,125,0,0,56,0,0,56,0,0,56,0,0,56,0,
+ 0,56,0,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 14,0,0,14,0,0,15,170,64,15,255,244,14,0,125,14,0,30,14,0,14,14,0,14,
+ 14,0,45,15,170,248,15,255,144,14,0,0,14,0,0,14,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,191,128,3,234,244,11,64,120,15,0,56,
+ 14,0,116,14,43,224,14,47,208,14,1,180,14,0,56,14,0,44,14,0,60,14,0,120,
+ 14,42,240,14,47,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,208,0,
+ 0,224,0,0,116,0,0,0,0,2,254,0,15,171,192,46,2,208,20,0,224,0,22,224,
+ 6,254,224,30,80,224,60,0,224,60,2,224,47,175,248,11,248,124,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,10,0,0,29,0,0,56,0,0,0,0,2,254,0,
+ 15,171,192,46,2,208,20,0,224,0,22,224,6,254,224,30,80,224,60,0,224,60,2,224,
+ 47,175,248,11,248,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,173,0,2,135,0,0,0,0,2,254,0,15,171,192,46,2,208,20,0,224,0,22,224,
+ 6,254,224,30,80,224,60,0,224,60,2,224,47,175,248,11,248,124,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,1,129,128,10,186,128,8,25,0,0,0,0,2,254,0,
+ 15,171,192,45,2,208,20,0,224,0,22,224,6,254,224,30,80,224,60,0,224,60,2,224,
+ 47,175,248,11,248,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 3,131,128,2,66,64,0,0,0,2,254,0,15,235,192,46,1,208,20,0,224,0,22,224,
+ 6,254,224,30,80,224,60,0,224,60,2,224,47,175,248,7,248,124,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,184,0,0,220,0,0,184,0,0,0,0,2,254,0,
+ 15,171,192,46,1,208,20,0,224,0,22,224,6,254,224,30,80,224,60,0,224,60,2,224,
+ 47,175,248,11,248,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,7,210,244,31,191,189,44,61,14,20,44,15,1,190,175,
+ 15,255,255,46,108,0,56,60,5,60,62,14,46,235,189,11,130,244,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,190,64,
+ 11,235,208,30,1,240,45,0,116,60,0,0,56,0,0,60,0,0,44,0,20,45,0,180,
+ 15,66,224,7,255,128,0,121,0,0,61,0,1,71,0,1,254,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,208,0,
+ 0,176,0,0,52,0,0,0,0,1,190,64,11,235,208,30,1,240,44,0,180,62,170,180,
+ 63,255,244,56,0,0,44,0,80,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,10,0,0,29,0,0,40,0,0,0,0,1,190,64,
+ 11,235,208,30,1,240,44,0,180,62,170,180,63,255,244,56,0,0,44,0,80,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,173,0,2,135,64,0,0,0,1,190,64,11,235,208,30,1,240,44,0,180,62,170,180,
+ 63,255,244,56,0,0,44,0,80,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,131,128,2,66,64,0,0,0,1,190,64,
+ 11,235,208,30,0,240,44,0,116,62,170,180,63,255,244,56,0,0,44,0,80,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,0,
+ 0,44,0,0,29,0,0,0,0,15,254,0,10,174,0,0,14,0,0,14,0,0,14,0,
+ 0,14,0,0,14,0,0,14,0,0,14,0,10,175,168,15,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,128,0,7,64,0,10,0,0,0,0,15,254,0,
+ 10,174,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,
+ 10,175,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,47,64,0,161,192,0,0,0,15,254,0,10,174,0,0,14,0,0,14,0,0,14,0,
+ 0,14,0,0,14,0,0,14,0,0,14,0,10,175,168,15,255,252,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,224,224,0,144,144,0,0,0,15,254,0,
+ 10,174,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,0,14,0,
+ 10,175,168,15,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,228,20,
+ 1,190,252,0,111,208,0,101,224,0,105,176,7,255,244,31,65,244,45,0,184,60,0,56,
+ 56,0,56,60,0,56,44,0,116,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,80,80,2,173,208,2,6,64,0,0,0,14,47,144,
+ 14,186,240,15,128,184,15,0,56,14,0,56,14,0,56,14,0,56,14,0,56,14,0,56,
+ 14,0,56,14,0,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,208,0,
+ 0,176,0,0,52,0,0,0,0,1,190,64,11,235,208,30,0,240,44,0,116,60,0,56,
+ 56,0,56,60,0,56,44,0,116,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,10,0,0,29,0,0,40,0,0,0,0,1,190,64,
+ 11,235,208,30,0,240,44,0,116,60,0,56,56,0,56,60,0,56,44,0,116,30,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,189,0,2,199,64,0,0,0,1,190,64,11,235,208,30,0,240,44,0,116,60,0,56,
+ 56,0,56,60,0,56,44,0,116,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,144,128,2,170,128,2,6,0,0,0,0,1,190,64,
+ 11,235,208,31,0,240,45,0,116,60,0,56,60,0,56,60,0,56,45,0,116,31,0,240,
+ 11,235,208,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 3,131,128,2,66,64,0,0,0,1,190,64,11,235,208,30,0,240,44,0,116,60,0,56,
+ 56,0,56,60,0,56,44,0,116,30,0,240,11,235,208,1,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,0,
+ 0,188,0,0,100,0,0,0,0,42,170,160,63,255,240,0,0,0,0,100,0,0,188,0,
+ 0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,1,190,176,11,235,224,30,2,240,44,7,116,60,29,56,
+ 56,40,56,60,176,56,45,208,116,31,128,240,11,235,208,29,190,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,160,0,0,112,0,0,52,0,0,0,0,14,0,176,
+ 14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,15,0,240,11,65,240,
+ 7,235,176,1,248,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,
+ 0,13,0,0,40,0,0,0,0,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,
+ 14,0,176,14,0,176,15,0,240,11,65,240,7,235,176,1,248,176,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,125,0,1,215,0,0,0,0,14,0,176,
+ 14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,15,0,240,11,1,240,
+ 7,235,176,1,248,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 2,195,128,1,130,64,0,0,0,14,0,176,14,0,176,14,0,176,14,0,176,14,0,176,
+ 14,0,176,14,0,176,15,0,240,11,65,240,7,235,176,1,248,176,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,7,64,0,11,0,0,29,0,0,0,0,45,0,44,
+ 14,0,56,11,0,116,7,64,176,3,128,224,2,193,208,1,210,192,0,227,128,0,183,64,
+ 0,127,0,0,62,0,0,29,0,2,188,0,3,228,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 14,0,0,14,0,0,14,0,0,14,47,144,15,250,244,15,128,60,15,64,29,15,0,14,
+ 14,0,14,15,0,14,15,64,29,15,128,60,15,250,244,14,111,144,14,0,0,14,0,0,
+ 14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,131,128,2,66,64,0,0,0,60,0,56,
+ 45,0,116,30,0,176,15,0,224,11,65,208,7,130,192,3,195,128,1,215,64,0,235,0,
+ 0,190,0,0,124,0,0,56,0,6,180,0,11,224,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_mono_20 = {32,255,12,28,ht_mono_20_pixels};
+static const uint8_t ht_mono_24_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,176,0,0,
+ 2,192,0,0,10,0,0,0,0,0,0,0,0,0,0,3,240,0,0,15,192,0,0,63,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,195,192,0,15,15,0,0,60,60,0,0,240,240,
+ 0,2,195,192,0,11,14,0,0,44,56,0,0,112,224,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,180,44,0,2,192,224,0,14,7,64,0,120,29,
+ 0,47,255,255,0,191,255,252,0,44,14,0,0,224,120,0,3,129,208,0,29,11,0,11,
+ 255,255,192,47,255,255,0,11,3,128,0,56,29,0,0,224,116,0,7,66,192,0,45,11,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 160,0,0,3,192,0,0,31,64,0,11,255,208,0,255,255,208,11,211,203,128,61,15,15,
+ 64,240,60,45,3,208,240,0,7,231,192,0,11,255,64,0,6,255,208,0,1,255,224,0,
+ 3,199,208,100,15,7,129,240,60,31,3,224,240,120,7,231,199,208,11,255,254,0,6,255,
+ 208,0,0,240,0,0,3,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,31,208,7,129,255,208,44,11,135,193,208,60,15,15,
+ 0,240,60,180,2,225,243,128,7,255,108,0,7,245,224,0,0,15,0,0,0,117,254,0,
+ 3,159,125,0,45,180,124,1,226,192,240,11,11,3,192,116,45,31,3,192,57,180,45,0,
+ 111,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,190,64,0,31,255,64,0,248,47,0,3,192,60,
+ 0,15,1,224,0,46,15,64,0,126,248,0,0,191,64,0,11,248,0,0,189,184,10,11,
+ 192,244,124,61,1,245,224,240,1,251,67,208,2,248,11,208,11,224,15,255,255,208,6,254,
+ 135,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,80,0,0,7,128,0,0,44,0,0,1,224,0,0,11,64,
+ 0,0,60,0,0,1,224,0,0,11,64,0,0,45,0,0,0,244,0,0,3,192,0,0,
+ 15,0,0,0,61,0,0,0,180,0,0,2,224,0,0,7,128,0,0,15,0,0,0,45,
+ 0,0,0,60,0,0,0,180,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,20,0,0,0,180,0,0,0,240,0,0,2,208,0,0,7,192,
+ 0,0,11,64,0,0,46,0,0,0,120,0,0,1,240,0,0,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,7,192,0,0,30,0,0,0,180,0,0,3,192,0,0,30,
+ 0,0,0,180,0,0,7,128,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,130,64,0,7,93,0,0,11,224,0,3,255,252,
+ 0,15,255,240,0,2,248,0,0,30,180,0,0,112,224,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,255,255,252,3,255,255,240,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,224,0,0,15,192,0,0,63,
+ 0,0,0,56,0,0,0,208,0,0,7,0,0,0,40,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,255,192,0,
+ 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,15,192,0,0,63,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,9,0,0,0,116,0,0,2,192,0,0,30,0,0,0,180,
+ 0,0,3,192,0,0,30,0,0,0,180,0,0,3,192,0,0,30,0,0,0,180,0,0,
+ 3,192,0,0,30,0,0,0,180,0,0,3,128,0,0,29,0,0,0,176,0,0,3,128,
+ 0,0,45,0,0,0,240,0,0,7,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,190,64,0,47,255,128,1,244,31,64,15,64,63,
+ 0,120,2,253,2,208,30,120,15,64,245,240,60,7,135,192,240,60,15,3,210,208,60,15,
+ 95,1,240,45,180,7,128,127,128,45,0,253,1,240,1,244,31,64,2,255,248,0,1,190,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,44,0,0,0,176,0,0,7,192,0,15,255,0,
+ 0,63,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,63,255,255,192,255,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,144,0,63,255,224,3,244,7,208,31,0,7,
+ 128,184,0,31,1,64,0,124,0,0,2,224,0,0,47,64,0,7,244,0,1,254,64,0,
+ 47,208,0,2,248,0,0,47,64,0,1,244,0,0,11,128,0,0,63,255,255,192,255,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,6,254,64,0,127,255,192,3,224,31,128,46,0,31,
+ 0,0,0,60,0,0,1,240,0,0,31,64,0,47,228,0,0,127,224,0,0,2,240,0,
+ 0,2,224,0,0,7,192,160,0,15,3,208,0,120,7,208,11,208,11,255,253,0,6,254,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,240,0,0,31,192,0,0,255,0,0,11,124,
+ 0,0,120,240,0,3,195,192,0,45,15,0,1,224,60,0,30,0,240,0,176,3,192,11,
+ 64,15,0,63,255,255,192,255,255,255,0,0,3,192,0,0,15,0,0,0,60,0,0,0,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,15,255,252,0,63,255,240,1,240,0,0,7,128,0,
+ 0,46,0,0,0,181,186,0,2,255,255,64,15,224,47,0,61,0,46,0,0,0,124,0,
+ 0,0,240,0,0,3,192,120,0,31,0,244,0,184,2,244,11,192,2,255,253,0,1,191,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,144,0,31,255,224,1,244,7,208,11,64,6,
+ 128,120,0,0,2,210,186,0,11,127,255,64,63,208,111,0,252,0,62,3,208,0,124,15,
+ 0,1,240,60,0,3,192,180,0,30,1,240,0,180,2,228,27,192,3,255,253,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,252,0,0,3,208,0,0,45,
+ 0,0,2,224,0,0,30,0,0,0,244,0,0,7,128,0,0,60,0,0,1,224,0,0,
+ 11,64,0,0,60,0,0,1,224,0,0,11,64,0,0,45,0,0,0,244,0,0,3,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,190,64,0,47,255,128,2,244,31,128,15,64,31,
+ 0,60,0,60,0,244,1,240,1,244,31,64,1,255,244,0,11,255,224,0,248,2,240,11,
+ 128,2,224,61,0,7,192,240,0,15,2,208,0,120,7,224,11,208,11,255,254,0,6,255,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,254,64,0,127,255,192,3,228,27,128,46,0,11,
+ 64,244,0,30,3,192,0,60,15,64,1,240,46,0,11,192,126,1,191,0,127,255,188,0,
+ 111,229,224,0,0,11,128,0,0,61,2,208,1,224,7,208,47,64,11,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,252,0,0,3,240,0,0,15,192,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,15,192,0,0,63,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,252,0,0,3,240,0,0,15,192,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,15,192,0,0,63,
+ 0,0,0,40,0,0,0,208,0,0,7,0,0,0,40,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,7,0,0,2,252,0,1,191,144,0,111,224,0,31,244,0,0,249,0,0,3,
+ 228,0,0,11,249,0,0,1,255,64,0,0,111,224,0,0,27,240,0,0,2,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,255,255,240,15,255,255,192,0,0,0,0,0,0,0,0,
+ 0,0,0,15,255,255,192,63,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,52,0,0,0,254,0,0,1,191,144,0,0,47,228,0,0,7,253,0,0,1,188,0,
+ 0,6,240,0,1,191,128,0,127,208,0,47,228,0,3,249,0,0,14,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,128,0,31,255,192,1,248,11,128,11,128,15,
+ 0,61,0,45,0,80,0,244,0,0,7,192,0,0,125,0,0,11,208,0,0,125,0,0,
+ 2,208,0,0,15,0,0,0,20,0,0,0,0,0,0,3,240,0,0,15,192,0,0,63,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,47,228,0,7,255,248,0,126,1,248,7,208,1,
+ 244,46,0,2,224,240,185,215,199,139,255,79,46,125,124,60,182,224,240,243,223,66,195,207,
+ 124,14,15,61,240,56,60,247,193,225,227,219,143,203,75,95,231,248,30,25,6,64,61,0,
+ 0,0,189,1,64,0,191,255,0,0,111,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,126,0,0,2,252,0,0,15,180,0,0,121,224,
+ 0,2,211,192,0,15,11,64,0,120,30,0,1,224,60,0,11,64,244,0,60,2,208,1,
+ 255,255,128,11,255,255,0,60,0,45,1,224,0,120,11,128,0,240,61,0,3,209,240,0,
+ 11,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,254,128,0,255,255,192,3,192,31,128,15,0,31,
+ 0,60,0,60,0,240,1,240,3,192,31,64,15,255,228,0,63,255,224,0,240,1,244,3,
+ 192,1,224,15,0,3,192,60,0,15,0,240,0,124,3,192,7,224,15,255,254,0,63,255,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,128,0,47,255,208,1,244,27,192,15,64,11,
+ 128,120,0,31,2,208,0,20,15,64,0,0,60,0,0,0,240,0,0,3,192,0,0,15,
+ 64,0,0,45,0,2,144,120,0,31,0,244,0,184,1,244,11,192,2,255,253,0,1,191,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,250,0,0,255,255,64,3,192,47,64,15,0,31,
+ 0,60,0,45,0,240,0,120,3,192,1,240,15,0,3,192,60,0,15,0,240,0,60,3,
+ 192,1,240,15,0,7,128,60,0,45,0,240,1,240,3,192,47,64,15,255,244,0,63,250,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,0,63,255,252,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,64,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,63,255,252,0,255,255,240,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,128,0,47,255,192,1,244,31,128,15,64,15,
+ 64,120,0,46,2,208,0,0,15,64,0,0,60,0,0,0,240,15,255,3,192,47,252,15,
+ 64,0,240,45,0,3,192,120,0,31,0,244,0,252,1,244,27,240,2,255,247,192,1,190,
+ 79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,63,255,255,0,255,255,252,3,192,0,240,15,
+ 0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,
+ 0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,
+ 0,3,192,44,0,15,0,244,0,124,2,224,2,224,7,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,240,0,125,3,192,3,224,15,0,46,0,60,2,224,
+ 0,240,47,0,3,193,240,0,15,31,64,0,61,248,0,0,255,240,0,3,250,224,0,15,
+ 131,224,0,60,7,208,0,240,11,192,3,192,15,128,15,0,31,64,60,0,47,0,240,0,
+ 46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,128,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,253,0,127,3,248,2,252,15,224,11,240,62,192,59,
+ 192,251,65,239,3,221,7,124,15,56,44,240,60,176,227,192,241,215,79,3,199,93,60,15,
+ 14,176,240,60,47,131,192,240,190,15,3,193,244,60,15,3,192,240,60,0,3,192,240,0,
+ 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,64,15,0,254,0,60,3,252,0,240,15,180,3,
+ 192,60,224,15,0,242,208,60,3,199,128,240,15,11,3,192,60,29,15,0,240,60,60,3,
+ 192,180,240,15,0,227,192,60,2,207,0,240,7,188,3,192,15,240,15,0,31,192,60,0,
+ 63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,1,244,7,208,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,1,244,7,208,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,144,0,255,255,224,3,192,11,208,15,0,11,
+ 128,60,0,31,0,240,0,124,3,192,2,224,15,0,31,64,63,255,248,0,255,254,64,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,1,244,7,208,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,31,15,
+ 64,0,124,45,5,1,224,120,30,15,64,244,46,124,1,248,63,208,2,255,254,0,1,191,
+ 184,0,0,0,180,0,0,1,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,144,0,255,255,224,3,192,7,208,15,0,11,
+ 128,60,0,31,0,240,0,124,3,192,2,224,15,0,31,0,63,255,228,0,255,255,208,3,
+ 192,7,208,15,0,7,128,60,0,30,0,240,0,124,3,192,0,240,15,0,3,192,60,0,
+ 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,6,254,64,0,191,255,128,7,208,31,128,45,0,31,
+ 64,240,0,46,3,208,0,20,11,208,0,0,11,249,0,0,6,255,144,0,0,111,224,0,
+ 0,7,208,104,0,7,193,240,0,15,2,224,0,124,7,228,7,208,7,255,254,0,2,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,255,255,255,3,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,
+ 0,3,192,61,0,15,0,180,0,124,2,224,2,224,3,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,240,0,11,130,208,0,61,11,128,1,240,31,0,11,
+ 128,61,0,61,0,184,0,240,1,224,7,128,3,192,45,0,11,64,240,0,30,7,128,0,
+ 60,46,0,0,180,244,0,2,231,192,0,7,222,0,0,15,244,0,0,47,192,0,0,126,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,1,240,0,11,131,192,0,46,15,3,208,180,61,15,131,
+ 208,180,126,15,66,209,248,60,11,139,176,240,30,46,199,192,120,183,94,1,243,157,120,3,
+ 206,118,224,15,116,235,64,61,211,173,0,187,75,244,2,252,47,192,11,240,191,0,31,129,
+ 252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,124,0,46,0,244,0,244,1,240,11,128,2,224,61,
+ 0,7,194,224,0,11,143,0,0,31,184,0,0,47,192,0,0,126,0,0,2,252,0,0,
+ 31,184,0,0,180,244,0,7,194,224,0,61,3,208,1,240,11,128,15,64,15,64,184,0,
+ 31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,244,0,31,1,240,0,184,3,208,7,192,7,192,45,
+ 0,15,65,240,0,30,11,64,0,61,124,0,0,122,208,0,0,191,0,0,1,244,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,63,255,255,0,255,255,252,0,0,2,224,0,0,31,
+ 0,0,1,244,0,0,15,128,0,0,184,0,0,7,192,0,0,125,0,0,3,224,0,0,
+ 47,0,0,1,244,0,0,15,128,0,0,188,0,0,11,208,0,0,63,255,255,192,255,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,255,240,0,3,255,192,0,15,0,0,0,60,0,0,0,240,0,
+ 0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,
+ 60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,
+ 0,0,15,0,0,0,63,252,0,0,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,2,64,0,0,15,0,0,0,45,0,0,0,120,0,0,0,240,0,
+ 0,2,208,0,0,7,128,0,0,15,0,0,0,45,0,0,0,120,0,0,0,240,0,0,
+ 1,208,0,0,3,128,0,0,11,0,0,0,29,0,0,0,60,0,0,0,180,0,0,1,
+ 224,0,0,3,192,0,0,11,64,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,255,240,0,3,255,192,0,0,15,0,0,0,60,0,0,0,240,
+ 0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,
+ 192,0,0,15,0,0,63,252,0,0,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,248,0,0,11,240,0,0,62,224,
+ 0,2,211,192,0,15,11,64,0,120,30,0,2,208,44,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,255,255,252,3,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,120,0,0,0,180,0,0,0,240,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,111,144,0,251,255,208,3,248,11,192,15,192,11,128,61,0,31,0,244,0,60,3,
+ 192,0,240,15,64,3,192,61,0,31,0,252,0,184,3,248,11,192,15,191,253,0,60,111,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,111,144,0,31,255,224,0,249,7,208,7,192,7,192,45,0,5,0,244,0,0,3,
+ 192,0,0,15,64,0,0,45,0,10,0,124,0,124,0,249,7,208,1,255,254,0,0,175,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,
+ 0,6,249,60,0,127,254,240,3,224,47,192,30,0,47,0,180,0,124,3,208,0,240,15,
+ 0,3,192,61,0,15,0,180,0,124,2,240,2,240,3,224,47,192,7,255,223,0,6,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,191,144,0,31,255,224,0,248,7,208,7,128,7,192,45,0,15,64,255,255,253,3,
+ 255,255,244,15,64,0,0,45,0,0,0,120,0,124,0,248,7,224,1,255,254,0,0,175,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,31,255,0,2,255,252,0,15,64,0,0,60,0,
+ 0,63,255,255,0,255,255,252,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,
+ 15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,6,249,60,0,127,253,240,3,224,47,192,46,0,47,0,180,0,124,3,208,0,240,15,
+ 64,3,192,45,0,31,0,184,0,188,0,248,11,240,1,255,251,192,1,190,79,0,0,0,
+ 60,1,224,1,240,3,224,31,128,7,255,248,0,2,254,64,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,111,144,0,247,255,192,3,248,31,128,15,128,31,0,61,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,
+ 0,47,255,0,0,191,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,15,255,255,240,63,255,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,3,192,0,0,0,0,0,0,0,
+ 0,11,255,240,0,47,255,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,
+ 0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,
+ 240,0,0,3,192,0,0,31,0,3,255,248,0,15,255,128,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,0,126,0,240,3,224,3,192,62,0,15,2,224,0,60,47,0,0,242,244,0,3,
+ 239,224,0,15,247,208,0,63,71,192,0,244,11,128,3,192,15,64,15,0,31,64,60,0,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,191,224,0,1,255,224,0,0,7,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,63,255,255,192,255,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,242,225,184,3,239,223,248,15,135,225,240,61,15,67,192,240,60,15,3,192,240,60,15,
+ 3,192,240,60,15,3,192,240,60,15,3,192,240,60,15,3,192,240,60,15,3,192,240,60,
+ 15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,60,111,144,0,247,255,192,3,248,31,128,15,128,31,0,61,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,190,64,0,63,255,192,3,228,27,128,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,128,3,255,252,0,1,190,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,60,111,144,0,247,255,208,3,248,11,192,15,128,11,128,61,0,31,0,244,0,60,3,
+ 192,0,240,15,64,3,192,61,0,31,0,248,0,184,3,248,11,192,15,191,253,0,60,111,
+ 144,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,6,249,60,0,127,253,240,3,224,47,192,31,0,47,0,180,0,124,3,208,0,240,15,
+ 0,3,192,61,0,15,0,180,0,124,1,240,2,240,3,224,47,192,7,255,239,0,6,249,
+ 60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,242,255,0,255,239,252,0,15,208,0,0,61,0,0,0,244,0,0,3,192,0,0,
+ 15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,15,255,252,0,63,255,
+ 240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,2,254,64,0,127,255,128,2,224,31,64,15,64,46,0,61,0,0,0,190,64,0,0,
+ 127,249,0,0,22,253,0,20,0,124,0,240,0,240,2,228,11,192,3,255,253,0,1,191,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,128,0,0,15,0,0,0,60,0,
+ 0,255,255,252,3,255,255,240,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,
+ 15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,64,0,0,31,170,0,0,31,
+ 252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,61,0,124,0,244,2,240,2,244,31,192,3,255,223,0,2,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,184,0,31,1,240,0,184,3,208,3,208,11,128,31,0,15,0,184,0,45,3,208,0,
+ 120,31,0,0,240,180,0,2,211,192,0,7,158,0,0,15,180,0,0,47,192,0,0,126,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 1,224,0,7,135,192,16,46,15,3,208,180,61,15,130,208,180,126,15,1,226,236,60,7,
+ 139,113,224,14,57,215,64,61,211,173,0,187,78,176,1,252,47,192,7,224,126,0,15,129,
+ 248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,61,0,46,0,124,2,224,0,184,31,64,0,244,180,0,1,251,128,0,2,252,0,0,
+ 7,224,0,0,47,208,0,2,231,192,0,31,11,128,0,244,15,64,11,128,31,0,124,0,
+ 46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,244,0,30,1,224,0,180,3,192,3,192,11,64,30,0,30,0,180,0,60,3,192,0,
+ 180,30,0,1,224,180,0,3,211,192,0,11,158,0,0,31,180,0,0,47,192,0,0,126,
+ 0,0,0,180,0,0,7,192,0,2,189,0,0,15,224,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,255,255,240,0,0,11,128,0,0,184,0,0,7,128,0,0,124,0,0,
+ 7,192,0,0,61,0,0,3,208,0,0,45,0,0,2,208,0,0,15,255,255,0,63,255,
+ 252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,189,0,0,15,248,0,0,189,0,0,3,208,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,30,0,0,1,244,0,0,46,64,0,0,
+ 125,0,0,0,125,0,0,0,124,0,0,0,240,0,0,3,192,0,0,15,0,0,0,61,
+ 0,0,0,184,0,0,1,255,64,0,1,190,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,10,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,240,0,0,3,192,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,1,248,0,0,11,252,0,0,1,184,0,0,1,240,0,0,3,192,
+ 0,0,15,0,0,0,60,0,0,0,244,0,0,2,208,0,0,7,208,0,0,6,224,0,
+ 0,31,64,0,1,244,0,0,11,64,0,0,61,0,0,0,240,0,0,3,192,0,0,15,
+ 0,0,0,188,0,0,127,208,0,2,249,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,110,0,160,7,254,7,192,46,45,46,0,244,47,244,2,
+ 128,47,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,63,0,0,0,252,0,0,3,240,0,0,0,0,0,0,0,0,0,0,160,0,0,
+ 2,192,0,0,11,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,44,0,0,6,249,0,0,191,254,
+ 0,11,158,125,0,124,56,124,2,209,208,80,15,71,64,0,60,29,0,0,244,116,0,2,
+ 210,192,160,7,203,7,192,15,188,125,0,31,255,224,0,7,249,0,0,14,0,0,0,56,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,111,160,0,11,255,240,0,189,7,224,3,208,7,
+ 192,15,0,5,0,60,0,0,0,244,0,0,2,224,0,0,255,255,192,3,255,255,0,0,
+ 60,0,0,1,240,0,0,7,128,0,0,61,0,0,7,208,0,0,63,255,255,192,255,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,160,0,11,2,246,249,248,2,255,255,128,3,208,125,0,46,0,120,0,244,0,240,3,
+ 208,3,192,11,128,30,0,15,65,244,0,191,255,240,11,219,230,240,40,0,2,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,184,0,15,129,240,0,188,2,224,3,208,7,192,47,
+ 0,11,64,244,0,31,11,128,0,45,124,0,0,126,224,0,63,255,255,0,255,255,252,0,
+ 3,192,0,0,15,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,240,0,0,3,192,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,254,64,0,127,255,128,2,224,31,128,15,64,31,
+ 0,46,0,0,0,127,144,0,0,127,248,0,7,229,189,0,45,0,124,0,244,0,240,2,
+ 224,7,192,7,250,189,0,1,191,208,0,0,27,208,1,64,7,192,31,64,15,0,47,64,
+ 188,0,47,255,208,0,27,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,192,240,0,15,3,192,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,27,228,0,2,255,252,0,62,65,188,2,224,0,184,15,11,224,
+ 244,120,255,226,226,219,129,215,207,125,2,79,61,240,0,60,247,192,0,243,223,64,163,203,
+ 110,7,95,30,63,248,184,124,47,131,208,184,0,46,0,249,6,240,0,255,255,64,0,111,
+ 160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,254,0,0,30,110,0,0,96,44,0,0,26,240,
+ 0,7,234,192,0,56,11,0,0,229,188,0,1,255,120,0,0,80,80,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,224,244,0,46,15,128,2,224,184,0,47,11,192,0,244,60,0,3,
+ 208,240,0,11,194,240,0,11,130,224,0,11,131,224,0,15,131,208,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,255,252,2,
+ 255,255,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,
+ 84,0,3,255,240,0,15,87,192,0,63,191,0,0,245,124,0,3,219,240,0,15,111,192,
+ 0,61,95,0,0,245,124,0,3,234,240,0,15,103,192,0,61,79,0,0,250,188,0,3,
+ 217,240,0,15,19,192,0,63,255,0,0,245,124,0,3,221,240,0,15,19,192,0,62,175,
+ 0,0,248,188,0,3,197,240,0,15,255,192,0,42,170,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,111,228,0,11,149,184,0,160,0,120,7,31,228,116,36,112,112,
+ 160,193,193,193,195,7,253,7,12,28,160,28,52,112,208,160,97,194,195,64,161,1,40,0,
+ 164,7,128,0,127,228,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,255,192,0,15,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,47,128,0,3,255,192,0,46,11,128,0,244,31,0,3,208,124,
+ 0,11,130,224,0,15,255,0,0,11,224,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,
+ 0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,63,255,255,0,255,255,252,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,127,64,0,7,155,64,0,40,14,0,0,0,116,
+ 0,0,11,128,0,1,228,0,0,29,0,0,0,245,84,0,3,255,224,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,190,0,0,30,109,0,0,0,116,0,0,15,128,
+ 0,0,27,64,0,0,11,0,0,96,44,0,1,230,224,0,1,254,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,240,0,0,7,64,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,61,0,124,0,244,2,240,3,244,47,192,15,255,223,0,61,189,
+ 60,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,255,252,0,127,255,240,3,255,195,192,31,255,15,
+ 0,127,252,60,1,255,240,240,7,255,195,192,15,255,15,0,31,252,60,0,6,240,240,0,
+ 3,195,192,0,15,15,0,0,60,60,0,0,240,240,0,3,195,192,0,15,15,0,0,60,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,0,0,0,252,0,0,
+ 3,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,52,0,0,1,244,0,0,16,112,0,0,251,192,0,1,253,0,0,0,64,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,2,128,0,0,30,0,0,7,248,0,0,5,224,
+ 0,0,3,128,0,0,14,0,0,0,56,0,0,0,224,0,0,3,128,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,190,64,0,31,175,64,0,176,14,0,3,128,44,
+ 0,14,0,176,0,44,3,128,0,121,109,0,0,191,224,0,0,20,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,124,47,0,0,188,46,0,0,184,62,0,0,248,126,0,0,240,124,0,
+ 3,193,240,0,62,15,128,2,224,248,0,47,11,128,1,240,188,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,192,11,0,31,0,116,7,252,2,128,5,240,29,
+ 0,3,192,224,0,15,11,0,0,60,20,0,0,240,0,0,3,192,124,0,0,3,240,0,
+ 0,43,192,0,177,223,0,7,77,60,0,44,177,240,1,211,255,240,14,5,95,64,180,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,192,31,0,31,0,180,7,252,7,128,5,240,45,
+ 0,3,192,224,0,15,7,0,0,60,20,0,0,240,0,0,3,194,248,0,0,40,120,0,
+ 5,64,240,0,176,7,128,7,128,184,0,60,10,64,1,224,160,0,15,3,170,128,116,15,
+ 255,1,64,21,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,11,224,3,128,255,224,29,7,71,192,224,0,31,7,64,3,228,40,
+ 0,15,209,208,0,7,202,0,0,15,0,0,116,124,0,0,191,208,124,0,20,3,240,0,
+ 0,43,192,0,225,223,0,7,14,60,0,56,181,240,2,195,255,240,14,5,95,64,180,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,63,0,0,0,252,0,0,3,240,0,0,0,0,0,0,5,0,0,0,124,0,0,
+ 1,224,0,0,31,64,0,2,244,0,0,46,64,0,2,224,0,0,15,64,2,128,60,0,
+ 31,0,244,0,184,2,244,27,192,2,255,253,0,1,191,128,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,0,0,180,0,0,0,
+ 240,0,0,0,0,0,0,0,0,0,0,126,0,0,2,252,0,0,15,180,0,0,121,224,
+ 0,2,211,192,0,15,11,64,0,120,30,0,1,224,60,0,11,64,244,0,60,2,208,1,
+ 255,255,128,11,255,255,0,60,0,45,1,224,0,120,11,128,0,240,61,0,3,209,240,0,
+ 11,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,224,0,0,15,0,0,0,
+ 116,0,0,0,0,0,0,0,0,0,0,126,0,0,2,252,0,0,15,180,0,0,121,224,
+ 0,2,211,192,0,15,11,64,0,120,30,0,1,224,60,0,11,64,244,0,60,2,208,1,
+ 255,255,128,11,255,255,0,60,0,45,1,224,0,120,11,128,0,240,61,0,3,209,240,0,
+ 11,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,128,0,0,251,64,0,11,
+ 75,0,0,20,9,0,0,0,0,0,0,126,0,0,2,252,0,0,15,180,0,0,121,224,
+ 0,2,211,192,0,15,11,64,0,120,30,0,1,224,60,0,11,64,244,0,60,2,208,1,
+ 255,255,128,11,255,255,0,60,0,45,1,224,0,120,11,128,0,240,61,0,3,209,240,0,
+ 11,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,13,0,3,174,176,0,12,
+ 26,64,0,0,0,0,0,0,0,0,0,63,0,0,1,253,0,0,11,184,0,0,60,240,
+ 0,1,226,208,0,11,71,128,0,44,15,0,0,240,45,0,7,128,120,0,45,1,240,0,
+ 255,255,208,7,255,255,64,45,0,30,0,244,0,60,7,192,0,180,46,0,1,224,180,0,
+ 7,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,240,0,15,
+ 3,192,0,0,0,0,0,0,0,0,0,127,64,0,1,253,0,0,11,184,0,0,60,240,
+ 0,1,226,208,0,11,71,128,0,60,15,0,1,224,45,0,11,64,120,0,60,0,240,1,
+ 255,255,208,11,255,255,128,61,0,31,0,240,0,60,7,128,0,180,45,0,1,224,240,0,
+ 3,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,64,0,0,215,0,0,3,
+ 92,0,0,7,208,0,0,0,0,0,0,125,0,0,2,248,0,0,14,176,0,0,122,208,
+ 0,2,215,128,0,15,15,0,0,120,45,0,2,208,120,0,15,65,240,0,60,3,192,1,
+ 255,255,64,11,255,254,0,60,0,60,1,224,0,180,11,128,2,224,61,0,7,193,240,0,
+ 15,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,63,255,192,1,255,255,0,11,124,0,0,60,240,
+ 0,1,227,192,0,11,79,0,0,60,60,0,1,224,255,240,11,67,255,192,61,15,0,1,
+ 255,252,0,11,255,240,0,61,3,192,1,240,15,0,11,128,60,0,45,0,255,240,240,3,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,128,0,47,255,208,1,244,27,192,15,64,15,
+ 128,120,0,31,2,208,0,20,15,64,0,0,60,0,0,0,240,0,0,3,192,0,0,15,
+ 64,0,0,45,0,2,144,120,0,31,0,244,0,248,2,244,27,208,2,255,253,0,2,255,
+ 208,0,0,180,0,0,1,244,0,0,0,112,0,1,209,192,0,2,253,0,0,0,64,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,120,0,0,0,
+ 176,0,0,0,0,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,0,63,255,252,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,64,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,11,64,0,0,
+ 120,0,0,0,0,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,0,63,255,252,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,64,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,0,0,183,64,0,7,
+ 75,0,0,20,5,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,0,63,255,252,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,64,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,240,0,11,
+ 3,192,0,0,0,0,0,0,0,0,63,255,254,0,255,255,244,3,192,0,0,15,0,0,
+ 0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,0,63,255,252,0,240,0,0,3,
+ 192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,255,64,63,255,
+ 254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,0,0,0,180,0,0,0,
+ 224,0,0,0,0,0,0,0,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,240,0,0,15,0,0,0,
+ 180,0,0,0,0,0,0,0,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,128,0,0,235,64,0,11,
+ 15,0,0,20,25,0,0,0,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,240,0,15,
+ 3,192,0,0,0,0,0,0,0,0,63,255,255,0,255,255,252,0,3,192,0,0,15,0,
+ 0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,15,255,255,192,63,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,15,254,64,0,63,255,208,0,240,27,208,3,192,11,
+ 128,15,0,15,64,60,0,46,0,240,0,120,63,255,193,240,255,255,3,192,60,0,15,0,
+ 240,0,120,3,192,2,224,15,0,15,64,60,0,188,0,240,27,208,3,255,253,0,15,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,13,0,3,174,176,0,12,
+ 26,64,0,0,0,0,0,0,0,0,63,0,15,0,254,0,60,3,252,0,240,15,180,3,
+ 192,60,224,15,0,242,208,60,3,199,128,240,15,11,3,192,60,29,15,0,240,60,60,3,
+ 192,180,240,15,0,227,192,60,2,207,0,240,7,188,3,192,15,240,15,0,31,192,60,0,
+ 63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,0,0,120,0,0,0,
+ 180,0,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,2,244,7,224,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,2,244,7,224,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,0,0,11,64,0,0,
+ 120,0,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,2,244,7,224,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,2,244,7,224,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,192,0,0,247,128,0,11,
+ 71,128,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,2,244,7,224,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,2,244,7,224,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,105,13,0,3,174,180,0,12,
+ 26,64,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,2,244,7,224,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,2,244,7,224,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,60,0,3,192,240,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,144,0,47,255,224,2,244,7,224,15,64,7,
+ 192,120,0,11,66,208,0,30,15,64,0,124,60,0,0,240,240,0,3,195,192,0,15,15,
+ 64,0,124,45,0,1,224,120,0,11,64,244,0,124,2,244,7,224,2,255,254,0,1,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,116,0,160,2,244,11,192,2,244,188,0,2,251,192,0,2,252,0,0,
+ 11,244,0,0,190,244,0,11,194,244,0,188,2,240,0,128,2,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,151,128,47,255,252,1,244,27,224,15,64,47,
+ 192,120,1,255,66,208,15,174,15,64,188,124,60,3,209,240,240,46,3,195,209,240,15,15,
+ 79,64,124,45,188,1,224,127,208,11,64,254,0,124,2,248,7,208,15,255,254,0,181,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,0,0,0,224,0,0,1,
+ 208,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,
+ 0,3,192,60,0,15,0,244,0,124,2,224,2,224,3,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,0,0,45,0,0,0,
+ 224,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,
+ 0,3,192,60,0,15,0,244,0,124,2,224,2,224,3,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,0,0,2,222,0,0,29,
+ 29,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,
+ 0,3,192,60,0,15,0,244,0,124,2,224,2,224,3,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,192,240,0,11,3,192,0,0,
+ 0,0,0,0,0,0,0,0,0,0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,
+ 0,240,0,60,3,192,0,240,15,0,3,192,60,0,15,0,240,0,60,3,192,0,240,15,
+ 0,3,192,60,0,15,0,244,0,60,2,224,1,224,3,224,31,64,7,255,244,0,6,254,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,224,0,0,15,0,0,0,
+ 180,0,0,0,0,0,0,0,0,0,244,0,31,1,240,0,184,3,208,7,192,7,192,45,
+ 0,15,65,240,0,30,11,64,0,61,124,0,0,122,208,0,0,191,0,0,1,244,0,0,
+ 3,192,0,0,15,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,255,164,
+ 0,63,255,248,0,240,1,244,3,192,1,240,15,0,3,192,60,0,15,0,240,0,124,3,
+ 192,7,208,15,255,254,0,63,255,144,0,240,0,0,3,192,0,0,15,0,0,0,60,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,191,128,0,47,255,192,1,244,27,128,11,128,31,
+ 0,61,0,60,0,240,1,240,3,192,31,64,15,15,244,0,60,63,228,0,240,2,244,3,
+ 192,1,224,15,0,3,192,60,0,15,0,240,0,124,3,192,7,224,15,31,254,0,60,127,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,192,0,0,7,128,0,0,11,0,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,30,0,0,0,176,0,0,7,64,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,62,0,0,2,237,0,0,29,44,0,0,80,36,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,6,145,192,0,58,234,0,0,193,160,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,62,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,15,3,192,0,44,15,0,0,0,0,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,110,64,0,3,71,0,0,13,28,0,0,27,144,0,0,0,0,
+ 0,6,254,0,0,127,255,0,7,208,126,0,46,0,124,0,0,0,240,0,1,107,192,1,
+ 191,255,0,31,148,60,0,180,0,240,3,192,7,192,15,128,127,64,31,255,175,192,27,228,
+ 47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,11,224,189,0,255,251,252,7,194,248,184,45,7,208,240,0,15,3,192,26,255,255,2,
+ 255,255,252,47,151,192,0,244,31,0,3,192,125,14,15,131,248,184,31,253,255,208,31,144,
+ 189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,191,144,0,31,255,208,0,248,11,208,7,192,11,128,45,0,5,0,244,0,0,3,
+ 192,0,0,15,64,0,0,45,0,26,0,124,0,184,0,249,11,208,1,255,254,0,1,191,
+ 208,0,0,116,0,0,1,244,0,0,0,112,0,0,209,192,0,2,253,0,0,0,64,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,180,0,0,0,240,0,0,1,208,0,0,0,0,
+ 0,0,191,144,0,31,255,224,0,248,7,224,7,128,7,192,45,0,15,64,255,255,253,3,
+ 255,255,244,15,0,0,0,45,0,0,0,120,0,124,0,248,7,224,1,255,254,0,0,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,2,208,0,0,30,0,0,0,240,0,0,0,0,
+ 0,0,191,144,0,31,255,224,0,248,7,224,7,128,7,192,45,0,15,64,255,255,253,3,
+ 255,255,244,15,0,0,0,45,0,0,0,120,0,124,0,248,7,224,1,255,254,0,0,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,47,64,0,2,219,0,0,29,10,0,0,0,0,
+ 0,0,191,144,0,31,255,224,0,248,7,224,7,128,7,192,45,0,15,64,255,255,253,3,
+ 255,255,244,15,0,0,0,45,0,0,0,120,0,124,0,248,7,224,1,255,254,0,0,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,192,240,0,11,3,192,0,0,0,0,0,0,0,
+ 0,0,191,144,0,31,255,224,0,248,7,224,7,128,7,192,45,0,15,64,255,255,253,3,
+ 255,255,244,15,0,0,0,45,0,0,0,120,0,124,0,248,7,224,1,255,254,0,0,191,
+ 144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,184,0,0,0,240,0,0,1,224,0,0,0,0,
+ 0,47,255,0,0,191,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,15,255,255,240,63,255,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,2,224,0,0,31,0,0,0,180,0,0,0,0,
+ 0,47,255,0,0,191,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,15,255,255,240,63,255,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,6,128,0,0,63,192,0,2,199,128,0,9,6,64,0,0,0,
+ 0,47,255,0,0,191,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,15,255,255,240,63,255,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,240,240,0,3,194,192,0,0,0,0,0,0,0,
+ 0,47,255,0,0,191,252,0,0,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,
+ 0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,240,0,15,255,255,240,63,255,
+ 255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,248,6,0,10,254,253,0,6,255,64,0,47,189,
+ 0,0,16,120,0,10,249,244,1,255,255,224,15,128,47,128,184,0,47,2,208,0,124,15,
+ 0,0,240,60,0,3,192,180,0,30,2,224,0,180,3,224,11,192,7,255,253,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,1,160,160,0,14,187,64,0,48,104,0,0,0,0,
+ 0,60,111,144,0,247,255,192,3,248,31,128,15,128,31,0,61,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,224,0,0,3,208,0,0,7,128,0,0,0,0,
+ 0,2,190,128,0,63,255,192,3,228,27,192,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,192,7,255,252,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,11,128,0,0,60,0,0,2,208,0,0,0,0,
+ 0,2,190,128,0,63,255,192,3,228,27,192,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,192,7,255,252,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,47,64,0,1,235,64,0,15,14,0,0,100,25,0,0,0,0,
+ 0,2,190,128,0,63,255,192,3,228,27,192,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,192,7,255,252,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,144,112,0,58,251,128,0,192,168,0,0,0,0,
+ 0,2,190,128,0,63,255,192,3,228,27,192,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,192,7,255,252,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,195,192,0,15,15,0,0,0,0,0,0,0,0,
+ 0,2,190,128,0,63,255,192,3,228,27,192,31,0,15,64,180,0,30,3,208,0,124,15,
+ 0,0,240,61,0,7,192,180,0,30,1,240,0,244,3,228,27,192,7,255,252,0,2,190,
+ 128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,46,0,0,0,252,0,0,2,224,0,0,0,0,0,0,0,0,0,255,255,252,3,
+ 255,255,240,0,0,0,0,0,0,0,0,0,184,0,0,3,240,0,0,11,128,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,1,190,108,0,63,255,224,2,228,31,192,31,0,191,64,180,7,94,3,208,120,124,15,
+ 3,192,240,61,45,7,192,181,208,30,1,254,0,244,3,244,27,128,11,255,252,0,57,190,
+ 64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,2,224,0,0,2,192,0,0,7,128,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,61,0,124,0,244,2,240,2,244,31,192,3,255,223,0,2,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,11,64,0,0,120,0,0,2,192,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,61,0,124,0,244,2,240,2,244,31,192,3,255,223,0,2,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,47,64,0,1,239,0,0,11,30,0,0,36,20,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,60,0,124,0,244,1,240,2,240,31,192,3,251,223,0,2,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,195,192,0,15,15,0,0,0,0,0,0,0,0,
+ 0,60,0,60,0,240,0,240,3,192,3,192,15,0,15,0,60,0,60,0,240,0,240,3,
+ 192,3,192,15,0,15,0,61,0,124,0,244,2,240,2,244,31,192,3,255,223,0,2,249,
+ 60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,11,128,0,0,120,0,0,2,192,0,0,0,0,
+ 0,244,0,30,1,224,0,180,3,192,3,192,11,64,30,0,30,0,180,0,60,3,192,0,
+ 180,30,0,1,224,180,0,3,211,192,0,11,158,0,0,31,180,0,0,47,192,0,0,126,
+ 0,0,0,180,0,0,7,192,0,2,189,0,0,15,224,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,60,0,0,0,240,0,0,3,192,0,0,15,0,0,
+ 0,60,111,144,0,251,255,208,3,248,11,192,15,192,11,128,61,0,31,0,244,0,60,3,
+ 192,0,240,15,64,3,192,61,0,31,0,252,0,184,3,248,11,192,15,191,253,0,60,111,
+ 144,0,240,0,0,3,192,0,0,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,3,192,240,0,15,3,192,0,0,0,0,0,0,0,
+ 0,124,0,11,64,244,0,60,2,224,1,224,7,192,11,64,15,64,124,0,46,2,224,0,
+ 124,15,64,0,244,124,0,1,226,224,0,3,207,64,0,11,188,0,0,31,224,0,0,63,
+ 64,0,0,124,0,0,2,208,0,1,191,0,0,11,228,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_mono_24 = {32,255,15,32,ht_mono_24_pixels};
+static const uint8_t ht_mono_28_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,192,0,0,1,240,
+ 0,0,0,124,0,0,0,31,0,0,0,7,192,0,0,1,240,0,0,0,124,0,0,0,
+ 31,0,0,0,7,192,0,0,1,240,0,0,0,124,0,0,0,30,0,0,0,3,128,0,
+ 0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,0,252,
+ 0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,244,61,0,0,61,15,64,0,15,67,208,0,
+ 3,208,244,0,0,180,61,0,0,45,15,0,0,11,67,192,0,1,208,240,0,0,116,56,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,45,3,192,0,11,65,224,0,3,192,120,0,0,240,45,0,0,120,
+ 11,64,0,30,3,192,1,255,255,255,64,127,255,255,192,0,240,30,0,0,120,11,64,0,
+ 30,3,192,0,11,64,240,0,22,213,125,64,31,255,255,244,11,255,255,252,0,30,2,208,
+ 0,7,128,240,0,2,208,60,0,0,240,30,0,0,60,11,64,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,1,160,0,0,0,124,0,0,0,31,0,0,0,
+ 191,248,0,1,255,255,208,1,254,190,252,0,188,31,31,128,62,7,194,240,15,129,240,124,
+ 3,224,124,0,0,126,95,0,0,11,255,192,0,0,127,254,64,0,1,191,248,0,0,31,
+ 127,128,0,7,194,240,31,1,240,61,7,208,124,15,128,252,31,3,208,31,135,194,244,2,
+ 255,250,248,0,47,255,248,0,1,191,228,0,0,7,192,0,0,1,240,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,228,0,120,11,255,64,
+ 61,7,231,240,46,2,224,125,15,0,248,15,75,128,62,3,215,192,15,129,246,208,2,244,
+ 189,224,0,63,254,244,0,6,254,184,0,0,4,60,42,0,0,45,127,244,0,31,61,47,
+ 0,15,94,7,192,7,135,128,240,3,194,224,60,2,224,120,31,1,240,15,11,192,180,2,
+ 255,208,120,0,31,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,191,144,0,0,255,254,0,0,190,91,208,0,
+ 62,0,244,0,15,128,61,0,3,224,31,64,0,188,31,128,0,15,159,128,0,1,255,128,
+ 0,0,191,128,0,1,255,244,0,0,253,63,1,240,189,7,224,188,46,0,126,46,15,128,
+ 7,223,67,224,0,191,192,188,0,15,208,31,213,91,248,2,255,255,239,64,27,254,146,244,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,128,0,0,
+ 3,208,0,0,2,224,0,0,0,244,0,0,0,124,0,0,0,62,0,0,0,15,64,0,
+ 0,7,192,0,0,2,224,0,0,0,184,0,0,0,62,0,0,0,15,128,0,0,3,224,
+ 0,0,0,248,0,0,0,46,0,0,0,11,128,0,0,1,240,0,0,0,61,0,0,0,
+ 15,128,0,0,1,240,0,0,0,61,0,0,0,11,128,0,0,0,244,0,0,0,30,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,224,0,0,0,45,0,0,0,7,192,
+ 0,0,0,180,0,0,0,31,0,0,0,3,208,0,0,0,184,0,0,0,47,0,0,0,
+ 7,192,0,0,1,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,
+ 0,0,125,0,0,0,31,0,0,0,11,192,0,0,2,224,0,0,0,244,0,0,0,124,
+ 0,0,0,45,0,0,0,31,0,0,0,11,64,0,0,7,128,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,36,24,0,0,15,15,0,0,1,235,64,0,
+ 5,111,149,0,3,255,255,192,0,255,255,240,0,0,190,0,0,0,186,224,0,0,60,61,
+ 0,0,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,1,240,0,0,0,124,0,0,0,31,0,0,0,7,192,0,0,1,240,0,3,
+ 255,255,255,0,255,255,255,192,21,91,213,80,0,1,240,0,0,0,124,0,0,0,31,0,
+ 0,0,7,192,0,0,1,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 3,240,0,0,0,252,0,0,0,63,0,0,0,2,128,0,0,0,208,0,0,0,112,0,
+ 0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,21,85,80,0,15,255,252,0,3,255,255,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,0,252,0,0,0,63,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,46,0,0,0,15,64,0,0,7,192,0,0,2,224,0,0,0,244,0,0,0,
+ 120,0,0,0,45,0,0,0,15,0,0,0,7,128,0,0,3,208,0,0,1,240,0,0,
+ 0,184,0,0,0,61,0,0,0,31,0,0,0,11,128,0,0,3,208,0,0,1,240,0,
+ 0,0,184,0,0,0,61,0,0,0,31,0,0,0,11,128,0,0,3,192,0,0,1,224,
+ 0,0,0,180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 111,144,0,1,255,255,0,0,254,91,240,0,189,0,190,0,62,0,63,192,31,0,47,244,
+ 11,192,31,126,2,224,11,139,128,248,7,194,240,61,3,208,188,15,129,240,31,3,224,244,
+ 11,192,184,184,2,224,47,125,0,248,7,254,0,61,0,255,0,47,0,47,128,31,128,3,
+ 249,111,192,0,127,255,208,0,1,190,64,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,208,0,0,0,180,
+ 0,0,0,189,0,0,63,255,64,0,15,255,208,0,1,85,244,0,0,0,61,0,0,0,
+ 15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,5,85,249,84,3,255,255,
+ 255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,175,228,0,1,255,255,208,1,254,86,252,0,
+ 252,0,31,128,125,0,2,240,47,0,0,124,5,64,0,47,0,0,0,15,128,0,0,11,
+ 208,0,0,31,224,0,0,127,224,0,0,191,144,0,1,255,64,0,1,254,0,0,1,253,
+ 0,0,0,253,0,0,0,125,0,0,0,47,85,85,84,15,255,255,255,3,255,255,255,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,175,228,0,1,255,255,128,1,253,86,248,0,188,0,47,64,41,0,
+ 3,208,0,0,0,244,0,0,0,125,0,0,0,190,0,0,31,249,0,0,7,254,64,0,
+ 0,86,248,0,0,0,31,64,0,0,2,224,0,0,0,188,6,128,0,47,1,244,0,11,
+ 128,62,0,7,208,11,245,91,224,0,191,255,224,0,6,255,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,0,0,0,47,192,0,0,31,240,0,0,15,252,0,0,11,159,0,0,7,199,192,
+ 0,3,209,240,0,2,224,124,0,1,240,31,0,0,244,7,192,0,184,1,240,0,124,0,
+ 124,0,61,0,31,0,46,85,91,213,15,255,255,255,195,255,255,255,240,0,0,31,0,0,
+ 0,7,192,0,0,1,240,0,0,0,124,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,255,255,208,1,255,255,
+ 244,0,189,85,84,0,46,0,0,0,11,128,0,0,3,224,0,0,0,244,4,0,0,61,
+ 191,228,0,31,255,255,64,7,249,6,244,2,244,0,63,0,0,0,7,208,0,0,0,244,
+ 0,0,0,61,1,80,0,15,64,188,0,7,192,31,128,7,224,2,249,91,240,0,47,255,
+ 244,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,111,248,0,0,191,255,208,0,190,85,253,0,
+ 125,0,15,128,46,0,1,80,15,0,0,0,7,134,254,64,2,235,255,248,0,191,229,111,
+ 128,63,128,2,244,15,192,0,62,3,224,0,11,192,248,0,1,240,62,0,0,188,11,128,
+ 0,46,1,240,0,15,128,62,0,11,208,7,245,95,224,0,127,255,224,0,2,255,144,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,240,15,255,255,252,1,85,85,126,0,0,0,46,0,0,0,
+ 31,0,0,0,15,64,0,0,11,128,0,0,3,208,0,0,2,224,0,0,0,244,0,0,
+ 0,184,0,0,0,61,0,0,0,31,0,0,0,11,128,0,0,2,224,0,0,0,244,0,
+ 0,0,125,0,0,0,31,0,0,0,7,192,0,0,1,240,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 175,160,0,1,255,255,64,1,253,87,244,0,188,0,62,0,62,0,11,192,15,128,2,240,
+ 2,240,0,248,0,126,65,189,0,6,255,249,0,1,255,255,64,2,249,86,248,1,244,0,
+ 31,64,184,0,2,224,62,0,0,188,15,128,0,47,2,224,0,11,128,125,0,7,208,15,
+ 229,91,240,0,191,255,224,0,6,255,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,191,224,0,2,255,255,
+ 64,2,249,87,244,1,248,0,47,0,188,0,3,208,62,0,0,184,15,64,0,31,3,224,
+ 0,11,192,184,0,3,240,31,64,2,252,3,248,6,255,0,127,255,251,128,2,255,226,224,
+ 0,1,0,244,0,0,0,124,2,144,0,46,0,189,0,47,64,15,229,111,128,1,255,255,
+ 128,0,10,254,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,0,0,0,63,0,0,0,15,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,0,252,0,0,0,63,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,252,0,0,0,63,0,0,0,15,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,3,240,0,0,0,252,0,0,0,63,0,0,0,2,128,0,0,0,
+ 208,0,0,0,112,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,
+ 0,0,0,191,0,0,6,255,128,0,31,249,0,0,191,228,0,2,255,128,0,0,253,0,
+ 0,0,63,64,0,0,11,254,0,0,0,47,249,0,0,0,127,228,0,0,1,191,224,0,
+ 0,2,252,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,63,255,255,192,15,255,255,240,1,85,85,84,0,0,0,0,0,0,0,0,0,
+ 5,85,85,80,3,255,255,252,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,13,0,0,0,3,248,0,0,0,191,228,0,0,1,191,208,
+ 0,0,6,255,128,0,0,11,254,0,0,0,31,192,0,0,7,240,0,0,47,248,0,1,
+ 191,224,0,6,255,64,0,47,249,0,0,15,224,0,0,3,64,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,43,249,0,0,127,255,224,0,127,149,253,0,63,0,11,192,31,64,
+ 1,244,11,192,0,61,1,80,0,15,64,0,0,7,192,0,0,7,224,0,0,11,224,0,
+ 0,15,224,0,0,11,208,0,0,3,208,0,0,1,240,0,0,0,104,0,0,0,0,0,
+ 0,0,0,0,0,0,3,240,0,0,0,252,0,0,0,63,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 27,249,0,0,47,255,244,0,47,149,191,0,47,64,7,224,31,128,0,125,11,192,0,15,
+ 131,224,185,226,225,244,191,248,188,188,126,126,47,46,62,11,71,207,143,66,209,243,231,192,
+ 180,188,245,240,44,46,61,124,15,11,143,159,71,195,211,227,226,245,240,184,191,223,244,47,
+ 11,129,164,7,208,0,0,0,189,0,0,0,31,208,88,0,1,255,255,64,0,27,254,64,
+ 0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,208,0,0,11,244,
+ 0,0,3,238,0,0,1,247,192,0,0,184,244,0,0,61,46,0,0,31,71,192,0,7,
+ 192,244,0,2,224,46,0,0,244,11,192,0,124,1,244,0,46,0,62,0,15,255,255,128,
+ 7,255,255,240,2,245,85,125,0,248,0,11,128,125,0,2,240,47,0,0,125,11,128,0,
+ 15,131,208,0,2,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,255,232,0,3,255,255,208,0,249,86,253,0,
+ 61,0,31,128,15,64,2,240,3,208,0,188,0,244,0,47,0,61,0,15,128,15,64,27,
+ 192,3,255,255,128,0,255,255,228,0,62,85,111,128,15,64,1,248,3,208,0,47,0,244,
+ 0,7,192,61,0,2,240,15,64,0,248,3,229,86,252,0,255,255,253,0,63,255,228,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,0,191,255,128,0,254,87,248,0,189,0,47,64,62,0,
+ 3,224,31,0,0,188,11,192,0,5,2,224,0,0,0,248,0,0,0,61,0,0,0,15,
+ 64,0,0,3,224,0,0,0,184,0,0,0,47,0,0,41,7,192,0,31,0,248,0,15,
+ 128,47,64,11,208,3,249,91,224,0,47,255,224,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,160,0,3,255,255,64,0,249,91,248,0,61,0,47,64,15,64,2,240,3,208,0,125,
+ 0,244,0,15,128,61,0,2,224,15,64,0,188,3,208,0,47,0,244,0,7,192,61,0,
+ 2,240,15,64,0,184,3,208,0,62,0,244,0,31,64,61,0,11,192,15,64,11,208,3,
+ 229,111,224,0,255,255,224,0,63,254,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,255,255,240,3,255,255,
+ 252,0,249,85,85,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,255,255,252,0,255,255,255,0,62,85,85,64,15,64,0,0,
+ 3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,229,85,84,0,255,255,
+ 255,0,63,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,255,255,248,3,255,255,254,0,249,85,85,0,
+ 61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,
+ 0,3,255,255,252,0,255,255,255,0,62,85,85,64,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,0,191,255,128,0,190,86,248,0,189,0,47,64,62,0,
+ 3,224,31,0,0,189,11,192,0,0,2,224,0,0,0,248,0,0,0,61,0,21,84,15,
+ 64,47,255,67,224,11,255,208,184,0,0,244,47,0,0,61,7,192,0,31,64,248,0,11,
+ 208,47,64,11,244,3,249,91,189,0,63,255,143,64,1,190,67,208,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,
+ 0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,
+ 3,208,0,15,64,244,0,3,208,61,0,0,244,15,255,255,253,3,255,255,255,64,249,85,
+ 87,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,
+ 64,0,61,3,208,0,15,64,244,0,3,208,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,255,255,192,15,255,255,
+ 240,1,85,249,84,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,
+ 0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,5,87,229,80,3,255,255,
+ 252,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,7,192,0,0,1,240,0,0,0,124,0,
+ 0,0,31,0,0,0,7,192,0,0,1,240,0,0,0,124,0,0,0,31,0,0,0,7,
+ 192,0,0,1,240,0,0,0,124,0,0,0,31,0,0,0,7,192,45,0,1,240,15,128,
+ 0,188,2,240,0,62,0,125,0,31,64,11,229,111,128,0,191,255,128,0,6,254,64,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,61,0,2,244,15,64,1,248,3,208,1,248,0,244,0,248,0,61,0,
+ 252,0,15,64,188,0,3,208,189,0,0,244,125,0,0,61,126,0,0,15,191,128,0,3,
+ 255,244,0,0,255,47,64,0,63,67,240,0,15,128,126,0,3,208,11,208,0,244,0,252,
+ 0,61,0,31,128,15,64,2,244,3,208,0,63,0,244,0,7,224,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,
+ 0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,
+ 0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,
+ 229,85,84,0,255,255,255,128,63,255,255,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,0,11,240,63,192,3,
+ 252,15,244,1,255,3,254,0,191,192,251,128,46,240,61,240,15,124,15,109,7,159,3,219,
+ 65,215,192,245,224,181,240,61,60,60,124,15,75,14,31,3,210,215,135,192,244,122,209,240,
+ 61,15,240,124,15,66,248,31,3,208,190,7,192,244,31,65,240,61,2,128,124,15,64,0,
+ 31,3,208,0,7,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,63,128,1,240,15,240,0,124,3,254,0,31,0,
+ 251,192,7,192,61,180,1,240,15,94,0,124,3,211,192,31,0,244,184,7,192,61,31,1,
+ 240,15,66,208,124,3,208,120,31,0,244,15,71,192,61,2,225,240,15,64,60,124,3,208,
+ 11,95,0,244,1,231,192,61,0,62,240,15,64,7,252,3,208,0,255,0,244,0,47,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,1,255,255,128,0,254,87,244,0,189,0,47,0,62,0,
+ 3,224,31,0,0,188,11,192,0,31,3,224,0,7,208,248,0,0,244,61,0,0,61,15,
+ 64,0,15,67,224,0,3,208,248,0,1,244,46,0,0,124,7,192,0,47,0,248,0,15,
+ 128,47,64,11,192,3,249,95,208,0,127,255,224,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,249,0,3,255,255,224,0,249,85,191,0,61,0,7,208,15,64,0,184,3,208,0,47,
+ 0,244,0,11,192,61,0,2,240,15,64,1,248,3,208,1,252,0,255,255,253,0,63,255,
+ 248,0,15,149,64,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,
+ 208,0,0,0,244,0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,228,0,1,255,255,
+ 128,0,254,87,244,0,189,0,47,0,62,0,3,224,31,0,0,188,11,192,0,31,3,224,
+ 0,7,208,248,0,0,244,61,0,0,61,15,64,0,15,67,224,0,3,208,248,0,1,244,
+ 47,0,0,124,7,192,248,47,0,248,31,95,128,47,66,255,192,3,249,127,208,0,127,255,
+ 224,0,1,191,188,0,0,0,11,128,0,0,0,160,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,63,255,228,0,15,255,255,128,3,229,86,252,0,
+ 244,0,31,64,61,0,2,224,15,64,0,188,3,208,0,47,0,244,0,11,128,61,0,7,
+ 208,15,149,91,224,3,255,255,208,0,255,255,253,0,61,0,27,192,15,64,0,248,3,208,
+ 0,46,0,244,0,11,128,61,0,2,240,15,64,0,124,3,208,0,31,0,244,0,7,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,1,255,255,208,0,254,86,253,0,189,0,15,128,62,0,
+ 1,244,15,128,0,62,3,224,0,0,0,190,0,0,0,11,249,64,0,0,127,254,0,0,
+ 1,191,248,0,0,1,191,128,0,0,2,244,26,0,0,46,7,208,0,11,192,248,0,2,
+ 240,31,128,0,248,2,249,86,252,0,47,255,253,0,1,191,228,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
+ 255,255,252,63,255,255,255,5,85,249,85,64,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,
+ 3,208,0,0,0,244,0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,244,15,64,0,
+ 61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,
+ 0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,
+ 15,128,0,61,3,224,0,31,64,188,0,11,192,31,128,7,224,2,249,91,240,0,47,255,
+ 244,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,248,0,0,184,47,0,0,62,7,192,0,31,64,
+ 244,0,11,192,46,0,3,224,11,192,1,244,1,244,0,124,0,62,0,46,0,11,192,15,
+ 64,1,240,7,192,0,61,2,224,0,11,128,248,0,1,240,125,0,0,61,47,0,0,11,
+ 139,128,0,2,243,208,0,0,126,240,0,0,15,248,0,0,2,253,0,0,0,127,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,244,0,0,188,62,0,0,46,15,128,168,11,130,224,63,3,224,184,31,
+ 192,244,47,7,240,61,7,193,253,31,65,240,187,71,192,125,46,225,240,15,79,120,188,3,
+ 211,206,46,0,248,227,203,128,46,120,242,224,11,158,45,244,2,235,75,125,0,126,209,239,
+ 64,31,176,123,192,7,252,31,240,0,255,3,252,0,63,128,255,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,
+ 0,2,240,11,192,1,244,0,248,0,188,0,47,0,125,0,3,224,47,0,0,188,31,64,
+ 0,15,139,128,0,1,247,208,0,0,63,224,0,0,7,244,0,0,1,253,0,0,0,255,
+ 128,0,0,189,244,0,0,62,46,0,0,47,7,208,0,15,64,188,0,11,192,31,64,7,
+ 208,2,240,2,240,0,126,1,244,0,11,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,0,1,244,31,64,0,
+ 248,2,240,0,125,0,125,0,62,0,11,128,31,64,1,244,15,128,0,46,7,208,0,7,
+ 211,224,0,0,185,244,0,0,31,248,0,0,2,252,0,0,0,126,0,0,0,15,64,0,
+ 0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,63,255,255,240,15,255,255,252,1,85,85,126,0,
+ 0,0,47,64,0,0,31,64,0,0,15,128,0,0,11,192,0,0,11,208,0,0,7,224,
+ 0,0,3,240,0,0,2,244,0,0,1,248,0,0,1,248,0,0,0,253,0,0,0,189,
+ 0,0,0,126,0,0,0,63,0,0,0,47,149,85,84,15,255,255,255,3,255,255,255,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,3,255,224,0,0,255,248,0,0,62,84,0,0,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,
+ 15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,249,80,0,0,63,
+ 254,0,0,15,255,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0,7,
+ 128,0,0,0,240,0,0,0,46,0,0,0,7,192,0,0,0,244,0,0,0,46,0,0,
+ 0,7,192,0,0,0,244,0,0,0,46,0,0,0,7,192,0,0,0,244,0,0,0,46,
+ 0,0,0,7,192,0,0,0,244,0,0,0,30,0,0,0,3,192,0,0,0,180,0,0,
+ 0,30,0,0,0,3,208,0,0,0,184,0,0,0,31,0,0,0,3,208,0,0,0,184,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,2,255,244,0,0,191,253,0,0,5,95,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,
+ 0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,
+ 0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,
+ 208,0,0,0,244,0,0,21,125,0,0,47,255,64,0,11,255,208,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,240,0,0,2,254,0,0,
+ 0,251,192,0,0,184,244,0,0,61,46,0,0,31,3,208,0,11,128,184,0,7,192,31,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,85,85,0,63,255,255,192,15,255,
+ 255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,0,0,0,
+ 15,64,0,0,1,240,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,249,0,0,63,255,208,0,47,
+ 149,253,0,31,64,15,128,6,128,2,240,0,0,0,188,0,0,26,255,0,2,255,255,192,
+ 3,250,81,240,2,244,0,188,0,248,0,47,0,62,0,31,192,11,229,111,245,0,255,255,
+ 127,192,11,249,6,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,64,0,0,3,209,190,64,0,250,255,248,0,63,229,111,128,15,224,2,
+ 244,3,240,0,62,0,248,0,11,128,62,0,2,240,15,64,0,124,3,224,0,47,0,248,
+ 0,11,128,63,0,3,224,15,224,2,244,3,254,86,248,0,246,255,248,0,61,27,228,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,27,250,0,0,31,255,244,0,31,213,191,0,15,128,7,224,7,192,0,188,2,
+ 224,0,0,0,248,0,0,0,61,0,0,0,15,128,0,0,2,224,0,5,0,124,0,11,
+ 192,15,128,7,224,1,253,91,240,0,31,255,240,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,7,192,0,0,1,240,0,0,0,124,0,0,0,31,0,0,0,7,192,0,111,145,240,
+ 0,191,254,188,0,190,86,255,0,126,0,47,192,47,0,3,240,11,128,0,188,3,224,0,
+ 47,0,244,0,7,192,62,0,2,240,11,128,0,188,2,240,0,63,0,126,0,47,192,11,
+ 229,111,240,0,191,254,124,0,6,249,31,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,249,0,0,31,255,244,0,31,
+ 149,191,0,15,128,7,224,7,192,0,188,2,224,0,31,64,255,255,255,208,63,255,255,244,
+ 15,149,85,84,2,224,0,0,0,124,0,6,64,15,128,3,240,1,249,91,244,0,31,255,
+ 244,0,1,191,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,6,255,240,0,7,255,252,0,2,245,85,0,
+ 0,248,0,0,0,61,0,0,15,255,255,252,3,255,255,255,0,85,249,85,64,0,61,0,
+ 0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,
+ 208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,27,228,124,0,47,255,159,0,47,149,191,192,31,128,11,240,11,192,0,252,3,
+ 224,0,47,0,244,0,7,192,61,0,2,240,15,128,0,188,2,240,0,63,0,126,0,47,
+ 192,11,229,111,240,0,191,254,124,0,6,249,31,0,0,0,11,192,31,64,3,224,2,249,
+ 91,244,0,47,255,244,0,1,191,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,209,190,64,
+ 0,246,255,248,0,62,229,127,64,15,208,3,224,3,224,0,188,0,248,0,47,0,61,0,
+ 7,192,15,64,1,240,3,208,0,124,0,244,0,31,0,61,0,7,192,15,64,1,240,3,
+ 208,0,124,0,244,0,31,0,61,0,7,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,208,0,0,0,244,
+ 0,0,0,20,0,0,0,0,0,0,0,0,0,0,11,255,244,0,2,255,253,0,0,21,
+ 95,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,5,85,249,84,3,255,255,
+ 255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,15,64,0,0,1,64,0,
+ 0,0,0,0,0,0,0,0,2,255,255,64,0,191,255,208,0,5,85,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,
+ 3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,
+ 0,0,61,0,1,85,111,64,0,255,255,128,0,63,255,128,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,
+ 0,0,3,208,0,189,0,244,0,189,0,61,0,190,0,15,64,126,0,3,208,126,0,0,
+ 244,126,0,0,61,127,64,0,15,191,224,0,3,254,125,0,0,255,11,208,0,63,0,252,
+ 0,15,64,31,128,3,208,1,244,0,244,0,47,0,61,0,3,224,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,
+ 254,0,0,7,255,224,0,0,85,189,0,0,0,15,64,0,0,3,208,0,0,0,244,0,
+ 0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,5,
+ 85,249,84,3,255,255,255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,110,7,224,15,191,215,254,3,249,
+ 187,155,192,252,31,193,244,62,3,224,61,15,64,244,15,67,208,61,3,208,244,15,64,244,
+ 61,3,208,61,15,64,244,15,67,208,61,3,208,244,15,64,244,61,3,208,61,15,64,244,
+ 15,67,208,61,3,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,70,249,0,3,215,255,224,0,251,149,253,0,63,64,15,
+ 128,15,128,2,240,3,224,0,188,0,244,0,31,0,61,0,7,192,15,64,1,240,3,208,
+ 0,124,0,244,0,31,0,61,0,7,192,15,64,1,240,3,208,0,124,0,244,0,31,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,27,249,0,0,47,255,240,0,31,149,191,0,15,128,7,224,11,192,0,188,2,
+ 224,0,31,64,248,0,3,208,61,0,0,244,15,128,0,61,2,224,0,31,64,188,0,11,
+ 192,15,128,7,224,1,249,91,240,0,47,255,240,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,70,249,0,
+ 3,219,255,224,0,255,149,190,0,63,128,11,208,15,192,0,248,3,224,0,46,0,248,0,
+ 11,192,61,0,1,240,15,128,0,188,3,224,0,46,0,252,0,15,128,63,128,11,208,15,
+ 249,91,224,3,239,255,224,0,244,127,144,0,61,0,0,0,15,64,0,0,3,208,0,0,
+ 0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,111,145,240,0,191,254,124,0,190,
+ 86,255,0,126,0,47,192,47,0,3,240,11,128,0,188,3,224,0,47,0,244,0,7,192,
+ 62,0,2,240,11,128,0,188,2,240,0,63,0,126,0,47,192,11,229,111,240,0,191,255,
+ 188,0,6,253,31,0,0,0,7,192,0,0,1,240,0,0,0,124,0,0,0,31,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,255,198,254,0,255,247,255,128,21,126,213,64,0,15,192,
+ 0,0,3,224,0,0,0,248,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,
+ 244,0,0,0,61,0,0,0,15,64,0,1,87,229,80,0,255,255,252,0,63,255,255,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,27,249,0,0,47,255,240,0,47,149,190,0,15,128,7,208,3,224,0,164,0,
+ 184,0,0,0,31,229,0,0,1,191,249,0,0,1,175,240,0,0,0,126,0,125,0,11,
+ 192,15,128,2,240,1,253,86,248,0,47,255,248,0,1,191,228,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,208,0,0,0,244,0,0,0,61,0,0,63,255,255,240,
+ 15,255,255,252,1,85,249,85,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,62,0,0,0,
+ 11,208,0,0,1,255,252,0,0,27,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,208,0,244,0,244,0,61,0,61,
+ 0,15,64,15,64,3,208,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,208,
+ 3,208,0,244,0,248,0,61,0,62,0,31,64,11,192,15,208,1,253,90,244,0,47,255,
+ 61,0,1,254,15,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,31,0,0,125,3,208,0,47,0,188,0,15,64,31,64,7,
+ 192,3,224,2,224,0,188,0,244,0,31,64,124,0,3,224,46,0,0,124,15,64,0,15,
+ 75,192,0,2,227,224,0,0,125,244,0,0,15,248,0,0,2,253,0,0,0,127,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,125,0,0,31,15,64,0,11,195,224,46,2,224,184,15,192,248,46,7,240,61,7,
+ 193,253,31,1,240,187,71,192,61,61,225,224,11,78,60,184,2,231,139,45,0,122,210,223,
+ 64,31,176,123,192,3,252,15,224,0,190,3,248,0,47,128,189,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,192,0,248,
+ 1,248,0,188,0,31,64,125,0,2,240,62,0,0,62,47,0,0,7,239,64,0,0,191,
+ 64,0,0,31,192,0,0,15,248,0,0,11,223,64,0,7,210,240,0,3,224,46,0,2,
+ 240,7,224,1,244,0,125,0,248,0,11,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,64,0,125,2,224,0,47,0,124,
+ 0,15,128,15,64,7,208,2,224,2,240,0,125,0,248,0,15,128,125,0,2,240,47,0,
+ 0,125,15,64,0,15,135,192,0,1,242,224,0,0,61,244,0,0,11,188,0,0,1,254,
+ 0,0,0,63,64,0,0,7,192,0,0,2,224,0,0,63,240,0,0,15,228,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,15,255,255,240,3,255,255,252,0,85,85,127,0,0,0,47,
+ 0,0,0,47,64,0,0,47,64,0,0,47,64,0,0,31,64,0,0,31,64,0,0,31,
+ 64,0,0,31,64,0,0,15,128,0,0,15,149,85,80,3,255,255,252,0,255,255,255,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,1,190,0,0,2,255,128,0,1,249,64,0,0,184,0,0,0,62,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,125,0,0,0,47,0,0,0,31,64,0,0,
+ 63,64,0,0,15,144,0,0,1,189,0,0,0,11,192,0,0,1,244,0,0,0,61,0,
+ 0,0,15,64,0,0,3,208,0,0,0,248,0,0,0,62,0,0,0,7,229,0,0,0,
+ 191,224,0,0,6,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,
+ 15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,
+ 3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,15,228,0,0,3,255,64,0,0,91,240,
+ 0,0,0,125,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,62,0,0,0,
+ 15,128,0,0,2,240,0,0,0,62,0,0,0,6,240,0,0,0,188,0,0,0,249,0,
+ 0,0,188,0,0,0,62,0,0,0,15,128,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,31,64,0,1,111,192,0,0,255,208,0,0,63,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,7,248,3,
+ 208,7,255,129,244,2,241,249,188,0,248,15,254,0,41,0,190,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,
+ 175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,
+ 3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,
+ 0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,
+ 63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,
+ 0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,
+ 240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,
+ 240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,
+ 0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,
+ 252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,
+ 62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,255,240,0,3,255,252,0,
+ 0,240,15,0,0,63,175,192,0,15,0,240,0,3,235,252,0,0,240,191,0,0,60,175,
+ 192,0,15,85,240,0,3,213,124,0,0,254,191,0,0,61,111,192,0,15,85,240,0,3,
+ 234,188,0,0,242,15,0,0,60,235,192,0,15,20,240,0,3,255,252,0,0,250,175,0,
+ 0,60,3,192,0,15,63,240,0,3,192,60,0,0,250,175,0,0,62,71,192,0,15,69,
+ 240,0,3,255,252,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,240,0,0,0,252,0,0,0,
+ 63,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,14,0,0,0,7,128,0,
+ 0,1,240,0,0,0,124,0,0,0,31,0,0,0,7,192,0,0,1,240,0,0,0,124,
+ 0,0,0,31,0,0,0,7,192,0,0,1,240,0,0,0,124,0,0,0,31,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,2,208,0,0,0,240,0,0,0,125,0,0,
+ 2,255,244,0,3,255,255,128,2,245,226,244,1,244,120,46,0,188,30,5,64,62,7,64,
+ 0,15,130,208,0,3,224,180,0,0,248,45,0,0,47,15,2,240,7,227,192,248,0,254,
+ 241,252,0,31,255,253,0,0,191,248,0,0,7,144,0,0,1,224,0,0,0,120,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,43,249,0,0,127,255,224,0,63,150,253,0,47,64,31,192,15,128,
+ 2,164,3,224,0,0,0,248,0,0,0,46,0,0,0,11,192,0,0,63,255,252,0,15,
+ 255,255,0,1,95,149,64,0,3,208,0,0,0,244,0,0,0,124,0,0,0,46,0,0,
+ 0,31,0,0,0,47,85,85,84,15,255,255,255,3,255,255,255,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,64,125,0,0,125,
+ 15,214,249,127,0,255,255,255,0,15,229,191,0,7,208,7,208,2,224,0,184,0,248,0,
+ 47,0,62,0,11,192,11,128,2,224,1,244,1,244,0,63,150,252,0,63,255,255,192,63,
+ 91,229,252,15,64,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,0,2,224,31,64,1,
+ 244,2,240,0,188,0,125,0,61,0,11,128,47,0,1,244,15,64,0,46,7,192,0,7,
+ 211,224,0,0,185,240,0,5,95,249,80,3,255,255,252,0,255,255,255,0,0,15,64,0,
+ 5,87,229,80,3,255,255,252,0,255,255,255,0,0,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,
+ 0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,208,0,0,0,
+ 244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,
+ 0,15,64,0,0,3,208,0,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,232,0,0,191,255,208,0,190,86,252,0,62,0,31,128,15,128,
+ 2,160,2,244,0,0,0,47,228,0,0,2,255,228,0,3,250,191,128,2,240,1,248,0,
+ 248,0,47,0,62,0,11,192,11,208,3,224,0,191,171,240,0,6,255,240,0,0,1,191,
+ 64,0,0,7,224,7,208,0,188,0,252,0,47,0,47,213,111,128,2,255,255,128,0,27,
+ 254,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 64,20,0,0,244,31,0,0,61,7,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,20,0,0,1,191,228,0,2,255,255,128,2,249,6,
+ 248,1,244,0,31,64,180,0,1,224,120,31,244,61,29,47,255,71,139,31,129,241,227,203,
+ 192,45,60,243,224,1,15,60,248,0,3,207,62,0,0,242,203,128,25,60,182,240,11,94,
+ 29,62,91,203,67,199,255,211,192,184,111,146,224,31,64,2,240,1,249,86,244,0,31,255,
+ 244,0,0,191,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,111,144,0,0,126,189,0,0,45,7,128,0,
+ 0,1,240,0,0,111,252,0,0,126,159,0,0,60,3,192,0,15,6,240,0,2,255,239,
+ 128,0,26,65,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,2,244,62,0,1,244,63,0,1,244,47,0,1,
+ 248,47,64,0,248,31,64,0,60,11,128,0,15,129,244,0,1,248,47,64,0,31,66,240,
+ 0,1,244,63,0,0,47,67,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,85,84,0,191,255,
+ 255,64,47,255,255,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,11,255,240,0,3,255,252,0,0,240,15,0,0,63,175,192,0,15,0,240,
+ 0,3,235,252,0,0,240,191,0,0,60,175,192,0,15,85,240,0,3,213,124,0,0,254,
+ 191,0,0,61,111,192,0,15,85,240,0,3,234,188,0,0,242,15,0,0,60,235,192,0,
+ 15,20,240,0,3,255,252,0,0,250,175,0,0,60,3,192,0,15,63,240,0,3,192,60,
+ 0,0,250,175,0,0,62,71,192,0,15,69,240,0,3,255,252,0,0,255,255,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,111,228,0,0,185,91,128,0,224,0,44,0,
+ 178,255,131,128,116,245,120,116,44,60,15,14,15,15,7,131,195,195,255,128,240,240,246,208,
+ 60,45,60,60,30,7,143,7,139,64,185,64,91,128,15,144,27,192,0,191,255,128,0,6,
+ 254,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,85,85,0,0,63,255,192,0,15,255,240,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 31,208,0,0,47,254,0,0,47,155,224,0,15,128,188,0,3,224,47,0,0,248,11,192,
+ 0,47,155,224,0,2,255,224,0,0,31,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,64,0,5,87,229,84,3,255,255,255,0,255,255,255,192,0,15,64,0,
+ 0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,5,85,85,84,3,255,255,
+ 255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,27,228,0,0,31,175,64,0,11,65,224,0,
+ 2,128,56,0,0,0,45,0,0,0,110,0,0,0,189,0,0,0,244,0,0,0,180,0,
+ 0,0,62,170,128,0,15,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,47,208,0,0,46,189,0,0,30,7,128,0,0,0,224,0,0,6,
+ 228,0,0,1,248,0,0,0,7,128,0,0,0,240,0,1,208,60,0,0,62,189,0,0,
+ 6,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,64,0,0,
+ 11,128,0,0,3,192,0,0,2,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,208,0,244,0,244,0,61,0,61,
+ 0,15,64,15,64,3,208,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,208,
+ 3,208,0,244,0,248,0,61,0,62,0,31,64,15,192,15,208,3,253,94,244,0,251,255,
+ 125,0,61,126,79,64,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,111,255,208,0,191,255,244,0,191,254,125,0,
+ 63,255,79,64,31,255,211,208,7,255,244,244,1,255,253,61,0,127,255,79,64,15,255,211,
+ 208,1,255,244,244,0,31,253,61,0,0,95,79,64,0,3,211,208,0,0,244,244,0,0,
+ 61,61,0,0,15,79,64,0,3,211,208,0,0,244,244,0,0,61,61,0,0,15,79,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,252,0,0,0,63,0,0,0,15,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,5,0,0,0,7,64,0,0,2,248,0,0,0,7,128,
+ 0,1,128,224,0,0,127,248,0,0,7,248,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,0,0,0,60,
+ 0,0,1,191,0,0,0,191,192,0,0,0,240,0,0,0,60,0,0,0,15,0,0,0,
+ 3,192,0,0,0,240,0,0,0,60,0,0,0,15,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,47,224,0,0,63,190,0,0,46,2,208,0,
+ 15,0,120,0,3,192,14,0,0,240,3,128,0,45,1,224,0,7,145,244,0,0,191,244,
+ 0,0,6,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,126,11,208,0,7,208,188,0,0,189,15,128,0,
+ 11,208,248,0,0,188,31,64,0,31,2,224,0,11,193,244,0,11,208,248,0,11,208,248,
+ 0,7,208,188,0,7,224,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,
+ 192,0,176,0,176,0,120,0,188,0,60,2,255,0,30,0,23,192,15,0,0,240,7,128,
+ 0,60,3,192,0,15,0,80,0,3,192,0,0,0,240,1,240,0,60,0,252,0,0,0,
+ 191,0,0,0,123,192,0,184,56,240,0,125,44,60,0,46,45,15,0,31,15,255,240,15,
+ 66,170,248,7,128,0,60,3,208,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,192,1,240,0,176,0,
+ 180,0,188,0,124,2,255,0,61,0,23,192,46,0,0,240,31,64,0,60,11,128,0,15,
+ 1,64,0,3,192,4,0,0,240,127,224,0,60,127,254,0,0,46,7,192,0,69,0,240,
+ 0,176,0,116,0,120,0,180,0,60,2,208,0,30,2,128,0,15,2,213,84,7,128,255,
+ 255,3,192,63,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,4,0,1,80,47,224,0,248,63,254,0,188,30,7,192,61,0,
+ 1,240,46,0,7,228,31,64,1,248,11,128,0,7,135,192,0,0,240,64,1,208,60,0,
+ 0,62,189,0,240,6,249,0,188,0,0,0,127,0,0,80,43,192,0,125,28,240,0,46,
+ 13,60,0,31,9,15,0,11,131,255,252,7,192,170,250,3,208,0,60,1,224,0,15,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,240,0,0,0,252,0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,
+ 0,188,0,0,0,47,0,0,0,31,128,0,0,31,192,0,0,47,128,0,0,47,128,0,
+ 0,31,64,0,0,11,128,0,84,3,208,0,62,0,248,0,31,64,47,0,15,192,7,249,
+ 111,208,0,127,255,208,0,6,255,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,2,240,0,0,0,61,0,0,0,7,128,0,0,0,180,0,0,0,0,0,0,0,
+ 31,208,0,0,11,244,0,0,3,238,0,0,1,247,192,0,0,184,244,0,0,61,46,0,
+ 0,31,71,192,0,7,192,244,0,2,224,46,0,0,244,11,192,0,124,1,244,0,46,0,
+ 62,0,15,255,255,128,7,255,255,240,2,245,85,125,0,248,0,11,128,125,0,2,240,47,
+ 0,0,125,11,128,0,15,131,208,0,2,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,224,0,
+ 0,2,240,0,0,0,244,0,0,0,120,0,0,0,0,0,0,0,31,208,0,0,11,244,
+ 0,0,3,238,0,0,1,247,192,0,0,184,244,0,0,61,46,0,0,31,71,192,0,7,
+ 192,244,0,2,224,46,0,0,244,11,192,0,124,1,244,0,46,0,62,0,15,255,255,128,
+ 7,255,255,240,2,245,85,125,0,248,0,11,128,125,0,2,240,47,0,0,125,11,128,0,
+ 15,131,208,0,2,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,61,224,0,0,45,
+ 30,0,0,25,1,64,0,0,0,0,0,0,31,208,0,0,11,244,0,0,3,238,0,0,
+ 1,247,192,0,0,184,244,0,0,61,46,0,0,31,71,192,0,7,192,244,0,2,224,46,
+ 0,0,244,11,192,0,124,1,244,0,46,0,62,0,15,255,255,128,7,255,255,240,2,245,
+ 85,125,0,248,0,11,128,125,0,2,240,47,0,0,125,11,128,0,15,131,208,0,2,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,1,0,80,0,7,248,56,0,3,155,237,0,0,192,105,0,0,0,0,0,
+ 0,0,0,0,0,0,47,192,0,0,15,244,0,0,7,238,0,0,2,231,192,0,0,244,
+ 244,0,0,124,62,0,0,30,11,192,0,11,129,244,0,3,208,62,0,1,240,11,192,0,
+ 184,1,240,0,61,0,61,0,31,255,255,128,11,255,255,240,2,229,85,125,0,244,0,11,
+ 128,124,0,1,240,46,0,0,125,15,128,0,15,135,208,0,2,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,5,0,80,0,3,208,124,0,0,244,31,0,0,0,0,0,0,0,0,0,0,0,
+ 63,192,0,0,15,240,0,0,7,253,0,0,2,235,128,0,0,245,240,0,0,124,61,0,
+ 0,46,11,128,0,15,65,240,0,7,192,61,0,2,240,15,128,0,248,2,240,0,125,0,
+ 125,0,31,255,255,64,11,255,255,224,3,229,85,188,1,240,0,15,64,184,0,2,224,62,
+ 0,0,188,31,64,0,31,75,192,0,3,224,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,253,0,0,0,210,128,0,
+ 0,48,112,0,0,14,104,0,0,1,184,0,0,0,0,0,0,0,47,208,0,0,15,248,
+ 0,0,3,239,0,0,1,247,208,0,0,184,248,0,0,61,46,0,0,31,71,192,0,11,
+ 192,244,0,3,224,46,0,1,244,11,192,0,124,1,244,0,46,0,62,0,15,255,255,192,
+ 7,255,255,244,2,245,85,125,0,248,0,11,128,125,0,1,240,47,0,0,125,11,128,0,
+ 15,131,208,0,2,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,31,255,252,0,11,255,255,0,3,239,149,64,
+ 1,243,208,0,0,184,244,0,0,61,61,0,0,31,79,64,0,11,195,208,0,3,224,244,
+ 0,1,244,63,255,0,188,15,255,192,46,3,229,80,15,255,244,0,7,255,253,0,2,229,
+ 95,64,0,244,3,208,0,124,0,244,0,46,0,62,85,15,64,15,255,199,192,3,255,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,0,191,255,128,0,190,86,248,0,189,0,47,64,62,0,
+ 2,240,31,64,0,125,11,192,0,5,66,224,0,0,0,248,0,0,0,61,0,0,0,15,
+ 64,0,0,3,224,0,0,0,248,0,0,0,46,0,0,41,7,192,0,15,64,248,0,11,
+ 192,47,64,7,224,3,244,7,240,0,127,255,244,0,2,255,224,0,0,11,64,0,0,2,
+ 248,0,0,0,7,128,0,1,128,224,0,0,122,180,0,0,7,244,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,188,0,0,0,15,64,0,0,1,240,0,0,0,45,0,0,0,0,0,0,15,
+ 255,255,240,3,255,255,252,0,249,85,85,0,61,0,0,0,15,64,0,0,3,208,0,0,
+ 0,244,0,0,0,61,0,0,0,15,64,0,0,3,255,255,252,0,255,255,255,0,62,85,
+ 85,64,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,
+ 229,85,84,0,255,255,255,0,63,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,
+ 0,0,124,0,0,0,61,0,0,0,30,0,0,0,0,0,0,15,255,255,240,3,255,255,
+ 252,0,249,85,85,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,255,255,252,0,255,255,255,0,62,85,85,64,15,64,0,0,
+ 3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,229,85,84,0,255,255,
+ 255,0,63,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,25,0,0,0,47,208,0,0,31,125,0,0,11,
+ 71,128,0,6,64,96,0,0,0,0,0,15,255,255,240,3,255,255,252,0,249,85,85,0,
+ 61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,
+ 0,3,255,255,252,0,255,255,255,0,62,85,85,64,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,15,64,0,0,3,229,85,84,0,255,255,255,0,63,255,255,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,80,20,0,0,124,15,64,0,31,3,208,0,0,0,0,
+ 0,0,0,0,0,15,255,255,240,3,255,255,252,0,249,85,85,0,61,0,0,0,15,64,
+ 0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,255,255,252,0,
+ 255,255,255,0,62,85,85,64,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,
+ 0,15,64,0,0,3,229,85,84,0,255,255,255,0,63,255,255,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,2,224,0,0,0,125,0,0,0,11,128,0,0,0,240,0,0,0,0,0,0,63,
+ 255,255,192,15,255,255,240,1,85,249,84,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,
+ 0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,5,
+ 87,229,80,3,255,255,252,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,208,0,
+ 0,2,224,0,0,0,240,0,0,0,180,0,0,0,0,0,0,63,255,255,192,15,255,255,
+ 240,1,85,249,84,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,
+ 0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,5,87,229,80,3,255,255,
+ 252,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,0,0,0,126,224,0,0,60,
+ 45,0,0,25,1,64,0,0,0,0,0,63,255,255,192,15,255,255,240,1,85,249,84,0,
+ 0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,
+ 0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,
+ 244,0,0,0,61,0,0,0,15,64,0,5,87,229,80,3,255,255,252,0,255,255,255,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,5,0,80,0,3,208,124,0,0,244,31,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,192,15,255,255,240,1,85,249,84,0,0,61,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,
+ 0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,
+ 0,0,15,64,0,5,87,229,80,3,255,255,252,0,255,255,255,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,
+ 255,160,0,3,255,255,64,0,249,91,248,0,61,0,47,64,15,64,2,240,3,208,0,125,
+ 0,244,0,15,128,61,0,2,224,15,64,0,188,63,255,240,47,15,255,252,7,193,126,85,
+ 2,240,15,64,0,184,3,208,0,62,0,244,0,31,64,61,0,11,192,15,64,11,208,3,
+ 229,111,224,0,255,255,224,0,63,254,128,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,80,0,7,248,56,0,
+ 3,155,237,0,0,192,105,0,0,0,0,0,0,0,0,0,0,63,64,1,240,15,224,0,
+ 124,3,252,0,31,0,251,64,7,192,61,176,1,240,15,93,0,124,3,211,128,31,0,244,
+ 180,7,192,61,30,1,240,15,66,192,124,3,208,120,31,0,244,15,7,192,61,2,209,240,
+ 15,64,124,124,3,208,11,95,0,244,1,231,192,61,0,62,240,15,64,11,252,3,208,1,
+ 255,0,244,0,47,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,11,128,0,0,1,244,0,0,0,46,0,0,0,3,
+ 192,0,0,0,0,0,0,0,0,0,0,0,111,228,0,1,255,255,128,0,254,87,244,0,
+ 189,0,47,0,62,0,3,224,31,0,0,188,11,128,0,31,3,224,0,7,208,248,0,0,
+ 244,61,0,0,61,15,64,0,15,67,224,0,3,208,248,0,1,244,46,0,0,124,7,192,
+ 0,47,0,248,0,15,128,47,64,11,192,3,249,95,224,0,127,255,224,0,1,191,144,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,31,64,0,0,11,128,0,0,3,192,0,0,2,208,0,0,0,0,0,
+ 0,0,0,0,0,0,111,228,0,1,255,255,128,0,254,87,244,0,189,0,47,0,62,0,
+ 3,224,31,0,0,188,11,128,0,31,3,224,0,7,208,248,0,0,244,61,0,0,61,15,
+ 64,0,15,67,224,0,3,208,248,0,1,244,46,0,0,124,7,192,0,47,0,248,0,15,
+ 128,47,64,11,192,3,249,95,224,0,127,255,224,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,164,
+ 0,0,0,191,64,0,0,180,240,0,0,120,30,0,0,0,0,0,0,0,0,0,0,0,
+ 111,228,0,1,255,255,128,0,254,87,244,0,189,0,47,0,62,0,3,224,31,0,0,188,
+ 11,128,0,31,3,224,0,7,208,248,0,0,244,61,0,0,61,15,64,0,15,67,224,0,
+ 3,208,248,0,1,244,46,0,0,124,7,192,0,47,0,248,0,15,128,47,64,11,192,3,
+ 249,95,224,0,127,255,224,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,80,0,7,244,52,0,
+ 3,155,188,0,0,192,105,0,0,0,0,0,0,0,0,0,0,0,111,228,0,1,255,255,
+ 128,0,254,87,244,0,189,0,47,0,62,0,3,224,31,0,0,188,11,128,0,31,3,224,
+ 0,7,208,248,0,0,244,61,0,0,61,15,64,0,15,67,224,0,3,208,248,0,1,244,
+ 46,0,0,124,7,192,0,47,0,248,0,15,128,47,64,11,192,3,249,95,224,0,127,255,
+ 224,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,192,244,0,1,240,61,0,0,20,
+ 5,0,0,0,0,0,0,0,0,0,0,0,111,228,0,1,255,255,128,0,254,87,244,0,
+ 189,0,47,0,62,0,3,224,31,0,0,188,11,128,0,31,3,224,0,7,208,248,0,0,
+ 244,61,0,0,61,15,64,0,15,67,224,0,3,208,248,0,1,244,46,0,0,124,7,192,
+ 0,47,0,248,0,15,128,47,64,11,192,3,249,95,224,0,127,255,224,0,1,191,144,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,96,0,36,0,126,0,47,0,11,224,47,64,0,190,47,64,0,
+ 7,255,64,0,0,191,64,0,0,47,224,0,0,47,190,0,0,47,71,224,0,47,64,126,
+ 0,31,64,7,192,1,64,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 111,229,240,1,255,255,244,0,254,87,252,0,189,0,63,0,62,0,47,224,31,0,31,188,
+ 11,192,11,95,3,224,7,199,208,248,3,208,244,61,2,224,61,15,65,240,15,67,224,180,
+ 3,208,248,124,1,244,47,61,0,124,7,238,0,47,0,255,0,15,128,47,128,11,192,7,
+ 249,95,208,3,255,255,224,2,225,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,208,0,0,0,184,0,0,
+ 0,15,0,0,0,1,224,0,0,0,0,0,0,0,0,0,0,61,0,0,244,15,64,0,
+ 61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,
+ 0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,
+ 15,128,0,61,3,224,0,31,64,188,0,7,192,31,128,7,224,2,249,91,240,0,47,255,
+ 244,0,1,191,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,11,128,0,0,7,208,0,0,2,224,0,0,0,
+ 240,0,0,0,0,0,0,0,0,0,0,61,0,0,244,15,64,0,61,3,208,0,15,64,
+ 244,0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,
+ 244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,128,0,61,3,224,
+ 0,31,64,188,0,7,192,31,128,7,224,2,249,91,240,0,47,255,244,0,1,191,160,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,104,0,0,0,127,128,0,0,60,180,0,0,45,11,64,0,0,0,0,
+ 0,0,0,0,0,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,
+ 0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,3,
+ 208,0,15,64,244,0,3,208,61,0,0,244,15,128,0,61,3,224,0,31,64,188,0,7,
+ 192,31,128,7,224,2,249,91,240,0,47,255,244,0,1,191,160,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,3,208,244,0,0,244,61,0,0,20,5,0,0,0,0,0,0,0,0,0,0,61,
+ 0,0,244,15,64,0,61,3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,
+ 3,208,0,15,64,244,0,3,208,61,0,0,244,15,64,0,61,3,208,0,15,64,244,0,
+ 3,208,61,0,0,244,15,128,0,61,3,224,0,31,64,188,0,7,192,31,128,7,224,2,
+ 249,91,240,0,47,255,244,0,1,191,160,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,208,0,
+ 0,2,224,0,0,1,240,0,0,0,180,0,0,0,0,0,0,252,0,1,244,31,64,0,
+ 248,2,240,0,125,0,125,0,62,0,11,128,31,64,1,244,15,128,0,46,7,208,0,7,
+ 211,224,0,0,185,244,0,0,31,248,0,0,2,252,0,0,0,126,0,0,0,15,64,0,
+ 0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,
+ 0,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,255,249,0,3,255,255,244,0,249,85,191,0,61,0,7,224,15,64,0,
+ 188,3,208,0,47,0,244,0,11,192,61,0,2,224,15,64,1,244,3,229,86,252,0,255,
+ 255,248,0,63,255,228,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,175,228,0,1,255,255,64,0,254,87,244,0,189,0,62,0,46,0,
+ 11,192,15,128,2,240,3,208,0,184,0,244,0,125,0,61,5,190,0,15,71,254,0,3,
+ 209,255,224,0,244,0,127,0,61,0,3,224,15,64,0,188,3,208,0,31,0,244,0,11,
+ 192,61,0,7,224,15,65,91,240,3,210,255,244,0,244,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,240,0,0,0,
+ 61,0,0,0,7,128,0,0,0,180,0,0,0,0,0,0,0,0,0,0,0,27,249,0,
+ 0,63,255,208,0,47,149,253,0,31,64,15,128,6,128,2,240,0,0,0,188,0,0,26,
+ 255,0,2,255,255,192,3,250,81,240,2,240,0,188,0,248,0,47,0,62,0,31,192,11,
+ 229,111,245,0,255,255,127,192,11,249,7,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,208,0,0,2,224,0,0,0,244,
+ 0,0,0,120,0,0,0,0,0,0,0,0,0,0,0,27,249,0,0,63,255,208,0,47,
+ 149,253,0,31,64,15,128,6,128,2,240,0,0,0,188,0,0,26,255,0,2,255,255,192,
+ 3,250,81,240,2,240,0,188,0,248,0,47,0,62,0,31,192,11,229,111,245,0,255,255,
+ 127,192,11,249,7,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,41,0,0,0,47,208,0,0,30,60,0,0,30,7,128,0,
+ 0,0,0,0,0,0,0,0,0,27,249,0,0,63,255,208,0,47,149,253,0,31,64,15,
+ 128,6,128,2,240,0,0,0,188,0,0,26,255,0,2,255,255,192,3,250,81,240,2,240,
+ 0,188,0,248,0,47,0,62,0,31,192,11,229,111,245,0,255,255,127,192,11,249,7,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,64,20,0,1,253,14,0,0,230,235,64,0,48,26,64,0,0,0,0,0,0,0,
+ 0,0,0,27,249,0,0,63,255,208,0,63,149,253,0,31,64,15,128,6,128,2,240,0,
+ 0,0,188,0,0,26,255,0,2,255,255,192,3,250,81,240,2,240,0,188,0,248,0,47,
+ 0,62,0,31,192,11,229,111,245,0,255,255,127,192,11,249,7,240,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 240,61,0,0,124,15,64,0,5,1,64,0,0,0,0,0,0,0,0,0,0,27,249,0,
+ 0,63,255,208,0,47,149,253,0,31,64,15,128,6,128,2,240,0,0,0,188,0,0,26,
+ 255,0,2,255,255,192,3,250,81,240,2,240,0,188,0,248,0,47,0,62,0,31,192,11,
+ 229,111,245,0,255,255,127,192,11,249,7,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,64,0,0,53,176,0,0,13,28,
+ 0,0,1,253,0,0,0,0,0,0,0,0,0,0,0,27,249,0,0,63,255,208,0,47,
+ 149,253,0,31,64,15,128,6,128,2,240,0,0,0,188,0,0,26,255,0,2,255,255,192,
+ 3,250,81,240,2,240,0,188,0,248,0,47,0,62,0,31,192,11,229,111,245,0,255,255,
+ 127,192,11,249,7,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,1,254,11,244,2,255,235,255,129,249,191,230,240,188,11,224,
+ 62,25,2,244,11,128,0,124,2,240,6,191,255,252,31,255,255,255,31,230,245,85,75,192,
+ 188,0,3,224,47,64,100,248,15,224,62,47,91,190,111,71,255,139,255,128,111,128,191,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,10,250,0,0,31,255,244,0,31,213,191,64,15,128,7,224,7,192,0,188,2,
+ 224,0,0,0,248,0,0,0,61,0,0,0,15,128,0,0,2,224,0,5,0,188,0,7,
+ 192,31,128,3,224,2,249,7,244,0,47,255,244,0,1,191,224,0,0,7,64,0,0,2,
+ 248,0,0,0,7,128,0,1,128,224,0,0,122,180,0,0,7,244,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 125,0,0,0,11,128,0,0,0,244,0,0,0,30,0,0,0,0,0,0,0,27,249,0,
+ 0,47,255,244,0,47,149,191,0,15,128,7,224,11,192,0,188,2,224,0,31,64,255,255,
+ 255,208,63,255,255,244,15,149,85,84,2,224,0,0,0,188,0,6,64,15,128,3,240,2,
+ 249,91,244,0,47,255,244,0,1,191,224,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,0,0,0,61,
+ 0,0,0,46,0,0,0,15,0,0,0,0,0,0,0,27,249,0,0,47,255,244,0,47,
+ 149,191,0,15,128,7,224,11,192,0,188,2,224,0,31,64,255,255,255,208,63,255,255,244,
+ 15,149,85,84,2,224,0,0,0,188,0,6,64,15,128,3,240,2,249,91,244,0,47,255,
+ 244,0,1,191,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,26,0,0,0,31,224,0,0,15,46,0,0,15,66,208,0,
+ 0,0,0,0,0,0,0,0,0,27,249,0,0,47,255,244,0,47,149,191,0,15,128,7,
+ 224,11,192,0,188,2,224,0,31,64,255,255,255,208,63,255,255,244,15,149,85,84,2,224,
+ 0,0,0,188,0,6,64,15,128,3,240,2,249,91,244,0,47,255,244,0,1,191,224,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,244,61,0,0,61,15,64,0,5,1,64,0,0,0,0,0,0,0,
+ 0,0,0,27,249,0,0,47,255,244,0,47,149,191,0,15,128,7,224,11,192,0,188,2,
+ 224,0,47,64,255,255,255,208,63,255,255,244,15,149,85,84,2,224,0,0,0,188,0,6,
+ 64,15,128,3,240,2,249,91,244,0,47,255,244,0,1,191,224,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 62,0,0,0,7,192,0,0,0,184,0,0,0,15,0,0,0,0,0,0,11,255,244,0,
+ 2,255,253,0,0,21,95,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,
+ 64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,5,
+ 85,249,84,3,255,255,255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,0,0,0,45,
+ 0,0,0,31,0,0,0,11,64,0,0,0,0,0,11,255,244,0,2,255,253,0,0,21,
+ 95,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,
+ 0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,5,85,249,84,3,255,255,
+ 255,0,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,11,224,0,0,7,173,0,0,7,194,192,0,
+ 1,128,36,0,0,0,0,0,11,255,244,0,2,255,253,0,0,21,95,64,0,0,3,208,
+ 0,0,0,244,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,
+ 61,0,0,0,15,64,0,0,3,208,0,5,85,249,84,3,255,255,255,0,255,255,255,192,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,244,31,0,0,61,7,192,0,5,0,80,0,0,0,0,0,0,0,
+ 0,0,11,255,244,0,2,255,253,0,0,21,95,64,0,0,3,208,0,0,0,244,0,0,
+ 0,61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,61,0,0,0,15,64,
+ 0,0,3,208,0,5,85,249,84,3,255,255,255,0,255,255,255,192,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,
+ 126,64,20,0,31,253,190,0,0,47,254,64,0,63,252,0,0,10,75,128,0,0,65,244,
+ 0,7,255,174,0,11,255,255,192,11,224,31,240,7,208,0,253,2,240,0,31,64,248,0,
+ 3,208,61,0,0,244,15,128,0,61,3,224,0,31,64,188,0,11,192,31,128,7,224,2,
+ 249,91,240,0,47,255,244,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,32,0,1,253,28,0,0,231,238,
+ 0,0,48,42,0,0,0,0,0,0,0,0,0,0,15,70,249,0,3,219,255,224,0,251,
+ 149,253,0,63,64,15,128,15,128,2,240,3,224,0,188,0,244,0,31,0,61,0,7,192,
+ 15,64,1,240,3,208,0,124,0,244,0,31,0,61,0,7,192,15,64,1,240,3,208,0,
+ 124,0,244,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,1,244,0,0,0,46,0,0,0,3,192,0,0,0,120,0,0,
+ 0,0,0,0,0,0,0,0,0,27,249,0,0,47,255,244,0,47,149,191,0,15,128,7,
+ 224,11,192,0,188,2,224,0,31,64,248,0,3,208,61,0,0,244,15,128,0,61,2,224,
+ 0,31,64,188,0,11,192,15,128,7,224,2,249,91,240,0,47,255,244,0,1,191,144,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,2,224,0,0,1,244,0,0,0,184,0,0,0,60,0,0,0,0,0,0,0,0,
+ 0,0,0,27,249,0,0,47,255,244,0,47,149,191,0,15,128,7,224,11,192,0,188,2,
+ 224,0,31,64,248,0,3,208,61,0,0,244,15,128,0,61,2,224,0,31,64,188,0,11,
+ 192,15,128,7,224,2,249,91,240,0,47,255,244,0,1,191,144,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,
+ 31,224,0,0,15,45,0,0,11,66,208,0,0,0,0,0,0,0,0,0,0,27,249,0,
+ 0,47,255,244,0,47,149,191,0,15,128,7,224,11,192,0,188,2,224,0,31,64,248,0,
+ 3,208,61,0,0,244,15,128,0,61,2,224,0,31,64,188,0,11,192,15,128,7,224,2,
+ 249,91,240,0,47,255,244,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,24,0,0,127,71,0,0,57,251,
+ 128,0,12,10,128,0,0,0,0,0,0,0,0,0,0,27,249,0,0,47,255,244,0,47,
+ 213,191,0,15,192,7,224,11,208,0,188,2,240,0,31,64,252,0,3,208,63,0,0,244,
+ 15,192,0,61,2,240,0,31,64,189,0,11,192,15,192,7,224,2,253,91,240,0,47,255,
+ 244,0,1,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,244,61,0,0,61,15,64,0,5,1,64,0,
+ 0,0,0,0,0,0,0,0,0,27,249,0,0,47,255,244,0,47,149,191,0,15,128,7,
+ 224,11,192,0,188,2,224,0,31,64,248,0,3,208,61,0,0,244,15,128,0,61,2,224,
+ 0,31,64,188,0,11,192,15,128,7,224,2,249,91,240,0,47,255,244,0,1,191,144,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,7,208,0,0,3,252,0,0,0,125,0,0,0,0,0,0,0,0,0,0,3,
+ 255,255,255,0,255,255,255,192,21,85,85,80,0,0,0,0,0,0,0,0,0,0,125,0,
+ 0,0,63,192,0,0,7,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,249,184,
+ 0,47,255,248,0,31,149,191,0,15,128,47,224,11,192,30,188,2,224,15,31,64,248,11,
+ 67,208,61,7,128,244,15,131,192,61,2,226,208,31,64,189,224,11,192,15,240,7,224,1,
+ 253,91,240,0,127,255,240,0,61,191,144,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,240,0,0,0,46,0,0,0,3,192,
+ 0,0,0,116,0,0,0,0,0,0,0,0,0,0,3,208,0,244,0,244,0,61,0,61,
+ 0,15,64,15,64,3,208,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,208,
+ 3,208,0,244,0,248,0,61,0,62,0,31,64,11,192,11,208,1,253,90,244,0,47,255,
+ 125,0,1,254,15,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,3,224,0,0,1,240,0,0,0,180,0,0,0,56,0,0,
+ 0,0,0,0,0,0,0,0,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,
+ 208,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,208,3,208,0,244,0,248,
+ 0,61,0,62,0,31,64,11,192,11,208,1,253,90,244,0,47,255,125,0,1,254,15,64,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,25,0,0,0,31,224,0,0,15,45,0,0,11,67,192,0,0,0,0,0,0,0,
+ 0,0,3,208,0,244,0,244,0,61,0,61,0,15,64,15,64,3,208,3,208,0,244,0,
+ 244,0,61,0,61,0,15,64,15,64,3,208,3,208,0,244,0,244,0,61,0,62,0,31,
+ 64,11,192,11,208,1,249,27,244,0,47,255,125,0,1,254,15,64,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+ 240,61,0,0,124,15,64,0,5,1,64,0,0,0,0,0,0,0,0,0,3,208,0,244,
+ 0,244,0,61,0,61,0,15,64,15,64,3,208,3,208,0,244,0,244,0,61,0,61,0,
+ 15,64,15,64,3,208,3,208,0,244,0,248,0,61,0,62,0,31,64,11,192,11,208,1,
+ 253,90,244,0,47,255,125,0,1,254,15,64,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,224,0,0,1,240,0,0,0,180,
+ 0,0,0,120,0,0,0,0,0,0,0,0,0,0,15,64,0,125,2,224,0,47,0,124,
+ 0,15,128,15,64,7,208,2,224,2,240,0,125,0,248,0,15,128,125,0,2,240,47,0,
+ 0,125,15,64,0,15,135,192,0,1,242,224,0,0,61,244,0,0,11,188,0,0,1,254,
+ 0,0,0,63,64,0,0,7,192,0,0,2,224,0,0,63,240,0,0,15,228,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,15,64,0,0,3,208,0,0,0,
+ 244,0,0,0,61,0,0,0,15,70,249,0,3,235,255,224,0,255,149,190,0,63,64,11,
+ 208,15,192,0,248,3,208,0,46,0,244,0,11,192,61,0,1,240,15,64,0,188,3,208,
+ 0,46,0,252,0,15,128,63,64,11,208,15,249,91,224,3,239,255,224,0,244,191,144,0,
+ 61,0,0,0,15,64,0,0,3,208,0,0,0,244,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,208,124,0,0,244,31,0,0,20,1,64,0,0,0,0,0,0,0,
+ 0,0,47,0,0,184,7,208,0,61,0,248,0,31,0,47,0,11,128,7,208,3,208,0,
+ 248,1,240,0,47,0,184,0,7,208,61,0,0,248,31,0,0,31,11,128,0,3,211,208,
+ 0,0,185,240,0,0,31,248,0,0,3,252,0,0,0,190,0,0,0,15,64,0,0,11,
+ 192,0,0,191,224,0,0,47,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_mono_28 = {32,255,17,38,ht_mono_28_pixels};
+static const uint8_t ht_pixel_40_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,
+ 255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,
+ 255,255,255,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,
+ 255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,
+ 255,255,255,255,255,255,255,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,
+ 255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,
+ 0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,
+ 255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,
+ 0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,
+ 255,255,192,0,0,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,
+ 252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,
+ 255,255,255,0,63,255,252,0,255,255,240,3,255,255,255,240,0,0,255,255,240,3,255,255,
+ 255,240,0,0,255,255,240,3,255,255,255,240,0,0,255,255,240,3,255,255,255,240,0,0,
+ 255,255,240,3,255,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,
+ 0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,
+ 0,0,255,255,240,0,0,255,255,240,0,0,0,63,255,255,255,0,63,255,252,0,0,63,
+ 255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,
+ 63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,
+ 0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,
+ 255,255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,
+ 240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,
+ 0,0,0,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,252,0,
+ 0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,
+ 0,255,255,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,
+ 252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,
+ 255,255,255,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,
+ 15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,
+ 0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,
+ 0,3,255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,
+ 255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,
+ 0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,
+ 0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,
+ 240,0,0,255,255,240,0,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,
+ 255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,
+ 255,255,255,255,255,255,255,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,
+ 255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,
+ 252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,15,255,255,255,192,0,0,0,0,0,
+ 15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,
+ 192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,
+ 255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,
+ 255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,
+ 252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,
+ 240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,
+ 255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,
+ 255,255,240,3,255,255,255,255,252,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,
+ 0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,
+ 0,0,255,255,240,0,0,0,0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,
+ 255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,
+ 255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,
+ 255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,192,0,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,255,255,255,192,0,0,0,0,63,
+ 255,255,255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,
+ 192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,
+ 252,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,252,0,0,63,
+ 255,252,0,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,
+ 240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,
+ 255,240,0,0,255,255,240,3,255,255,192,0,0,0,255,255,240,3,255,255,192,0,0,0,
+ 255,255,240,3,255,255,192,0,0,0,255,255,240,3,255,255,192,0,0,0,255,255,240,3,
+ 255,255,192,0,0,0,255,255,255,255,255,0,0,0,0,0,255,255,255,255,255,0,0,0,
+ 0,0,255,255,255,255,255,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,255,255,
+ 255,255,255,0,0,0,0,0,255,255,240,3,255,255,192,0,0,0,255,255,240,3,255,255,
+ 192,0,0,0,255,255,240,3,255,255,192,0,0,0,255,255,240,3,255,255,192,0,0,0,
+ 255,255,240,3,255,255,192,0,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,
+ 0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,
+ 0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,
+ 255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,
+ 255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,
+ 255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,
+ 255,255,255,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,
+ 252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,
+ 240,3,255,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,
+ 255,252,0,0,63,255,252,0,255,255,255,252,0,0,63,255,252,0,255,255,255,252,0,0,
+ 63,255,252,0,255,255,255,255,255,0,63,255,252,0,255,255,255,255,255,0,63,255,252,0,
+ 255,255,255,255,255,0,63,255,252,0,255,255,255,255,255,0,63,255,252,0,255,255,255,255,
+ 255,0,63,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,
+ 252,0,255,255,240,3,255,255,255,255,252,0,255,255,240,3,255,255,255,255,252,0,255,255,
+ 240,3,255,255,255,255,252,0,255,255,240,0,0,255,255,255,252,0,255,255,240,0,0,255,
+ 255,255,252,0,255,255,240,0,0,255,255,255,252,0,255,255,240,0,0,255,255,255,252,0,
+ 255,255,240,0,0,255,255,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,0,15,255,255,0,63,255,252,0,0,0,
+ 15,255,255,0,63,255,252,0,0,0,15,255,255,0,63,255,252,0,0,0,15,255,255,0,
+ 63,255,252,0,0,0,15,255,255,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,
+ 0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,
+ 252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,
+ 240,3,255,0,63,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,
+ 255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,
+ 255,255,255,255,255,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,
+ 0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,252,0,255,255,255,
+ 252,0,255,255,255,252,0,255,255,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,
+ 0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,
+ 255,255,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,0,15,255,255,255,255,
+ 240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,
+ 0,15,255,255,255,255,240,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,
+ 0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,
+ 255,255,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,
+ 0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,15,255,255,0,0,
+ 0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,
+ 0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,0,0,0,0,0,0,0,0,3,255,0,0,0,0,0,0,0,0,3,
+ 255,0,0,0,0,0,0,0,0,3,255,0,0,0,0,0,0,0,0,3,255,0,0,0,
+ 0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,
+ 15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,
+ 192,0,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,
+ 0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,
+ 0,0,15,255,255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,
+ 255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,
+ 0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,
+ 255,255,255,240,0,0,0,0,0,3,255,255,255,240,0,0,0,0,0,3,255,255,255,240,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,
+ 0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,
+ 252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,
+ 0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,255,255,252,0,0,0,
+ 0,3,255,255,255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,3,255,255,
+ 255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,
+ 0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,
+ 0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,
+ 255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,63,255,255,255,255,192,0,0,0,
+ 0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,
+ 255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,
+ 192,0,0,0,0,63,255,255,255,255,192,0,0,0,0,63,255,255,255,255,192,0,0,0,
+ 0,63,255,255,255,255,192,0,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,
+ 255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,255,255,252,0,0,0,
+ 0,3,255,255,255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,3,255,255,
+ 255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,
+ 255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,0,255,255,240,0,
+ 0,255,255,240,0,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,
+ 252,0,255,255,255,255,255,255,255,255,252,0,255,255,255,255,255,255,255,255,252,0,255,255,
+ 255,255,255,255,255,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,
+ 63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,
+ 255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,
+ 255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,
+ 252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,
+ 0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,
+ 252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,
+ 0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,
+ 0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,
+ 0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,
+ 0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,
+ 0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,
+ 0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,
+ 0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,
+ 255,252,0,0,0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,
+ 0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,
+ 252,0,0,0,0,0,0,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,
+ 255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,
+ 255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,
+ 15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,
+ 0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,
+ 0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,0,0,3,255,255,255,255,252,0,0,0,
+ 0,3,255,255,255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,3,255,255,
+ 255,255,252,0,0,0,0,3,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,
+ 15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,
+ 255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,
+ 0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,
+ 252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,
+ 63,255,252,0,255,255,240,3,255,0,63,255,252,0,255,255,240,3,255,0,63,255,252,0,
+ 255,255,240,3,255,0,63,255,252,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,
+ 255,255,255,240,0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,255,255,255,255,240,
+ 0,0,0,63,255,255,255,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,
+ 255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,
+ 255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,
+ 0,0,63,255,252,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,
+ 255,252,0,255,255,240,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,
+ 192,0,0,0,0,0,15,255,255,255,192,0,0,0,0,0,15,255,255,255,192,0,0,0,
+ 0,0,15,255,255,255,192,0,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,
+ 0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,
+ 0,0,0,63,255,252,0,255,255,240,0,0,255,255,240,0,0,0,63,255,252,0,255,255,
+ 240,0,0,0,63,255,252,0,255,255,240,0,0,0,63,255,252,0,255,255,240,0,0,0,
+ 63,255,252,0,255,255,240,0,0,0,63,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,
+ 255,255,255,255,252,0,0,0,15,255,255,255,255,255,252,0,0,0,15,255,255,255,255,255,
+ 252,0,0,0,15,255,255,255,255,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,
+ 0,0,0,0,63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,0,0,0,0,
+ 63,255,252,0,0,0,0,0,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,
+ 0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,
+ 255,255,255,255,252,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,
+ 0,0,0,0,0,0,0,255,255,240,0,0,0,0,0,0,0,255,255,240,0,0,0,0,
+ 0,0,0,255,255,240,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,
+ 255,0,0,0,0,0,0,0,15,255,255,0,0,0,0,0,0,0,15,255,255,0,0,0,
+ 0,0,0,0,15,255,255,0,0,0,0,0,0,63,255,255,255,255,255,255,252,0,0,63,
+ 255,255,255,255,255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,63,255,255,255,255,
+ 255,255,252,0,0,63,255,255,255,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,
+ 0,255,255,255,252,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,255,255,255,
+ 252,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,255,255,255,0,0,0,
+ 0,0,0,63,255,255,255,0,0,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,
+ 255,255,255,0,0,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,255,255,255,252,0,0,0,
+ 0,0,0,255,255,255,252,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,255,
+ 255,255,252,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,0,0,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,255,255,
+ 255,0,0,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,255,255,255,0,0,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,
+ 0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,255,255,255,
+ 252,0,0,0,0,0,0,255,255,255,252,0,0,0,0,0,0,255,255,255,252,0,0,0,
+ 0,0,0,255,255,255,252,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,
+ 192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,
+ 0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,
+ 255,255,192,0,0,0,0,0,0,3,255,255,192,0,0,0,0,0,0,3,255,255,192,0,
+ 0,0,0,0,0,3,255,255,192,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,
+ 255,255,255,0,0,0,0,0,0,63,255,255,255,0,0,0,0,0,0,63,255,255,255,0,
+ 0,0,0,0,0,63,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,
+ 255,0,63,255,252,0,0,63,255,255,255,0,63,255,252,0,0,63,255,255,255,0,63,255,
+ 252,0,255,255,240,3,255,255,255,240,0,0,255,255,240,3,255,255,255,240,0,0,255,255,
+ 240,3,255,255,255,240,0,0,255,255,240,3,255,255,255,240,0,0,255,255,240,3,255,255,
+ 255,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_pixel_40 = {32,126,40,48,ht_pixel_40_pixels};
+static const uint8_t ht_open_20_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 11,255,248,26,170,248,0,3,248,0,15,120,0,61,56,0,244,56,3,208,56,15,64,52,
+ 61,0,32,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_open_20 = {8599,8599,12,28,ht_open_20_pixels};
+static const uint8_t ht_lock_dot_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,
+ 0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,
+ 255,255,255,240,0,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,
+ 255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,
+ 63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,
+ 0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,
+ 0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,252,0,0,63,255,
+ 252,0,0,63,255,252,0,0,63,255,252,0,0,0,15,255,255,255,255,240,0,0,0,0,
+ 15,255,255,255,255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,15,255,255,255,
+ 255,240,0,0,0,0,15,255,255,255,255,240,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_lock_dot = {111,111,40,48,ht_lock_dot_pixels};
+const uint8_t ht_mono_20_ink[224][4] = {
+ {0,0,0,0},
+ {5,8,6,21},
+ {3,8,7,13},
+ {1,8,10,21},
+ {1,6,10,23},
+ {1,8,11,21},
+ {1,8,11,21},
+ {5,8,6,13},
+ {4,6,7,23},
+ {3,6,7,23},
+ {3,7,9,13},
+ {1,11,10,20},
+ {5,20,6,24},
+ {3,15,8,16},
+ {5,20,6,21},
+ {2,6,9,23},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {5,11,6,21},
+ {5,11,6,24},
+ {1,11,9,20},
+ {2,13,10,18},
+ {1,11,9,20},
+ {1,8,10,21},
+ {1,8,11,24},
+ {0,8,11,21},
+ {2,8,10,21},
+ {1,8,10,21},
+ {2,8,11,21},
+ {2,8,10,21},
+ {2,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {2,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {2,8,10,21},
+ {1,8,10,21},
+ {1,8,9,21},
+ {1,8,11,21},
+ {2,8,10,21},
+ {1,8,11,22},
+ {1,8,9,21},
+ {0,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {0,8,11,21},
+ {0,8,11,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {4,6,8,23},
+ {2,6,9,23},
+ {3,6,8,23},
+ {2,8,9,13},
+ {2,22,10,23},
+ {4,7,7,9},
+ {1,11,10,21},
+ {2,8,11,21},
+ {1,11,10,21},
+ {1,8,10,21},
+ {1,11,10,21},
+ {1,8,9,21},
+ {1,11,10,24},
+ {2,8,10,21},
+ {2,8,10,21},
+ {2,8,8,24},
+ {2,8,10,21},
+ {1,8,10,21},
+ {1,11,11,21},
+ {2,11,10,21},
+ {1,11,10,21},
+ {2,11,11,24},
+ {1,11,10,24},
+ {2,11,10,21},
+ {2,11,10,21},
+ {1,8,9,21},
+ {2,11,9,21},
+ {1,11,10,21},
+ {0,11,11,21},
+ {1,11,10,21},
+ {1,11,10,24},
+ {2,11,9,21},
+ {3,6,9,23},
+ {5,6,6,23},
+ {3,6,9,23},
+ {2,13,10,17},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {1,6,7,24},
+ {0,0,0,0},
+ {5,11,6,24},
+ {1,8,10,21},
+ {1,8,10,21},
+ {1,10,11,20},
+ {1,8,11,21},
+ {5,7,6,23},
+ {1,8,10,23},
+ {3,8,8,9},
+ {1,7,11,21},
+ {2,8,9,14},
+ {2,12,10,19},
+ {2,15,10,20},
+ {1,6,7,24},
+ {1,7,11,17},
+ {3,7,7,8},
+ {3,7,9,13},
+ {1,11,9,21},
+ {3,8,7,15},
+ {3,8,7,15},
+ {4,7,7,9},
+ {2,11,9,24},
+ {2,8,10,21},
+ {5,15,6,16},
+ {4,21,7,25},
+ {4,8,7,15},
+ {2,8,8,14},
+ {1,12,9,19},
+ {1,8,10,21},
+ {1,8,10,22},
+ {1,8,11,21},
+ {1,11,10,24},
+ {0,3,11,21},
+ {0,3,11,21},
+ {0,3,11,21},
+ {0,3,11,21},
+ {0,4,11,21},
+ {0,3,11,21},
+ {0,8,10,21},
+ {1,8,10,26},
+ {2,3,10,21},
+ {2,3,10,21},
+ {2,3,10,21},
+ {2,4,10,21},
+ {2,3,10,21},
+ {2,3,10,21},
+ {2,3,10,21},
+ {2,4,10,21},
+ {1,8,11,21},
+ {1,3,9,21},
+ {1,3,11,21},
+ {1,3,11,21},
+ {1,3,11,21},
+ {1,3,11,21},
+ {1,4,11,21},
+ {2,12,9,19},
+ {1,8,11,21},
+ {1,3,10,21},
+ {1,3,10,21},
+ {1,3,10,21},
+ {1,4,10,21},
+ {1,3,10,21},
+ {2,8,11,21},
+ {2,8,10,21},
+ {1,7,10,21},
+ {1,7,10,21},
+ {1,8,10,21},
+ {1,7,10,21},
+ {1,8,10,21},
+ {1,7,10,21},
+ {1,11,11,21},
+ {1,11,10,25},
+ {1,7,10,21},
+ {1,7,10,21},
+ {1,8,10,21},
+ {1,8,10,21},
+ {2,7,10,21},
+ {2,7,10,21},
+ {2,8,10,21},
+ {2,8,10,21},
+ {1,7,10,21},
+ {2,7,10,21},
+ {1,7,10,21},
+ {1,7,10,21},
+ {1,8,10,21},
+ {1,7,10,21},
+ {1,8,10,21},
+ {1,11,9,20},
+ {1,11,10,21},
+ {2,7,9,21},
+ {2,7,9,21},
+ {2,8,9,21},
+ {2,8,9,21},
+ {1,7,10,24},
+ {2,8,11,24},
+ {1,8,10,24},
+};
+const uint8_t ht_open_20_ink[1][4] = {
+ {0,8,10,17},
+};
diff --git a/devices/harness-device/firmware/main/ui/habitat/form.c b/devices/harness-device/firmware/main/ui/habitat/form.c
new file mode 100644
index 000000000..b6ccc9d7a
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/form.c
@@ -0,0 +1,96 @@
+#include "form.h"
+#include <stdio.h>
+#include <string.h>
+
+void ht_form_reset(ht_form_t *s)
+{
+ uint32_t serial = s->serial;
+ memset(s, 0, sizeof *s);
+ s->serial = serial;
+}
+bool ht_form_dismiss(ht_form_t *s)
+{
+ bool sent = false;
+ if (s->id[0] && s->emit) {
+ ht_form_command_t c = {HT_FORM_CLOSE, s->id, ++s->serial, s->page.revision, 0};
+ sent = s->emit(&c, s->ctx);
+ }
+ ht_form_reset(s);
+ return sent;
+}
+static bool send(ht_form_t *s, ht_form_op_t op, int delta, uint32_t now)
+{
+ ht_form_command_t c = {op, s->id, ++s->serial, s->page.revision, delta};
+ if (!s->emit || !s->emit(&c, s->ctx)) return false;
+ s->request = c.request; s->pending = true; s->pending_op = op;
+ s->deadline = now + 3500;
+ return true;
+}
+bool ht_form_open(ht_form_t *s, const char *id, uint32_t now, ht_form_emit_t emit, void *ctx)
+{
+ if (!id || !*id || strlen(id) >= sizeof s->id || s->pending) return false;
+ ht_form_reset(s);
+ snprintf(s->id, sizeof s->id, "%s", id);
+ s->emit = emit; s->ctx = ctx;
+ if (send(s, HT_FORM_OPEN, 0, now)) return true;
+ s->failed = true;
+ snprintf(s->page.error, sizeof s->page.error, "Cable busy. Try again.");
+ return false;
+}
+bool ht_form_command(ht_form_t *s, ht_form_op_t op, uint32_t revision, int delta, uint32_t now)
+{
+ if (!s->id[0] || s->pending) return false;
+ if (op == HT_FORM_OPEN || op == HT_FORM_STATE) return send(s, op, 0, now);
+ if (s->failed || !s->page.active || revision != s->page.revision) return false;
+ if (op == HT_FORM_ACTIVATE && (!s->page.enabled || s->page.busy)) return false;
+ if (op == HT_FORM_MOVE && (s->page.busy || !delta || delta < -8 || delta > 8)) return false;
+ s->queued = 0; s->remainder = 0;
+ return send(s, op, delta, now);
+}
+static void flush(ht_form_t *s, uint32_t now)
+{
+ if (!s->queued || s->pending || !s->page.active || s->page.busy || s->failed) return;
+ int delta = s->queued;
+ if (send(s, HT_FORM_MOVE, delta, now)) s->queued = 0;
+}
+void ht_form_move(ht_form_t *s, int pixels, uint32_t now)
+{
+ if (!s->page.active || s->page.busy || s->failed || pixels < -466 || pixels > 466) return;
+ s->remainder += pixels;
+ int steps = s->remainder / 42;
+ s->remainder %= 42;
+ s->queued += steps;
+ if (s->queued > 8) s->queued = 8;
+ if (s->queued < -8) s->queued = -8;
+ flush(s, now);
+}
+bool ht_form_reply(ht_form_t *s, const char *id, uint32_t request, bool ok,
+ const ht_form_page_t *page, uint32_t now)
+{
+ if (!s->pending || !id || strcmp(s->id, id) || request != s->request) return false;
+ s->pending = false;
+ s->page = *page;
+ s->failed = !ok && !page->active;
+ if (!ok) { s->queued = 0; s->remainder = 0; }
+ if (ok && !page->active) { ht_form_reset(s); return true; }
+ s->poll = now + (page->busy ? 300 : 1000);
+ flush(s, now);
+ // Completing a read changes interaction state even when every page field
+ // is identical. A frame drawn during that read disabled the buttons; its
+ // hit targets must be rebuilt when pending clears. The compositor skips
+ // unchanged pixels, so ordinary polling still has no display transfer.
+ return true;
+}
+bool ht_form_tick(ht_form_t *s, uint32_t now)
+{
+ if (!s->id[0]) return false;
+ if (s->pending && (int32_t)(now - s->deadline) >= 0) {
+ s->pending = false; s->failed = true; s->queued = 0; s->remainder = 0;
+ snprintf(s->page.error, sizeof s->page.error, "No reply. Check Harness on desktop.");
+ return true;
+ }
+ flush(s, now);
+ if (!s->pending && !s->failed && s->page.active && (int32_t)(now - s->poll) >= 0)
+ send(s, HT_FORM_STATE, 0, now);
+ return false;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/form.h b/devices/harness-device/firmware/main/ui/habitat/form.h
new file mode 100644
index 000000000..7e4532135
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/form.h
@@ -0,0 +1,40 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum { HT_FORM_OPEN, HT_FORM_STATE, HT_FORM_MOVE, HT_FORM_ACTIVATE, HT_FORM_BACK, HT_FORM_CLOSE } ht_form_op_t;
+typedef struct {
+ char title[80], label[160], detail[384], previous[96], next[96];
+ char error[180], status[96], action[32];
+ uint32_t revision;
+ int position, total;
+ bool active, busy, enabled, can_query;
+ char query[96];
+} ht_form_page_t;
+typedef struct {
+ ht_form_op_t op;
+ const char *id;
+ uint32_t request, revision;
+ int delta;
+} ht_form_command_t;
+typedef bool (*ht_form_emit_t)(const ht_form_command_t *, void *);
+typedef struct {
+ char id[48];
+ ht_form_page_t page;
+ uint32_t serial, request, deadline, poll;
+ int queued, remainder;
+ bool pending, failed;
+ ht_form_op_t pending_op;
+ ht_form_emit_t emit;
+ void *ctx;
+} ht_form_t;
+
+void ht_form_reset(ht_form_t *);
+// Leave locally even if the desktop never replied; late replies cannot reopen it.
+// Returns whether the best-effort close could be queued.
+bool ht_form_dismiss(ht_form_t *);
+bool ht_form_open(ht_form_t *, const char *id, uint32_t now, ht_form_emit_t, void *);
+bool ht_form_command(ht_form_t *, ht_form_op_t, uint32_t revision, int delta, uint32_t now);
+void ht_form_move(ht_form_t *, int pixels, uint32_t now);
+bool ht_form_reply(ht_form_t *, const char *id, uint32_t request, bool ok, const ht_form_page_t *, uint32_t now);
+bool ht_form_tick(ht_form_t *, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/gestures.c b/devices/harness-device/firmware/main/ui/habitat/gestures.c
new file mode 100644
index 000000000..9afdc9289
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/gestures.c
@@ -0,0 +1,45 @@
+#include "gestures.h"
+#include <stdlib.h>
+
+void ht_gesture_cancel(ht_gesture_t *g)
+{
+ g->live = false;
+ // Preserve the voice guard across its resulting screen transition.
+}
+void ht_gesture_guard(ht_gesture_t *g, uint32_t now)
+{
+ g->guard_valid = true;
+ g->guard_until = now + 450;
+}
+void ht_gesture_begin(ht_gesture_t *g, int x, int y, uint32_t now, uint32_t context)
+{
+ (void)context; // No multi-contact gesture state; the UI cancels on target/view changes.
+ if (g->live) ht_gesture_cancel(g);
+ g->guarded = g->guard_valid && (int32_t)(now - g->guard_until) < 0;
+ if (!g->guarded) g->guard_valid = false;
+ g->x = x; g->y = y; g->began = now;
+ g->live = true; g->moved = false; g->axis = 0;
+}
+void ht_gesture_move(ht_gesture_t *g, int x, int y)
+{
+ if (!g->live) return;
+ int dx = x - g->x, dy = y - g->y;
+ if (dx * dx + dy * dy >= 12 * 12) {
+ g->moved = true;
+ if (!g->axis) g->axis = abs(dx) > abs(dy) ? 2 : 1;
+ }
+}
+ht_touch_result_t ht_gesture_end(ht_gesture_t *g, int x, int y, uint32_t now)
+{
+ if (!g->live) return HT_TOUCH_NONE;
+ ht_gesture_move(g, x, y);
+ g->live = false;
+ uint32_t duration = now - g->began;
+ if (g->moved || g->guarded) {
+ return HT_TOUCH_NONE;
+ }
+ if (duration < 25 || duration > 350) {
+ return duration >= 650 && duration <= 1800 ? HT_TOUCH_HOLD : HT_TOUCH_NONE;
+ }
+ return HT_TOUCH_TAP;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/gestures.h b/devices/harness-device/firmware/main/ui/habitat/gestures.h
new file mode 100644
index 000000000..8f6dd6f0b
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/gestures.h
@@ -0,0 +1,19 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+// A tap is a completed contact, never a DOWN. Motion permanently owns a contact.
+// Pure arithmetic; scrolling never waits for a tap window.
+typedef enum { HT_TOUCH_NONE, HT_TOUCH_TAP, HT_TOUCH_HOLD } ht_touch_result_t;
+typedef struct {
+ int x, y;
+ uint32_t began, guard_until;
+ unsigned axis;
+ bool live, moved, guarded, guard_valid;
+} ht_gesture_t;
+void ht_gesture_begin(ht_gesture_t *g, int x, int y, uint32_t now, uint32_t context);
+void ht_gesture_move(ht_gesture_t *g, int x, int y);
+ht_touch_result_t ht_gesture_end(ht_gesture_t *g, int x, int y, uint32_t now);
+void ht_gesture_cancel(ht_gesture_t *g);
+// A voice action consumes a rapid double/triple tap as one intent, across view transitions.
+void ht_gesture_guard(ht_gesture_t *g, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/layout_bench.c b/devices/harness-device/firmware/main/ui/habitat/layout_bench.c
new file mode 100644
index 000000000..a2ead957d
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/layout_bench.c
@@ -0,0 +1,197 @@
+// Opt-in ESP32 service-time measurements before the live renderer starts.
+// Fixed local scenes only: no app actions, microphone or fabricated contacts.
+#include "octopus.h"
+#include "ascii_clip.h"
+#include "layout_bench.h"
+#ifdef DEVICE_LAYOUT_BASELINE82
+#define BASELINE_LABEL "regions82"
+#define CURRENT_LABEL "bands84"
+#elif defined(DEVICE_LAYOUT_BASELINE79)
+#include "reference79/reference.h"
+#define BASELINE_LABEL "dense79"
+#define CURRENT_LABEL "packed81"
+#else
+#include "reference48/reference.h"
+#define BASELINE_LABEL "baseline48"
+#define CURRENT_LABEL "optimized"
+#endif
+#include "touch.h"
+#include "esp_timer.h"
+#include "esp_attr.h"
+#include "esp_app_desc.h"
+#include "esp_log.h"
+#include "esp_task_wdt.h"
+#include "esp_heap_caps.h"
+#include "cable_client.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+enum { SAMPLES = 40 };
+static RTC_NOINIT_ATTR uint32_t attempted[2];
+void cable_scroll_benchmark(void);
+static bool reference_renderer;
+void ht_layout_raster(const ht_scene_t *scene, ht_rect_t region, uint16_t *out)
+{
+#ifdef DEVICE_LAYOUT_BASELINE82
+ ht_raster(scene, region, out);
+#else
+ if (reference_renderer)
+#ifdef DEVICE_LAYOUT_BASELINE79
+ ht79_raster(scene, region, out);
+#else
+ ht48_raster(scene, region, out);
+#endif
+ else ht_raster(scene, region, out);
+#endif
+}
+static void make_scene(ht_scene_t *scene, const ht_tim_face_t *face, uint8_t frame,
+ uint16_t ink, const char *recap)
+{
+#if !defined(DEVICE_LAYOUT_BASELINE79) && !defined(DEVICE_LAYOUT_BASELINE82)
+ if (reference_renderer) { ht48_octopus_face(scene, face, frame, ink, recap); return; }
+#endif
+ ht_octopus_face(scene, face, frame, ink, recap);
+}
+static void find_damage(const ht_scene_t *before, const ht_scene_t *after, ht_damage_t *out)
+{
+#ifdef DEVICE_LAYOUT_BASELINE82
+ ht_damage(before, after, out);
+#else
+ if (reference_renderer)
+#ifdef DEVICE_LAYOUT_BASELINE79
+ ht79_damage(before, after, out);
+#else
+ ht48_damage(before, after, out);
+#endif
+ else ht_damage(before, after, out);
+#endif
+}
+static int compare(const void *a, const void *b)
+{
+ uint32_t x = *(const uint32_t *)a, y = *(const uint32_t *)b;
+ return x < y ? -1 : x > y;
+}
+static void report(const char *stage, uint32_t values[SAMPLES])
+{
+ qsort(values, SAMPLES, sizeof values[0], compare);
+ ESP_LOGI("layout-bench", "%s n=%d min=%lu median=%lu p95=%lu max=%lu",
+ stage, SAMPLES, (unsigned long)values[0],
+ (unsigned long)((values[19] + values[20]) / 2),
+ (unsigned long)values[37], (unsigned long)values[39]);
+}
+static uint32_t raster(const ht_scene_t *scene, const ht_damage_t *damage, uint16_t *scratch)
+{
+ int64_t began = esp_timer_get_time();
+ for (int i = 0; i < damage->count; i++) {
+ ht_rect_t r = damage->rect[i];
+ int step = r.w * r.h <= 2048 ? r.h : 24;
+ for (int y = r.y; y < r.y + r.h; y += step) {
+ int h = r.y + r.h - y; if (h > step) h = step;
+ ht_layout_raster(scene, (ht_rect_t){r.x, y, r.w, h}, scratch);
+ }
+ }
+ return (uint32_t)(esp_timer_get_time() - began);
+}
+static void checkpoint(const char *label)
+{
+ assert(heap_caps_check_integrity_all(true));
+ touch_stats_t t; touch_stats(&t);
+ ESP_LOGI("layout-bench", "%s internal=%u largest=%u psram=%u stack=%u touches=%lu failures=%lu",
+ label, (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_SPIRAM),
+ (unsigned)uxTaskGetStackHighWaterMark(NULL),
+ (unsigned long)t.presses, (unsigned long)t.read_failures);
+}
+void ht_layout_benchmark(uint16_t *scratch, ht_scene_t *a, ht_scene_t *b,
+ uint32_t (*paint)(const ht_scene_t *, const ht_damage_t *))
+{
+ // At most one attempt per version across watchdog/software resets.
+ uint32_t key = 2166136261u;
+ for (const char *p = esp_app_get_description()->version; *p; p++)
+ key = (key ^ (uint8_t)*p) * 16777619u;
+ if (attempted[0] == key && attempted[1] == ~key) {
+ ESP_LOGW("layout-bench", "already attempted; normal device control resumes");
+ return;
+ }
+ attempted[0] = key; attempted[1] = ~key;
+ int64_t deadline = esp_timer_get_time() + 15000000;
+ while (!cable_client_is_connected() && esp_timer_get_time() < deadline) {
+ esp_task_wdt_reset(); vTaskDelay(pdMS_TO_TICKS(100));
+ }
+ vTaskDelay(pdMS_TO_TICKS(200));
+ static const char *layouts[] = {"straight", "curved", "reading"};
+ static const char *events[] = {"animation", "name", "status", "gaze", "recap"};
+ static const char *names[] = {"Deploy latest firmware", "Mobile app build and deploy"};
+ static const char *summary = "The update is installed. Voice input now sends to the selected agent. The result stays in the center.";
+ uint32_t model[SAMPLES], damage_us[SAMPLES], raster_us[SAMPLES], total[SAMPLES], bytes[SAMPLES];
+ ESP_LOGI("layout-bench", "BEGIN 4800 samples; CPU and request-to-final-DMA service time; excludes queue, sensor, panel scanout and voice; actual " BASELINE_LABEL " versus " CURRENT_LABEL " ABBA; 40 per block");
+ ht_arc_fast_sampling(true); ht_glyph_cache_enable(true); ht_damage_fast_ascii(true); ht_raster_fast_ascii(true); ht_arc_tight_bounds(true);
+ ht_octopus_fast_scene(true);
+ ht_ascii_clip_short_runs(true);
+ checkpoint("before");
+ uint32_t touches = touch_activity_generation();
+ for (int pass = 0; pass < 2; pass++) for (int mode_order = 0; mode_order < 2; mode_order++) {
+ int mode = pass ? 1 - mode_order : mode_order;
+ reference_renderer = mode == 0;
+#ifdef DEVICE_LAYOUT_BASELINE82
+ ht_damage_banded(mode != 0);
+#endif
+ for (int path_order = 0; path_order < 2; path_order++) {
+ int panel = pass ? 1 - path_order : path_order;
+ for (int order = 0; order < 3; order++) {
+ int layout = pass ? 2 - order : order;
+ for (int event = 0; event < 5; event++) {
+ ht_tim_face_t f = {.recipient=names[0], .status="Inbox 2 / Working",
+ .mood=HT_TIM_WORKING, .straight_title=layout==0,
+ .foreground=0xffff, .dim=ht_rgb(0x909990), .ink=ht_rgb(0xb9ed80)};
+ ht_scene_clear(a, ht_rgb(0x080c08));
+ make_scene(a, &f, 0, ht_rgb(0xc8a9f0), layout==2 ? summary : NULL);
+ ht_damage_t damage; find_damage(NULL, a, &damage);
+ if (panel) paint(a, &damage); else raster(a, &damage, scratch);
+ for (int i = 0; i < SAMPLES; i++) {
+ if (touch_activity_generation() != touches) {
+ ESP_LOGW("layout-bench", "CANCEL real input; normal control resumes");
+ goto done;
+ }
+ esp_task_wdt_reset();
+ f.recipient=names[event==1 ? (i+1)%2 : 0];
+ f.status=event==2 && !(i%2) ? "Inbox 2 / Wandering" : "Inbox 2 / Working";
+ f.pose.look=event==3 ? (i%2 ? -1 : 1) : 0;
+ uint8_t frame=event==0 ? (i+1)%HT_OCTOPUS_FRAMES : 0;
+ bool reading = event==4 ? ((i+1)%2 ? layout!=2 : layout==2) : layout==2;
+ int64_t start=esp_timer_get_time();
+ ht_scene_clear(b,a->background);
+ make_scene(b,&f,frame,ht_rgb(0xc8a9f0),reading ? summary : NULL);
+ int64_t modeled=esp_timer_get_time();
+ find_damage(a,b,&damage);
+ int64_t damaged=esp_timer_get_time();
+ assert(damage.count && damage.pixels);
+ raster_us[i]=panel ? paint(b,&damage) : raster(b,&damage,scratch);
+ int64_t end=esp_timer_get_time();
+ model[i]=modeled-start; damage_us[i]=damaged-modeled; total[i]=end-start;
+ bytes[i]=damage.pixels*2;
+ *a=*b;
+ // Outside every timing interval; no diagnostic idle-WDT starvation.
+ vTaskDelay(1);
+ }
+ ESP_LOGI("layout-bench", "BLOCK pass=%d renderer=%s path=%s layout=%s event=%s",
+ pass,mode ? CURRENT_LABEL : BASELINE_LABEL,panel ? "DMA" : "CPU",layouts[layout],events[event]);
+ report("model_us",model); report("damage_us",damage_us);
+ report("raster_us",raster_us); report("total_us",total); report("pixel_bytes",bytes);
+ }
+ }
+ }
+ checkpoint("block");
+ }
+ ESP_LOGI("layout-bench", "END complete; normal device control resumes");
+ cable_scroll_benchmark();
+done:
+ reference_renderer = false;
+ ht_damage_banded(true);
+ memset(a,0,sizeof *a); memset(b,0,sizeof *b);
+ checkpoint("after");
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/layout_bench.h b/devices/harness-device/firmware/main/ui/habitat/layout_bench.h
new file mode 100644
index 000000000..df06313ae
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/layout_bench.h
@@ -0,0 +1,7 @@
+#pragma once
+#include "terminal.h"
+
+// Diagnostic-only hooks. The final DMA fence is shared by both renderer paths.
+void ht_layout_raster(const ht_scene_t *scene, ht_rect_t region, uint16_t *out);
+void ht_layout_benchmark(uint16_t *scratch, ht_scene_t *a, ht_scene_t *b,
+ uint32_t (*paint)(const ht_scene_t *, const ht_damage_t *));
diff --git a/devices/harness-device/firmware/main/ui/habitat/octopus.c b/devices/harness-device/firmware/main/ui/habitat/octopus.c
new file mode 100644
index 000000000..1a550cf2f
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/octopus.c
@@ -0,0 +1,263 @@
+#include "octopus.h"
+#include <string.h>
+#include "perf_bench.h"
+#include "ascii_clip.h"
+
+#include "octopus_art.inc"
+_Static_assert(sizeof octopus_frame_rows / sizeof octopus_frame_rows[0] == HT_OCTOPUS_FRAMES * HT_OCTOPUS_ROWS, "octopus poses");
+#ifdef DEVICE_LAYOUT_BENCH
+static bool fast_scene = true;
+void ht_octopus_fast_scene(bool enabled) { fast_scene = enabled; }
+#endif
+
+bool ht_octopus_motion_tick(ht_octopus_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, int x,
+ unsigned level, uint32_t activity)
+{
+ bool changed = ht_tim_motion_tick(&m->reaction, now, mood, quiet, visible, down, x, level, activity);
+ bool running = visible && !quiet && !down && mood != HT_TIM_LISTENING &&
+ mood != HT_TIM_ASLEEP && mood != HT_TIM_OFFLINE;
+#ifdef DEVICE_OCTOPUS_BENCH
+ // Freeze only the body; preserve identical gaze, blink, mic and touch code for the A/B.
+ running = running && octopus_perf_animate();
+#endif
+ // The exact gallery cadence when working; a gentler half-speed idle swim.
+ uint8_t rate = mood == HT_TIM_CONTENT ? 2 : 1;
+ uint8_t old_frame = m->frame;
+ if (m->initialized && m->running && running) {
+ uint32_t elapsed = now - m->last_ms;
+ // Reduce before multiplying/adding, including across the millisecond wrap.
+ uint32_t scaled = elapsed % (HT_OCTOPUS_DURATION * m->rate) + m->remainder;
+ m->phase = (m->phase + scaled / m->rate) % HT_OCTOPUS_DURATION;
+ m->remainder = scaled % m->rate;
+ } else m->remainder = 0;
+ if (m->rate != rate) m->remainder = 0;
+ m->initialized = true; m->running = running; m->rate = rate; m->last_ms = now;
+ m->frame = 0;
+ while (m->frame + 1 < HT_OCTOPUS_FRAMES && m->phase >= octopus_ends[m->frame]) m->frame++;
+ m->next_ms = m->reaction.next_ms;
+ if (running) {
+ uint32_t next = (octopus_ends[m->frame] - m->phase) * rate - m->remainder;
+ if (next < m->next_ms) m->next_ms = next ? next : 1;
+ }
+ return changed || m->frame != old_frame;
+}
+
+static void lines(ht_scene_t *s, int y, int width, int count, const ht_font_t *font,
+ uint16_t ink, const char *text, bool mark, const int *widths)
+{
+ if (!text) text = "";
+ int start = s->count;
+ const char *rest = text;
+ for (int row = 0; row < count; row++) {
+ int w = widths ? widths[row] : width;
+ const char *begin = rest, *end = ht_take_line(&rest, w / font->width);
+ char line[HT_TEXT_BYTES];
+ size_t n = (size_t)(end - begin);
+ if (n >= sizeof line) n = sizeof line - 1;
+ memcpy(line, begin, n); line[n] = 0;
+ ht_text(s, (HT_WIDTH - w) / 2, y + row * font->height, w, font, ink, s->background, line);
+ }
+ if (mark && *rest && s->count > start) {
+ char *line = s->runs[s->count - 1].text, *p = line, *space = NULL;
+ int keep = (widths ? widths[count - 1] : width) / font->width - 2;
+ for (int i = 0; *p && i < keep; i++) {
+ if (*p == ' ') space = p;
+ const char *next = p; ht_utf8_next(&next); p = (char *)next;
+ }
+ if (*p && *p != ' ' && space) p = space;
+ while (p > line && p[-1] == ' ') p--;
+ strcpy(p, " +");
+ }
+ for (int i = start; i < s->count; i++) {
+ ht_run_t *r = &s->runs[i]; const char *p = r->text; int n = 0;
+ while (*p) { ht_utf8_next(&p); n++; }
+ r->w = n * font->width; r->x = (HT_WIDTH - r->w) / 2;
+ }
+}
+
+static void expression(char row[55], int y, int eye, const ht_tim_face_t *f)
+{
+ if (y == eye) {
+ const char *eyes = NULL;
+ char gaze[4] = " @ ";
+ if (f->pose.pressed || f->pose.look) {
+ memset(gaze, ' ', 3);
+ gaze[f->pose.look < 0 ? 0 : f->pose.look > 0 ? 2 : 1] = '@';
+ eyes = gaze;
+ } else if (f->pose.blink || f->mood == HT_TIM_ASLEEP) eyes = "---";
+ else if (f->mood == HT_TIM_ATTENTION) eyes = " O ";
+ else if (f->mood == HT_TIM_DONE || f->mood == HT_TIM_BOOPED) eyes = " ^ ";
+ else if (f->mood == HT_TIM_OFFLINE) eyes = " - ";
+ if (eyes) { memcpy(row + 19, eyes, 3); memcpy(row + 30, eyes, 3); }
+ }
+ if (f->unread) {
+ // The right tentacle stays raised while unread messages remain. It is
+ // part of the same ASCII portrait, registered to the bobbing head;
+ // no badge, extra run, independent timer or animated asset.
+ static const struct { uint8_t x; const char *ink; } arm[] = {
+ {46, ",;oo,"}, {45, ":#..#;"}, {45, ";# .:;"},
+ {45, ";#;"}, {45, ";#;"}, {44, " ;#;"},
+ {43, " ;##"}, {42, " .##;"}, {41, " .##;"},
+ {39, " .x##;"}, {36, " .x##%;."}, {33, " .x####xo."}
+ };
+ int pose_row = y - eye + 5;
+ if (pose_row >= 0 && pose_row < 12) {
+ memset(row + 42, ' ', 12);
+ memcpy(row + arm[pose_row].x, arm[pose_row].ink, strlen(arm[pose_row].ink));
+ }
+ }
+ if (f->mood == HT_TIM_LISTENING && (y == eye + 2 || y == eye + 3)) {
+ static const char *mouth[5][2] = {
+ {"###.###", "#######"}, {"##---##", "#######"}, {"##(o)##", "#######"},
+ {"#( o )#", "##(_)##"}, {"#( O )#", "#(___)#"}
+ };
+ unsigned level = f->pose.level > 4 ? 4 : f->pose.level;
+ memcpy(row + 23, mouth[level][y - eye - 2], 7);
+ }
+}
+
+static void recap_lines(ht_scene_t *s, int y, int width, int rows, bool centered, const int *widths,
+ uint16_t ink, const char *recap)
+{
+ // Every nonempty recap ends in the desktop arrow, including complete
+ // sentences. Reserve its cell before wrapping; cached host markers dedupe.
+ // Seven visible rows use a bounded UTF-8 prefix. Bound the prefix
+ // even when the source is longer than the device's stored recap buffer.
+ char marked[7 * HT_TEXT_BYTES + 3];
+ size_t used = 0;
+ const char *p = recap ? recap : "";
+ while (*p) {
+ const char *start = p;
+ ht_utf8_next(&p);
+ size_t bytes = (size_t)(p - start);
+ if (used + bytes + 3 > sizeof marked) break;
+ memcpy(marked + used, start, bytes);
+ used += bytes;
+ }
+ while (used && marked[used - 1] == ' ') used--;
+ marked[used] = 0;
+ if (used && !(used >= 2 && !strcmp(marked + used - 2, " +")))
+ strcpy(marked + used, " +");
+ int start = s->count;
+ lines(s, y, width, rows, &ht_mono_20, ink, marked, true, widths);
+ // The host's continuation marker and the display's own row-overflow marker
+ // both reserve " +". Replace only that final sign with the desktop action
+ // glyph; keeping the space and cell width preserves wrapping and centering.
+ for (int i = s->count - 1; i >= start; i--) {
+ ht_run_t *r = &s->runs[i];
+ size_t n = strlen(r->text);
+ if (!n) continue;
+ // Wrapping can leave the marker on a row of its own. Bring the last
+ // word with it when it fits, so the arrow stays attached to prose.
+ if (n == 1 && r->text[0] == '+' && i > start) {
+ ht_run_t *prev = &s->runs[i - 1];
+ char *word = strrchr(prev->text, ' ');
+ word = word ? word + 1 : prev->text;
+ const char *p = word;
+ int cells = 0;
+ while (*p) { ht_utf8_next(&p); cells++; }
+ if (cells && cells + 2 <= (widths ? widths[i - start] : width) / ht_mono_20.width &&
+ strlen(word) + 3 <= sizeof r->text) {
+ strcpy(r->text, word);
+ strcat(r->text, " +");
+ while (word > prev->text && word[-1] == ' ') word--;
+ *word = 0;
+ p = prev->text;
+ int kept = 0;
+ while (*p) { ht_utf8_next(&p); kept++; }
+ prev->w = kept * ht_mono_20.width;
+ prev->x = (HT_WIDTH - prev->w) / 2;
+ r->w = (cells + 2) * ht_mono_20.width;
+ r->x = (HT_WIDTH - r->w) / 2;
+ n = strlen(r->text);
+ }
+ }
+ if ((n >= 2 && !strcmp(r->text + n - 2, " +")) ||
+ (n == 1 && r->text[0] == '+')) {
+ r->text[n - 1] = 0;
+ r->w -= ht_mono_20.width;
+ ht_text(s, r->x + r->w, r->y, ht_open_20.width, &ht_open_20,
+ ink, s->background, "\xe2\x86\x97");
+ }
+ break;
+ }
+ if (centered) {
+ int bottom = y;
+ for (int i = start; i < s->count; i++)
+ if (s->runs[i].text[0]) bottom = s->runs[i].y + ht_mono_20.height;
+ // y describes the full five-row area. Center the actual prose inside it.
+ int shift = (rows * ht_mono_20.height - (bottom - y)) / 2;
+ for (int i = start; i < s->count; i++) s->runs[i].y += shift;
+ }
+}
+
+void ht_recap_lines(ht_scene_t *s, int y, uint16_t ink, const char *recap)
+{
+ recap_lines(s, y, 336, 3, false, NULL, ink, recap);
+}
+bool ht_octopus_short_recap(const char *recap)
+{
+ return recap && *recap && ht_text_rows(recap, &ht_mono_20, 324) <= 3;
+}
+
+static void recipient(ht_scene_t *s, const ht_tim_face_t *f, int y)
+{
+ // In reading mode the name labels the message directly underneath it.
+ // Long names wrap without changing the text size.
+ lines(s, y, 320, 2, &ht_mono_20, f->primary_title ? f->foreground : f->dim, f->recipient, false, NULL);
+}
+
+void ht_octopus_portrait(ht_scene_t *s, const ht_tim_face_t *f, uint8_t frame, uint16_t ink,
+ const ht_font_t *font, int y)
+{
+ if (frame >= HT_OCTOPUS_FRAMES) frame = 0;
+ int x = (HT_WIDTH - HT_OCTOPUS_COLS * font->width) / 2;
+ if (f->mood == HT_TIM_OFFLINE || f->mood == HT_TIM_ASLEEP) ink = f->dim;
+ for (int i = 0; i < HT_OCTOPUS_ROWS; i++) {
+ char row[HT_OCTOPUS_COLS + 1];
+ if (!ht_ascii_clip_row(&octopus_clip, frame, i, row, sizeof row)) {
+ memset(row, ' ', HT_OCTOPUS_COLS); row[HT_OCTOPUS_COLS] = 0;
+ }
+ expression(row, i, octopus_eyes[frame], f);
+#ifdef DEVICE_LAYOUT_BENCH
+ if (!fast_scene)
+ ht_text(s, x, y + i * font->height, HT_OCTOPUS_COLS * font->width, font, ink, s->background, row);
+ else
+#endif
+ ht_ascii_text(s, x, y + i * font->height, HT_OCTOPUS_COLS * font->width,
+ font, ink, s->background, row, HT_OCTOPUS_COLS);
+ }
+}
+
+void ht_octopus_face(ht_scene_t *s, const ht_tim_face_t *f, uint8_t frame, uint16_t ink,
+ const char *recap)
+{
+ if (frame >= HT_OCTOPUS_FRAMES) frame = 0;
+ // The outcome owns the reading space after a turn. Artwork and its label
+ // move together above the recap; the status footer stays fixed.
+ bool result = recap && *recap;
+ bool brief = result && ht_octopus_short_recap(recap);
+ bool compact = f->focus || f->carrying;
+ const ht_font_t *font = result ? (brief ? &ht_octopus_font_6 : &ht_octopus_font_4) : compact ? &ht_octopus_font_8 : &ht_octopus_font_10;
+ int y = result ? (brief ? 78 : 72) : compact ? 113 : 98;
+ if (result && f->roomy_reading)
+ y = brief ? HT_OCTOPUS_BRIEF_Y : HT_OCTOPUS_READING_Y;
+ ht_octopus_portrait(s, f, frame, ink, font, y);
+ if (f->straight_title) recipient(s, f, ht_octopus_title_y(result, compact));
+ else ht_arc_title(s, f->primary_title ? f->foreground : f->dim, f->recipient);
+ // Keep slots stable through long titles and animation; damage stays local.
+ static const int reading_widths[] = {396, 396, 384, 372, 348, 324, 276};
+ static const int brief_widths[] = {372, 348, 324};
+ static const int roomy_widths[] = {408, 408, 396, 372, 348, 312};
+ if (result && f->roomy_reading) recap_lines(s,
+ brief ? HT_OCTOPUS_BRIEF_TEXT_Y : HT_OCTOPUS_READING_TEXT_Y,
+ brief ? 372 : 408, brief ? 3 : 6, false,
+ brief ? brief_widths : roomy_widths, f->foreground, recap);
+ else if (result) recap_lines(s, brief ? 252 : 194, brief ? 372 : 396,
+ brief ? 3 : 7, false, brief ? brief_widths : reading_widths, f->foreground, recap);
+ else lines(s, 337, 320, 1, &ht_mono_20, f->dim, compact ? f->detail : "", false, NULL);
+ if (!f->footer_action && !f->straight_title) ht_arc_status(s, f->ink, f->status);
+ else lines(s, f->footer_action ? 369 : 385, 276, 1, &ht_mono_20, f->ink, f->status, false, NULL);
+ lines(s, 417, 210, 1, &ht_mono_20, f->dim, f->hint, false, NULL);
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/octopus.h b/devices/harness-device/firmware/main/ui/habitat/octopus.h
new file mode 100644
index 000000000..d5ec0a5dc
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/octopus.h
@@ -0,0 +1,46 @@
+#pragma once
+#include "tim.h"
+
+enum { HT_OCTOPUS_FRAMES = 63, HT_OCTOPUS_COLS = 54, HT_OCTOPUS_ROWS = 27,
+ HT_OCTOPUS_DURATION = 5210 };
+// Shared by the reading compositor and its touch regions. The text ends above
+// the bottom arc; moving it must never make its target cover the portrait.
+enum { HT_OCTOPUS_BRIEF_Y = 96, HT_OCTOPUS_READING_Y = 92,
+ HT_OCTOPUS_BRIEF_TEXT_Y = 284, HT_OCTOPUS_READING_TEXT_Y = 224 };
+extern const ht_font_t ht_octopus_font_2, ht_octopus_font_4, ht_octopus_font_6, ht_octopus_font_8, ht_octopus_font_10;
+#ifdef DEVICE_LAYOUT_BENCH
+void ht_octopus_fast_scene(bool enabled);
+#endif
+typedef struct {
+ ht_tim_motion_t reaction;
+ uint32_t last_ms, next_ms;
+ uint16_t phase;
+ uint8_t frame, remainder, rate;
+ bool initialized, running;
+} ht_octopus_motion_t;
+
+// Wall-clock poses, no frame backlog. Pause the large body during touch and
+// microphone capture; only the small face reacts while recording.
+bool ht_octopus_motion_tick(ht_octopus_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, int x,
+ unsigned level, uint32_t activity);
+// The straight comparison title stays above either size of companion.
+static inline int ht_octopus_title_y(bool result, bool compact)
+{
+ (void)result; (void)compact;
+ return 41;
+}
+// A completed result gets tapered rows and a 108 px portrait (162 px for brief
+// results). Roomy reading uses six rows; the default preserves benchmark geometry. NULL keeps
+// the large working/listening face. The recap dismisses locally; the portrait
+// remains the voice surface.
+void ht_octopus_face(ht_scene_t *scene, const ht_tim_face_t *face, uint8_t frame, uint16_t ink,
+ const char *recap);
+// Portrait only for a local gesture preview; same immutable ASCII frames.
+void ht_octopus_portrait(ht_scene_t *scene, const ht_tim_face_t *face, uint8_t frame, uint16_t ink,
+ const ht_font_t *font, int y);
+// Three centered text rows, word-boundary
+// clipping, and one spaced desktop arrow on every nonempty summary.
+void ht_recap_lines(ht_scene_t *scene, int y, uint16_t ink, const char *recap);
+// Short answers borrow spare reading space for a larger, still-secondary companion.
+bool ht_octopus_short_recap(const char *recap);
diff --git a/devices/harness-device/firmware/main/ui/habitat/octopus_art.inc b/devices/harness-device/firmware/main/ui/habitat/octopus_art.inc
new file mode 100644
index 000000000..831770fa0
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/octopus_art.inc
@@ -0,0 +1,1093 @@
+// Generated by scripts/gen_octopus.py. Do not edit.
+// Adapted from ferrebarrat/brrtfetch, gifs/defaults/brrt.gif.
+// Exact approved gallery text frames; see prototype/habitat/CREATURE_GALLERY_02.md.
+// Shared rows, lossless nibble RLE. No images or runtime conversion.
+static const uint8_t octopus_data[] = {
+ 240,240,240,80,240,48,179,4,240,64,240,0,4,5,6,39,129,9,8,6,3,240,16,224,
+ 4,8,87,177,2,6,3,4,224,192,4,5,9,39,209,39,1,2,8,3,208,192,5,9,
+ 1,7,241,17,7,17,2,6,4,192,176,6,2,241,145,8,3,176,176,6,2,49,2,22,
+ 2,113,2,22,9,81,8,3,176,176,4,6,9,33,8,4,7,8,6,81,22,7,4,8,
+ 49,2,8,4,192,192,3,6,9,17,2,38,8,81,9,38,9,33,2,8,3,208,64,6,
+ 9,24,3,48,4,6,8,2,49,9,5,2,49,8,6,65,9,8,5,48,25,8,9,4,
+ 80,16,3,8,1,6,3,16,24,64,5,6,8,2,49,6,53,9,33,2,9,6,5,4,
+ 64,9,5,4,5,2,9,6,48,16,8,7,1,5,32,20,80,20,3,8,25,97,2,25,
+ 5,4,3,96,3,4,16,9,23,48,16,6,23,9,5,4,96,4,37,24,22,120,6,24,
+ 6,3,5,3,4,96,4,2,23,48,32,4,23,1,9,86,24,4,8,2,1,2,24,18,
+ 1,7,50,6,2,1,2,6,3,6,8,86,8,1,7,9,5,48,48,4,3,8,23,18,
+ 23,6,3,5,2,1,23,3,8,2,17,23,2,33,2,3,8,17,2,8,6,23,1,9,
+ 23,2,3,20,64,112,70,2,17,7,2,6,16,8,17,7,2,25,23,17,4,6,2,7,
+ 17,2,86,5,112,80,3,9,1,23,2,23,9,3,5,4,32,8,17,7,6,16,23,17,
+ 4,0,4,5,3,9,55,2,7,1,18,6,3,64,80,6,7,2,3,160,8,1,7,2,
+ 5,16,2,23,1,4,176,3,2,7,9,5,48,80,6,7,21,3,32,4,5,8,3,32,
+ 8,23,4,48,2,7,1,4,0,4,24,5,128,23,9,48,112,9,8,6,32,5,1,3,
+ 32,4,9,23,4,48,9,23,3,4,16,4,8,2,48,8,6,5,8,1,6,64,208,5,
+ 23,6,5,8,1,7,2,5,64,3,8,23,2,6,5,1,7,2,64,3,21,96,208,20,
+ 9,1,7,1,9,5,128,4,9,1,7,1,9,5,4,224,240,0,3,5,8,39,129,9,
+ 8,6,3,240,16,224,4,8,71,209,8,3,4,224,192,3,6,9,39,209,39,1,2,8,
+ 3,208,176,4,6,9,33,9,4,7,8,6,81,22,7,4,8,49,2,8,4,192,48,4,
+ 8,41,3,4,32,3,6,8,2,49,2,5,2,33,2,8,6,65,8,6,5,48,3,41,
+ 3,4,64,16,3,9,1,6,4,16,6,5,64,5,6,8,2,49,6,53,9,33,2,9,
+ 6,5,4,64,6,3,4,3,18,8,48,16,8,7,1,3,160,36,24,9,97,2,24,5,
+ 20,160,2,23,48,16,6,1,7,9,5,4,96,4,37,24,22,120,6,24,6,3,6,3,
+ 4,96,4,1,7,1,48,32,4,23,1,8,86,8,9,4,8,2,1,2,24,17,23,2,
+ 17,2,6,2,1,2,6,3,6,9,86,8,1,7,8,3,48,48,20,8,23,18,23,6,
+ 21,2,1,23,4,8,2,17,23,49,2,3,8,7,1,2,8,6,23,1,9,23,2,3,
+ 4,80,80,4,86,2,17,7,2,6,16,8,17,7,2,25,23,17,4,6,2,7,17,2,
+ 86,5,112,64,8,2,1,7,17,39,9,19,4,32,8,17,7,6,16,23,17,4,0,4,
+ 19,9,55,2,7,1,18,6,3,64,64,1,7,2,192,8,1,7,2,5,16,2,23,1,
+ 4,176,4,2,9,1,5,4,32,64,7,1,21,4,160,8,23,4,48,2,7,1,4,208,
+ 5,7,1,5,32,80,3,9,8,3,32,4,25,8,32,4,9,23,4,48,9,23,3,4,
+ 16,41,48,3,9,5,6,9,2,3,48,192,5,7,1,16,3,6,23,2,5,64,3,8,
+ 23,9,5,16,9,7,80,37,80,208,5,18,1,7,1,9,3,128,4,9,1,7,1,18,
+ 8,224,240,48,184,5,4,240,48,240,4,6,2,55,161,2,8,4,240,0,208,4,5,87,
+ 161,23,1,9,6,3,224,192,5,8,1,39,225,23,17,2,6,208,176,3,8,2,241,113,
+ 9,3,4,176,176,5,9,49,9,3,6,9,2,81,2,9,8,3,8,65,2,6,3,176,
+ 64,5,38,4,32,5,8,2,17,9,4,2,21,81,6,3,1,4,8,49,2,6,4,32,
+ 5,22,96,32,4,9,8,6,19,8,5,16,4,3,8,33,66,65,2,9,34,33,9,6,
+ 4,32,9,6,5,8,9,5,64,16,6,7,1,5,112,4,3,6,9,2,33,2,6,72,
+ 6,8,49,9,6,5,3,112,2,23,48,16,6,7,1,5,144,4,5,6,8,49,73,2,
+ 33,9,8,6,20,128,2,23,48,32,4,7,1,6,128,52,22,8,98,9,22,3,52,96,
+ 4,3,7,8,64,48,8,23,9,84,3,37,8,2,9,24,105,8,6,9,2,8,4,22,
+ 5,84,6,7,9,5,64,64,4,9,23,1,23,8,54,2,1,7,9,8,9,17,23,2,
+ 17,2,8,9,2,1,2,5,22,2,23,1,23,1,4,96,64,4,3,69,34,17,7,1,
+ 8,0,8,17,55,49,4,9,7,1,7,1,2,1,6,21,6,35,96,32,3,8,2,23,
+ 1,55,9,8,2,8,3,4,16,8,33,8,19,23,17,36,8,2,24,55,1,39,2,8,
+ 5,48,32,8,7,2,6,3,4,51,4,96,8,17,7,6,16,23,17,4,80,51,4,35,
+ 5,23,9,3,16,32,9,7,3,5,8,192,8,23,5,4,16,5,1,7,1,4,240,8,
+ 7,1,4,0,32,4,5,9,8,5,192,8,23,4,48,2,7,1,4,176,6,8,4,3,
+ 9,7,4,16,240,64,9,23,4,48,1,7,1,4,192,4,6,8,6,48,192,24,5,48,
+ 5,1,7,2,4,48,8,23,6,3,32,3,6,9,3,192,192,2,1,9,22,9,2,7,
+ 9,5,96,4,8,23,2,6,5,8,2,7,3,192,208,3,6,56,3,4,144,3,5,8,
+ 9,24,6,224,240,80,20,80,20,240,80,240,0,4,3,5,39,129,9,6,5,4,240,16,
+ 240,5,1,71,177,2,5,4,240,192,4,5,8,39,209,39,1,9,6,4,208,192,5,9,
+ 1,23,241,1,7,17,2,6,4,192,176,5,9,241,129,2,6,3,176,176,6,2,49,2,
+ 9,8,2,113,2,24,2,81,8,3,176,64,5,41,3,16,3,8,9,33,8,4,7,9,
+ 8,81,24,7,4,8,49,2,8,3,4,16,8,25,4,80,32,4,2,1,8,4,64,3,
+ 6,9,17,9,37,6,81,8,37,9,33,2,9,5,32,5,20,5,1,2,6,48,32,3,
+ 23,6,96,3,6,9,2,49,2,6,65,9,8,65,9,8,5,112,1,23,48,32,3,7,
+ 1,6,112,4,5,6,9,2,33,2,69,8,2,33,2,8,6,3,128,17,9,48,64,23,
+ 6,128,35,25,2,113,25,6,19,128,3,9,7,8,64,64,9,23,5,4,80,5,19,5,
+ 38,120,38,5,3,5,3,80,5,9,7,5,4,64,80,5,2,7,17,7,41,8,5,8,
+ 9,17,24,18,17,34,9,6,17,2,3,4,6,25,33,23,9,4,96,112,8,22,72,17,
+ 23,5,8,9,1,2,23,2,17,2,9,5,2,7,1,2,9,40,6,5,8,3,128,16,
+ 4,3,9,2,17,2,33,7,18,7,2,3,4,3,0,8,17,23,17,7,33,4,6,2,
+ 8,17,9,7,33,2,17,18,8,3,48,0,5,2,7,8,6,8,9,5,56,4,96,8,
+ 17,7,6,16,23,17,4,80,56,6,24,6,8,1,7,8,4,16,0,2,7,1,3,4,
+ 224,8,1,23,5,16,39,1,4,224,4,5,7,1,8,0,16,3,22,3,224,8,23,4,
+ 48,2,7,1,4,192,4,6,20,8,7,8,0,240,64,8,23,4,48,2,7,1,4,208,
+ 3,8,9,2,3,4,0,240,64,8,23,4,48,2,7,1,4,240,64,192,2,9,3,0,
+ 4,3,5,1,7,9,4,80,5,23,9,6,3,0,4,5,7,3,192,192,5,9,1,2,
+ 1,23,8,3,144,6,2,23,34,6,4,192,224,68,208,68,224,240,48,182,3,4,240,48,
+ 240,0,5,8,2,39,129,18,9,6,4,240,0,208,4,3,1,71,161,23,1,9,6,4,
+ 224,192,3,8,2,39,225,23,1,2,9,5,208,176,4,6,9,241,97,2,8,3,192,64,
+ 35,48,6,2,49,9,3,5,9,113,9,5,3,8,81,6,3,48,4,96,32,4,9,1,
+ 9,5,20,32,5,8,2,17,8,4,7,6,5,81,6,5,7,4,8,49,2,6,64,3,
+ 6,1,9,5,48,32,3,23,6,80,4,5,8,17,2,57,81,2,41,2,33,9,6,4,
+ 96,2,23,48,32,3,7,1,6,96,4,5,6,9,2,33,9,5,73,22,49,2,22,3,
+ 112,2,23,48,48,3,7,1,5,112,3,5,8,9,49,72,2,33,2,8,6,3,4,96,
+ 4,6,7,9,4,48,64,2,7,1,3,96,52,22,8,114,22,5,36,96,3,8,7,9,
+ 5,64,80,9,7,2,8,86,3,5,6,25,8,6,120,6,25,8,4,3,5,86,17,9,
+ 96,80,4,3,7,2,1,7,53,9,18,1,2,24,17,23,2,17,2,6,18,1,25,6,
+ 21,9,2,9,1,8,3,112,16,20,88,6,8,17,23,2,17,2,0,8,2,1,39,49,
+ 2,4,8,1,8,23,17,9,104,6,3,48,0,8,2,1,18,7,1,9,39,1,3,21,
+ 3,48,8,33,8,21,23,17,4,32,21,3,6,1,7,17,9,17,2,23,9,3,16,0,
+ 7,1,9,240,0,8,17,7,6,4,0,23,17,4,224,4,5,2,7,1,3,0,3,21,
+ 240,0,8,23,8,3,16,8,1,7,1,4,224,4,21,7,1,5,240,64,8,23,4,48,
+ 2,7,1,4,224,3,5,6,5,16,192,19,64,5,1,7,8,64,5,2,7,8,5,4,
+ 32,4,5,208,192,8,2,9,3,6,9,2,7,9,3,96,4,3,23,1,9,3,5,9,
+ 7,4,192,224,5,8,25,8,192,3,6,40,5,224,240,32,4,178,6,3,4,240,32,240,
+ 3,9,71,177,9,3,4,240,208,4,5,71,177,23,1,2,8,5,224,192,5,9,1,23,
+ 241,23,17,2,6,4,192,176,5,8,2,241,113,9,5,4,176,176,6,2,65,18,145,18,
+ 97,8,3,176,176,5,9,2,33,8,4,41,81,41,4,8,65,9,5,4,176,16,4,3,
+ 25,5,80,5,8,2,17,8,4,8,3,5,81,6,3,8,4,8,49,2,6,112,6,8,
+ 48,16,8,7,5,4,112,3,6,2,65,2,9,65,2,9,65,2,8,5,128,4,5,7,
+ 3,16,16,9,7,6,4,112,4,3,6,8,2,33,2,8,70,8,9,33,2,9,6,5,
+ 4,128,3,8,7,3,16,16,6,23,9,6,4,112,4,21,6,34,1,66,17,18,8,6,
+ 5,4,128,4,8,1,7,4,32,32,4,9,7,1,9,3,4,80,3,4,19,22,8,105,
+ 8,22,5,3,4,3,4,80,4,5,9,7,2,6,48,64,3,9,7,2,105,4,5,8,
+ 18,24,25,2,73,6,18,9,20,6,89,2,1,7,5,4,64,48,181,33,7,24,9,17,
+ 23,2,17,2,24,2,7,17,8,21,35,21,3,5,3,4,64,0,8,9,2,1,23,1,
+ 135,8,5,6,0,8,17,55,49,4,3,8,1,23,1,55,1,23,1,7,2,24,4,16,
+ 0,7,9,3,0,4,16,4,80,20,48,8,33,6,16,23,17,4,16,36,0,20,96,8,
+ 1,9,7,1,5,0,5,3,240,16,8,23,8,3,16,8,1,7,1,4,240,4,8,17,
+ 5,240,48,2,7,1,4,64,4,5,7,1,5,240,36,0,240,48,1,7,1,96,3,23,
+ 6,240,48,240,48,1,7,1,96,5,23,6,240,48,240,48,1,7,1,96,3,7,1,6,
+ 240,48,240,16,4,3,7,1,8,96,4,2,7,8,3,240,32,208,5,9,16,6,7,6,
+ 4,144,5,2,1,6,4,5,8,224,224,4,9,2,9,8,208,3,1,9,24,224,240,16,
+ 20,33,130,6,5,20,240,16,240,3,2,71,177,9,5,4,240,208,3,6,71,177,23,1,
+ 2,8,5,224,176,5,9,2,241,113,2,5,4,176,176,6,2,65,18,145,34,81,8,3,
+ 176,176,3,8,2,33,8,4,2,25,81,9,8,2,4,8,65,9,5,4,176,16,4,5,
+ 25,6,80,5,8,2,17,9,4,6,3,5,81,6,3,6,4,8,33,2,9,6,112,6,
+ 9,4,32,16,8,7,3,4,112,3,6,2,65,2,8,65,25,65,2,8,5,144,5,7,
+ 3,16,16,9,7,6,4,112,20,6,8,9,33,2,9,69,8,9,33,2,8,6,5,4,
+ 128,3,8,7,5,16,16,6,1,7,2,6,4,128,3,21,34,113,18,8,21,4,128,4,
+ 8,23,48,32,4,8,23,9,5,4,80,35,5,22,8,105,8,22,5,3,4,3,4,80,
+ 3,6,2,7,2,6,48,64,4,8,7,2,105,3,6,9,18,24,98,9,6,2,1,9,
+ 19,6,105,2,7,5,4,64,32,4,6,149,6,17,23,6,8,9,1,2,23,2,17,2,
+ 8,6,2,7,17,8,149,3,64,0,9,34,23,2,71,1,39,8,21,0,8,17,55,49,
+ 4,3,6,1,23,1,55,2,23,2,23,18,9,5,0,0,7,9,4,240,0,8,1,23,
+ 5,16,23,17,4,240,4,8,23,5,0,3,4,240,0,6,2,23,6,4,16,6,1,7,
+ 1,8,3,224,4,37,4,240,48,1,23,96,3,7,1,6,240,48,240,16,4,3,7,2,
+ 6,96,4,9,7,9,5,240,32,208,3,9,20,6,7,5,4,144,3,9,7,8,4,6,
+ 8,224,240,8,9,8,6,208,4,2,24,6,224,240,16,4,3,33,130,6,5,20,240,16,
+ 176,3,8,2,33,9,4,41,81,9,8,2,4,8,65,9,5,4,176,192,5,8,2,17,
+ 9,4,8,3,5,81,6,3,8,4,8,33,2,9,6,208,0,19,5,144,3,6,2,65,
+ 2,8,65,25,65,2,8,5,160,4,32,0,7,9,5,144,4,3,6,8,9,33,2,9,
+ 69,8,9,33,2,8,6,5,4,144,3,6,17,0,0,7,1,8,4,176,3,21,34,113,
+ 18,8,21,4,176,4,5,7,1,4,0,8,1,7,2,6,3,128,51,22,8,105,8,22,
+ 5,3,4,3,4,128,3,8,1,7,9,3,0,16,4,6,23,1,9,83,5,6,3,6,
+ 9,1,2,24,98,9,6,2,1,9,3,38,83,5,9,23,1,3,32,32,4,5,6,5,
+ 3,7,17,39,2,22,2,1,7,6,8,9,17,23,2,17,2,8,6,9,17,5,6,9,
+ 39,1,23,2,6,4,21,4,32,16,5,1,9,8,2,9,0,4,35,21,8,1,7,2,
+ 5,0,8,17,55,49,4,9,7,17,9,8,3,5,3,4,3,5,6,17,41,2,3,0,
+ 16,3,6,3,0,6,1,7,33,7,1,23,1,3,16,5,9,1,7,9,3,16,1,23,
+ 1,6,4,3,7,9,1,55,1,39,1,4,0,3,8,9,4,0,112,38,5,8,6,8,
+ 6,32,4,1,7,1,6,64,5,9,7,1,9,6,16,5,54,5,8,6,5,112,240,16,
+ 6,7,1,6,144,1,7,2,5,4,240,0,240,16,6,7,3,176,2,7,1,240,16,240,
+ 16,8,7,3,176,2,7,1,240,16,240,16,8,7,4,176,2,7,1,240,16,240,16,8,
+ 7,5,4,144,4,2,7,2,240,16,240,16,3,9,7,6,144,17,2,240,32,240,0,6,
+ 9,2,6,4,144,5,9,2,9,4,240,0,176,5,9,49,9,3,6,9,2,81,2,9,
+ 6,3,8,65,2,6,3,176,192,5,8,2,17,8,4,2,21,81,6,5,1,4,8,49,
+ 2,6,208,192,4,3,8,33,66,65,2,9,34,33,9,6,4,208,208,4,5,6,9,2,
+ 33,2,6,72,6,8,49,9,6,5,3,224,240,4,5,6,8,49,73,2,33,9,8,6,
+ 3,4,240,3,1,8,192,3,20,3,22,8,98,9,22,5,52,192,6,8,3,4,7,9,
+ 3,144,4,37,8,18,24,105,8,6,9,2,8,4,6,21,176,1,7,5,0,18,1,7,
+ 114,41,3,9,1,7,9,8,9,17,23,2,17,2,8,9,2,1,2,3,6,194,1,9,
+ 3,32,4,6,4,6,2,9,24,25,3,0,4,2,7,1,9,0,8,17,55,33,2,4,
+ 9,7,1,9,5,4,41,6,2,41,2,9,5,4,32,80,20,80,4,5,7,1,8,4,
+ 9,1,23,1,6,19,23,17,2,24,7,1,9,5,80,3,18,5,64,80,6,1,6,4,
+ 32,4,8,7,2,3,5,2,39,9,64,6,1,23,1,9,0,23,2,6,4,16,3,6,
+ 8,9,4,80,80,5,9,7,1,34,1,9,5,0,9,1,7,2,6,4,96,4,5,1,
+ 23,1,9,21,7,1,2,9,23,2,112,240,5,23,6,192,3,8,23,9,240,240,2,7,
+ 2,240,3,7,1,240,240,2,7,2,240,5,7,2,240,240,4,18,8,4,176,4,3,7,
+ 2,6,240,240,16,3,24,3,160,5,9,8,4,240,0,240,48,181,3,4,240,48,240,0,
+ 3,6,9,39,129,2,9,8,5,240,16,208,20,2,71,161,23,1,8,5,4,224,192,3,
+ 6,2,39,209,39,1,2,9,5,208,176,4,6,9,1,7,241,65,2,8,4,192,176,6,
+ 2,49,9,21,9,113,2,21,9,81,8,3,176,192,5,9,33,8,4,7,6,5,81,22,
+ 7,4,8,49,2,6,4,192,192,4,5,8,17,2,40,9,81,9,40,2,33,2,8,3,
+ 208,208,4,5,8,2,49,9,5,66,8,6,49,2,8,6,5,224,240,3,6,8,9,49,
+ 70,2,33,2,9,6,3,4,240,240,52,24,9,97,2,24,5,20,240,16,8,2,6,144,
+ 3,5,3,6,5,6,25,8,6,120,6,25,8,3,6,37,4,144,24,3,9,1,9,4,
+ 64,5,40,2,23,4,8,2,1,2,24,17,23,2,17,2,6,2,1,2,8,3,9,7,
+ 1,9,24,96,4,17,5,0,6,2,23,2,1,23,18,7,1,5,0,4,2,1,7,1,
+ 4,8,2,17,23,49,2,4,9,7,1,9,5,4,0,17,9,23,1,18,17,7,2,6,
+ 4,16,4,35,5,22,4,48,3,6,7,2,5,0,8,2,1,23,2,24,23,17,24,9,
+ 7,1,8,5,48,37,6,53,32,208,6,1,5,6,9,2,1,23,1,3,32,4,2,39,
+ 2,9,5,7,1,9,4,208,208,4,3,2,39,9,5,112,3,9,55,8,5,3,8,4,
+ 192,176,8,4,5,23,9,5,3,176,4,3,5,8,39,8,4,192,128,3,6,9,7,21,
+ 23,6,4,240,16,9,7,1,4,21,160,128,53,20,5,7,2,9,6,208,4,5,8,1,
+ 7,5,0,3,5,160,240,0,8,25,208,5,18,6,4,224,240,4,8,2,55,161,2,8,
+ 20,240,208,4,5,87,161,23,1,2,6,3,224,176,5,9,49,9,4,6,9,2,81,2,
+ 9,6,4,8,65,2,6,3,176,192,5,8,2,17,8,4,2,21,81,6,3,2,4,8,
+ 49,2,6,4,192,208,4,3,6,9,2,33,2,6,72,6,8,49,9,6,5,3,224,240,
+ 52,22,8,98,9,22,5,52,240,36,144,38,21,8,18,24,105,8,6,9,2,8,4,54,
+ 4,144,20,0,2,1,8,64,4,8,2,1,18,17,3,9,1,7,9,8,9,17,23,2,
+ 17,2,8,9,2,1,2,5,9,7,2,1,18,36,64,18,5,5,17,2,9,8,2,55,
+ 9,8,4,0,4,2,7,1,8,0,8,17,55,33,2,4,9,7,17,9,5,0,8,9,
+ 8,23,2,22,21,9,7,1,3,16,3,22,21,6,5,4,48,5,2,7,8,5,3,2,
+ 1,23,1,6,19,23,17,9,22,23,1,2,4,32,8,21,8,22,24,4,16,208,4,19,
+ 8,9,1,39,8,64,6,1,23,2,9,4,21,6,4,208,192,5,8,9,23,1,8,2,
+ 5,112,4,5,55,1,2,9,5,4,192,192,2,7,1,8,1,6,208,3,5,6,55,9,
+ 3,176,144,4,3,16,5,2,8,6,3,240,0,3,6,8,7,8,4,176,160,3,48,21,
+ 3,240,0,3,37,4,192,240,0,4,5,8,39,129,9,8,6,3,240,16,224,4,8,87,
+ 193,8,3,4,224,208,3,6,8,2,49,9,5,2,49,24,65,24,5,224,240,5,6,8,
+ 2,49,6,53,9,33,2,9,6,5,4,240,240,0,4,19,24,9,97,2,9,8,5,19,
+ 240,16,0,2,1,9,8,3,4,112,4,6,21,24,22,120,6,24,6,3,6,3,4,96,
+ 4,6,8,9,7,3,16,0,24,9,7,1,2,102,8,9,4,8,2,1,2,24,1,2,
+ 23,2,17,2,6,2,1,2,6,3,6,9,86,8,2,39,8,4,16,48,19,8,23,17,
+ 23,6,21,2,1,23,3,8,2,17,23,49,2,3,9,17,2,8,6,39,2,39,51,48,
+ 128,3,38,2,17,7,2,6,16,8,17,7,1,25,23,17,4,6,2,7,17,2,70,4,
+ 128,112,9,2,55,2,3,5,4,16,8,2,23,5,4,16,23,17,4,0,4,5,3,9,
+ 71,1,2,6,112,112,23,9,16,3,38,20,3,39,8,64,8,1,7,8,3,16,37,32,
+ 3,23,9,112,112,7,2,21,19,7,2,5,6,9,23,8,3,96,5,1,7,2,6,0,
+ 8,18,32,4,23,9,112,128,6,25,5,0,1,55,9,176,8,2,1,39,1,0,25,2,
+ 1,5,128,208,3,5,6,5,3,224,4,22,5,3,0,37,160,224,4,6,87,177,2,6,
+ 3,240,176,4,6,9,33,8,4,7,8,6,81,8,6,7,4,8,49,2,8,4,192,192,
+ 3,6,9,17,2,38,8,81,8,38,9,33,2,8,5,208,208,3,6,8,2,49,2,5,
+ 65,8,6,65,9,8,5,224,16,5,9,24,5,144,4,19,8,25,97,2,25,5,19,128,
+ 4,6,8,9,8,48,16,6,7,2,8,5,4,96,4,37,6,8,22,120,6,8,22,3,
+ 5,3,80,4,3,8,2,23,48,16,3,6,119,1,7,1,2,4,8,2,17,24,18,1,
+ 7,50,6,2,1,2,6,3,6,2,1,7,17,71,9,5,48,64,20,51,5,1,6,21,
+ 9,1,23,3,8,2,17,23,2,33,9,3,8,17,2,8,6,2,8,6,3,5,19,0,
+ 4,80,112,70,2,17,7,2,6,16,8,17,7,1,18,23,17,4,6,1,7,17,2,5,
+ 70,5,112,80,5,9,1,23,1,23,2,3,5,4,32,8,17,7,6,16,23,17,4,0,
+ 4,5,3,9,55,1,23,1,8,96,80,8,7,1,3,160,9,23,5,4,16,9,23,1,
+ 4,160,8,1,7,5,4,64,80,8,7,6,5,3,16,9,40,4,16,9,23,3,64,9,
+ 23,6,3,16,9,8,6,5,64,8,7,1,5,64,96,4,25,6,16,23,2,19,9,7,
+ 1,6,4,80,4,5,2,7,1,9,5,3,8,1,7,3,4,8,25,2,1,96,192,5,
+ 9,55,8,4,160,6,2,71,5,4,0,4,22,3,112,224,52,208,20,19,20,224,240,0,
+ 3,6,8,39,129,2,9,8,5,240,16,224,4,9,71,161,23,1,8,5,4,224,192,3,
+ 6,9,39,209,39,1,2,9,3,208,176,4,6,9,1,7,241,17,7,17,2,8,4,192,
+ 192,3,5,8,17,2,40,9,81,9,40,2,33,2,8,3,208,64,4,6,41,6,32,4,
+ 5,8,2,97,9,3,6,97,2,8,6,5,48,2,25,2,3,80,64,23,2,0,9,8,
+ 64,3,6,8,9,65,2,6,8,65,2,9,6,3,4,64,2,21,2,7,8,64,64,23,
+ 1,4,3,4,80,36,24,9,97,2,24,5,20,96,3,4,5,1,7,8,64,64,5,2,
+ 23,9,86,21,6,40,6,120,6,40,3,118,2,23,6,3,64,80,20,3,17,9,23,1,
+ 2,4,8,2,1,2,24,17,23,2,17,2,6,2,1,2,8,3,8,39,1,2,7,8,
+ 3,4,96,176,8,38,1,23,1,4,8,2,17,23,49,2,4,8,7,17,9,22,4,192,
+ 48,3,9,18,49,7,18,7,1,9,5,16,8,17,7,2,24,23,17,4,5,9,7,1,
+ 2,17,2,1,66,19,4,48,32,4,1,7,1,6,9,22,9,8,3,96,8,17,7,6,
+ 16,23,17,4,64,5,41,8,6,9,8,6,7,1,8,48,32,3,7,8,3,4,192,8,
+ 1,7,2,5,16,9,23,1,4,208,4,1,7,2,4,16,32,4,6,9,18,192,8,23,
+ 4,48,2,7,1,4,160,21,0,3,23,5,32,80,20,64,8,25,48,3,2,23,4,48,
+ 2,23,3,4,16,25,8,3,48,4,6,9,2,6,3,48,192,1,2,5,16,3,6,23,
+ 2,5,64,3,8,23,9,5,16,3,9,7,3,192,192,6,2,7,9,1,7,1,9,3,
+ 128,4,9,2,23,2,23,9,4,192,240,240,16,4,5,8,6,3,224,240,4,8,2,55,
+ 161,2,8,3,4,240,192,5,8,1,23,241,23,17,2,6,208,176,5,9,2,33,9,4,
+ 6,9,2,81,2,9,6,4,8,65,2,6,3,176,128,37,0,5,8,2,17,8,4,2,
+ 21,81,6,3,2,4,8,49,2,6,4,3,22,4,128,96,4,8,34,0,4,3,8,2,
+ 17,50,33,18,1,66,33,9,6,4,0,6,8,1,2,8,112,96,4,23,8,4,16,4,
+ 3,6,9,2,81,9,4,5,97,9,6,5,3,32,4,2,23,112,96,4,7,1,6,64,
+ 4,5,6,8,65,2,9,2,65,9,8,6,3,4,64,6,23,112,96,4,7,1,9,69,
+ 52,22,8,98,9,22,5,36,3,53,8,1,7,2,112,112,3,6,2,55,1,21,8,18,
+ 24,105,8,6,9,2,8,4,5,2,55,2,8,3,128,144,5,2,53,9,2,1,7,9,
+ 8,9,17,23,2,17,2,24,2,17,6,5,19,4,0,4,160,32,20,6,88,17,23,1,
+ 9,24,0,8,17,55,49,4,9,7,2,23,17,9,86,3,20,48,0,3,8,17,9,2,
+ 1,2,33,2,3,36,48,8,33,8,19,23,17,4,0,20,35,55,2,1,23,33,6,4,
+ 16,0,1,7,8,4,240,8,17,7,6,16,23,17,4,224,3,6,7,2,8,0,0,3,
+ 6,24,4,224,8,23,5,4,16,5,1,7,1,4,192,3,4,0,4,8,7,9,0,240,
+ 64,8,23,4,48,2,7,1,4,192,3,6,9,2,9,5,16,240,64,8,23,4,48,1,
+ 7,1,4,240,64,192,8,6,64,5,1,23,4,48,2,23,5,4,48,5,224,192,17,9,
+ 5,6,9,1,7,2,5,96,3,2,23,9,3,20,5,7,3,192,208,3,6,56,3,4,
+ 144,5,6,8,7,17,2,6,4,192,240,0,20,3,39,129,8,5,3,4,240,16,240,3,
+ 2,71,177,2,5,4,240,192,4,3,8,71,177,39,1,9,6,4,208,176,5,9,2,241,
+ 113,2,6,4,176,176,6,2,49,2,25,2,129,25,2,81,8,3,176,176,3,8,2,33,
+ 8,4,1,9,8,81,9,8,1,4,8,65,9,3,4,176,128,5,9,2,0,5,8,2,
+ 17,9,3,21,6,81,6,3,6,3,8,33,2,9,6,0,6,2,5,4,128,96,4,2,
+ 1,9,5,16,3,6,9,113,2,8,9,113,9,8,5,16,4,5,1,2,8,112,96,4,
+ 23,8,48,4,6,8,9,81,9,4,5,81,2,8,6,3,4,32,4,2,23,112,96,4,
+ 7,2,6,4,64,3,21,9,18,113,18,6,21,4,48,4,3,9,7,1,112,112,8,23,
+ 9,56,5,19,5,38,120,22,5,19,5,6,40,2,23,9,5,112,128,4,6,1,23,2,
+ 9,3,6,9,1,2,24,98,9,6,2,1,2,19,8,1,23,9,5,4,144,176,54,17,
+ 23,5,8,9,1,2,23,2,17,2,9,5,2,7,17,9,22,4,192,16,5,8,25,18,
+ 9,34,1,2,1,7,2,5,19,0,8,17,71,33,4,6,1,9,7,1,2,1,34,9,
+ 18,25,6,3,48,0,2,1,18,8,9,2,6,25,2,9,4,96,8,17,7,6,16,23,
+ 17,4,64,4,9,18,9,6,9,2,8,2,1,7,1,5,4,0,0,7,1,8,240,0,
+ 8,17,7,6,16,23,17,4,224,3,5,8,7,1,3,240,64,8,23,4,48,2,7,1,
+ 4,192,4,5,3,5,9,7,6,0,240,64,8,23,4,48,2,7,1,4,224,24,6,32,
+ 192,6,5,64,5,1,23,4,48,2,7,1,5,4,240,48,192,18,8,5,6,9,2,7,
+ 2,6,4,64,4,5,23,2,8,4,0,4,5,1,4,192,208,5,24,25,8,3,4,144,
+ 6,2,23,34,8,4,192,240,240,0,20,35,4,224,240,48,179,20,240,48,240,0,3,5,
+ 8,39,129,2,9,6,3,240,16,224,4,8,71,177,7,1,8,5,4,224,80,4,6,1,
+ 2,6,0,4,6,9,33,8,4,7,8,6,81,22,7,4,8,49,2,8,4,0,4,2,
+ 9,3,112,80,8,7,1,5,32,3,6,9,17,2,38,8,81,9,38,9,33,2,8,3,
+ 32,8,23,112,80,8,7,2,3,48,3,6,8,2,97,9,3,6,113,8,6,5,64,2,
+ 7,112,80,8,7,9,3,80,5,6,8,9,65,2,6,8,65,2,9,6,5,4,64,4,
+ 2,7,112,80,8,7,2,6,3,80,36,24,9,97,2,24,5,20,80,4,2,23,112,80,
+ 3,8,7,1,9,37,19,21,6,24,22,120,6,24,6,3,21,3,5,38,7,1,9,112,
+ 128,8,1,39,2,21,8,2,1,2,24,17,23,18,1,2,6,2,1,2,6,4,5,17,
+ 7,2,9,8,3,128,16,3,21,3,112,3,8,2,1,23,3,8,2,17,23,49,2,3,
+ 8,17,9,6,4,224,0,8,18,8,1,7,1,6,21,3,8,2,1,23,1,8,16,8,
+ 17,7,2,25,23,17,4,0,3,2,23,17,18,9,17,2,8,41,8,4,16,0,2,9,
+ 3,16,3,6,71,8,5,6,5,4,32,8,17,7,6,16,8,23,1,4,32,22,8,39,
+ 1,9,6,5,2,22,9,7,1,6,0,240,64,8,1,7,2,5,32,8,1,7,2,5,
+ 208,3,5,6,7,6,0,240,64,8,23,4,64,3,7,1,6,208,4,21,3,16,240,64,
+ 8,23,4,64,5,23,6,240,48,240,64,8,23,4,64,3,23,6,240,48,240,64,9,23,
+ 4,64,3,23,6,240,48,208,8,9,4,3,5,6,17,9,96,4,2,7,9,3,240,32,
+ 208,3,5,2,1,2,21,4,144,5,2,7,9,6,8,5,224,240,240,16,4,19,4,240,
+ 240,4,6,9,1,39,145,18,6,4,240,0,208,4,3,87,161,23,1,9,6,3,224,192,
+ 5,8,1,39,225,23,17,2,5,208,192,5,9,2,17,8,4,1,21,81,6,5,1,4,
+ 8,49,2,6,4,32,35,96,48,3,7,2,9,64,4,5,8,17,2,41,2,33,2,17,
+ 2,41,2,33,9,6,4,48,5,9,7,8,3,64,48,23,8,96,4,5,6,9,2,81,
+ 9,4,5,97,2,6,5,3,80,5,1,7,9,64,48,23,8,128,4,5,24,65,2,9,
+ 2,65,9,8,6,3,4,96,5,1,7,8,64,48,6,1,7,9,4,96,52,22,8,98,
+ 9,22,5,52,64,4,5,2,7,9,3,64,64,8,1,7,2,88,6,3,5,6,25,24,
+ 105,8,6,25,8,4,22,24,22,24,1,7,6,96,80,4,5,7,18,39,9,3,9,2,
+ 17,9,8,9,17,23,2,17,2,6,9,2,1,2,3,9,39,1,2,7,8,3,112,32,
+ 4,24,6,64,3,6,9,23,1,25,0,8,17,55,33,2,4,9,7,17,9,5,64,19,
+ 0,36,48,32,8,3,9,1,2,19,5,9,17,23,6,3,32,8,17,7,8,21,23,17,
+ 9,6,8,7,97,23,1,7,1,23,2,5,4,0,32,4,16,5,2,23,2,8,2,3,
+ 96,8,17,7,6,32,8,1,7,1,8,3,16,3,8,25,24,37,6,0,20,8,7,1,
+ 3,112,19,4,144,8,23,6,4,48,4,6,23,1,4,192,5,9,17,3,240,64,8,23,
+ 4,112,2,7,2,240,16,240,64,8,23,4,112,9,7,1,240,16,240,64,8,23,4,112,
+ 9,7,1,4,240,0,240,48,6,2,23,3,96,4,1,7,5,240,16,208,3,2,9,24,
+ 2,7,1,9,4,112,17,2,5,240,16,224,4,56,6,4,144,51,240,16,240,48,185,5,
+ 4,240,48,240,4,8,1,55,177,9,3,4,240,208,4,5,87,161,23,1,2,8,3,224,
+ 176,3,8,2,241,113,9,5,4,176,176,5,9,2,33,8,4,8,9,2,81,2,9,8,
+ 4,8,65,2,5,4,176,192,5,8,2,17,8,4,9,21,81,6,3,2,4,8,49,2,
+ 6,4,192,0,18,8,144,3,8,2,17,50,17,2,9,2,17,34,33,2,9,6,128,5,
+ 9,2,1,5,0,0,7,1,5,144,4,3,6,9,2,81,9,4,5,97,9,6,5,3,
+ 128,3,6,1,7,6,0,0,2,7,1,9,3,4,128,4,5,22,2,65,18,65,9,22,
+ 4,128,4,8,2,7,1,3,16,16,5,2,7,1,8,3,112,3,20,3,22,8,121,22,
+ 5,3,4,3,4,80,3,6,2,7,1,8,48,32,4,5,23,2,41,56,6,4,5,8,
+ 18,24,121,6,18,9,4,6,8,9,24,41,1,23,6,4,64,80,6,17,9,2,7,1,
+ 22,9,1,39,24,9,17,23,2,17,2,24,2,17,5,9,1,23,2,9,7,9,6,112,
+ 176,8,2,23,1,9,24,0,8,17,55,49,4,9,7,17,9,6,16,4,5,88,22,32,
+ 128,4,6,2,9,1,9,20,48,8,33,6,20,39,1,2,6,5,7,2,33,9,2,1,
+ 7,1,2,7,9,1,7,1,7,8,4,112,5,2,1,8,128,8,17,7,6,32,6,2,
+ 23,2,6,16,5,73,5,4,48,4,6,17,5,80,4,5,23,9,144,8,23,3,4,48,
+ 4,3,39,2,3,4,176,19,20,80,8,7,1,3,160,8,23,4,112,3,8,23,2,5,
+ 224,80,6,7,2,9,6,144,4,6,1,7,5,128,3,23,2,224,240,80,3,2,7,6,
+ 96,3,6,2,7,2,6,224,240,0,8,6,16,5,9,23,5,80,8,2,1,6,3,4,
+ 240,240,0,6,8,9,34,8,240,208,240,0,20,3,1,7,1,130,8,5,3,4,240,16,
+ 208,3,6,71,177,23,1,2,9,5,4,208,176,3,8,2,33,8,4,2,25,81,9,8,
+ 1,4,8,65,9,5,4,176,192,5,8,2,17,9,4,6,3,5,81,6,3,6,3,8,
+ 33,2,9,6,4,192,208,3,6,9,113,2,8,9,113,2,8,5,224,208,20,6,8,9,
+ 81,9,4,5,81,2,8,6,5,4,176,24,4,6,9,6,208,3,21,34,113,18,8,21,
+ 4,192,4,23,5,9,7,8,192,5,19,5,22,8,105,8,22,5,35,4,160,3,9,7,
+ 9,3,6,7,1,9,5,35,9,18,17,41,3,6,9,17,24,98,9,6,2,1,2,3,
+ 5,9,49,2,1,18,8,1,39,3,16,0,3,8,25,24,2,7,9,8,9,40,9,1,
+ 39,6,8,9,17,23,2,17,2,8,6,9,17,6,8,41,8,6,2,9,8,9,24,5,
+ 48,112,5,8,9,34,23,1,6,21,0,8,17,55,49,4,9,7,17,2,8,4,0,3,
+ 8,2,25,2,9,2,9,6,4,16,80,4,5,23,1,9,2,3,96,8,17,7,5,16,
+ 2,23,17,5,3,2,8,2,71,2,9,8,2,8,9,2,9,7,9,4,64,5,2,7,
+ 9,5,3,144,8,23,8,4,32,3,9,7,1,9,6,16,3,5,6,37,80,4,8,17,
+ 5,48,3,1,2,4,176,9,39,112,2,23,1,6,5,3,224,48,6,1,2,5,6,4,
+ 144,5,2,23,4,112,3,6,2,1,23,224,64,51,4,160,8,23,3,144,4,3,2,7,
+ 224,240,16,4,5,6,1,7,8,4,128,3,9,2,1,7,4,208,240,16,6,23,8,3,
+ 160,4,35,4,224,176,5,9,2,241,113,2,6,3,176,192,5,8,2,17,9,3,6,5,
+ 6,81,6,3,6,3,8,33,2,9,5,208,208,3,6,9,65,2,8,65,25,65,9,8,
+ 5,224,224,4,6,8,9,33,2,9,69,8,2,33,2,8,6,3,4,224,240,0,3,21,
+ 9,18,113,18,6,21,240,16,240,5,19,5,38,120,22,21,3,5,4,192,5,6,4,6,
+ 2,8,4,0,6,24,2,89,8,3,6,9,17,24,18,17,34,9,6,17,2,3,5,8,
+ 9,33,2,7,1,2,3,4,6,9,8,7,1,5,6,18,6,4,3,6,9,24,70,8,
+ 17,23,6,8,9,1,2,23,2,17,2,9,5,9,17,8,22,8,9,8,6,9,8,22,
+ 5,22,8,9,8,3,16,4,5,2,65,55,1,2,1,5,19,0,8,17,71,33,4,9,
+ 23,65,18,17,18,1,2,8,4,32,16,7,1,22,3,208,8,1,7,8,3,16,2,23,
+ 1,4,0,4,8,5,6,41,8,6,25,8,3,41,7,8,3,0,16,17,8,5,208,6,
+ 2,23,4,48,2,7,1,6,3,224,3,17,6,0,32,36,192,4,1,7,1,96,5,23,
+ 9,6,19,4,240,240,32,4,1,7,2,112,4,8,1,39,2,6,3,208,240,0,4,3,
+ 5,23,9,160,20,3,6,2,7,3,192,240,0,9,18,1,6,4,224,4,3,208,240,0,
+ 4,19,4,240,240,0,240,16,20,178,6,3,4,240,32,208,3,6,87,161,23,1,2,8,
+ 5,224,192,5,8,2,17,9,4,8,3,5,81,6,3,8,4,8,49,2,6,4,192,208,
+ 3,6,2,65,2,9,65,2,9,65,2,8,5,224,208,4,3,6,8,9,33,2,8,70,
+ 8,9,33,2,9,6,5,4,224,240,0,21,6,34,1,66,17,18,8,21,4,240,0,48,
+ 19,21,112,51,22,8,121,22,5,3,4,3,4,112,4,37,48,32,4,49,9,18,9,2,
+ 41,3,6,8,18,24,50,9,2,25,6,18,9,4,6,8,9,34,9,34,39,2,48,16,
+ 4,5,6,21,6,5,2,9,5,9,8,22,17,23,24,9,17,23,2,17,2,8,6,9,
+ 17,6,5,6,18,9,8,18,8,112,0,9,2,17,55,1,34,33,7,8,21,0,8,17,
+ 55,49,4,9,23,33,137,5,64,0,7,8,64,5,25,8,2,9,6,80,8,1,7,8,
+ 3,16,23,17,4,48,6,2,1,18,8,1,25,33,2,5,4,16,0,5,3,240,16,9,
+ 23,4,32,23,17,4,224,3,8,7,6,16,240,16,4,5,1,7,9,80,9,23,5,4,
+ 208,5,25,3,16,240,16,6,23,6,112,3,2,7,1,8,0,5,22,8,4,192,240,3,
+ 9,18,3,160,5,9,1,39,1,9,4,192,224,4,7,1,9,3,240,20,3,6,4,192,
+ 240,34,9,240,240,16,240,48,165,6,3,4,240,48,208,4,3,2,71,161,23,1,9,5,
+ 4,224,176,4,6,9,241,97,2,8,4,192,192,5,9,33,9,4,7,6,5,81,6,5,
+ 7,4,8,49,2,6,4,192,208,4,5,6,9,2,33,2,5,9,50,22,49,2,8,6,
+ 5,224,240,3,5,8,9,49,8,54,2,33,2,9,6,3,4,240,48,5,35,112,52,40,
+ 17,2,17,34,24,5,36,128,4,35,48,32,4,55,6,133,6,25,8,6,120,6,25,8,
+ 4,22,101,8,1,23,2,48,48,3,37,23,1,2,7,8,21,25,2,1,2,24,17,23,
+ 2,17,2,6,2,17,9,19,5,39,2,23,1,21,3,4,48,0,5,22,1,23,1,69,
+ 2,17,7,2,9,1,0,8,2,1,39,49,2,4,8,23,17,2,117,3,4,64,0,7,
+ 2,5,3,6,21,2,23,1,23,2,5,6,4,32,8,17,7,9,22,23,17,4,5,22,
+ 5,2,55,1,23,1,23,2,8,48,0,8,5,80,4,16,20,96,8,23,4,32,23,17,
+ 4,64,20,80,20,6,2,7,3,16,240,48,6,1,7,8,48,8,23,1,4,208,8,9,
+ 2,7,3,16,240,16,4,5,7,1,8,80,2,23,5,4,32,4,19,4,96,36,32,240,
+ 0,6,2,7,6,4,96,3,6,9,1,2,9,6,5,8,1,7,3,192,224,4,7,1,
+ 8,3,176,4,8,2,23,17,8,4,192,224,4,7,1,2,9,240,240,16,240,35,4,240,
+ 240,16,240,4,8,1,55,161,2,8,3,4,240,192,5,8,1,23,241,23,17,2,6,4,
+ 192,176,5,9,2,33,9,4,8,9,2,81,2,9,8,4,8,65,2,6,4,176,192,5,
+ 8,2,17,9,4,2,21,81,6,3,9,4,8,49,2,6,4,192,208,3,8,2,17,66,
+ 65,2,9,18,33,2,9,6,224,208,4,3,6,9,2,33,2,6,24,6,56,49,9,6,
+ 5,3,224,16,52,144,4,5,22,49,82,33,9,8,6,3,112,3,9,8,6,3,48,16,
+ 8,7,1,9,5,128,3,20,3,22,8,98,9,22,5,3,4,3,4,96,4,3,8,23,
+ 4,32,16,5,1,7,1,9,6,84,3,6,3,5,8,18,24,121,6,18,9,4,22,5,
+ 84,3,9,1,23,4,32,48,40,9,23,1,23,1,9,6,5,9,1,7,24,9,17,23,
+ 2,17,2,24,2,17,21,8,39,1,39,25,5,64,16,4,5,34,9,4,19,6,5,3,
+ 6,8,1,23,8,0,8,17,55,49,4,9,7,17,2,9,37,3,37,112,16,8,7,9,
+ 6,9,23,1,25,18,1,23,8,4,16,8,17,7,6,20,23,17,4,0,3,1,8,2,
+ 55,1,23,1,8,6,5,64,16,6,2,9,3,0,4,3,2,1,9,17,2,3,64,8,
+ 1,7,1,6,16,23,17,4,48,3,53,3,6,5,3,39,9,4,32,240,64,9,23,4,
+ 32,3,1,7,1,4,160,3,6,4,6,23,5,32,208,36,32,1,23,2,64,2,23,3,
+ 32,5,22,3,48,3,50,5,48,208,8,7,2,5,8,1,7,9,5,80,5,8,23,9,
+ 5,3,9,1,7,6,208,208,8,39,1,2,3,4,128,4,6,1,55,8,4,208,224,4,
+ 6,5,3,240,240,32,224,4,8,87,193,6,3,4,224,64,6,41,3,48,3,6,8,2,
+ 49,9,5,2,49,8,6,65,24,5,48,57,4,80,16,3,8,1,6,3,16,24,64,5,
+ 6,8,2,49,6,53,9,33,2,9,6,5,4,64,2,5,4,5,1,9,6,48,16,9,
+ 7,1,3,32,20,80,4,19,24,9,97,2,24,5,19,4,80,20,16,2,23,48,16,6,
+ 23,9,5,4,96,4,37,24,22,120,6,24,6,3,6,3,4,96,4,1,23,48,32,4,
+ 23,1,9,86,8,9,4,8,2,1,2,24,1,2,23,50,6,2,1,2,6,3,6,9,
+ 86,8,1,7,9,5,48,48,4,3,8,23,18,23,8,21,2,1,23,4,8,2,17,23,
+ 2,33,2,3,8,17,2,8,6,39,9,23,2,3,20,64,96,4,70,2,17,7,2,6,
+ 16,8,17,7,1,25,23,17,4,6,2,7,17,2,86,5,112,80,5,9,1,23,2,23,
+ 9,3,5,4,32,8,17,7,6,4,0,23,17,4,0,4,5,3,9,55,2,23,18,8,
+ 3,64,80,6,7,2,3,160,8,23,2,5,16,2,23,1,4,176,3,1,7,9,5,48,
+ 80,8,7,21,3,32,4,5,9,3,32,8,23,4,48,2,7,1,4,0,4,25,5,96,
+ 4,0,23,2,48,96,4,25,6,32,6,7,3,32,4,2,23,4,48,2,23,3,4,16,
+ 4,8,2,48,8,6,5,9,1,6,64,208,6,23,8,5,6,23,2,5,64,3,8,23,
+ 2,6,5,1,7,1,64,3,21,96,224,4,9,1,7,1,9,5,128,4,9,1,7,1,
+ 2,6,4,224,192,3,5,9,39,209,39,1,2,8,3,208,64,8,41,3,48,3,6,8,
+ 2,49,9,5,65,8,6,65,24,5,48,57,4,80,16,8,7,1,3,32,20,80,4,19,
+ 24,9,97,2,24,5,19,96,3,4,16,2,23,48,32,4,23,1,9,86,8,9,4,8,
+ 2,1,2,24,17,23,2,1,18,6,2,1,2,6,3,6,9,86,8,1,7,9,5,48,
+ 48,4,3,8,23,18,23,8,21,2,1,23,3,8,2,17,23,2,33,2,3,8,17,2,
+ 8,6,39,9,23,2,3,20,64,96,4,70,2,17,7,2,6,16,8,17,7,2,25,23,
+ 17,4,6,2,7,17,2,86,5,112,80,8,7,21,3,32,4,5,9,3,32,8,23,4,
+ 48,2,7,1,4,0,4,25,5,128,23,2,48,96,4,25,6,32,6,7,3,32,4,2,
+ 23,4,48,2,23,3,4,16,4,8,2,48,8,22,9,1,6,64,208,6,23,6,5,8,
+ 23,2,5,64,3,8,23,2,6,5,1,7,2,64,3,21,96,224,4,9,1,7,1,9,
+ 5,4,112,4,9,1,7,1,2,5,4,224,64,8,41,3,48,3,6,8,2,49,9,5,
+ 2,49,8,6,65,24,5,48,57,4,80,16,8,7,1,3,32,20,80,36,24,9,97,2,
+ 24,5,20,96,20,16,2,23,48,32,4,23,1,9,86,8,9,4,8,2,1,2,24,1,
+ 2,23,2,1,18,6,2,1,2,6,3,6,9,86,8,1,7,9,5,48,80,5,9,1,
+ 23,2,23,9,3,5,4,32,8,17,7,6,4,0,23,17,4,0,4,5,3,9,55,2,
+ 7,1,18,8,3,64,112,24,6,32,6,7,3,32,4,2,23,4,48,2,23,3,4,16,
+ 4,8,2,48,8,22,9,2,6,64,64,5,38,4,32,3,6,9,17,2,38,8,81,9,
+ 38,9,33,2,8,3,48,5,22,4,80,16,4,3,2,8,5,19,8,5,32,3,6,8,
+ 2,49,9,5,2,49,8,6,65,24,5,48,9,5,3,8,2,6,4,48,16,8,7,1,
+ 3,144,5,6,8,2,49,6,53,9,33,2,9,6,5,4,128,2,23,48,16,3,6,7,
+ 9,5,4,96,4,37,24,22,120,6,24,6,3,6,3,4,96,4,1,2,6,48,32,4,
+ 23,1,9,86,8,9,4,8,2,1,2,24,1,2,23,2,17,2,6,2,1,2,6,3,
+ 6,9,86,8,1,7,8,64,48,4,3,8,23,18,23,6,21,2,1,23,3,8,2,17,
+ 23,49,2,3,9,7,1,2,8,6,39,9,23,2,3,20,64,80,3,86,2,17,7,2,
+ 6,16,8,17,7,2,25,23,17,4,6,2,7,17,2,86,5,112,64,8,17,7,17,39,
+ 9,19,4,32,8,17,7,6,4,0,23,17,4,0,4,5,3,9,55,2,7,1,18,6,
+ 3,64,64,1,7,2,192,8,1,7,2,5,16,2,23,1,4,176,3,2,7,2,6,48,
+ 64,7,1,21,4,160,8,23,4,48,2,7,1,4,208,1,23,4,32,80,5,25,3,32,
+ 8,25,48,4,2,23,4,48,2,23,3,4,16,41,5,32,22,5,8,17,6,48,192,17,
+ 3,16,3,6,23,2,5,64,3,8,23,2,6,16,3,9,7,4,32,4,21,3,80,192,
+ 6,2,7,9,1,7,1,9,5,128,4,9,1,7,1,34,5,208,240,48,134,5,22,3,
+ 4,240,48,240,0,3,6,9,39,129,18,9,5,4,240,0,64,35,4,48,5,9,33,9,
+ 4,7,6,5,81,6,5,7,4,8,49,2,6,4,32,4,19,96,32,4,8,9,8,6,
+ 8,6,4,16,4,5,8,17,2,40,9,81,9,40,2,33,9,8,3,32,38,9,8,3,
+ 64,16,6,7,1,5,32,4,48,4,5,6,9,2,33,9,5,73,22,49,2,8,6,5,
+ 48,4,32,2,7,1,48,16,8,7,1,3,144,3,5,8,9,49,72,2,33,2,9,6,
+ 3,4,128,2,23,48,16,4,5,7,8,3,128,52,40,97,2,24,5,36,128,4,17,9,
+ 48,32,4,23,2,6,80,4,3,21,6,25,8,6,120,6,25,8,4,6,5,4,64,4,
+ 5,2,7,8,64,64,6,2,7,1,18,17,41,3,9,2,1,2,24,17,23,2,17,2,
+ 6,2,17,9,3,6,9,33,2,1,7,1,8,3,4,64,80,4,5,9,6,8,9,8,
+ 22,8,1,23,2,0,8,2,1,39,49,2,4,8,7,17,9,6,25,8,6,2,8,5,
+ 112,48,4,6,9,34,17,2,1,2,1,7,6,3,16,8,17,7,9,22,23,17,4,3,
+ 6,7,1,2,1,2,1,34,1,18,3,20,48,32,3,1,7,18,8,6,9,2,25,3,
+ 80,8,17,7,6,4,0,23,17,4,64,8,41,8,6,25,8,23,2,48,32,3,7,8,
+ 3,208,8,23,8,3,16,8,23,1,4,208,3,9,7,9,3,16,32,3,1,9,24,4,
+ 176,8,23,4,48,2,7,1,4,160,4,3,0,4,8,7,2,3,16,64,35,64,4,3,
+ 4,64,8,23,4,48,2,7,1,4,48,4,3,64,4,5,8,18,8,48,192,2,8,4,
+ 32,4,6,1,7,2,4,48,6,1,7,9,5,4,16,3,6,8,4,192,192,34,6,8,
+ 2,1,7,9,5,96,4,5,39,8,6,9,17,3,192,208,3,6,56,3,4,144,20,5,
+ 40,6,224,240,48,185,5,3,240,48,240,4,8,1,55,177,8,3,4,240,176,5,9,2,
+ 33,9,4,8,9,2,81,2,9,8,4,8,65,2,5,4,176,32,3,25,6,4,64,5,
+ 8,2,17,8,4,9,21,81,6,3,9,4,8,49,2,6,4,64,4,25,8,48,16,9,
+ 7,5,20,5,80,3,6,2,17,66,65,2,9,18,33,2,9,6,80,4,5,0,5,9,
+ 7,3,16,16,9,7,8,3,112,4,3,6,8,2,33,2,24,70,8,49,9,6,5,3,
+ 128,5,2,7,3,16,32,3,7,2,6,4,112,4,5,22,2,33,82,33,9,22,4,128,
+ 4,2,17,4,32,32,4,9,7,1,9,3,4,80,3,20,3,22,8,121,22,5,3,4,
+ 3,4,80,4,6,1,7,8,4,48,64,3,9,7,2,9,24,57,3,5,8,18,24,121,
+ 6,18,9,4,6,88,9,2,1,7,3,4,64,96,4,7,18,7,1,6,21,2,17,7,
+ 24,9,17,23,2,17,2,24,2,17,37,1,7,1,9,7,1,8,112,80,5,8,38,24,
+ 2,39,9,22,0,8,17,55,49,4,9,7,1,23,1,8,102,4,80,16,4,5,1,9,
+ 2,23,17,23,6,4,3,4,48,8,33,6,20,23,17,52,19,5,55,2,23,2,17,2,
+ 3,32,0,4,2,7,9,3,224,8,17,7,6,4,0,23,17,4,224,5,2,7,8,3,
+ 0,0,6,1,7,51,192,8,23,3,4,16,3,1,7,1,4,192,4,16,5,7,1,6,
+ 0,16,5,8,22,3,208,8,23,4,48,2,7,1,4,176,4,8,6,8,9,2,3,16,
+ 240,64,8,23,4,48,2,7,1,4,208,21,3,48,192,5,3,64,3,2,23,4,48,6,
+ 1,7,2,6,4,32,4,6,4,192,192,1,2,6,20,5,8,23,2,3,80,4,5,39,
+ 8,3,5,8,7,3,192,208,5,66,6,3,160,5,8,1,18,9,4,208,192,4,5,8,
+ 39,209,39,1,2,8,4,208,176,6,9,241,129,2,6,3,176,176,6,2,49,2,25,2,
+ 113,2,25,2,81,8,3,176,176,3,8,2,33,9,4,7,9,8,81,24,7,4,8,65,
+ 9,3,4,176,192,3,6,9,17,9,3,21,6,81,8,5,6,5,9,33,2,9,5,208,
+ 0,8,25,5,128,3,6,9,2,49,2,6,65,9,8,65,9,8,5,224,0,7,2,3,
+ 160,4,22,9,2,33,2,69,8,2,33,2,8,6,3,4,128,21,24,16,0,2,17,8,
+ 3,4,144,35,25,2,113,25,6,19,4,144,3,5,6,23,4,0,16,5,9,7,2,8,
+ 3,112,5,19,5,38,120,38,5,3,5,3,112,3,2,39,6,16,48,4,9,17,66,9,
+ 8,19,8,9,17,24,18,17,34,9,6,17,2,3,5,6,2,73,1,23,1,2,6,4,
+ 32,80,3,53,22,9,2,17,39,5,8,9,1,2,23,2,17,2,9,5,2,7,49,118,
+ 5,4,64,32,4,3,1,23,1,39,1,2,1,7,35,4,0,8,17,23,17,7,33,20,
+ 19,7,1,9,1,119,2,9,4,32,0,3,9,1,2,8,6,3,192,8,17,7,6,16,
+ 23,17,4,224,8,2,1,9,5,0,0,7,1,5,240,4,9,23,6,4,16,8,23,1,
+ 4,240,0,6,23,5,0,2,9,5,3,5,3,192,2,23,96,6,7,2,5,208,5,6,
+ 8,2,8,3,16,3,21,4,208,1,23,96,5,23,8,3,192,4,19,4,16,240,48,1,
+ 7,1,112,3,23,9,4,240,16,240,48,1,7,1,128,5,1,7,2,4,240,0,192,20,
+ 32,4,3,7,1,8,144,4,6,23,9,5,3,208,192,3,6,24,2,23,9,3,208,8,
+ 34,3,192,224,4,51,240,240,16,208,20,2,71,161,23,1,9,5,4,224,192,5,9,33,
+ 9,4,7,6,5,81,22,7,4,8,49,2,6,4,192,0,22,5,176,3,6,8,9,49,
+ 70,2,33,2,9,6,3,4,240,0,23,8,192,36,24,9,97,2,24,5,36,240,0,0,
+ 6,2,1,8,6,5,32,3,21,4,16,21,6,25,8,6,120,6,8,9,8,3,5,19,
+ 5,3,4,16,4,3,9,17,2,48,16,4,5,7,8,5,35,53,6,24,9,2,1,2,
+ 24,17,23,2,17,2,6,2,1,2,24,25,37,35,21,40,48,48,3,9,17,2,33,2,
+ 17,7,9,1,7,1,4,8,2,17,23,49,2,4,8,1,9,7,17,2,97,2,8,3,
+ 4,32,16,3,8,7,9,8,9,6,41,21,6,8,64,8,17,7,2,24,23,17,4,32,
+ 22,5,6,24,9,8,6,8,9,6,2,7,1,6,3,0,0,9,17,3,240,9,1,23,
+ 6,16,23,17,4,224,4,3,8,7,1,5,0,7,2,4,240,6,1,7,9,64,8,1,
+ 7,6,3,224,4,6,17,5,0,5,8,2,9,3,176,3,8,23,8,96,3,23,8,3,
+ 224,35,4,240,16,5,1,7,8,144,23,2,240,32,240,16,5,23,8,144,8,1,7,8,
+ 4,240,0,240,16,5,1,7,6,160,5,2,7,8,3,240,240,16,5,9,7,6,176,3,
+ 1,7,2,6,224,240,4,3,8,1,9,3,208,8,18,9,4,192,240,5,8,6,5,240,
+ 0,36,208,192,4,3,8,2,17,66,65,2,9,18,33,2,9,6,4,208,240,4,5,6,
+ 8,49,2,57,2,33,9,8,6,3,64,20,3,4,112,112,7,1,18,48,3,20,3,22,
+ 8,57,34,9,22,5,3,4,3,4,32,3,6,2,7,1,112,112,23,1,8,22,3,0,
+ 3,5,8,18,24,121,6,18,9,20,3,5,24,9,2,7,2,6,112,64,51,21,3,5,
+ 6,9,17,39,24,9,17,23,2,17,2,24,2,7,33,2,69,51,4,64,48,6,2,23,
+ 1,39,17,23,5,40,0,8,17,55,49,4,5,8,5,7,1,2,1,103,1,9,6,5,
+ 32,0,3,8,1,7,5,148,48,8,2,23,2,6,4,3,23,17,9,5,16,180,9,23,
+ 2,6,4,0,7,1,8,208,3,5,1,23,8,64,8,1,7,1,8,3,224,3,23,6,
+ 0,7,2,5,4,160,4,6,2,23,6,3,96,4,6,39,8,4,176,3,9,18,5,16,
+ 5,24,4,128,4,2,39,176,3,9,23,8,3,240,224,4,1,7,2,3,208,3,23,1,
+ 2,224,240,1,7,2,3,208,4,6,23,2,224,240,3,8,2,1,2,6,208,23,2,224,
+ 240,32,3,6,3,208,9,2,9,224,240,240,64,6,2,9,4,192,240,0,20,3,33,130,
+ 8,5,3,4,240,16,208,3,6,71,177,23,1,2,9,5,224,176,3,8,2,33,8,4,
+ 41,81,25,2,4,8,65,9,5,4,176,192,5,8,2,17,9,4,6,3,5,81,6,3,
+ 6,3,8,33,2,9,6,208,208,3,6,2,65,2,8,65,25,65,2,8,5,224,208,20,
+ 6,8,9,33,2,9,69,8,9,33,2,8,6,5,4,224,112,25,8,6,64,3,21,34,
+ 113,18,8,21,4,48,3,8,9,2,9,112,96,4,7,1,8,3,48,5,35,22,8,105,
+ 8,22,5,3,4,3,4,32,4,5,2,7,1,112,112,3,2,1,41,6,4,3,6,9,
+ 17,24,98,9,6,2,1,9,19,6,8,25,2,1,7,8,4,112,64,37,102,8,1,39,
+ 6,8,9,17,23,2,17,2,8,6,2,7,33,8,134,3,64,16,3,8,2,39,2,119,
+ 6,21,0,8,17,55,49,4,3,5,9,23,2,55,1,2,23,33,9,4,16,0,9,1,
+ 7,3,4,176,4,3,1,39,8,3,16,1,23,17,6,224,3,2,7,1,3,0,7,9,
+ 4,192,5,8,2,7,9,5,3,64,5,9,7,1,9,6,208,4,6,23,5,0,6,25,
+ 8,4,112,4,3,2,1,7,1,4,144,4,1,23,1,5,4,160,4,35,4,16,36,112,
+ 3,8,23,9,5,208,5,9,23,2,6,224,192,9,7,3,4,240,16,4,3,1,7,9,
+ 4,192,192,2,7,240,96,6,23,6,176,192,8,1,8,6,5,240,48,4,8,7,8,176,
+ 208,4,38,240,32,8,2,1,3,192,240,16,4,3,1,7,1,114,1,8,5,3,4,240,
+ 16,208,3,6,71,177,39,1,9,5,4,208,176,6,2,49,34,145,34,81,8,3,176,96,
+ 4,7,1,2,9,64,3,21,34,113,18,8,21,64,5,9,2,7,1,112,96,4,7,1,
+ 8,3,48,5,19,5,22,8,105,8,22,5,3,4,5,4,32,4,5,2,7,1,112,112,
+ 3,2,23,1,34,4,6,9,17,24,98,9,6,2,1,9,4,3,6,9,1,2,1,23,
+ 6,4,112,144,4,5,4,0,3,5,8,2,23,6,8,9,17,23,2,17,2,8,6,9,
+ 33,8,6,25,5,20,19,0,3,37,4,16,0,4,5,24,137,2,17,7,2,5,4,8,
+ 17,55,49,4,9,23,33,50,23,1,23,1,2,17,6,0,0,23,9,5,6,9,1,25,
+ 2,33,2,8,2,3,4,3,1,39,8,3,16,2,23,17,6,32,6,34,9,8,80,4,
+ 5,17,5,0,5,9,2,9,4,160,5,9,1,7,9,5,3,64,3,9,7,1,2,6,
+ 208,4,35,4,192,19,5,2,23,1,4,160,1,23,1,5,3,240,144,4,6,2,1,39,
+ 9,5,208,3,8,39,1,6,4,192,144,5,7,1,6,36,240,16,36,3,23,9,176,144,
+ 5,7,2,8,240,96,4,22,7,2,176,160,36,240,112,38,3,176,208,4,5,87,161,23,
+ 1,2,8,5,224,176,5,9,2,241,113,9,5,4,176,176,6,2,65,18,241,33,8,3,
+ 176,176,5,9,2,33,8,4,8,25,81,41,4,8,65,2,5,4,176,192,5,8,2,17,
+ 8,4,8,3,5,81,6,3,8,4,8,49,2,6,4,192,208,3,6,2,65,2,9,65,
+ 2,9,65,2,9,5,224,144,4,32,4,3,6,8,2,33,2,8,70,8,9,49,9,6,
+ 5,3,224,112,7,1,9,8,5,32,4,5,22,34,1,66,17,18,8,6,5,4,48,6,
+ 9,2,7,2,112,96,4,7,1,8,3,5,32,3,4,19,22,8,121,22,5,3,4,3,
+ 4,32,4,5,2,7,1,112,112,5,1,23,57,3,6,8,18,24,25,18,57,6,18,9,
+ 4,6,8,41,1,23,8,3,112,160,4,17,9,6,5,2,1,7,24,9,17,23,2,17,
+ 2,24,9,17,6,5,6,1,2,8,4,48,51,32,0,4,6,56,6,64,6,8,9,1,
+ 7,1,6,0,8,17,55,49,4,9,23,33,40,57,1,55,2,5,0,0,23,9,21,9,
+ 39,1,2,39,17,3,4,3,2,1,23,9,5,0,4,39,17,6,20,0,8,33,2,9,
+ 7,6,68,5,17,5,0,5,38,4,16,25,8,6,25,8,3,0,5,8,2,7,2,6,
+ 3,64,5,2,7,1,9,6,208,4,37,4,176,4,35,8,1,23,3,4,128,3,39,2,
+ 3,36,208,144,4,5,71,2,5,208,5,9,71,6,4,176,144,5,7,2,6,19,4,240,
+ 16,4,35,2,7,9,176,144,5,7,2,9,4,240,96,3,6,7,9,176,160,36,240,112,
+ 4,21,3,176,240,4,5,8,2,39,129,18,9,6,4,240,0,208,4,3,1,71,161,23,
+ 1,9,6,3,224,192,3,8,2,39,209,39,1,2,9,5,208,176,4,6,9,241,113,8,
+ 3,4,176,176,6,2,49,9,3,5,9,113,9,5,3,9,81,6,3,176,192,5,8,33,
+ 8,4,7,6,5,81,6,5,7,4,8,49,2,6,4,192,192,4,5,8,17,2,57,81,
+ 2,41,2,33,9,6,4,208,112,53,16,4,5,6,9,2,33,9,5,73,22,49,2,8,
+ 21,0,69,3,112,80,6,2,1,6,8,1,48,3,5,8,9,49,72,2,33,2,8,6,
+ 3,4,16,2,9,21,18,1,96,80,9,7,2,21,9,48,52,22,8,114,8,6,5,36,
+ 32,8,6,16,8,1,7,96,80,5,9,7,1,9,70,21,6,25,8,6,120,6,25,8,
+ 4,86,8,9,1,7,9,96,16,4,21,3,4,0,19,8,39,1,9,4,9,2,1,2,
+ 24,17,23,2,17,2,6,18,1,9,19,5,55,6,5,3,4,3,5,6,5,4,16,16,
+ 6,7,9,1,9,3,80,4,5,1,23,2,0,8,2,1,55,33,2,4,8,23,17,2,
+ 85,6,1,7,9,6,9,2,3,0,16,5,25,5,8,7,8,22,5,6,8,9,1,7,
+ 8,3,0,8,2,39,9,22,23,17,21,6,5,87,1,23,1,8,5,20,24,3,0,96,
+ 4,1,9,8,6,53,16,4,5,1,23,9,4,48,9,23,1,6,16,19,21,20,176,128,
+ 22,4,7,1,2,9,0,5,9,23,9,3,96,3,1,7,1,8,0,8,9,1,7,6,
+ 3,176,160,4,7,49,23,2,4,160,9,39,18,39,8,176,192,5,24,6,5,4,208,4,
+ 5,6,40,3,6,3,176,240,0,4,3,5,39,129,8,6,3,4,240,16,192,4,3,8,
+ 39,209,39,1,9,6,4,208,176,3,8,2,33,9,4,1,9,8,81,24,7,4,8,65,
+ 9,3,4,176,192,5,8,9,17,9,3,21,6,81,8,21,3,9,33,2,9,5,208,208,
+ 3,6,9,2,49,2,6,65,9,8,65,9,8,6,32,4,51,96,48,4,8,2,25,2,
+ 8,48,4,6,8,9,49,2,69,8,2,33,2,8,6,3,4,32,3,1,25,2,5,4,
+ 64,16,5,23,1,5,16,6,8,80,35,25,2,113,25,6,19,80,4,9,3,0,4,1,
+ 7,1,48,16,6,23,2,5,16,20,64,5,19,5,38,120,38,5,3,5,3,128,2,23,
+ 48,32,3,7,2,8,102,8,9,3,6,9,17,24,18,17,50,6,17,2,21,6,8,85,
+ 6,2,7,1,8,48,64,3,8,23,17,23,9,22,8,2,23,5,8,9,1,2,23,2,
+ 17,2,9,5,9,17,8,6,8,39,1,39,6,5,3,64,128,4,35,9,18,23,9,4,
+ 0,8,17,39,1,7,33,4,8,23,17,2,37,3,5,4,128,112,5,9,1,39,1,6,
+ 8,3,32,8,17,7,5,4,0,23,17,4,0,4,8,6,2,71,1,8,3,112,112,2,
+ 23,5,19,4,80,8,23,6,4,16,1,23,1,4,48,4,35,6,23,1,6,112,112,23,
+ 19,4,0,5,24,6,16,5,1,23,64,8,23,5,4,16,40,32,3,23,6,112,112,5,
+ 8,18,5,0,2,7,8,20,6,23,9,3,64,4,6,1,7,2,5,3,9,1,7,4,
+ 6,8,9,7,5,4,112,208,5,9,55,2,4,144,8,1,55,9,0,5,8,6,160,240,
+ 3,5,3,4,192,4,35,4,240,240,0,3,5,8,39,129,2,9,8,3,240,16,224,4,
+ 9,71,177,7,1,8,5,4,224,192,5,9,1,7,241,17,7,17,2,8,4,192,176,6,
+ 2,49,2,22,9,113,2,22,9,81,8,3,176,192,5,9,33,9,4,7,8,5,81,22,
+ 7,4,8,49,2,6,4,192,64,4,35,4,32,3,5,9,17,2,22,24,81,9,40,9,
+ 33,2,8,3,32,4,19,5,96,48,6,9,8,38,5,32,4,6,8,2,49,2,5,66,
+ 8,6,65,8,6,5,48,2,8,6,9,8,5,64,16,6,7,1,5,32,5,3,64,3,
+ 5,8,9,49,70,9,33,2,9,6,5,4,64,4,32,2,23,48,16,8,7,1,5,160,
+ 36,24,9,97,2,24,5,20,160,2,23,48,16,3,9,7,2,8,3,80,4,3,6,5,
+ 6,40,6,120,6,40,3,6,5,4,80,4,3,39,48,32,4,1,23,9,72,41,4,8,
+ 2,1,2,24,17,23,2,17,2,6,2,1,2,8,3,6,9,88,9,23,8,4,48,80,
+ 6,23,18,7,1,8,21,1,39,4,8,2,17,23,49,2,4,8,7,17,8,6,1,7,
+ 1,9,23,2,112,96,4,72,2,17,7,2,5,16,8,17,7,2,24,23,17,4,5,9,
+ 7,33,40,6,24,3,112,80,5,2,23,1,2,23,9,20,48,8,17,7,8,4,0,23,
+ 17,4,16,20,8,39,1,2,23,1,9,96,80,8,7,9,3,160,8,23,2,5,16,9,
+ 23,1,4,160,8,2,7,6,3,64,80,8,7,22,3,48,4,18,8,16,8,23,3,48,
+ 2,7,1,4,0,3,25,5,48,4,0,4,6,7,2,5,64,96,4,24,5,32,5,7,
+ 1,6,20,6,1,23,4,48,8,23,8,3,4,3,2,7,2,16,4,6,8,9,2,9,
+ 4,80,208,4,5,7,33,7,1,6,96,3,8,39,1,7,9,5,48,35,112,240,0,6,
+ 9,8,5,4,144,5,6,8,6,4,240,0,224,4,8,71,209,8,5,4,224,48,5,38,
+ 64,3,6,9,17,2,38,8,81,9,38,9,33,2,8,3,64,38,3,64,16,4,6,1,
+ 6,19,9,3,48,3,6,8,2,97,9,5,8,1,25,65,8,6,5,48,5,9,19,40,
+ 48,16,8,7,2,3,144,5,6,8,9,65,2,5,8,65,2,9,6,5,4,128,4,1,
+ 7,48,16,8,7,1,5,160,36,24,9,97,2,24,5,20,160,9,23,48,16,3,5,7,
+ 2,6,4,80,20,6,21,24,22,120,6,24,6,3,6,5,4,80,4,3,7,9,3,48,
+ 32,4,1,23,9,70,24,9,4,8,2,1,2,24,17,23,50,6,2,1,2,8,3,6,
+ 9,86,9,23,6,64,64,4,8,23,18,23,8,21,2,1,23,4,8,2,17,23,49,2,
+ 3,9,7,1,2,8,6,23,1,9,23,2,4,96,80,4,5,70,2,17,7,2,6,16,
+ 8,17,7,2,25,23,17,4,6,2,7,17,2,86,5,112,64,5,2,1,39,1,23,2,
+ 19,4,32,8,17,7,6,4,0,23,17,4,0,4,19,9,55,2,7,1,18,8,3,64,
+ 64,9,7,1,3,176,8,1,7,2,5,16,2,23,1,4,176,8,1,7,8,3,48,64,
+ 9,7,21,4,48,4,6,9,5,32,8,23,4,48,2,7,1,4,0,3,25,5,112,4,
+ 23,8,48,80,3,9,8,5,48,5,7,3,4,16,3,2,23,4,48,2,23,5,4,16,
+ 3,1,2,32,4,9,22,9,1,5,64,208,5,23,8,6,8,23,2,3,64,4,6,23,
+ 1,9,6,23,2,64,37,96,240,9,33,8,3,144,8,2,1,2,8,3,240,240,48,8,
+ 89,72,5,4,240,48,192,5,8,2,17,9,4,2,21,81,6,3,2,4,8,49,2,6,
+ 4,192,192,4,3,8,2,17,50,33,18,1,50,33,2,9,6,4,208,0,4,19,5,128,
+ 4,3,6,9,2,81,9,4,5,97,9,6,5,3,128,5,24,3,4,0,0,7,2,6,
+ 176,4,5,6,8,2,49,2,9,2,65,9,8,6,3,4,144,4,3,9,7,8,0,0,
+ 7,1,5,176,3,36,22,8,98,9,22,5,52,144,4,5,1,7,8,0,0,9,1,7,
+ 2,6,3,96,4,37,8,18,24,105,8,6,9,2,9,4,6,21,96,3,8,2,7,1,
+ 3,16,16,4,6,9,23,17,2,1,7,1,25,8,5,2,1,7,9,8,9,17,23,2,
+ 17,2,24,2,17,5,6,9,33,2,65,9,6,48,80,3,22,21,22,9,8,9,1,7,
+ 1,8,0,8,17,55,49,4,9,7,17,2,8,38,5,24,6,112,48,21,9,1,7,1,
+ 55,2,9,1,5,4,16,8,33,6,19,23,17,20,3,7,25,55,1,39,2,5,3,4,
+ 48,32,3,1,7,2,5,8,5,6,24,6,3,80,8,17,7,8,4,0,23,17,4,48,
+ 4,56,5,6,8,22,23,9,48,32,3,7,6,4,0,5,176,8,23,5,4,16,3,1,
+ 7,1,4,208,4,8,7,1,3,16,32,4,9,2,9,8,4,176,8,23,4,48,2,7,
+ 1,4,160,4,6,0,3,8,7,6,4,16,64,4,3,4,64,19,4,64,9,23,4,48,
+ 1,7,1,4,32,4,35,64,3,9,2,9,3,48,192,1,2,3,16,4,3,2,23,9,
+ 4,48,5,2,7,1,6,4,16,3,6,7,4,192,192,6,2,7,2,1,23,2,6,3,
+ 96,4,3,2,23,1,9,1,7,8,4,192,208,4,3,37,3,192,4,5,22,5,3,224,
+ 240,48,196,240,64,240,0,4,3,5,39,129,9,8,5,3,240,16,240,5,87,177,2,6,
+ 3,240,192,4,5,9,39,209,39,1,2,8,4,208,176,6,2,241,145,6,3,176,176,6,
+ 2,49,2,24,2,113,2,24,2,81,8,3,176,176,4,6,9,33,9,4,7,9,8,81,
+ 24,7,4,8,49,2,8,3,4,176,192,3,6,9,17,9,37,8,81,8,37,9,33,2,
+ 8,5,208,208,3,6,9,2,97,2,6,8,113,9,8,5,224,240,5,6,8,2,65,9,
+ 5,6,65,18,8,5,3,240,240,0,35,25,2,97,2,25,6,19,4,240,0,25,6,128,
+ 52,6,3,5,54,120,38,5,3,5,3,20,160,18,5,8,7,2,5,19,69,6,56,5,
+ 8,9,17,24,18,17,50,6,2,1,2,6,5,6,8,1,8,6,53,19,37,23,5,0,
+ 5,9,23,6,85,8,41,17,23,3,8,2,1,2,23,2,17,2,9,5,9,17,25,8,
+ 9,22,53,3,6,39,6,3,4,16,4,3,5,2,1,7,2,1,39,18,7,9,3,5,
+ 3,0,8,17,23,17,23,17,4,6,2,8,17,9,23,49,7,17,8,5,4,32,0,6,
+ 2,23,24,9,5,56,4,96,8,17,7,6,4,0,23,17,4,80,56,6,24,6,8,1,
+ 23,6,4,0,0,7,1,5,240,0,8,1,23,5,4,0,39,1,4,224,20,3,7,1,
+ 5,0,7,2,3,0,5,3,208,8,23,4,48,2,7,1,4,208,6,20,3,7,9,3,
+ 16,5,9,8,5,4,208,8,23,4,48,2,7,1,4,208,3,8,9,2,5,4,0,240,
+ 48,3,9,23,4,48,2,7,1,3,4,240,48,192,2,9,3,0,4,5,8,23,9,96,
+ 5,1,7,2,6,3,0,4,5,7,4,192,192,3,8,17,39,5,4,144,6,2,23,17,
+ 2,6,4,192,240,48,6,168,3,4,240,48,240,4,6,9,2,39,129,34,6,4,240,0,
+ 176,4,6,2,241,113,8,3,4,176,176,6,2,49,9,3,6,9,2,81,2,9,6,3,
+ 8,81,6,3,176,192,5,8,2,17,9,4,7,6,5,81,6,5,1,4,8,49,2,6,
+ 4,192,192,4,5,8,17,2,41,2,81,2,41,2,33,9,6,4,208,208,4,5,6,9,
+ 2,81,9,4,5,97,2,8,5,3,224,240,3,5,24,65,2,25,65,2,8,6,3,4,
+ 240,4,3,4,144,5,22,3,5,6,25,24,105,8,6,25,8,4,3,5,22,4,144,19,
+ 0,9,1,8,80,3,5,6,4,37,18,17,2,24,17,23,2,17,2,6,9,2,1,25,
+ 8,5,3,25,3,96,4,18,5,5,9,8,5,9,18,73,8,39,1,34,0,8,17,55,
+ 33,2,4,8,17,23,17,2,121,8,6,1,9,3,0,6,2,7,1,2,1,7,9,55,
+ 6,21,3,48,8,17,7,8,21,23,17,4,16,5,6,21,8,33,9,2,1,9,7,17,
+ 7,8,3,0,0,7,2,3,240,0,8,17,7,6,16,9,1,7,1,4,240,4,3,23,
+ 6,0,9,2,9,5,4,208,8,1,7,9,4,48,3,8,7,9,5,208,4,5,6,7,
+ 2,3,16,35,224,2,23,96,3,7,1,6,208,3,21,3,16,240,48,2,23,96,5,23,
+ 6,240,48,240,48,2,23,96,3,23,6,240,48,240,48,6,23,3,80,5,7,1,6,240,
+ 48,240,16,20,2,23,6,80,3,2,7,9,3,240,32,208,6,9,21,9,23,8,3,128,
+ 6,1,7,8,3,6,9,4,208,224,4,6,5,3,224,3,9,24,6,224,240,16,20,33,
+ 130,8,5,20,240,16,176,3,8,2,33,8,4,2,8,9,81,25,2,4,8,65,9,5,
+ 4,176,192,5,8,2,17,9,4,8,3,5,81,6,3,8,4,8,49,9,6,4,192,208,
+ 4,3,6,8,9,33,2,8,22,37,8,9,49,8,6,5,4,224,240,0,3,21,34,113,
+ 18,8,21,4,240,0,240,5,35,22,8,105,8,22,5,3,4,3,4,240,48,3,4,80,
+ 4,8,9,8,3,6,8,1,2,24,98,9,6,2,1,9,4,3,6,25,3,80,4,8,
+ 2,9,32,48,165,6,1,39,6,8,9,17,23,2,17,2,8,6,2,7,17,9,181,3,
+ 32,0,3,6,9,71,1,39,1,39,8,21,0,8,17,55,49,4,3,6,2,39,1,87,
+ 1,23,1,9,4,16,0,23,2,240,0,8,1,7,9,3,16,39,1,5,4,224,3,9,
+ 7,2,3,0,7,1,8,240,0,9,23,4,48,5,9,7,2,5,224,4,8,23,6,0,
+ 36,224,4,1,7,1,112,4,23,9,224,36,0,240,48,1,7,2,128,23,2,240,32,240,
+ 48,1,7,9,128,23,2,240,32,240,48,2,7,2,128,23,2,240,32,240,16,4,3,17,
+ 8,128,23,9,240,32,224,3,20,6,7,8,3,144,5,1,7,6,4,240,0,224,5,25,
+ 6,224,3,25,5,240,240,0,4,19,39,129,8,6,3,4,240,16,176,3,8,2,33,8,
+ 4,1,24,81,9,8,1,4,8,65,9,3,4,176,192,5,8,2,17,9,3,5,3,6,
+ 81,6,5,6,3,8,33,2,9,5,208,208,3,6,9,2,49,2,8,65,25,65,9,8,
+ 5,224,224,4,6,8,9,49,9,6,53,8,2,33,2,8,6,3,4,224,64,4,35,112,
+ 3,21,25,2,113,18,6,21,4,112,4,19,4,64,64,8,23,2,3,80,5,19,5,38,
+ 120,22,21,3,5,4,80,6,2,23,5,64,64,4,3,6,39,1,23,1,2,4,6,9,
+ 17,24,18,17,34,9,6,17,2,3,5,9,55,1,23,1,36,64,32,4,38,3,0,3,
+ 21,22,5,3,8,2,23,5,8,9,1,2,23,2,17,2,9,5,9,17,8,6,40,6,
+ 20,3,5,3,22,5,48,0,34,9,23,2,33,2,33,2,23,9,3,0,8,17,71,33,
+ 3,9,23,1,66,9,7,18,7,49,2,8,4,0,7,9,48,4,8,38,40,6,9,4,
+ 16,5,9,23,8,3,16,9,23,17,6,16,8,25,2,25,8,9,3,48,4,6,17,5,
+ 0,3,4,240,4,1,7,1,5,64,3,8,23,1,9,4,208,35,4,240,16,6,1,7,
+ 5,144,9,2,23,4,240,0,240,16,6,7,8,4,176,5,7,9,5,240,240,16,8,7,
+ 208,5,23,6,240,240,16,8,7,3,4,176,3,7,1,6,240,240,16,6,23,5,160,5,
+ 9,7,3,240,0,240,16,3,8,7,6,144,4,8,2,8,240,16,240,0,6,18,3,4,
+ 240,240,240,0,4,3,5,240,240,16,240,16,20,33,130,8,5,4,240,32,192,5,8,2,
+ 17,9,4,8,3,5,81,6,3,8,4,8,33,2,9,6,4,192,208,3,6,2,65,2,
+ 9,65,25,65,2,8,5,224,208,4,3,6,8,9,33,2,9,6,53,8,9,49,8,6,
+ 5,4,224,112,7,1,9,8,64,3,21,34,113,18,8,21,4,48,5,9,2,7,2,112,
+ 96,4,7,1,8,3,48,5,35,22,8,105,8,22,5,3,4,3,4,32,4,5,2,23,
+ 112,112,3,2,23,50,3,6,9,1,2,24,98,9,6,2,1,9,3,6,9,34,1,23,
+ 8,4,112,32,4,37,3,16,4,8,18,9,8,6,2,23,6,8,9,17,23,2,17,2,
+ 8,6,9,17,6,8,9,2,9,8,6,16,4,3,37,48,0,41,5,23,1,24,89,1,
+ 7,2,5,0,8,17,55,49,4,9,7,17,2,8,0,6,24,41,1,23,17,9,5,0,
+ 0,7,9,48,4,17,2,9,17,2,9,1,3,16,3,9,1,7,9,3,16,1,23,17,
+ 6,5,1,9,2,71,1,8,3,32,4,5,17,5,0,5,4,240,0,1,7,1,6,64,
+ 5,9,23,1,9,16,3,54,5,80,4,37,4,240,0,3,6,1,7,5,144,9,1,23,
+ 6,3,240,240,0,17,8,208,4,8,7,1,8,224,240,0,7,1,240,0,6,1,7,224,
+ 240,0,7,1,3,208,4,5,23,1,224,240,0,9,1,7,6,4,176,5,17,8,4,224,
+ 240,16,3,8,9,3,240,240,192,5,8,2,39,225,23,17,2,5,208,176,6,9,49,9,
+ 3,6,9,2,81,2,9,6,3,8,65,2,6,3,176,192,5,8,2,17,9,4,1,21,
+ 81,6,5,1,4,8,49,2,6,4,192,128,37,6,20,5,6,9,2,33,2,5,72,6,
+ 8,49,2,6,5,3,0,4,37,4,128,112,7,1,2,9,5,32,4,5,24,49,73,2,
+ 33,9,8,6,3,4,16,5,25,1,8,5,112,112,23,9,5,48,52,22,8,98,9,22,
+ 5,52,32,3,6,1,7,1,112,112,8,1,7,1,54,21,8,25,24,105,8,6,25,8,
+ 4,70,9,1,7,9,5,112,16,4,19,6,5,16,20,3,23,1,2,3,9,17,9,24,
+ 17,23,2,17,2,6,9,2,1,2,5,9,39,1,9,3,4,0,52,3,32,16,8,1,
+ 2,8,2,7,2,6,5,3,0,5,22,1,7,1,9,0,8,17,55,33,2,4,9,7,
+ 17,9,5,32,3,5,6,9,23,9,8,2,9,4,0,16,6,9,4,0,3,5,3,2,
+ 23,33,2,7,6,3,0,2,49,8,3,5,23,17,9,6,8,7,33,34,17,7,1,5,
+ 3,4,3,9,2,3,0,144,3,9,24,5,64,1,23,2,64,8,1,23,2,8,0,4,
+ 9,34,25,5,4,128,240,20,5,9,7,9,3,96,4,6,39,9,6,5,4,224,224,3,
+ 1,39,192,4,5,17,23,6,4,192,224,5,7,9,6,3,240,3,8,1,7,3,192,224,
+ 3,7,8,6,3,240,8,9,1,7,4,192,240,21,22,240,21,19,208,240,6,87,177,2,
+ 6,3,240,176,4,6,9,33,9,4,7,8,6,81,24,7,4,8,65,8,3,192,208,3,
+ 6,8,2,49,2,5,65,24,65,9,8,6,224,112,3,9,2,9,1,3,16,5,6,8,
+ 2,49,69,9,33,18,6,5,3,16,1,2,9,2,6,3,112,96,4,23,8,0,1,3,
+ 32,4,19,41,97,2,25,6,19,4,32,2,6,4,8,7,1,112,96,4,23,2,6,5,
+ 3,20,6,21,6,8,22,120,6,8,22,3,6,3,20,5,6,8,1,7,2,112,48,21,
+ 3,16,8,18,39,1,4,8,2,17,24,49,50,6,2,1,2,21,9,55,1,9,3,16,
+ 3,21,48,16,5,25,1,2,6,48,53,9,1,23,3,8,2,17,23,2,33,9,3,9,
+ 17,9,8,37,19,16,4,6,34,9,3,16,16,5,9,8,3,6,23,1,9,21,9,17,
+ 7,1,8,0,5,9,17,23,18,23,17,5,8,1,7,17,2,69,9,1,7,1,5,3,
+ 9,3,16,96,4,8,6,9,7,1,9,6,5,6,4,16,2,1,23,5,4,16,6,23,
+ 17,5,4,6,21,22,55,9,6,5,96,192,6,41,4,3,6,23,9,96,6,23,9,5,
+ 0,9,18,6,20,5,4,144,192,23,9,21,9,23,3,112,4,3,39,6,8,9,1,7,
+ 3,8,2,160,192,8,55,1,9,192,4,6,1,23,1,2,20,3,160,240,4,6,2,1,
+ 39,145,18,8,4,240,0,176,6,9,49,9,4,6,9,2,81,2,9,6,3,8,65,2,
+ 6,3,176,192,5,8,2,17,8,4,1,21,81,6,3,1,4,8,49,2,6,4,192,192,
+ 4,3,8,17,2,41,18,65,2,41,2,33,9,6,4,208,96,4,54,16,4,5,6,9,
+ 2,33,2,6,72,6,8,49,9,6,5,3,0,5,38,8,5,112,80,6,1,2,22,1,
+ 48,4,5,6,8,49,73,2,33,9,8,6,3,4,16,25,3,5,2,1,7,96,80,9,
+ 7,9,19,9,48,3,36,22,8,98,9,22,3,52,16,6,5,16,8,23,96,80,6,1,
+ 7,9,8,70,21,6,25,24,105,8,6,25,8,4,102,9,17,6,4,3,4,48,48,9,
+ 8,22,9,8,2,55,2,3,9,1,7,9,24,17,23,2,17,2,6,9,2,1,2,5,
+ 9,71,1,5,4,5,6,25,48,48,4,5,9,1,8,3,32,4,5,6,1,7,1,9,
+ 0,8,2,1,55,33,2,4,9,7,17,9,5,32,20,5,8,7,8,21,48,80,6,23,
+ 1,2,9,2,33,7,6,4,16,8,17,7,8,19,23,17,20,6,7,33,2,41,2,23,
+ 2,4,80,96,4,8,25,8,2,9,6,3,48,6,9,23,3,32,8,23,1,4,48,5,
+ 8,6,55,9,5,112,192,9,2,9,5,36,1,23,4,64,3,9,7,1,8,3,0,41,
+ 6,16,3,7,9,128,192,1,7,9,21,8,23,9,5,96,4,6,23,1,6,5,9,7,
+ 2,0,5,8,7,6,128,192,6,2,7,1,23,2,4,160,4,6,2,39,2,0,25,8,
+ 3,144,208,4,5,6,5,3,240,240,32,240,48,4,35,36,67,4,240,64,176,4,6,9,
+ 33,9,4,7,8,6,81,8,6,7,4,8,49,2,8,3,192,64,6,41,3,48,3,6,
+ 8,2,49,2,5,65,24,65,9,8,5,48,57,4,80,16,3,6,1,6,3,16,24,64,
+ 5,6,8,2,49,69,9,33,2,9,6,5,4,64,2,5,4,5,1,9,5,48,16,9,
+ 7,1,3,32,20,64,4,35,41,97,2,25,6,19,4,80,3,4,16,2,23,48,16,6,
+ 23,8,5,4,96,4,5,3,5,6,8,22,120,6,8,22,3,5,3,4,96,4,2,23,
+ 48,32,4,23,1,9,86,24,4,8,2,1,2,24,18,17,50,6,2,1,2,6,5,6,
+ 9,22,21,22,8,1,7,2,5,48,48,3,5,9,23,17,23,8,21,9,1,23,3,8,
+ 2,17,23,2,33,9,3,8,17,9,8,6,39,2,23,1,5,3,4,64,112,69,2,17,
+ 7,1,8,16,8,17,7,1,18,23,17,4,6,1,7,17,2,101,112,80,3,9,1,23,
+ 1,23,2,3,5,4,32,8,17,7,6,16,23,17,4,0,4,5,3,2,55,1,23,2,
+ 9,6,3,64,80,6,7,1,5,160,8,1,7,1,5,16,1,23,1,4,176,3,1,7,
+ 9,5,48,80,8,7,21,3,32,3,6,9,3,32,8,23,4,48,2,7,1,4,0,3,
+ 25,5,96,4,0,23,2,48,96,4,25,6,32,6,7,3,4,16,4,9,23,4,48,2,
+ 23,3,4,16,3,9,2,48,9,6,5,8,1,6,64,208,6,23,8,5,6,1,7,2,
+ 5,64,3,8,23,9,6,5,1,7,1,64,5,22,96,224,4,9,1,23,2,5,4,112,
+ 4,9,1,7,1,9,5,4,224,64,6,24,6,4,32,3,6,9,17,2,38,8,81,9,
+ 38,9,33,2,8,3,48,5,24,4,80,16,4,5,2,8,5,4,3,6,4,32,3,6,
+ 8,2,49,2,5,66,8,6,65,8,6,5,48,9,5,3,6,2,8,3,48,16,8,7,
+ 1,3,144,3,6,8,9,49,70,9,33,2,9,6,5,4,128,2,23,48,16,8,7,1,
+ 3,160,36,24,9,97,2,24,5,36,144,2,23,48,16,20,7,2,6,4,96,4,6,21,
+ 24,22,120,6,24,6,3,6,5,4,80,4,5,7,2,5,48,48,2,23,9,104,9,4,
+ 8,2,1,2,24,17,23,18,1,2,6,2,1,2,8,3,6,9,88,9,7,1,6,64,
+ 80,6,23,18,7,1,6,21,2,1,23,4,8,2,17,23,49,2,4,8,7,1,2,8,
+ 5,23,1,9,23,9,4,96,80,4,86,2,17,7,2,6,16,8,17,7,2,8,9,23,
+ 17,4,5,2,7,17,2,86,5,112,64,8,2,1,7,17,39,9,4,3,4,32,8,17,
+ 7,6,16,23,17,4,0,4,3,4,9,39,1,2,7,1,18,8,5,64,64,1,7,2,
+ 192,8,23,2,3,16,2,23,1,4,176,3,2,7,2,6,48,64,7,1,6,5,4,160,
+ 8,23,4,48,2,7,1,4,208,23,1,48,80,5,24,3,32,8,25,4,32,4,9,23,
+ 4,48,2,23,3,4,16,6,24,5,32,5,8,5,9,2,9,64,192,2,7,8,16,4,
+ 6,23,1,5,64,3,8,23,9,5,16,3,9,7,4,32,4,21,4,80,192,4,6,17,
+ 23,1,9,5,128,4,9,1,71,5,208,176,5,9,2,33,9,4,6,8,2,81,2,9,
+ 8,4,8,65,2,6,4,176,32,4,25,6,80,5,8,2,17,9,4,9,21,81,6,3,
+ 9,4,8,49,2,6,4,48,3,25,8,3,48,16,8,7,2,19,6,80,3,6,2,17,
+ 66,65,2,9,18,33,2,9,6,64,21,0,3,9,1,9,32,16,9,7,2,3,112,4,
+ 3,6,9,2,33,2,6,8,6,24,6,24,49,9,6,5,3,128,8,23,4,16,16,6,
+ 1,7,6,4,128,4,5,22,2,33,82,33,9,22,3,144,8,1,7,4,32,32,4,23,
+ 2,3,112,3,20,3,22,8,121,22,5,3,4,3,4,96,3,9,7,9,4,48,48,3,
+ 1,7,2,54,24,6,37,8,18,24,105,8,6,18,9,4,22,5,70,9,2,7,6,3,
+ 64,80,5,23,2,1,23,2,9,8,5,9,1,7,24,9,17,23,2,17,2,24,2,17,
+ 5,6,9,39,2,23,2,4,96,176,56,1,7,1,8,0,8,17,55,49,4,9,7,17,
+ 9,24,3,192,48,19,6,2,65,7,1,9,1,5,4,16,8,33,6,20,23,17,20,5,
+ 7,9,2,7,33,2,17,9,19,4,64,32,4,2,7,1,6,9,22,40,5,80,8,17,
+ 7,8,16,23,17,4,48,5,8,9,24,6,9,24,23,6,64,32,3,7,8,4,0,3,
+ 4,160,8,23,3,4,16,3,1,7,1,4,192,20,2,7,5,32,32,4,25,24,6,4,
+ 160,8,23,4,48,2,7,1,4,160,21,0,3,1,7,5,32,64,35,176,4,9,23,4,
+ 48,2,23,4,160,4,6,9,2,8,3,48,192,8,6,32,4,3,1,7,1,6,64,5,
+ 9,7,1,8,3,32,4,8,4,192,192,2,1,2,6,9,2,7,1,6,4,96,4,3,
+ 1,23,1,5,6,9,7,3,192,208,3,8,18,6,224,4,34,9,224,240,0,4,5,6,
+ 39,129,9,8,5,3,240,16,176,4,6,9,33,9,4,7,8,6,81,24,7,4,8,49,
+ 2,8,3,4,176,32,20,112,3,6,9,17,9,37,8,81,8,37,9,33,2,8,5,112,
+ 20,48,0,8,18,8,3,112,3,6,8,2,49,2,5,65,24,65,9,8,5,112,4,6,
+ 8,9,5,16,0,23,5,176,5,6,8,2,49,69,9,33,2,9,6,5,3,160,4,17,
+ 16,0,9,7,1,8,3,4,144,35,41,97,2,25,6,19,4,144,4,6,2,7,2,16,
+ 16,3,9,7,2,6,4,112,37,6,8,22,120,6,8,22,3,5,3,96,4,5,1,23,
+ 6,32,32,4,9,23,9,85,8,2,3,8,9,17,24,18,17,50,6,2,1,2,21,8,
+ 9,6,69,8,7,1,6,4,48,80,5,2,7,17,23,8,21,9,2,23,3,8,2,17,
+ 23,2,33,9,3,9,17,9,22,39,2,23,9,4,96,80,4,3,69,9,17,7,1,8,
+ 16,8,17,7,1,18,23,17,4,8,1,7,17,2,85,3,112,32,4,6,8,1,103,2,
+ 5,6,4,32,8,17,7,6,16,23,17,4,0,4,6,5,2,55,1,23,2,9,6,3,
+ 64,16,5,1,7,1,3,20,176,9,23,2,4,16,1,23,1,4,64,20,32,4,0,3,
+ 23,17,3,4,16,16,9,7,3,0,4,3,176,8,23,5,64,6,1,7,6,3,224,2,
+ 7,8,16,16,3,8,2,9,8,5,144,3,8,23,9,96,5,23,6,4,144,8,5,4,
+ 6,17,4,16,240,3,8,1,7,9,3,112,4,5,23,1,6,144,6,24,3,48,176,6,
+ 5,6,8,23,2,5,4,160,3,6,2,7,1,9,8,224,160,4,17,2,5,3,4,240,
+ 0,4,6,9,2,17,3,176,176,35,5,240,48,20,0,20,192,192,3,8,2,39,225,23,
+ 17,2,5,208,176,3,8,2,241,113,8,3,4,176,176,6,2,49,9,3,6,9,2,81,
+ 2,9,6,3,8,65,2,6,3,176,192,5,9,2,17,9,4,1,21,81,6,5,1,4,
+ 8,49,2,6,4,192,0,37,144,4,5,6,9,2,33,2,5,8,9,40,6,8,49,2,
+ 6,5,3,144,4,37,4,0,7,9,3,176,4,5,24,49,73,2,33,2,8,6,3,4,
+ 160,4,3,1,7,5,0,23,8,3,160,3,36,22,8,98,9,22,5,20,3,4,144,4,
+ 5,9,7,1,5,0,6,1,7,1,8,3,80,5,6,37,6,25,24,105,8,6,25,8,
+ 4,54,4,80,6,2,23,8,3,0,16,4,5,1,7,1,98,17,3,9,17,9,24,17,
+ 23,2,17,2,6,9,2,1,2,5,8,17,18,9,34,1,7,1,9,3,32,80,5,9,
+ 2,24,2,9,6,5,6,1,7,1,9,0,8,17,55,33,2,4,9,7,17,9,6,9,
+ 2,9,6,18,8,112,80,3,8,73,2,17,7,8,3,16,8,17,7,8,21,23,17,4,
+ 3,8,7,33,89,8,4,96,16,5,2,7,1,2,17,25,17,2,8,64,3,2,23,3,
+ 32,2,23,1,4,48,6,33,2,8,1,25,1,23,2,3,32,0,6,1,7,6,4,192,
+ 4,1,7,1,80,8,23,8,3,192,5,6,9,7,8,3,0,0,17,3,0,19,144,5,
+ 9,23,8,112,3,23,1,9,3,128,4,5,0,4,6,7,9,3,0,0,5,9,2,9,
+ 6,3,80,4,5,9,39,1,3,4,144,9,2,1,7,2,8,5,80,3,6,8,9,2,
+ 8,4,16,32,20,80,3,9,23,1,6,4,240,0,4,9,23,1,3,4,64,36,48,144,
+ 5,7,1,8,3,240,80,3,5,9,7,8,176,144,5,7,9,5,3,240,80,19,5,7,
+ 8,176,176,22,5,240,80,5,22,4,192,240,16,20,33,130,6,5,4,240,32,176,3,8,
+ 2,33,8,4,9,8,9,81,9,8,9,4,8,65,9,5,4,176,192,5,8,2,17,9,
+ 4,8,3,5,81,6,3,8,4,8,33,18,6,208,208,4,3,6,8,9,33,2,8,6,
+ 53,8,9,33,2,9,6,5,4,224,240,4,37,34,113,18,8,21,4,240,0,9,2,6,
+ 192,51,22,8,105,8,22,5,3,4,3,4,192,25,3,2,7,2,6,4,80,20,8,25,
+ 5,6,8,18,24,98,9,6,18,9,4,6,8,25,3,112,4,6,1,7,6,0,9,65,
+ 23,17,23,25,2,5,2,1,7,6,8,9,17,23,2,17,2,8,6,9,17,4,6,2,
+ 8,23,1,39,49,7,1,6,4,32,4,56,6,21,22,4,3,8,1,7,1,6,0,8,
+ 17,55,49,4,9,7,1,9,8,3,0,22,5,38,56,6,32,16,4,3,6,8,25,65,
+ 7,1,2,1,5,16,5,9,1,7,9,3,16,23,17,3,4,3,7,9,1,23,17,2,
+ 7,1,34,9,8,3,32,0,6,2,23,8,41,22,25,8,6,4,16,3,6,1,7,1,
+ 6,48,3,2,7,17,6,32,5,8,9,8,22,72,2,23,8,5,0,0,7,2,5,4,
+ 176,3,8,23,5,112,5,23,1,9,3,176,20,6,7,1,0,0,9,2,9,8,5,4,
+ 80,3,6,9,2,23,8,160,3,8,39,8,6,5,112,6,24,1,2,6,0,16,4,19,
+ 4,48,4,5,1,39,8,5,4,208,4,3,8,1,7,17,6,3,64,51,32,144,8,7,
+ 2,3,240,112,4,8,7,1,176,144,6,7,2,3,240,128,4,7,1,176,176,4,240,128,
+ 4,22,5,176,240,16,4,3,33,130,8,5,20,240,16,192,5,8,2,17,9,4,6,3,
+ 5,81,6,3,6,4,8,33,2,9,6,4,192,208,4,3,6,8,9,33,2,9,6,53,
+ 8,9,33,2,8,6,5,4,224,240,4,3,21,34,113,18,8,21,4,240,0,8,9,5,
+ 96,36,9,18,5,6,9,1,2,24,98,9,6,2,1,9,3,5,8,18,3,20,112,8,
+ 9,3,2,1,9,51,21,9,1,23,25,2,5,2,23,6,8,9,17,23,2,17,2,8,
+ 6,9,17,4,6,2,8,23,2,37,67,17,5,5,22,53,22,25,6,5,4,3,6,2,
+ 7,1,5,0,8,17,55,49,4,9,7,1,9,5,16,53,22,5,19,21,6,5,4,0,
+ 3,9,7,2,17,18,9,6,19,9,1,23,8,19,2,39,9,3,16,2,23,17,5,3,
+ 1,7,1,2,5,3,5,6,113,5,3,0,0,7,1,8,5,6,40,1,55,1,8,3,
+ 5,8,2,23,2,5,64,5,9,7,1,9,6,0,6,2,71,8,22,72,7,1,3,0,
+ 7,2,8,3,4,32,20,3,53,2,1,23,9,3,112,4,8,39,1,5,3,21,19,4,
+ 64,4,5,8,7,1,5,16,3,22,4,32,5,8,7,1,55,9,6,5,176,5,6,8,
+ 55,1,7,2,5,64,5,22,4,16,128,2,7,9,68,240,16,68,8,1,7,160,128,6,
+ 25,240,176,6,2,7,160,160,4,240,176,36,160,240,16,20,34,137,6,3,4,240,32,240,
+ 3,9,1,55,177,9,3,4,240,176,6,2,65,2,241,49,8,3,176,176,5,9,2,33,
+ 8,4,41,81,41,4,8,65,2,5,4,176,208,4,3,6,8,2,33,2,8,70,8,9,
+ 49,9,6,5,4,224,240,4,5,22,34,1,66,17,18,8,6,5,4,240,0,240,3,20,
+ 3,22,8,121,22,5,3,4,3,4,240,32,4,96,4,57,5,6,8,18,24,121,6,18,
+ 9,4,6,8,2,9,6,3,80,3,6,5,4,16,0,9,17,5,3,6,18,1,39,1,
+ 18,3,9,1,7,24,9,17,23,2,17,2,24,2,17,3,8,1,9,23,1,25,6,3,
+ 6,2,1,7,5,16,0,85,8,9,6,37,20,5,2,7,1,6,0,8,17,55,49,4,
+ 9,7,1,9,5,16,21,6,7,9,21,38,5,4,16,0,9,17,2,1,9,3,68,6,
+ 9,1,7,8,19,2,1,23,9,5,0,4,39,1,2,6,5,23,1,9,68,19,6,1,
+ 18,7,8,5,4,0,7,1,5,4,6,2,39,1,2,23,1,8,21,8,2,23,1,6,
+ 64,5,2,7,1,9,6,0,8,1,103,1,9,8,6,5,2,23,5,0,4,3,21,20,
+ 19,69,19,9,1,23,2,5,4,96,3,9,23,1,2,19,53,35,4,16,5,24,3,4,
+ 0,128,9,1,7,1,55,2,8,5,176,5,8,9,55,1,7,1,9,160,128,6,8,3,
+ 4,35,4,240,16,4,35,4,3,9,7,160,208,4,5,8,9,2,33,9,5,9,2,9,
+ 18,8,6,49,2,8,6,5,224,112,21,3,64,3,5,8,9,49,72,2,33,2,9,6,
+ 3,4,64,21,3,112,96,4,7,1,6,64,52,24,9,82,1,2,24,5,36,64,4,2,
+ 23,112,96,4,17,2,8,53,6,5,6,25,8,6,120,6,25,8,3,22,37,6,9,1,
+ 7,2,112,128,5,9,55,1,4,8,2,1,2,24,17,23,2,17,2,6,2,17,9,3,
+ 9,71,8,3,128,16,4,3,4,128,20,2,23,1,4,8,2,1,39,49,2,4,9,7,
+ 17,6,4,16,20,64,36,32,16,8,7,8,4,112,3,8,7,9,5,16,8,17,7,9,
+ 22,23,17,4,5,9,7,1,9,6,128,5,9,17,3,0,16,6,1,9,3,64,4,0,
+ 5,9,7,3,48,9,23,3,32,23,17,4,16,4,17,2,8,4,0,4,64,6,2,1,
+ 6,16,128,3,6,2,0,5,6,5,48,8,1,7,2,4,48,6,2,7,5,4,32,5,
+ 22,4,5,2,3,4,128,128,9,1,2,0,1,7,2,20,3,8,23,9,96,5,23,2,
+ 5,4,3,8,1,7,3,6,1,2,5,128,192,6,2,71,8,3,144,8,1,71,8,4,
+ 192,208,4,3,6,21,3,192,4,3,21,19,224,176,3,8,2,33,9,4,2,25,81,9,
+ 8,2,4,8,65,9,5,4,176,208,3,6,2,65,2,9,65,2,9,65,2,8,6,224,
+ 128,4,35,20,3,6,8,9,33,2,9,6,53,8,9,33,2,8,6,5,4,16,4,19,
+ 144,112,6,17,25,3,32,3,21,34,113,18,8,21,4,32,4,25,1,6,128,112,2,7,
+ 1,8,20,16,5,35,22,8,105,8,22,5,3,4,3,4,32,6,9,7,8,128,128,6,
+ 9,8,1,7,17,3,6,9,18,24,98,9,6,18,9,3,6,9,1,23,1,25,4,128,
+ 16,6,18,8,4,64,5,54,2,23,6,8,9,17,23,2,17,2,8,6,9,17,6,21,
+ 22,3,64,4,41,3,16,16,6,1,9,3,112,6,2,1,7,2,5,0,8,17,55,49,
+ 4,9,7,33,2,128,4,6,2,7,3,0,16,3,6,5,4,96,6,2,7,9,3,32,
+ 8,17,7,6,16,23,17,4,0,3,2,6,2,7,9,4,112,4,21,4,0,176,8,7,
+ 1,3,64,8,1,23,6,16,23,17,4,48,3,5,1,7,8,4,160,144,4,6,2,3,
+ 4,0,6,24,4,0,8,23,3,48,2,7,1,4,3,24,6,3,0,4,9,2,6,160,
+ 128,3,9,17,5,16,7,1,9,0,4,9,23,4,48,2,23,19,6,9,7,6,0,25,
+ 2,8,160,240,23,2,6,23,1,5,64,3,9,23,2,9,23,6,240,240,3,2,23,1,
+ 6,4,112,3,1,39,3,240,0,224,4,8,87,177,2,6,3,240,176,6,2,49,2,22,
+ 2,113,2,6,8,9,81,8,3,176,176,4,6,9,33,9,4,7,8,6,81,24,7,4,
+ 8,49,2,8,4,192,208,3,6,8,2,49,2,5,65,24,65,9,8,5,224,112,4,6,
+ 2,8,2,5,16,5,6,8,2,49,6,53,9,33,2,9,6,5,4,0,4,25,8,5,
+ 4,128,112,23,9,0,1,5,32,4,19,41,97,2,25,5,19,4,32,2,8,5,7,2,
+ 6,112,112,23,9,4,8,3,0,4,37,6,8,22,120,6,24,6,3,6,3,4,0,8,
+ 5,3,2,7,2,112,32,3,8,6,5,0,9,1,7,2,22,8,9,4,8,2,17,24,
+ 17,23,50,6,2,1,2,6,3,6,9,22,9,23,2,6,0,22,5,48,0,5,18,5,
+ 9,6,16,35,23,2,5,9,1,23,3,8,2,17,23,2,33,9,3,9,17,2,8,6,
+ 23,9,19,4,16,2,24,9,2,4,0,16,22,128,3,8,1,7,2,6,16,8,17,7,
+ 1,18,23,17,4,6,1,7,17,2,5,128,3,9,6,4,0,176,6,2,23,5,4,32,
+ 8,17,7,6,16,23,17,4,0,4,5,3,9,23,8,5,112,4,32,144,3,1,7,1,
+ 5,32,4,5,0,8,1,7,1,5,16,1,23,1,36,48,5,23,8,160,144,3,23,3,
+ 32,5,9,2,0,8,23,4,48,2,7,1,4,6,9,6,16,3,21,2,9,160,144,3,
+ 7,1,6,4,16,9,7,2,4,9,23,4,48,2,23,3,9,23,16,8,41,5,160,160,
+ 35,4,16,9,1,9,1,7,1,5,64,3,8,23,33,0,4,3,4,208,240,0,4,6,
+ 7,2,5,4,112,4,2,1,2,4,240,16,144,20,16,3,6,8,2,49,9,5,2,49,
+ 8,6,65,24,5,0,36,160,80,3,6,1,9,2,7,3,32,5,6,8,2,49,6,53,
+ 9,33,2,9,6,5,4,16,9,2,8,2,9,6,112,80,9,7,2,3,5,7,3,48,
+ 4,19,24,9,97,2,24,5,19,4,32,25,0,3,2,7,3,96,64,4,8,7,9,5,
+ 3,8,4,16,4,37,24,22,120,6,24,6,3,6,3,4,0,19,0,4,9,7,5,36,
+ 48,32,5,3,9,24,23,2,8,22,8,9,4,8,2,1,2,24,17,23,50,6,2,1,
+ 2,6,3,6,9,38,9,7,1,8,0,34,3,32,64,19,0,19,8,9,23,9,5,2,
+ 1,23,4,8,2,17,23,49,2,3,8,17,2,8,6,23,1,2,3,4,16,20,3,48,
+ 144,4,3,22,9,1,7,2,6,16,8,17,7,2,25,23,17,4,6,2,7,17,2,22,
+ 5,3,160,128,5,8,1,55,5,4,32,8,17,7,6,16,23,17,4,0,4,5,3,9,
+ 39,17,8,3,4,112,112,6,23,2,4,48,4,19,0,8,1,7,2,5,16,2,23,1,
+ 20,3,80,5,1,7,1,8,112,112,23,2,20,32,5,41,0,8,23,4,48,2,7,1,
+ 4,6,2,8,4,64,4,23,8,112,128,6,41,3,16,1,7,9,19,2,23,4,48,2,
+ 23,3,4,5,7,2,6,0,4,2,25,1,5,128,240,5,23,9,23,2,5,64,3,8,
+ 23,1,2,7,6,4,16,6,21,160,240,0,4,6,1,9,5,4,112,4,9,17,4,240,
+ 16,48,4,6,41,3,48,3,6,8,2,49,9,5,2,49,8,6,65,8,6,5,48,57,
+ 4,80,16,3,8,1,6,3,16,8,6,64,5,6,8,2,49,6,53,9,33,2,9,6,
+ 5,4,64,2,5,4,5,1,9,6,48,16,8,7,1,3,32,20,80,36,24,9,97,2,
+ 24,5,19,4,80,3,4,16,2,23,48,32,4,23,1,9,86,8,9,4,8,2,1,2,
+ 24,17,23,18,1,2,6,2,1,2,6,3,6,9,86,8,1,7,2,5,48,48,4,3,
+ 8,23,2,1,23,6,21,2,1,23,3,8,2,17,23,49,2,3,8,17,2,8,6,23,
+ 1,9,23,2,3,20,64,80,5,9,1,23,2,23,9,19,4,32,8,17,7,6,16,23,
+ 17,4,0,4,5,3,9,39,1,2,7,1,18,8,3,64,80,8,7,21,3,32,4,5,
+ 9,3,32,8,23,4,48,2,7,1,4,0,4,25,5,128,23,9,48,96,4,9,8,5,
+ 32,6,7,3,32,4,9,23,4,48,2,23,3,4,16,3,9,1,48,9,22,8,1,6,
+ 64,208,6,23,8,6,8,23,2,5,64,3,8,23,9,6,5,1,7,2,64,3,21,96,
+ 224,4,9,1,7,1,9,5,128,4,9,1,7,1,9,5,4,224,16,8,7,1,3,32,
+ 20,80,36,24,9,97,2,24,5,19,96,20,16,2,23,48,32,4,23,1,9,86,8,9,
+ 4,8,2,1,2,24,17,23,18,1,2,6,2,1,2,6,3,6,9,86,8,1,7,9,
+ 5,48,48,4,3,8,23,2,1,23,8,21,2,1,23,3,8,2,17,23,49,2,3,8,
+ 17,2,8,6,23,1,9,23,2,3,20,64,80,5,9,1,23,2,23,9,19,4,32,8,
+ 17,7,6,16,23,17,4,0,4,5,3,9,55,2,7,1,18,8,3,64,80,6,7,2,
+ 3,160,8,1,7,2,3,16,2,23,1,4,176,3,2,7,9,5,48,96,4,9,8,5,
+ 32,6,7,3,32,4,2,23,4,48,2,23,3,4,16,3,9,1,48,9,22,9,1,6,
+ 64,208,6,23,8,6,8,23,2,5,64,3,8,23,9,6,5,1,7,1,64,3,21,96,
+ 224,4,9,23,1,9,5,128,4,9,1,7,1,9,5,4,224,
+};
+static const uint16_t octopus_row_offsets[] = {
+ 0,4,10,23,33,45,58,66,81,101,118,145,177,202,226,258,293,317,350,373,400,430,454,472,
+ 485,494,506,526,555,587,605,631,665,698,723,754,777,797,827,849,866,873,884,895,906,916,936,963,
+ 993,1019,1041,1061,1087,1120,1147,1178,1205,1228,1252,1268,1288,1310,1324,1331,1344,1353,1365,1378,1387,1403,1432,1462,
+ 1485,1510,1527,1550,1579,1607,1643,1674,1696,1717,1735,1747,1771,1788,1793,1800,1813,1825,1837,1847,1868,1901,1924,1948,
+ 1974,1994,2017,2048,2076,2111,2133,2154,2170,2188,2211,2222,2231,2240,2251,2263,2273,2284,2301,2329,2354,2383,2409,2439,
+ 2465,2489,2520,2549,2569,2584,2595,2606,2618,2633,2650,2662,2672,2681,2692,2702,2713,2733,2763,2786,2814,2835,2863,2888,
+ 2913,2943,2962,2983,2994,3009,3026,3037,3048,3067,3088,3107,3134,3154,3181,3211,3249,3288,3330,3358,3372,3383,3394,3405,
+ 3418,3429,3444,3464,3483,3498,3516,3531,3549,3572,3601,3639,3667,3700,3731,3741,3750,3759,3771,3783,3790,3803,3814,3826,
+ 3838,3853,3872,3889,3906,3921,3932,3956,3991,4033,4065,4088,4105,4122,4139,4158,4168,4178,4189,4209,4229,4247,4257,4276,
+ 4313,4353,4389,4408,4427,4442,4460,4471,4484,4493,4508,4524,4538,4567,4603,4632,4657,4685,4708,4735,4755,4769,4778,4799,
+ 4816,4832,4854,4881,4913,4946,4971,5002,5024,5054,5086,5103,5110,5123,5134,5146,5160,5177,5202,5230,5253,5273,5307,5328,
+ 5360,5392,5416,5437,5464,5486,5506,5515,5526,5537,5558,5583,5609,5634,5658,5679,5703,5729,5754,5785,5806,5831,5849,5861,
+ 5877,5898,5914,5926,5935,5947,5957,5971,5992,6021,6046,6070,6093,6114,6141,6163,6197,6234,6255,6274,6288,6304,6328,6343,
+ 6350,6356,6369,6380,6411,6436,6458,6483,6503,6528,6558,6582,6621,6659,6679,6694,6705,6716,6727,6744,6761,6768,6780,6791,
+ 6802,6824,6854,6878,6901,6924,6950,6983,7011,7046,7081,7100,7111,7122,7134,7147,7163,7172,7179,7189,7200,7210,7231,7251,
+ 7277,7303,7329,7357,7385,7416,7440,7475,7501,7521,7537,7554,7568,7585,7594,7608,7620,7640,7662,7675,7693,7709,7730,7763,
+ 7801,7834,7868,7897,7913,7932,7945,7962,7973,7983,8004,8018,8036,8048,8063,8102,8142,8170,8202,8222,8237,8252,8267,8278,
+ 8286,8295,8306,8327,8342,8361,8375,8393,8423,8458,8481,8514,8532,8549,8566,8580,8592,8598,8606,8618,8628,8648,8666,8682,
+ 8699,8720,8753,8782,8818,8842,8860,8879,8900,8915,8924,8930,8941,8953,8974,8994,9009,9027,9047,9074,9103,9134,9164,9200,
+ 9235,9254,9273,9295,9310,9318,9327,9350,9382,9406,9430,9463,9496,9521,9554,9576,9605,9635,9658,9676,9688,9710,9734,9768,
+ 9801,9826,9853,9882,9905,9924,9947,9969,10004,10038,10066,10091,10124,10148,10174,10208,10241,10266,10298,10320,10339,10366,10391,10410,
+ 10419,10432,10458,10489,10519,10542,10561,10589,10624,10657,10693,10724,10746,10771,10796,10820,10839,10851,10858,10868,10889,10918,10947,10974,
+ 10997,11026,11053,11083,11107,11138,11161,11185,11208,11222,11242,11263,11276,11288,11297,11312,11332,11352,11372,11396,11418,11442,11473,11499,
+ 11530,11554,11574,11596,11613,11625,11638,11654,11667,11673,11684,11703,11721,11735,11770,11801,11834,11872,11892,11912,11931,11942,11955,11968,
+ 11981,11994,12003,12020,12039,12065,12091,12116,12145,12171,12192,12215,12230,12242,12253,12264,12274,12282,12294,12305,12323,12344,12358,12376,
+ 12396,12422,12450,12473,12501,12525,12549,12573,12588,12602,12611,12624,12634,12649,12660,12671,12692,12719,12747,12780,12808,12843,12868,12882,
+ 12898,12911,12923,12930,12941,12951,12961,12979,13000,13015,13035,13061,13088,13113,13142,13171,13206,13236,13251,13264,13279,13292,13300,13313,
+ 13325,13337,13347,13364,13384,13400,13421,13449,13472,13496,13535,13570,13607,13631,13658,13672,13687,13700,13712,13732,13751,13770,13801,13827,
+ 13849,13878,13912,13937,13966,13990,14014,14047,14063,14073,14086,14097,14110,14125,14144,14169,14198,14226,14244,14271,14303,14333,14359,14388,
+ 14410,14441,14474,14493,14508,14517,14540,14569,14594,14612,14640,14670,14702,14728,14760,14783,14811,14843,14864,14877,14886,14906,14923,14948,
+ 14975,14996,15026,15062,15090,15121,15153,15178,15204,15230,15254,15276,15288,15293,15306,15314,15326,15334,15349,15370,15387,15401,15416,15429,
+ 15447,15479,15513,15550,15580,15601,15624,15647,15661,15684,15700,15708,15720,15730,15749,15770,15787,15803,15817,15841,15873,15902,15940,15961,
+ 15986,16001,16011,16021,16033,16047,16065,16076,16086,16106,16127,16146,16158,16172,16203,16225,16254,16275,16295,16309,16319,16329,16339,16350,
+ 16365,16374,16386,16406,16427,16442,16460,16478,16500,16530,16567,16597,16632,16651,16664,16676,16685,16697,16709,16722,16730,16738,16748,16770,
+ 16784,16803,16824,16849,16875,16912,16944,16982,17005,17019,17030,17040,17051,17064,17072,17083,17103,17123,17147,17173,17193,17216,17253,17295,
+ 17335,17358,17374,17386,17399,17412,17419,17427,17446,17461,17489,17514,17542,17571,17604,17643,17675,17696,17716,17731,17743,17763,17783,17800,
+ 17826,17854,17877,17902,17937,17973,18003,18030,18054,18079,18098,18107,18116,18137,18159,18190,18214,18241,18274,18308,18331,18364,18387,18416,
+ 18447,18471,18489,18515,18549,18572,18590,18617,18648,18680,18706,18740,18761,18780,18810,18836,18851,18872,18901,18929,18958,18981,19006,19033,
+ 19065,19084,19115,19145,19170,19193,19212,19234,19257,19267,19280,19301,19322,19348,19369,19392,19418,19449,19479,19505,19537,19565,19587,19612,
+ 19630,19648,19664,19673,19684,19694,19714,19734,19759,19782,19805,19834,19869,19902,19928,19961,19985,20011,20043,20063,20077,20090,20099,20109,
+ 20130,20150,20170,20181,20199,20229,20265,20297,20335,20371,20393,20421,20445,20457,20468,20476,20487,20509,20529,20541,20570,20605,20639,20676,
+ 20711,20743,20770,20782,20791,20797,20807,20817,20827,20844,20862,20877,20891,20918,20958,20991,21029,21067,21097,21116,21132,21153,21174,21194,
+ 21219,21245,21272,21304,21338,21367,21396,21409,21421,21441,21456,21481,21501,21526,21552,21583,21612,21645,21667,21696,21723,21739,21753,21762,
+ 21778,21798,21813,21842,21866,21894,21932,21971,22001,22027,22052,22078,22103,22124,22140,22160,22191,22218,22249,22286,22320,22347,22374,22401,
+ 22426,22454,22474,22489,22514,22547,22571,22605,22639,22672,22699,22729,22752,22770,22792,22826,22860,22892,22915,22945,22968,22985,
+};
+static const uint16_t octopus_frame_rows[] = {
+ 0,1,2,3,4,5,6,6,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
+ 22,0,0,0,1,23,24,25,5,6,6,6,7,26,9,27,28,29,30,31,32,33,34,35,
+ 36,37,38,39,0,0,0,40,41,42,43,44,6,6,6,45,46,47,48,49,50,51,52,53,
+ 54,55,56,57,58,59,60,61,0,62,63,64,65,66,67,6,6,68,69,70,71,72,73,74,
+ 75,76,77,78,79,80,81,82,82,83,84,85,86,87,88,89,90,6,6,6,91,92,93,94,
+ 95,96,97,98,99,100,101,102,103,82,82,82,104,105,106,107,108,109,110,111,6,6,112,113,
+ 114,115,116,117,118,119,120,121,122,123,124,125,126,125,127,128,129,130,131,132,133,66,134,6,
+ 6,135,136,137,138,139,140,141,142,143,144,145,146,147,127,127,127,127,148,149,150,151,132,133,
+ 66,134,6,6,135,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,0,
+ 40,41,42,43,44,6,6,6,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,
+ 186,0,0,187,188,189,190,191,6,6,6,192,193,194,195,196,197,198,199,200,201,202,203,204,
+ 205,206,207,0,0,0,0,40,208,209,43,44,6,6,6,210,211,172,212,174,213,214,215,216,
+ 217,218,219,220,221,222,0,0,0,0,1,223,224,25,5,6,6,6,7,8,9,225,226,227,
+ 228,229,230,231,232,233,234,235,236,0,0,0,0,1,2,237,4,5,6,6,6,7,238,239,
+ 240,226,241,242,243,244,245,246,247,248,249,250,251,0,0,0,187,252,253,254,255,6,6,6,
+ 192,193,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,0,0,40,271,209,272,44,
+ 6,6,6,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,0,0,290,291,
+ 292,66,293,6,6,294,295,296,297,298,299,300,301,302,303,304,305,306,307,82,308,309,310,311,
+ 312,313,314,254,5,6,6,6,7,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,
+ 330,331,332,40,333,334,335,44,6,6,6,170,336,337,338,339,340,341,342,343,344,345,346,347,
+ 348,349,350,351,352,0,353,354,355,272,356,6,6,6,357,358,359,360,361,362,363,364,365,366,
+ 367,368,369,370,371,372,373,0,0,374,132,375,66,293,6,6,135,376,377,378,379,380,381,382,
+ 383,384,385,386,387,388,389,390,391,0,0,0,290,132,292,66,392,6,6,294,295,393,394,395,
+ 396,397,398,399,400,401,402,403,404,405,406,407,0,0,0,408,108,409,66,134,6,6,112,113,
+ 410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,0,0,0,425,188,426,190,427,6,
+ 6,6,192,428,194,429,430,431,432,433,434,435,436,437,438,439,440,441,442,0,0,0,353,443,
+ 209,444,356,6,6,6,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,0,0,
+ 0,1,2,461,4,5,6,6,6,7,8,9,462,463,464,465,466,467,468,469,470,471,472,473,
+ 474,0,0,0,1,2,224,475,5,6,6,6,7,8,9,476,463,477,465,478,479,480,469,470,
+ 481,482,483,484,0,0,0,1,2,461,4,5,6,6,6,7,8,9,485,463,486,465,487,479,
+ 480,488,18,481,489,483,484,0,0,0,1,23,224,25,5,6,6,6,7,8,490,491,492,29,
+ 493,494,495,496,497,498,499,500,501,502,0,0,0,503,504,426,190,427,6,6,6,192,505,506,
+ 507,508,509,510,511,512,513,514,515,516,517,518,519,520,0,0,521,522,355,110,356,6,6,6,
+ 523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,0,0,63,64,540,66,541,
+ 6,6,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,187,188,561,
+ 190,191,6,6,6,192,562,256,195,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,
+ 353,443,355,444,356,6,6,6,445,358,578,212,579,580,581,582,583,584,585,586,587,588,589,590,
+ 591,592,0,593,132,594,66,293,6,6,135,595,596,597,598,599,600,601,602,603,604,605,606,607,
+ 608,609,610,611,0,0,612,132,613,66,293,6,6,614,376,377,597,598,615,616,617,618,619,620,
+ 621,622,623,624,625,626,0,0,0,107,108,627,110,628,6,6,629,630,631,632,633,634,635,636,
+ 637,638,639,640,641,642,643,644,645,0,0,0,86,646,647,648,649,6,6,6,650,651,652,653,
+ 654,655,656,657,658,659,660,661,662,663,0,0,0,0,0,0,664,64,665,66,67,6,6,542,
+ 666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,0,0,0,0,187,681,682,254,683,
+ 6,6,6,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,0,0,0,1,23,
+ 700,25,5,6,6,6,7,8,701,702,703,704,705,706,707,708,709,710,711,712,713,714,0,0,
+ 0,715,271,209,272,44,6,6,6,445,716,717,718,719,720,721,722,723,724,725,726,727,728,729,
+ 730,731,0,732,733,734,735,66,736,6,6,737,738,739,740,741,742,743,744,745,746,747,748,749,
+ 750,82,751,752,753,0,754,755,647,648,756,6,6,6,757,758,759,760,761,213,762,763,764,765,
+ 766,767,768,769,770,771,772,773,774,775,132,133,66,134,6,6,112,776,777,411,778,779,780,781,
+ 782,783,784,785,786,787,788,788,789,790,791,792,793,64,292,66,67,6,6,294,794,795,796,797,
+ 798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,132,133,110,134,6,6,112,136,
+ 814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,0,0,40,333,334,830,44,6,
+ 6,6,831,832,759,833,834,835,836,837,838,839,840,841,842,843,844,845,0,0,0,732,2,846,
+ 4,66,6,6,6,737,847,739,848,849,850,851,852,853,854,855,856,857,858,0,0,0,0,0,
+ 0,40,859,334,830,44,6,6,6,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,
+ 0,0,0,0,875,2,237,735,66,736,6,6,737,876,739,877,878,879,880,881,882,883,884,885,
+ 886,887,888,889,0,0,0,1,313,682,25,5,6,6,6,684,685,890,891,892,893,894,895,896,
+ 897,898,899,900,901,902,903,0,0,0,353,522,355,444,356,6,6,6,904,905,906,907,908,909,
+ 910,911,912,913,914,915,916,917,918,919,920,0,732,921,846,4,66,736,6,6,737,922,923,924,
+ 925,926,927,928,929,930,931,932,933,934,935,936,937,938,0,40,333,647,939,940,6,6,6,941,
+ 942,759,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,0,958,108,133,66,134,6,
+ 6,112,959,960,411,961,962,963,964,965,966,967,968,969,970,971,972,973,974,0,0,975,132,133,
+ 66,134,6,6,112,136,976,597,977,978,780,979,980,981,982,983,984,985,986,987,988,0,0,0,
+ 989,990,627,110,111,6,6,991,992,410,632,993,994,995,996,997,998,999,1000,1001,1002,1003,0,0,
+ 0,0,0,425,188,426,190,427,6,6,6,192,428,194,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,
+ 1014,1015,0,0,0,0,0,151,132,409,66,134,6,6,112,1016,976,1017,1018,1019,1020,1021,1022,1023,
+ 1024,1025,1026,1027,1028,1029,0,0,0,0,1,2,1030,4,5,6,6,6,1031,1032,239,1033,1034,1035,
+ 1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,0,0,0,1,223,224,25,5,6,6,6,7,8,9,
+ 1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,0,0,0,1,23,224,25,5,6,6,6,
+ 7,8,9,1059,1060,1061,465,1062,1063,468,1064,18,1065,1066,1067,1068,0,0,0,1,23,224,25,5,
+ 6,6,6,7,8,9,1059,1060,1069,465,1070,1071,480,1072,1073,1065,1074,1075,1076,0,0,
+};
+static const char octopus_alphabet[] = " #%,.:;@ox";
+static const ht_ascii_clip_t octopus_clip = {
+ .cols=54, .rows=27, .symbols=10, .frames=63,
+ .unique_rows=1077, .data_bytes=sizeof octopus_data,
+ .alphabet=octopus_alphabet, .frame_rows=octopus_frame_rows,
+ .row_offsets=octopus_row_offsets, .data=octopus_data,
+};
+static const uint8_t octopus_eyes[] = {10,10,10,9,9,9,9,9,9,9,10,10,10,10,10,9,9,9,9,9,8,9,9,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,10,10,10,9,9,9,8,9,9,9,10,10,10,10,9,9,9,9,9,9,10,10,10,10,10};
+static const uint16_t octopus_ends[] = {100,170,270,330,430,500,600,670,770,830,930,1000,1100,1170,1270,1330,1430,1500,1600,1670,1770,1830,1930,2000,2100,2170,2270,2330,2430,2500,2600,2670,2770,2830,2930,3000,3100,3170,3270,3330,3430,3500,3600,3670,3770,3830,3930,4000,4100,4170,4270,4330,4430,4500,4600,4670,4770,4830,4930,5000,5100,5170,5210};
diff --git a/devices/harness-device/firmware/main/ui/habitat/octopus_font.c b/devices/harness-device/firmware/main/ui/habitat/octopus_font.c
new file mode 100644
index 000000000..277c7f7f1
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/octopus_font.c
@@ -0,0 +1,135 @@
+// Generated by scripts/gen_octopus.py. Habitat Octopus ASCII atlas.
+// Derived from Jgs7, (c) 2022 Adel Faure, Velvetyne; SIL OFL 1.1.
+// This atlas remains OFL-licensed; see fonts/Jgs-OFL.txt.
+#include "octopus.h"
+static const uint8_t octopus_2_pixels[] = {
+ 0,0,0,80,80,64,80,0,0,0,16,16,0,0,0,0,0,16,64,64,16,64,64,64,
+ 80,64,0,0,64,16,64,64,64,0,80,64,0,80,16,64,0,80,0,64,0,16,0,0,
+ 16,0,80,64,64,0,16,16,64,64,64,0,0,0,16,0,0,16,80,0,80,64,16,16,
+ 16,0,0,80,0,16,16,16,16,16,0,64,64,64,0,64,0,16,0,0,0,0,0,
+};
+const ht_font_t ht_octopus_font_2 = {32,126,1,2,octopus_2_pixels};
+static const uint8_t octopus_4_pixels[] = {
+ 0,0,68,0,80,0,85,85,144,128,16,84,85,0,0,0,17,16,68,64,10,80,72,68,
+ 0,0,5,0,0,0,16,68,69,0,17,16,80,80,81,0,21,80,81,64,84,0,17,64,
+ 84,0,65,0,0,0,0,0,84,16,80,80,81,64,0,0,21,16,85,80,84,64,84,16,
+ 5,64,84,80,84,64,85,16,85,80,68,64,21,16,88,80,68,80,85,80,89,80,69,0,
+ 4,64,69,0,4,80,81,64,68,64,85,80,85,80,85,80,85,80,4,64,84,80,68,64,
+ 64,17,68,64,85,0,0,5,0,0,22,16,69,80,20,80,21,80,73,64,84,64,4,16,
+ 69,80,64,64,16,21,72,80,68,64,6,64,5,80,5,80,4,85,1,85,5,64,5,0,
+ 68,80,85,0,5,0,69,16,5,80,5,85,80,80,20,0,68,68,65,64,16,0,
+};
+const ht_font_t ht_octopus_font_4 = {32,126,2,4,octopus_4_pixels};
+static const uint8_t octopus_6_pixels[] = {
+ 0,0,0,0,0,16,65,0,32,0,0,80,0,0,0,70,100,81,153,16,33,82,85,32,
+ 0,20,17,4,69,16,97,106,145,100,0,16,0,0,0,0,16,65,4,16,16,64,65,4,
+ 65,0,17,155,149,0,0,16,74,132,16,64,0,0,0,16,0,0,10,128,0,0,0,0,
+ 0,16,0,4,17,4,65,0,2,165,81,32,0,0,133,4,16,0,0,97,4,36,0,1,
+ 161,17,36,0,2,69,24,16,0,1,85,17,16,0,2,89,17,16,0,1,144,68,64,0,
+ 2,162,17,100,0,1,86,145,32,0,0,64,0,16,0,0,64,0,17,0,0,84,9,4,
+ 0,2,160,0,168,0,1,64,84,64,0,68,17,0,16,0,0,165,84,16,0,1,88,106,
+ 132,0,1,170,17,100,0,2,148,17,32,0,1,164,81,96,0,1,154,16,100,0,1,154,
+ 16,64,0,2,85,81,16,0,1,26,145,68,0,1,145,4,100,0,0,16,81,36,0,2,
+ 89,36,68,0,1,4,16,100,0,2,101,81,68,0,1,26,86,68,0,2,164,81,32,0,
+ 2,152,105,128,0,2,148,85,20,0,1,90,100,68,0,2,81,17,16,0,1,145,4,16,
+ 0,1,20,81,100,0,1,20,20,16,0,1,20,85,152,0,1,18,4,68,0,1,21,4,
+ 16,0,1,161,16,100,0,0,81,4,20,0,64,65,1,4,0,2,65,4,144,0,21,20,
+ 0,0,0,0,0,0,0,0,16,0,0,0,0,0,134,145,32,0,2,132,81,32,0,0,
+ 132,81,32,0,0,100,81,16,0,0,74,80,16,0,1,154,16,64,0,0,132,90,68,128,
+ 1,10,81,68,0,0,64,4,16,0,0,16,1,68,144,1,21,40,68,0,0,65,4,16,
+ 0,0,6,85,68,0,0,6,81,68,0,0,132,81,32,0,0,10,145,161,0,0,9,145,
+ 24,16,0,6,80,64,0,0,134,81,32,0,2,10,17,32,0,0,4,81,100,0,0,4,
+ 84,16,0,0,4,85,84,0,1,17,8,68,0,0,4,90,68,144,1,144,4,100,0,16,
+ 68,0,16,80,16,65,4,16,64,64,0,64,17,64,84,16,0,0,0,
+};
+const ht_font_t ht_octopus_font_6 = {32,126,3,6,octopus_6_pixels};
+static const uint8_t octopus_8_pixels[] = {
+ 0,0,0,0,0,0,0,0,32,32,32,32,0,16,16,0,40,40,0,0,0,0,0,0,
+ 237,136,136,136,136,237,136,68,32,56,160,112,40,184,32,0,42,4,8,8,32,32,42,128,
+ 0,40,164,129,136,37,0,0,24,16,0,0,0,0,0,0,2,8,8,8,8,5,2,2,
+ 32,32,32,32,32,32,32,128,32,100,253,100,32,0,0,0,32,32,185,32,32,32,32,16,
+ 0,0,0,0,0,24,16,0,0,0,170,0,0,0,0,0,0,0,0,0,0,32,0,0,
+ 2,4,8,8,32,32,32,128,32,136,136,168,136,32,0,0,0,24,24,8,8,8,0,0,
+ 24,82,5,4,32,106,0,0,24,18,9,2,18,24,0,0,0,8,88,136,173,8,4,0,
+ 168,128,160,8,68,32,0,0,32,132,160,136,136,32,0,0,0,168,8,36,16,128,0,0,
+ 32,136,100,136,136,32,0,0,32,136,136,40,72,32,0,0,32,0,0,0,0,32,0,0,
+ 0,4,4,0,0,8,16,0,2,8,32,128,104,2,0,0,170,0,0,0,0,170,0,0,
+ 128,32,8,2,41,128,0,0,136,0,32,0,0,32,0,0,40,1,138,162,152,40,0,0,
+ 32,136,136,168,136,136,0,0,160,136,164,136,136,160,0,0,36,132,128,128,68,36,0,0,
+ 160,136,136,136,136,160,0,0,168,128,164,128,128,168,0,0,168,128,164,128,128,64,0,0,
+ 32,132,128,168,136,32,0,0,0,136,168,136,136,136,0,0,168,32,32,32,32,168,0,0,
+ 8,8,8,8,136,32,0,0,1,132,148,160,152,129,0,0,64,128,128,128,128,168,0,0,
+ 0,152,152,136,136,136,0,0,0,152,136,168,152,136,0,0,32,136,136,136,136,32,0,0,
+ 160,136,136,160,128,128,0,0,32,136,136,136,160,36,0,0,160,136,136,160,144,132,0,0,
+ 32,132,96,8,68,32,0,0,168,32,32,32,32,16,0,0,136,136,136,136,136,32,0,0,
+ 0,136,136,40,40,32,0,0,0,136,136,136,168,136,0,0,0,136,84,32,16,136,0,0,
+ 0,136,40,32,32,32,0,0,168,4,4,32,80,168,0,0,41,32,32,32,32,41,0,0,
+ 32,32,32,8,8,1,2,2,160,32,32,32,32,160,0,0,33,34,130,0,0,0,0,0,
+ 0,0,0,0,0,0,0,170,36,4,0,0,0,0,0,0,0,0,168,40,136,32,0,0,
+ 128,128,168,136,136,32,0,0,0,0,168,128,68,36,0,0,8,8,168,136,136,32,0,0,
+ 0,0,168,169,68,36,0,0,36,132,164,128,128,128,0,0,0,0,32,136,136,40,72,32,
+ 0,128,160,136,136,136,0,0,0,32,0,16,32,32,0,0,0,1,1,0,2,2,18,24,
+ 0,128,152,144,164,68,0,0,0,32,32,32,32,32,0,0,0,0,16,168,168,136,0,0,
+ 0,0,32,136,136,136,0,0,0,0,168,136,136,32,0,0,0,32,132,136,136,160,128,0,
+ 0,32,72,136,136,40,8,0,0,0,168,128,128,128,0,0,0,0,42,24,18,25,0,0,
+ 128,128,168,128,129,40,0,0,0,0,136,136,136,32,0,0,0,0,136,24,40,32,0,0,
+ 0,0,136,168,168,16,0,0,0,0,152,32,84,68,0,0,0,0,72,136,136,40,72,32,
+ 0,0,168,36,16,168,0,0,2,8,36,128,96,8,8,6,32,32,32,32,32,32,32,32,
+ 128,32,8,2,9,32,32,144,8,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_octopus_font_8 = {32,126,4,8,octopus_8_pixels};
+static const uint8_t octopus_10_pixels[] = {
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,128,32,8,2,0,0,16,4,
+ 0,0,0,0,2,128,160,0,0,0,0,0,0,0,0,16,72,39,172,130,32,136,34,9,
+ 235,32,136,32,0,0,0,128,58,40,7,128,136,186,8,0,0,0,0,34,136,0,2,2,
+ 2,0,136,40,160,128,0,0,0,128,136,185,33,40,32,166,0,0,0,0,0,0,144,64,
+ 0,0,0,0,0,0,0,0,0,0,32,8,8,2,0,128,32,0,0,128,32,0,32,2,
+ 0,128,32,8,2,0,128,32,32,0,0,0,0,129,101,191,139,133,148,0,0,0,0,4,
+ 2,0,128,32,174,130,0,128,32,8,1,0,0,0,0,0,0,0,0,0,0,36,16,0,
+ 0,0,0,0,0,0,170,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,
+ 0,0,0,0,0,32,8,0,2,2,2,0,128,32,32,0,0,0,0,128,136,34,10,130,
+ 32,32,0,0,0,0,0,0,0,28,22,0,128,32,8,0,0,0,0,0,0,160,130,1,
+ 65,66,64,170,0,0,0,0,0,2,130,8,25,0,136,32,160,0,0,0,0,0,0,0,
+ 8,22,8,130,180,8,1,0,0,0,0,2,168,128,42,0,34,8,40,0,0,0,0,0,
+ 0,160,130,58,8,34,8,40,0,0,0,0,0,0,0,170,0,129,144,64,128,0,0,0,
+ 0,0,0,160,130,26,72,34,8,40,0,0,0,0,0,0,160,130,32,130,178,8,40,0,
+ 0,0,0,0,0,128,0,0,0,0,0,32,0,0,0,0,0,0,0,16,4,0,0,0,
+ 32,32,0,0,0,0,0,24,40,36,32,6,160,6,0,0,0,0,0,10,168,0,0,0,
+ 0,2,170,0,0,0,0,0,9,0,160,6,0,34,166,64,0,0,0,0,2,178,8,8,
+ 8,0,0,0,32,0,0,0,0,0,2,160,2,138,232,41,160,168,0,0,0,0,0,0,
+ 160,130,32,142,178,8,130,0,0,0,0,0,2,160,130,58,72,34,8,168,0,0,0,0,
+ 0,0,160,130,32,8,2,8,40,0,0,0,0,0,2,160,130,32,136,34,8,168,0,0,
+ 0,0,0,2,168,128,58,8,2,0,170,0,0,0,0,0,2,168,128,58,8,2,0,64,
+ 0,0,0,0,0,0,160,130,32,9,162,8,40,0,0,0,0,0,0,0,130,58,200,34,
+ 8,130,0,0,0,0,0,6,228,32,8,2,0,129,185,0,0,0,0,0,0,8,2,0,
+ 128,34,8,40,0,0,0,0,0,0,8,136,37,14,2,96,130,0,0,0,0,0,2,0,
+ 128,32,8,2,0,170,0,0,0,0,0,0,0,215,37,136,34,8,130,0,0,0,0,0,
+ 0,0,200,34,10,130,48,136,0,0,0,0,0,0,160,130,32,136,34,8,40,0,0,0,
+ 0,0,2,160,130,32,142,130,0,128,0,0,0,0,0,0,160,130,32,136,34,96,38,0,
+ 0,0,0,0,2,160,130,32,142,130,96,130,0,0,0,0,0,0,160,130,26,0,34,8,
+ 40,0,0,0,0,0,6,164,32,8,2,0,128,16,0,0,0,0,0,2,8,130,32,136,
+ 34,8,40,0,0,0,0,0,0,0,130,32,130,128,160,32,0,0,0,0,0,0,0,130,
+ 32,136,35,172,130,0,0,0,0,0,0,0,130,22,66,0,96,130,0,0,0,0,0,0,
+ 0,130,10,2,0,128,32,0,0,0,0,0,6,160,4,1,2,6,1,168,0,0,0,0,
+ 0,0,168,32,8,2,0,128,42,0,0,0,0,32,2,0,128,32,2,0,32,0,0,128,
+ 32,0,0,10,128,32,8,2,0,130,160,0,0,0,8,8,130,0,130,128,128,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,160,0,0,1,128,4,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,42,130,178,8,40,0,0,0,0,0,2,0,128,58,
+ 136,34,8,40,0,0,0,0,0,0,0,0,42,136,2,8,40,0,0,0,0,0,0,8,
+ 2,42,200,34,8,40,0,0,0,0,0,0,0,0,42,78,162,4,40,0,0,0,0,0,
+ 0,160,130,58,8,2,0,128,0,0,0,0,0,0,0,40,32,136,32,172,130,10,0,0,
+ 0,0,0,0,128,58,8,34,8,130,0,0,0,0,0,0,0,32,0,2,0,128,32,0,
+ 0,0,0,0,0,16,4,0,0,128,34,8,40,0,0,0,0,0,0,128,38,142,2,96,
+ 130,0,0,0,0,0,0,0,32,8,2,0,128,32,0,0,0,0,0,0,0,0,4,10,
+ 130,160,136,0,0,0,0,0,0,0,0,10,8,34,8,130,0,0,0,0,0,0,0,0,
+ 42,136,34,8,40,0,0,0,0,0,0,0,40,32,136,34,8,232,32,0,0,0,0,0,
+ 0,40,32,136,34,8,43,0,128,0,0,0,0,0,0,42,136,2,0,128,0,0,0,0,
+ 0,0,0,0,170,10,8,32,164,0,0,0,0,0,2,0,128,58,8,2,8,40,0,0,
+ 0,0,0,0,0,0,32,136,34,8,40,0,0,0,0,0,0,0,0,32,128,0,160,32,
+ 0,0,0,0,0,0,0,0,34,10,130,160,16,0,0,0,0,0,0,0,0,102,66,1,
+ 81,69,0,0,0,0,0,0,0,130,32,136,32,172,130,10,0,0,0,0,0,0,0,106,
+ 66,65,65,169,0,0,0,0,0,32,32,36,32,6,0,32,8,0,128,0,4,2,0,128,
+ 32,8,2,0,128,32,8,2,0,0,32,2,0,32,2,2,66,0,128,128,0,0,96,34,
+ 32,36,0,0,0,0,0,0,0,0,0,
+};
+const ht_font_t ht_octopus_font_10 = {32,126,5,10,octopus_10_pixels};
diff --git a/devices/harness-device/firmware/main/ui/habitat/perf_bench.c b/devices/harness-device/firmware/main/ui/habitat/perf_bench.c
new file mode 100644
index 000000000..b7ee6e1bb
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/perf_bench.c
@@ -0,0 +1,277 @@
+// Same binary, ABBA body-clock comparison. Synthetic data; never connect to live agents.
+#include "perf_bench.h"
+#include "runtime.h"
+#include "display.h"
+#include "ui_screens.h"
+#include "ui_perf.h"
+#include "touch.h"
+#include "audio_probe.h"
+#include "audio_capture.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "esp_heap_caps.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/portmacro.h"
+#include "cJSON.h"
+#include <assert.h>
+#include <stdatomic.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define TAG "OCTO_PERF"
+static atomic_bool animated;
+static portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;
+static uint32_t sequence, completed;
+static char expected[80];
+static bool expect_pressed;
+typedef struct {
+ uint32_t latency, bytes, model, damage, raster, paint;
+ bool matches;
+} sample_t;
+static sample_t result;
+static int64_t requested;
+static uint32_t last_raster, last_paint;
+static bool collecting;
+static struct {
+ uint32_t frames, bytes, model, damage, raster, paint, n;
+ uint32_t raster_samples[256], paint_samples[256];
+} ambient;
+
+bool octopus_perf_animate(void) { return atomic_load(&animated); }
+
+ht_perf_tag_t octopus_perf_capture(const ht_scene_t *scene, bool fresh)
+{
+ if (!fresh) return (ht_perf_tag_t){0};
+ // Called under the model lock, after the entire scene has been assembled. A frame
+ // already in DMA before this request carries its OLD sequence, so it cannot satisfy it.
+ bool matches = !expected[0];
+ for (int i = 0; i < scene->count && !matches; i++)
+ matches = strstr(scene->runs[i].text, expected) != NULL;
+ if (expect_pressed) matches = matches && habitat_bench_pressed();
+ return (ht_perf_tag_t){sequence, matches};
+}
+void octopus_perf_paint(uint32_t raster_us, uint32_t paint_us)
+{
+ last_raster = raster_us;
+ last_paint = paint_us;
+}
+void octopus_perf_commit(ht_perf_tag_t tag, uint32_t bytes, uint32_t model_us, uint32_t damage_us)
+{
+ int64_t done = bytes ? ui_perf_last_done() : esp_timer_get_time();
+ portENTER_CRITICAL(&mux);
+ if (tag.sequence && tag.sequence == sequence && completed != tag.sequence) {
+ result = (sample_t){.latency = (uint32_t)(done - requested), .bytes = bytes,
+ .model = model_us, .damage = damage_us, .raster = bytes ? last_raster : 0,
+ .paint = bytes ? last_paint : 0, .matches = tag.matches};
+ completed = tag.sequence;
+ }
+ if (collecting) {
+ ambient.model += model_us;
+ ambient.damage += damage_us;
+ if (bytes) {
+ ambient.frames++;
+ ambient.bytes += bytes;
+ ambient.raster += last_raster;
+ ambient.paint += last_paint;
+ if (ambient.n < 256) {
+ ambient.raster_samples[ambient.n] = last_raster;
+ ambient.paint_samples[ambient.n++] = last_paint;
+ }
+ }
+ }
+ portEXIT_CRITICAL(&mux);
+}
+static int cmp(const void *a, const void *b)
+{
+ uint32_t x = *(const uint32_t *)a, y = *(const uint32_t *)b;
+ return (x > y) - (x < y);
+}
+static void memory(const char *stage, int round, bool animate)
+{
+ ESP_LOGI(TAG, "memory stage=%s round=%d animate=%d internal=%u largest=%u psram=%u",
+ stage, round, animate,
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT),
+ (unsigned)heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
+}
+static void fixture(bool animate)
+{
+ atomic_store(&animated, animate);
+ ui_project_clear_all();
+ ui_projects_bulk_begin();
+ for (int i = 0; i < 16; i++) {
+ char id[24], title[40];
+ snprintf(id, sizeof id, "perf-%d", i);
+ snprintf(title, sizeof title, "Thread %02d alpha", i);
+ ui_project_set_name(id, title);
+ ui_project_set_engine(id, "codex");
+ ui_project_set_machine(id, "perf-machine", "M2");
+ ui_project_restore_event(id, "done",
+ "The build passed. Fixed the input queue and added a regression test. "
+ "All checks passed. The update is ready to review.", "Build passed; input fixed.");
+ ui_project_emit(id, NULL, "processing", NULL, NULL);
+ }
+ ui_projects_bulk_end();
+ ui_focus_project("perf-1");
+ habitat_bench_prepare(animate);
+ vTaskDelay(pdMS_TO_TICKS(600));
+}
+static uint32_t begin(const char *text, bool pressed, int64_t start)
+{
+ // Caller holds model lock across this mark and the entire API mutation.
+ portENTER_CRITICAL(&mux);
+ requested = start;
+ sequence++;
+ uint32_t id = sequence;
+ snprintf(expected, sizeof expected, "%s", text);
+ expect_pressed = pressed;
+ portEXIT_CRITICAL(&mux);
+ return id;
+}
+static sample_t await_frame(uint32_t id)
+{
+ int64_t deadline = esp_timer_get_time() + 1000000;
+ for (;;) {
+ portENTER_CRITICAL(&mux);
+ bool ready = completed == id;
+ sample_t value = result;
+ portEXIT_CRITICAL(&mux);
+ if (ready) return value;
+ assert(esp_timer_get_time() < deadline);
+ vTaskDelay(pdMS_TO_TICKS(1));
+ }
+}
+static void run_case(const char *name, int kind, int round, bool animate)
+{
+ uint32_t samples[40];
+ cJSON *qs = cJSON_Parse("[{\"key\":\"direction\",\"q\":\"Which direction should we take?\","
+ "\"multi\":false,\"options\":[\"Keep it quiet\",\"A little character\",\"Both directions\"]}]");
+ assert(qs);
+ ui_show_projects();
+ ui_focus_project("perf-1");
+ if (kind == 4) habitat_bench_question(qs);
+ vTaskDelay(pdMS_TO_TICKS(300));
+ for (int i = 0; i < 40; i++) {
+ // Vary arrival phase against the 60/80/100ms pose holds; avoid a timer-locked result.
+ if (kind == 3 || kind == 5) {
+ display_lock();
+ habitat_touch_cancel();
+ ui_show_projects();
+ display_unlock();
+ // Touch gaze lingers for 400ms after release. Let it return before the next DOWN.
+ if (kind == 5) vTaskDelay(pdMS_TO_TICKS(430));
+ }
+ vTaskDelay(pdMS_TO_TICKS(61 + (i * 37 % 97)));
+ char expect[80];
+ if (kind == 0) snprintf(expect, sizeof expect, "%d working", (i & 1) ? 16 : 15);
+ else if (kind == 1) snprintf(expect, sizeof expect, "Thread %02d alpha", i & 1);
+ else if (kind == 2) snprintf(expect, sizeof expect, "Thread 01 %s", (i & 1) ? "alpha" : "bravo");
+ else if (kind == 3) snprintf(expect, sizeof expect, "latest result");
+ else if (kind == 4) {
+ const char *prompt = (i & 1) ? "Which direction should we take?" : "What should we explore next?";
+ cJSON_SetValuestring(cJSON_GetObjectItem(cJSON_GetArrayItem(qs, 0), "q"), prompt);
+ snprintf(expect, sizeof expect, "%s", (i & 1) ? "Which direction" : "What should we");
+ } else expect[0] = 0;
+ int64_t t = esp_timer_get_time();
+ display_lock();
+ uint32_t id = begin(expect, kind == 5, t);
+ if (kind == 0) ui_project_emit("perf-15", NULL, (i & 1) ? "processing" : "done", NULL, NULL);
+ else if (kind == 1) ui_focus_project((i & 1) ? "perf-1" : "perf-0");
+ else if (kind == 2) {
+ ui_projects_bulk_begin();
+ for (int j = 0; j < 16; j++) {
+ char agent[24], title[40];
+ snprintf(agent, sizeof agent, "perf-%d", j);
+ snprintf(title, sizeof title, "Thread %02d %s", j, (i & 1) ? "alpha" : "bravo");
+ ui_project_set_name(agent, title);
+ }
+ ui_projects_bulk_end();
+ } else if (kind == 3) habitat_bench_reader();
+ else if (kind == 4) habitat_bench_question(qs);
+ else habitat_touch(true, 170, 225, (uint32_t)(esp_timer_get_time() / 1000));
+ display_unlock();
+ uint32_t api = (uint32_t)(esp_timer_get_time() - t);
+ sample_t s = await_frame(id);
+ ESP_LOGI(TAG, "sample round=%d animate=%d case=%s i=%d api_us=%lu dma_us=%lu bytes=%lu "
+ "model_us=%lu damage_us=%lu raster_us=%lu paint_us=%lu matches=%d",
+ round, animate, name, i, (unsigned long)api, (unsigned long)s.latency,
+ (unsigned long)s.bytes, (unsigned long)s.model, (unsigned long)s.damage,
+ (unsigned long)s.raster, (unsigned long)s.paint, s.matches);
+ // A background frame or no-op must never be reported as a successful response.
+ assert(s.matches && s.bytes && s.latency);
+ samples[i] = s.latency;
+ }
+ cJSON_Delete(qs);
+ display_lock();
+ habitat_touch_cancel();
+ display_unlock();
+ qsort(samples, 40, sizeof samples[0], cmp);
+ ESP_LOGI(TAG, "case=%s round=%d animate=%d n=40 dma_p50_us=%lu dma_p95_us=%lu dma_max_us=%lu",
+ name, round, animate, (unsigned long)samples[20], (unsigned long)samples[38], (unsigned long)samples[39]);
+}
+static void ambient_run(const char *state, int round, bool animate)
+{
+ vTaskDelay(pdMS_TO_TICKS(1000));
+ portENTER_CRITICAL(&mux);
+ memset(&ambient, 0, sizeof ambient);
+ collecting = true;
+ portEXIT_CRITICAL(&mux);
+ int64_t t = esp_timer_get_time();
+ vTaskDelay(pdMS_TO_TICKS(10000));
+ portENTER_CRITICAL(&mux);
+ collecting = false;
+ portEXIT_CRITICAL(&mux);
+ uint32_t elapsed = (uint32_t)(esp_timer_get_time() - t), n = ambient.n;
+ qsort(ambient.raster_samples, n, sizeof(uint32_t), cmp);
+ qsort(ambient.paint_samples, n, sizeof(uint32_t), cmp);
+ ESP_LOGI(TAG, "ambient state=%s round=%d animate=%d elapsed_us=%lu frames=%lu bytes=%lu "
+ "model_us=%lu damage_us=%lu raster_us=%lu paint_us=%lu raster_p50_us=%lu raster_p95_us=%lu "
+ "paint_p50_us=%lu paint_p95_us=%lu samples=%lu",
+ state, round, animate, (unsigned long)elapsed, (unsigned long)ambient.frames,
+ (unsigned long)ambient.bytes, (unsigned long)ambient.model, (unsigned long)ambient.damage,
+ (unsigned long)ambient.raster, (unsigned long)ambient.paint,
+ (unsigned long)(n ? ambient.raster_samples[n/2] : 0),
+ (unsigned long)(n ? ambient.raster_samples[n*95/100] : 0),
+ (unsigned long)(n ? ambient.paint_samples[n/2] : 0),
+ (unsigned long)(n ? ambient.paint_samples[n*95/100] : 0), (unsigned long)n);
+}
+void octopus_perf_run(void)
+{
+ // Runs on app_main, before cable startup; production render/audio priorities are unchanged.
+ ESP_LOGI(TAG, "BEGIN version=octopus27-abba-v1 cpu_mhz=240 panel_mhz=40 n=40 rounds=4");
+ assert(audio_notify_is_muted());
+ touch_stats_t first;
+ touch_stats(&first);
+ const char *names[] = {"working_count", "agent_switch", "agent_burst16", "recap_open", "question_update", "touch_feedback"};
+ const bool modes[] = {false, true, true, false};
+ for (int round = 0; round < 4; round++) {
+ bool animate = modes[round];
+ fixture(animate);
+ memory("before", round, animate);
+ for (int kind = 0; kind < 6; kind++) run_case(names[kind], kind, round, animate);
+ if (round < 2) {
+ ui_show_projects();
+ ambient_run("working", round, animate);
+ ESP_LOGI(TAG, "audio_begin round=%d animate=%d display=working_full_animation", round, animate);
+ audio_probe_run();
+ ESP_LOGI(TAG, "audio_end round=%d animate=%d", round, animate);
+ for (int i = 0; i < 16; i++) {
+ char id[24]; snprintf(id, sizeof id, "perf-%d", i);
+ ui_project_emit(id, NULL, "done", NULL, NULL);
+ }
+ ambient_run("idle", round, animate);
+ }
+ memory("after", round, animate);
+ touch_stats_t touch;
+ touch_stats(&touch);
+ ESP_LOGI(TAG, "touch round=%d presses=%lu failures=%lu inferred=%lu", round,
+ (unsigned long)(touch.presses-first.presses), (unsigned long)(touch.read_failures-first.read_failures),
+ (unsigned long)(touch.inferred_releases-first.inferred_releases));
+ assert(touch.presses == first.presses);
+ }
+ ESP_LOGI(TAG, "END completed=960 normal_firmware_must_be_restored");
+ // Keep all synthetic state isolated until the flasher restores the saved daily image.
+ for (;;) vTaskDelay(pdMS_TO_TICKS(1000));
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/perf_bench.h b/devices/harness-device/firmware/main/ui/habitat/perf_bench.h
new file mode 100644
index 000000000..16d535e66
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/perf_bench.h
@@ -0,0 +1,18 @@
+#pragma once
+#ifdef DEVICE_OCTOPUS_BENCH
+#include "terminal.h"
+#include <stdbool.h>
+#include <stdint.h>
+struct cJSON;
+typedef struct { uint32_t sequence; bool matches; } ht_perf_tag_t;
+// All model-facing calls run under display_lock. Completion runs after DMA, outside it.
+ht_perf_tag_t octopus_perf_capture(const ht_scene_t *scene, bool fresh);
+void octopus_perf_paint(uint32_t raster_us, uint32_t paint_us);
+void octopus_perf_commit(ht_perf_tag_t tag, uint32_t bytes, uint32_t model_us, uint32_t damage_us);
+void octopus_perf_run(void);
+bool octopus_perf_animate(void);
+void habitat_bench_prepare(bool animate);
+void habitat_bench_reader(void);
+void habitat_bench_question(const struct cJSON *questions);
+bool habitat_bench_pressed(void);
+#endif
diff --git a/devices/harness-device/firmware/main/ui/habitat/runtime.h b/devices/harness-device/firmware/main/ui/habitat/runtime.h
new file mode 100644
index 000000000..7e0d0f343
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/runtime.h
@@ -0,0 +1,16 @@
+#pragma once
+#include "terminal.h"
+// Model is protected by display_lock; DMA never holds that lock.
+bool habitat_scene_take(ht_scene_t *out);
+void habitat_tick(void);
+uint32_t habitat_next_wake_ms(void);
+bool habitat_is_voice_view(void);
+void habitat_touch(bool down, int x, int y, uint32_t now_ms);
+// The driver calls this on an untrusted sample, then swallows contact until a real release.
+void habitat_touch_cancel(void);
+void habitat_render_notify(void);
+void habitat_input_stamp(int64_t now_us);
+typedef struct {
+ uint32_t frames, bytes, raster_max_us, frame_max_us, input_last_us, input_max_us;
+} habitat_perf_t;
+void habitat_perf_get(habitat_perf_t *out);
diff --git a/devices/harness-device/firmware/main/ui/habitat/scroll.c b/devices/harness-device/firmware/main/ui/habitat/scroll.c
new file mode 100644
index 000000000..9ec6c9aad
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/scroll.c
@@ -0,0 +1,122 @@
+#include "scroll.h"
+#include <stdlib.h>
+
+#define CLAIM_PX 12
+#define REPORT_PX 8
+#define REPORT_MS 16
+#define MAX_SPEED 6000
+
+bool ht_scroll_on_rim(int x, int y)
+{
+ x -= 233; y -= 233;
+ int r = x * x + y * y;
+ return r >= 178 * 178 && r <= 233 * 233;
+}
+// Monotonic octant approximation: 1024 units per turn, clockwise. No trig/FPU in touch.
+static int bearing(int x, int y)
+{
+ x -= 233; y -= 233;
+ int ax = abs(x), ay = abs(y);
+ int angle = ax >= ay ? (ax ? 128 * ay / ax : 0) : 256 - 128 * ax / ay;
+ if (x < 0) angle = 512 - angle;
+ if (y < 0) angle = 1024 - angle;
+ return angle & 1023;
+}
+
+uint32_t ht_scroll_coast_ms(int velocity)
+{
+ unsigned speed = (unsigned)abs(velocity), duration = 0;
+ if (speed > MAX_SPEED) speed = MAX_SPEED;
+ // Rounded up, including a final frame; intentionally errs toward braking, never voice.
+ while (speed >= 40) {
+ speed = speed * 906 / 1000;
+ duration += 16;
+ }
+ return duration ? duration + 32 : 0;
+}
+
+static void measure(ht_scroll_t *g, int delta, uint32_t now)
+{
+ uint32_t dt = now - g->at;
+ if (!dt) return;
+ int speed = (int)((int64_t)delta * 1000 / dt);
+ if (speed > MAX_SPEED) speed = MAX_SPEED;
+ if (speed < -MAX_SPEED) speed = -MAX_SPEED;
+ g->velocity = (3 * speed + 2 * g->velocity) / 5;
+ g->at = now;
+}
+void ht_scroll_begin(ht_scroll_t *g, int x, int y, uint32_t now, bool reversed, bool rim_enabled,
+ ht_scroll_emit_t emit, void *ctx)
+{
+ ht_scroll_cancel(g);
+ *g = (ht_scroll_t){.sx = x, .sy = y, .y = y, .at = now,
+ .sign = reversed ? -1 : 1, .emit = emit, .ctx = ctx};
+ g->rim_candidate = rim_enabled && ht_scroll_on_rim(x, y);
+ g->rim_angle = bearing(x, y);
+ g->rim_radius = (x - 233) * (x - 233) + (y - 233) * (y - 233);
+ // A touch stops the preceding fling immediately; movement waits for a direction claim.
+ g->live = emit(HT_SCROLL_DOWN, 0, 0, ctx);
+}
+void ht_scroll_move(ht_scroll_t *g, int x, int y, uint32_t now)
+{
+ if (!g->live) return;
+ if (g->rim_candidate) {
+ int r = (x - 233) * (x - 233) + (y - 233) * (y - 233);
+ int angle = bearing(x, y), delta = (angle - g->rim_angle + 1536) % 1024 - 512;
+ if (r < 155 * 155 || r > 238 * 238 || abs(r - g->rim_radius) > 15000 || abs(delta) > 128) {
+ ht_scroll_cancel(g); // a radial stroke or bad sample cannot become a pane swipe
+ return;
+ }
+ g->rim_angle = angle;
+ if (!g->axis) g->rim_travel += delta;
+ g->rim_remainder -= delta * 600; // clockwise reads further down; 600 glass px/turn
+ g->pending += g->rim_remainder / 1024;
+ g->rim_remainder %= 1024;
+ if (abs(g->pending) > 2048) {
+ ht_scroll_cancel(g); // bounded backpressure; never emit an unbounded desktop jump
+ return;
+ }
+ if (!g->axis && abs(g->rim_travel) >= 48) g->axis = 3;
+ if (g->axis == 3 && (abs(g->pending) >= REPORT_PX || now - g->at >= REPORT_MS)) {
+ if (!g->pending || g->emit(HT_SCROLL_MOVE, g->sign * g->pending, 0, g->ctx)) {
+ g->pending = 0;
+ g->at = now;
+ }
+ }
+ return;
+ }
+ if (!g->axis) {
+ int dx = abs(x - g->sx), dy = abs(y - g->sy);
+ if (dx >= CLAIM_PX && dx > dy) g->axis = 2;
+ else if (dy >= CLAIM_PX && dy > dx) g->axis = 1;
+ }
+ if (g->axis == 2) return;
+ g->pending += y - g->y;
+ g->y = y;
+ if (g->axis != 1) return;
+ if (abs(g->pending) >= REPORT_PX || now - g->at >= REPORT_MS) {
+ // Backpressure retains travel. The caller reserves room for the closing UP.
+ if (!g->pending || g->emit(HT_SCROLL_MOVE, g->sign * g->pending, 0, g->ctx)) {
+ measure(g, g->pending, now);
+ g->pending = 0;
+ }
+ }
+}
+bool ht_scroll_end(ht_scroll_t *g, int x, int y, uint32_t now)
+{
+ if (!g->live) return g->rim_candidate;
+ ht_scroll_move(g, x, y, now);
+ if (!g->live) return g->rim_candidate;
+ bool claimed = g->axis == 1 || g->axis == 3;
+ if (claimed) measure(g, g->pending, now);
+ if (g->rim_candidate) g->velocity = 0; // a wheel stops under the finger, without a fling
+ g->emit(HT_SCROLL_UP, claimed ? g->sign * g->pending : 0,
+ claimed ? g->sign * g->velocity : 0, g->ctx);
+ g->live = false;
+ return claimed || g->rim_candidate;
+}
+void ht_scroll_cancel(ht_scroll_t *g)
+{
+ if (g->live) g->emit(HT_SCROLL_UP, 0, 0, g->ctx);
+ g->live = false;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/scroll.h b/devices/harness-device/firmware/main/ui/habitat/scroll.h
new file mode 100644
index 000000000..03828a2da
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/scroll.h
@@ -0,0 +1,25 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+// No allocation or I/O. The caller queues reports on the same worker as focus changes.
+typedef enum { HT_SCROLL_DOWN, HT_SCROLL_MOVE, HT_SCROLL_UP } ht_scroll_phase_t;
+typedef bool (*ht_scroll_emit_t)(ht_scroll_phase_t phase, int dy, int velocity, void *ctx);
+typedef struct {
+ int sx, sy, y, pending, velocity, sign;
+ int rim_angle, rim_travel, rim_remainder, rim_radius;
+ uint32_t at;
+ unsigned axis; // 0 undecided, 1 vertical, 2 horizontal, 3 circular
+ bool live, rim_candidate;
+ ht_scroll_emit_t emit;
+ void *ctx;
+} ht_scroll_t;
+void ht_scroll_begin(ht_scroll_t *g, int x, int y, uint32_t now, bool reversed, bool rim_enabled,
+ ht_scroll_emit_t emit, void *ctx);
+void ht_scroll_move(ht_scroll_t *g, int x, int y, uint32_t now);
+// True means vertical travel owns the gesture, even if it ended back at its starting point.
+bool ht_scroll_end(ht_scroll_t *g, int x, int y, uint32_t now);
+void ht_scroll_cancel(ht_scroll_t *g);
+// Conservative tap-to-brake window for the desktop's 0.002/second decay and 40px/s stop.
+uint32_t ht_scroll_coast_ms(int velocity);
+bool ht_scroll_on_rim(int x, int y);
diff --git a/devices/harness-device/firmware/main/ui/habitat/scroll_bench.c b/devices/harness-device/firmware/main/ui/habitat/scroll_bench.c
new file mode 100644
index 000000000..a7a0e727a
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/scroll_bench.c
@@ -0,0 +1,70 @@
+// Diagnostic only. Constructs messages in RAM; never calls the USB send path.
+#include "cable_scroll.h"
+#include "cJSON.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "esp_heap_caps.h"
+#include "esp_task_wdt.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <assert.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int compare(const void *a,const void *b)
+{
+ uint32_t x=*(const uint32_t*)a,y=*(const uint32_t*)b;
+ return x<y?-1:x>y;
+}
+static char *original(int phase,int dy,int velocity)
+{
+ static const char *names[]={"down","move","up"};
+ cJSON *root=cJSON_CreateObject();assert(root);
+ assert(cJSON_AddStringToObject(root,"t","scroll"));
+ assert(cJSON_AddStringToObject(root,"phase",names[phase]));
+ assert(cJSON_AddNumberToObject(root,"dy",dy));
+ if(phase==2)assert(cJSON_AddNumberToObject(root,"v",velocity));
+ char *wire=cJSON_PrintUnformatted(root);cJSON_Delete(root);assert(wire);return wire;
+}
+void cable_scroll_benchmark(void)
+{
+ uint32_t times[40];char wire[CABLE_SCROLL_JSON_MAX];
+ // Warm the same per-task libc paths before comparing allocations and time.
+ for(int phase=0;phase<3;phase++) {
+ char *old=original(phase,-466,6000);
+ assert(cable_scroll_encode(wire,sizeof wire,phase,-466,6000)==strlen(old));
+ assert(!strcmp(wire,old));cJSON_free(old);
+ }
+ unsigned before=heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
+ ESP_LOGI("scroll-bench","BEGIN 720 local encodes; cJSON / snprintf / direct; no USB/app commands");
+ static const char *modes[]={"cjson86","snprintf87","direct88"};
+ static const char *names[]={"down","move","up"};
+ for(int pass=0;pass<2;pass++)for(int order=0;order<3;order++) {
+ int mode=pass?2-order:order;
+ for(int phase=0;phase<3;phase++) {
+ for(int i=0;i<40;i++) {
+ int dy=i%2?-466:466,velocity=i%2?-6000:6000;
+ int64_t start=esp_timer_get_time();
+ if(mode==2)assert(cable_scroll_encode(wire,sizeof wire,phase,dy,velocity));
+ else if(mode==1) {
+ int n=phase==2
+ ? snprintf(wire,sizeof wire,"{\"t\":\"scroll\",\"phase\":\"up\",\"dy\":%d,\"v\":%d}",dy,velocity)
+ : snprintf(wire,sizeof wire,"{\"t\":\"scroll\",\"phase\":\"%s\",\"dy\":%d}",names[phase],dy);
+ assert(n>0&&(size_t)n<sizeof wire);
+ }
+ else {char *old=original(phase,dy,velocity);cJSON_free(old);}
+ times[i]=(uint32_t)(esp_timer_get_time()-start);
+ esp_task_wdt_reset();vTaskDelay(1);
+ }
+ qsort(times,40,sizeof *times,compare);
+ ESP_LOGI("scroll-bench","pass=%d mode=%s phase=%d n=40 min=%lu median=%lu p95=%lu max=%lu",
+ pass,modes[mode],phase,(unsigned long)times[0],
+ (unsigned long)((times[19]+times[20])/2),(unsigned long)times[37],(unsigned long)times[39]);
+ }
+ }
+ assert(heap_caps_check_integrity_all(true));
+ ESP_LOGI("scroll-bench","END internal=%u/%u; excludes queue, transport and desktop rendering",
+ before,(unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/selection.c b/devices/harness-device/firmware/main/ui/habitat/selection.c
new file mode 100644
index 000000000..7e0b44cc8
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/selection.c
@@ -0,0 +1,129 @@
+#include "selection.h"
+#include <stdio.h>
+#include <string.h>
+
+static int clamp(int n, int min, int max) { return n < min ? min : n > max ? max : n; }
+static bool send(ht_selection_t *s, ht_select_op_t op, int delta, uint32_t now)
+{
+ ht_select_command_t c = {op, s->id, s->agent, ++s->serial, s->revision, delta};
+ if (!s->emit || !s->emit(&c, s->ctx)) {
+ snprintf(s->error, sizeof(s->error), "Device busy. Choose again.");
+ return false;
+ }
+ s->request = c.request;
+ s->pending = true;
+ s->deadline = now + 3500;
+ return true;
+}
+void ht_selection_close(ht_selection_t *s)
+{
+ if (s->active && s->announced && s->emit) {
+ ht_select_command_t c = {HT_SELECT_CANCEL, s->id, s->agent, ++s->serial, s->revision, 0};
+ s->emit(&c, s->ctx);
+ }
+ uint32_t serial = s->serial;
+ memset(s, 0, sizeof(*s));
+ s->serial = serial;
+}
+void ht_selection_open(ht_selection_t *s, const char *id, const char *agent, uint32_t now,
+ ht_select_emit_t emit, void *ctx)
+{
+ ht_selection_close(s);
+ if (!id || !*id || !agent || !*agent) return;
+ snprintf(s->id, sizeof(s->id), "%s", id);
+ snprintf(s->agent, sizeof(s->agent), "%s", agent);
+ s->active = true; s->emit = emit; s->ctx = ctx;
+ s->announced = send(s, HT_SELECT_BEGIN, 0, now);
+}
+static void flush(ht_selection_t *s, uint32_t now)
+{
+ if (!s->active || s->pending || s->error[0] || !s->queued) return;
+ int delta = s->queued;
+ if (send(s, s->query[0] ? HT_SELECT_MATCH : HT_SELECT_STEP, delta, now)) s->queued = 0;
+}
+void ht_selection_move(ht_selection_t *s, int pixels, uint32_t now)
+{
+ if (!s->active || s->error[0]) return;
+ s->remainder += clamp(pixels, -466, 466);
+ int distance = s->query[0] ? 60 : 20;
+ int steps = s->remainder / distance;
+ s->remainder %= distance;
+ // One outstanding request and at most eight queued rows. A stalled app
+ // cannot accumulate a giant jump, and voice waits for the latest reply.
+ s->queued = clamp(s->queued + steps, -8, 8);
+ flush(s, now);
+}
+void ht_selection_extend(ht_selection_t *s, uint32_t now)
+{
+ if (ht_selection_ready(s) && s->rows)
+ send(s, s->query[0] ? HT_SELECT_LINES : s->extending ? HT_SELECT_LINE : HT_SELECT_EXTEND, 0, now);
+}
+static bool valid_result(const ht_selection_t *s, const char *id, uint32_t revision,
+ int rows, const char *query, int match, int matches)
+{
+ if (!id || strcmp(id, s->id) || revision != s->revision + 1 || rows > 16) return false;
+ if (query && *query) {
+ if (strlen(query) >= sizeof s->query || matches < 0 || match < 0 || match > matches) return false;
+ if (!matches) return match == 0 && rows == 0;
+ return match > 0 && rows >= 1;
+ }
+ return rows >= 1 && match == 0 && matches == 0;
+}
+static void apply_result(ht_selection_t *s, uint32_t revision, const char *excerpt, int rows,
+ bool extending, const char *query, int match, int matches)
+{
+ s->revision = revision; s->rows = rows; s->extending = extending;
+ s->match = match; s->matches = matches; s->error[0] = 0;
+ bool changed_mode = !!s->query[0] != !!(query && *query);
+ snprintf(s->query, sizeof s->query, "%s", query ? query : "");
+ if (changed_mode) s->remainder = s->queued = 0;
+ snprintf(s->excerpt, sizeof(s->excerpt), "%s", excerpt ? excerpt : "");
+}
+bool ht_selection_reply_search(ht_selection_t *s, uint32_t request, const char *id, bool ok,
+ uint32_t revision, const char *excerpt, int rows, bool extending,
+ const char *error, const char *query, int match, int matches, uint32_t now)
+{
+ if (!s->active || !s->pending || request != s->request) return false;
+ if (ok && !valid_result(s, id, revision, rows, query, match, matches)) return false;
+ s->pending = false;
+ if (!ok) {
+ snprintf(s->error, sizeof(s->error), "%s", error && *error ? error : "Choose the text again.");
+ s->queued = 0;
+ return true;
+ }
+ apply_result(s, revision, excerpt, rows, extending, query, match, matches);
+ flush(s, now);
+ return true;
+}
+bool ht_selection_reply(ht_selection_t *s, uint32_t request, const char *id, bool ok,
+ uint32_t revision, const char *excerpt, int rows, bool extending,
+ const char *error, uint32_t now)
+{
+ return ht_selection_reply_search(s, request, id, ok, revision, excerpt, rows, extending,
+ error, NULL, 0, 0, now);
+}
+bool ht_selection_found(ht_selection_t *s, const char *id, const char *agent,
+ uint32_t revision, const char *excerpt, int rows,
+ const char *query, int match, int matches)
+{
+ if (!ht_selection_ready(s) || !agent || strcmp(agent, s->agent) || !query || !*query ||
+ !valid_result(s, id, revision, rows, query, match, matches)) return false;
+ apply_result(s, revision, excerpt, rows, false, query, match, matches);
+ s->queued = s->remainder = 0;
+ return true;
+}
+bool ht_selection_tick(ht_selection_t *s, uint32_t now)
+{
+ if (!s->active || !s->pending || (int32_t)(now - s->deadline) < 0) return false;
+ s->pending = false; s->queued = 0;
+ snprintf(s->error, sizeof(s->error), "The app did not answer. Choose again.");
+ if (s->emit) {
+ ht_select_command_t c = {HT_SELECT_CANCEL, s->id, s->agent, ++s->serial, s->revision, 0};
+ if (s->emit(&c, s->ctx)) s->announced = false;
+ }
+ return true;
+}
+bool ht_selection_ready(const ht_selection_t *s)
+{
+ return s->active && !s->pending && !s->queued && !s->error[0] && s->revision > 0;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/selection.h b/devices/harness-device/firmware/main/ui/habitat/selection.h
new file mode 100644
index 000000000..b18d87162
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/selection.h
@@ -0,0 +1,41 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum { HT_SELECT_BEGIN, HT_SELECT_STEP, HT_SELECT_EXTEND, HT_SELECT_LINE, HT_SELECT_CANCEL, HT_SELECT_MATCH, HT_SELECT_LINES } ht_select_op_t;
+typedef struct {
+ ht_select_op_t op;
+ const char *id, *agent;
+ uint32_t request, revision;
+ int delta;
+} ht_select_command_t;
+typedef bool (*ht_select_emit_t)(const ht_select_command_t *, void *);
+
+typedef struct {
+ char id[48], agent[48], excerpt[241], error[160], query[121];
+ bool active, pending, extending, announced;
+ uint32_t serial, request, revision, deadline;
+ int rows, queued, remainder, match, matches;
+ ht_select_emit_t emit;
+ void *ctx;
+} ht_selection_t;
+
+void ht_selection_open(ht_selection_t *, const char *id, const char *agent, uint32_t now,
+ ht_select_emit_t, void *ctx);
+void ht_selection_close(ht_selection_t *);
+void ht_selection_move(ht_selection_t *, int pixels, uint32_t now);
+void ht_selection_extend(ht_selection_t *, uint32_t now);
+bool ht_selection_reply(ht_selection_t *, uint32_t request, const char *id, bool ok,
+ uint32_t revision, const char *excerpt, int rows, bool extending,
+ const char *error, uint32_t now);
+bool ht_selection_tick(ht_selection_t *, uint32_t now);
+bool ht_selection_ready(const ht_selection_t *);
+
+// Extended replies apply search mode before draining queued finger travel.
+bool ht_selection_reply_search(ht_selection_t *, uint32_t request, const char *id, bool ok,
+ uint32_t revision, const char *excerpt, int rows, bool extending,
+ const char *error, const char *query, int match, int matches, uint32_t now);
+// A spoken search advances the selection once, outside the gesture request queue.
+bool ht_selection_found(ht_selection_t *, const char *id, const char *agent,
+ uint32_t revision, const char *excerpt, int rows,
+ const char *query, int match, int matches);
diff --git a/devices/harness-device/firmware/main/ui/habitat/terminal.c b/devices/harness-device/firmware/main/ui/habitat/terminal.c
new file mode 100644
index 000000000..4aa6b4106
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/terminal.c
@@ -0,0 +1,716 @@
+#include "terminal.h"
+#include <string.h>
+#include "arc_geometry.inc"
+
+static int imin(int a, int b) { return a < b ? a : b; }
+static int imax(int a, int b) { return a > b ? a : b; }
+static uint16_t be16(uint16_t v) { return (uint16_t)((v << 8) | (v >> 8)); }
+static uint32_t punctuation_alias(uint32_t cp)
+{
+ // One cell in, one cell out. Keep the original UTF-8 in the scene/wire;
+ // reuse existing ASCII pixels for typographic punctuation outside Latin-1.
+ switch (cp) {
+ case 0x2010: case 0x2011: case 0x2012: case 0x2013: case 0x2014: case 0x2015:
+ case 0x2212: return '-';
+ case 0x2018: case 0x2019: case 0x201a: case 0x201b: return '\'';
+ case 0x201c: case 0x201d: case 0x201e: case 0x201f: return '"';
+ default: return cp;
+ }
+}
+static const ht_font_t *glyph_font(const ht_font_t *font, uint32_t cp)
+{
+ // Authored arrows in a recap use the same precomputed glyph as its marker.
+ // Identical cell metrics: no scaling, allocation, or extra text runs.
+ return cp == 0x2197 && font == &ht_mono_20 ? &ht_open_20 : font;
+}
+static uint32_t font_codepoint(const ht_font_t *font, uint32_t cp)
+{
+ // Space is always an empty cell, including compact Unicode-only atlases.
+ if (cp == ' ' || (cp >= font->first && cp <= font->last)) return cp;
+ font = glyph_font(font, cp);
+ cp = punctuation_alias(cp);
+ if (cp >= font->first && cp <= font->last) return cp;
+ return font->first <= '?' && font->last >= '?' ? '?' : ' ';
+}
+uint16_t ht_rgb(unsigned c)
+{
+ return (uint16_t)(((c >> 8) & 0xf800) | ((c >> 5) & 0x07e0) | ((c >> 3) & 0x1f));
+}
+uint32_t ht_utf8_next(const char **p)
+{
+ const unsigned char *s = (const unsigned char *)*p;
+ uint32_t c = *s++;
+ if (!c)
+ return 0;
+ if (c >= 0xc2 && c <= 0xf4) {
+ int n = c < 0xe0 ? 1 : c < 0xf0 ? 2 : 3;
+ uint32_t v = c & ((1u << (6 - n)) - 1);
+ for (int i = 0; i < n; i++) {
+ if ((s[i] & 0xc0) != 0x80) {
+ *p = (const char *)s;
+ return '?';
+ }
+ v = (v << 6) | (s[i] & 63);
+ }
+ s += n;
+ c = v;
+ } else if (c >= 128)
+ c = '?';
+ *p = (const char *)s;
+ return c;
+}
+void ht_scene_clear(ht_scene_t *s, uint16_t bg)
+{
+ s->count = 0;
+ s->background = bg;
+}
+bool ht_text(ht_scene_t *s, int x, int y, int w, const ht_font_t *font, uint16_t fg, uint16_t bg,
+ const char *text)
+{
+ if (s->count >= HT_RUNS || !font || w <= 0)
+ return false;
+ ht_run_t *r = &s->runs[s->count++];
+ memset(r, 0, sizeof(*r));
+ r->x = x;
+ r->y = y;
+ r->w = w;
+ r->font = font;
+ r->fg = fg;
+ r->bg = bg;
+ const char *p = text ? text : "";
+ size_t n = 0;
+ int cells = w / font->width;
+ while (*p && cells-- > 0) {
+ const char *start = p;
+ ht_utf8_next(&p);
+ size_t len = (size_t)(p - start);
+ if (n + len >= sizeof(r->text))
+ break;
+ memcpy(r->text + n, start, len);
+ n += len;
+ }
+ r->text[n] = 0;
+ return true;
+}
+bool ht_ascii_text(ht_scene_t *s, int x, int y, int w, const ht_font_t *font,
+ uint16_t fg, uint16_t bg, const char *text, size_t cells)
+{
+ if (s->count >= HT_RUNS || !font || !font->width || w <= 0 || (!text && cells)) return false;
+ size_t n = (size_t)w / font->width;
+ if (n > cells) n = cells;
+ if (n >= HT_TEXT_BYTES) n = HT_TEXT_BYTES - 1;
+ ht_run_t *r = &s->runs[s->count++];
+ memset(r, 0, sizeof *r);
+ r->x = x; r->y = y; r->w = w; r->font = font; r->fg = fg; r->bg = bg;
+ if (n) memcpy(r->text, text, n);
+ return true;
+}
+void ht_center(ht_scene_t *s, int y, const ht_font_t *font, uint16_t fg, const char *text)
+{
+ const char *p = text;
+ int n = 0;
+ while (*p) {
+ ht_utf8_next(&p);
+ n++;
+ }
+ int w = imin(n * font->width, HT_WIDTH - 80);
+ ht_text(s, (HT_WIDTH - w) / 2, y, w, font, fg, s->background, text);
+}
+static void arc_text(ht_scene_t *s, uint16_t fg, const char *text, bool bottom)
+{
+ if (!text || !*text) return;
+ if (!ht_text(s, HT_ARC_X, HT_ARC_Y, HT_ARC_COLS * ht_mono_20.width,
+ &ht_mono_20, fg, s->background, text)) return;
+ ht_run_t *r = &s->runs[s->count - 1];
+ // A long name ends at a word boundary; the pane list retains its full name.
+ if (strlen(text ? text : "") > strlen(r->text)) {
+ char *last = strrchr(r->text, ' ');
+ if (last && last - r->text >= HT_ARC_COLS / 2) *last = 0;
+ }
+ r->arc = bottom ? 2 : 1;
+ r->y = bottom ? HT_HEIGHT - HT_ARC_Y - HT_ARC_HEIGHT : HT_ARC_Y;
+ r->w = HT_ARC_WIDTH;
+}
+void ht_arc_title(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, false); }
+void ht_arc_status(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, true); }
+const char *ht_take_line(const char **cursor, int cols)
+{
+ const char *p = *cursor, *start = p, *space = NULL, *end = p;
+ int n = 0;
+ while (*p && *p != '\n' && n < cols) {
+ if (*p == ' ')
+ space = p;
+ ht_utf8_next(&p);
+ n++;
+ end = p;
+ }
+ if (*p && *p != '\n' && space && space > start) {
+ end = space;
+ p = space + 1;
+ } else if (*p == '\n')
+ p++;
+ *cursor = p;
+ return end;
+}
+int ht_text_rows(const char *text, const ht_font_t *font, int width)
+{
+ if (!font || !font->width || width < font->width) return 0;
+ const char *p = text ? text : "";
+ int rows = 0;
+ while (*p) { ht_take_line(&p, width / font->width); rows++; }
+ return rows;
+}
+bool ht_can_display(const char *text, const ht_font_t *font, int width, int lines)
+{
+ if (!font || !font->width || width < font->width || lines < 1)
+ return false;
+ const char *p = text ? text : "";
+ while (*p) {
+ uint32_t cp = ht_utf8_next(&p);
+ const ht_font_t *glyph = glyph_font(font, cp);
+ if (cp < glyph->first || cp > glyph->last) cp = punctuation_alias(cp);
+ if (cp != '\n' && cp != ' ' && (cp < glyph->first || cp > glyph->last || (cp >= 127 && cp < 160)))
+ return false;
+ }
+ p = text ? text : "";
+ int rows = 0;
+ while (*p) {
+ if (++rows > lines)
+ return false;
+ ht_take_line(&p, width / font->width);
+ }
+ return true;
+}
+int ht_wrap(ht_scene_t *s, int x, int y, int w, int lines, int skip, const ht_font_t *f,
+ uint16_t fg, const char *text)
+{
+ if (!f || !f->width || w < f->width || lines <= 0)
+ return 0;
+ const char *p = text ? text : "";
+ int row = 0, shown = 0, cols = w / f->width;
+ while (*p && shown < lines) {
+ const char *start = p;
+ const char *end = ht_take_line(&p, cols);
+ if (row++ < skip)
+ continue;
+ char line[HT_TEXT_BYTES];
+ size_t len = (size_t)(end - start);
+ if (len >= sizeof(line))
+ len = sizeof(line) - 1;
+ memcpy(line, start, len);
+ line[len] = 0;
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, line);
+ shown++;
+ }
+ // Keep the slots after a wrapped block stable when its line count changes.
+ // Otherwise one extra prompt line makes every following button look moved.
+ while (shown < lines) {
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, "");
+ shown++;
+ }
+ return row;
+}
+ht_rect_t ht_run_bounds(const ht_run_t *r)
+{
+ if (r->arc) {
+ const char *p = r->text; int count = 0;
+ while (*p && count < HT_ARC_COLS) { ht_utf8_next(&p); count++; }
+ if (!count) return (ht_rect_t){0, 0, 0, 0};
+ int sn = arc_trig[count - 1][0], cs = arc_trig[count - 1][1];
+ // Tight, conservative ink bounds. The arc canvas remains 416x128, but
+ // a short name must not dirty that whole rectangle on every pane switch.
+ int half_w = ((13 * cs + 29 * sn) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sn) >> 15) + 2;
+ int left = 233 - (205 * sn >> 14) - half_w - 1;
+ int bottom = 233 - (205 * cs >> 14) + half_h + 1;
+ return (ht_rect_t){left, r->arc == 2 ? HT_HEIGHT - bottom : HT_ARC_Y,
+ 2 * (233 - left), bottom - HT_ARC_Y};
+ }
+ return (ht_rect_t){r->x, r->y, r->w, r->font->height};
+}
+static bool intersect(ht_rect_t a, ht_rect_t b)
+{
+ return a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
+}
+static ht_rect_t united(ht_rect_t a, ht_rect_t b)
+{
+ int x = imin(a.x, b.x), y = imin(a.y, b.y);
+ return (ht_rect_t){x, y, imax(a.x + a.w, b.x + b.w) - x, imax(a.y + a.h, b.y + b.h) - y};
+}
+// Layout changes often form a stepped outline: a wide recap underneath a
+// narrower portrait. Keep that outline instead of inflating it to one large
+// rectangle. One pair of byte coordinates per two display rows, on the stack.
+typedef struct {
+ uint8_t left[HT_HEIGHT / 2], right[HT_HEIGHT / 2];
+} damage_rows_t;
+static void damage_add(ht_damage_t *d, ht_rect_t r, damage_rows_t *rows)
+{
+ int x = imax(0, r.x) & ~1, y = imax(0, r.y) & ~1, x2 = imin(HT_WIDTH, (r.x + r.w + 1) & ~1),
+ y2 = imin(HT_HEIGHT, (r.y + r.h + 1) & ~1);
+ r = (ht_rect_t){x, y, x2 - x, y2 - y};
+ if (r.w <= 0 || r.h <= 0)
+ return;
+ if (rows) for (int y = r.y / 2; y < (r.y + r.h) / 2; y++) {
+ int left = r.x / 2, right = (r.x + r.w) / 2;
+ if (left < rows->left[y]) rows->left[y] = left;
+ if (right > rows->right[y]) rows->right[y] = right;
+ }
+ for (int i = 0; i < d->count; i++) {
+ ht_rect_t u = united(d->rect[i], r);
+ if (intersect(d->rect[i], r) || u.w * u.h <= d->rect[i].w * d->rect[i].h + r.w * r.h + 64) {
+ r = u;
+ d->rect[i] = d->rect[--d->count];
+ i = -1;
+ }
+ }
+ if (d->count == HT_DAMAGE_MAX) {
+ d->count = 1;
+ d->rect[0] = (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT};
+ return;
+ }
+ d->rect[d->count++] = r;
+}
+static void damage_rows_finish(const damage_rows_t *rows, ht_damage_t *d)
+{
+ ht_damage_t candidate = {0};
+ for (int y = 0; y < HT_HEIGHT / 2;) {
+ int left = rows->left[y], right = rows->right[y], top = y++;
+ if (left >= right) continue;
+ while (y < HT_HEIGHT / 2 && rows->left[y] == left && rows->right[y] == right) y++;
+ if (candidate.count == HT_DAMAGE_MAX) {
+ // Bounded storage. Merge the adjacent pair costing the fewest extra
+ // pixels before adding another band; never allocate or fall back to
+ // a full frame simply because a curved outline has many steps.
+ int best = 0; unsigned least = UINT32_MAX;
+ for (int i = 0; i + 1 < candidate.count; i++) {
+ ht_rect_t a = candidate.rect[i], b = candidate.rect[i + 1], u = united(a, b);
+ unsigned extra = u.w * u.h - a.w * a.h - b.w * b.h;
+ if (extra < least) { least = extra; best = i; }
+ }
+ candidate.rect[best] = united(candidate.rect[best], candidate.rect[best + 1]);
+ memmove(&candidate.rect[best + 1], &candidate.rect[best + 2],
+ (size_t)(candidate.count - best - 2) * sizeof candidate.rect[0]);
+ candidate.count--;
+ }
+ candidate.rect[candidate.count++] = (ht_rect_t){left * 2, top * 2,
+ (right - left) * 2, (y - top) * 2};
+ }
+ for (int i = 0; i < candidate.count; i++)
+ candidate.pixels += (uint32_t)candidate.rect[i].w * candidate.rect[i].h;
+ // Include a small command/transaction cost. A marginal pixel reduction
+ // must not turn one efficient transfer into many tiny transfers.
+ if (candidate.pixels + candidate.count * 256u + 64 < d->pixels + d->count * 256u)
+ *d = candidate;
+}
+#ifdef DEVICE_LAYOUT_BENCH
+static bool damage_fast_ascii = true, raster_fast_ascii = true, damage_bands = true;
+void ht_damage_banded(bool enabled) { damage_bands = enabled; }
+void ht_raster_fast_ascii(bool enabled) { raster_fast_ascii = enabled; }
+void ht_damage_fast_ascii(bool enabled) { damage_fast_ascii = enabled; }
+#endif
+void ht_damage(const ht_scene_t *a, const ht_scene_t *b, ht_damage_t *d)
+{
+ memset(d, 0, sizeof(*d));
+ damage_rows_t row_storage, *rows = NULL;
+ bool reshape = false;
+ if (a && a->background == b->background
+#ifdef DEVICE_LAYOUT_BENCH
+ && damage_bands
+#endif
+ ) {
+ reshape = a->count != b->count;
+ for (int i = 0; !reshape && i < a->count; i++) {
+ const ht_run_t *old = &a->runs[i], *next = &b->runs[i];
+ reshape = old->font != next->font || old->x != next->x || old->y != next->y ||
+ old->w != next->w || old->arc != next->arc;
+ }
+ }
+ if (reshape) {
+ rows = &row_storage;
+ memset(rows->left, HT_WIDTH / 2, sizeof rows->left);
+ memset(rows->right, 0, sizeof rows->right);
+ }
+ if (!a || a->background != b->background) {
+ damage_add(d, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT}, NULL);
+ } else
+ for (int i = 0; i < imax(a->count, b->count); i++) {
+ if (i < a->count && i < b->count &&
+ memcmp(&a->runs[i], &b->runs[i], sizeof(ht_run_t)) == 0)
+ continue;
+ if (i < a->count && i < b->count) {
+ const ht_run_t *old = &a->runs[i], *next = &b->runs[i];
+ if (!old->arc && !next->arc && old->x == next->x && old->y == next->y && old->w == next->w &&
+ old->font == next->font && old->fg == next->fg && old->bg == next->bg) {
+ const char *p = old->text, *q = next->text;
+ int cell = 0, first = -1, last = -1;
+ bool ascii = old->font->first == 32 && old->font->last >= 126;
+#ifdef DEVICE_LAYOUT_BENCH
+ ascii = ascii && damage_fast_ascii;
+#endif
+ while (*p || *q) {
+ uint32_t pc = (uint8_t)*p, qc = (uint8_t)*q;
+ if (ascii && (pc | qc) < 128) {
+ // Artwork is one printable byte per cell. Avoid
+ // decoding and alias lookup for every tentacle cell.
+ // Missing trailing cells still render as spaces.
+ if (pc) p++; else pc = ' ';
+ if (qc) q++; else qc = ' ';
+ if (pc < 32 || pc > old->font->last) pc = '?';
+ if (qc < 32 || qc > old->font->last) qc = '?';
+ } else {
+ pc = *p ? ht_utf8_next(&p) : ' ';
+ qc = *q ? ht_utf8_next(&q) : ' ';
+ pc = font_codepoint(old->font, pc);
+ qc = font_codepoint(old->font, qc);
+ }
+ if (pc != qc) {
+ if (first < 0)
+ first = cell;
+ last = cell;
+ }
+ cell++;
+ }
+ if (first >= 0)
+ damage_add(d, (ht_rect_t){next->x + first * next->font->width, next->y,
+ (last - first + 1) * next->font->width,
+ next->font->height}, rows);
+ continue;
+ }
+ }
+ if (i < a->count)
+ damage_add(d, ht_run_bounds(&a->runs[i]), rows);
+ if (i < b->count)
+ damage_add(d, ht_run_bounds(&b->runs[i]), rows);
+ }
+ for (int i = 0; i < d->count; i++)
+ d->pixels += (uint32_t)d->rect[i].w * d->rect[i].h;
+ if (rows) damage_rows_finish(rows, d);
+}
+static void fill(uint16_t *p, size_t n, uint16_t c)
+{
+ for (size_t i = 0; i < n; i++)
+ p[i] = c;
+}
+static uint16_t blend(uint16_t fg, uint16_t bg, unsigned alpha)
+{
+ unsigned r = (((fg >> 11) * alpha + (bg >> 11) * (3 - alpha)) + 1) / 3;
+ unsigned g = ((((fg >> 5) & 63) * alpha + ((bg >> 5) & 63) * (3 - alpha)) + 1) / 3;
+ unsigned b = (((fg & 31) * alpha + (bg & 31) * (3 - alpha)) + 1) / 3;
+ return be16((r << 11) | (g << 5) | b);
+}
+
+// The small ASCII artwork uses only a handful of characters. Expand each used
+// glyph once for its font/palette, then copy clipped rows directly into DMA
+// strips. Fixed capacity, renderer-owned: no allocation and no per-frame churn.
+// Ordinary text and Unicode fonts retain the general renderer below.
+enum { GLYPH_SLOTS = 24, GLYPH_PIXELS = 50, ASCII_COUNT = 95 };
+typedef struct {
+ uint16_t pixels[GLYPH_SLOTS][GLYPH_PIXELS];
+ uint8_t index[ASCII_COUNT], code[GLYPH_SLOTS], next;
+ const ht_font_t *font;
+ uint16_t fg, bg;
+} glyph_cache_t;
+static glyph_cache_t glyph_cache;
+static bool glyph_cache_enabled = true;
+static uint32_t glyph_builds;
+void ht_glyph_cache_enable(bool enabled) { glyph_cache_enabled = enabled; }
+uint32_t ht_glyph_cache_builds(void) { return glyph_builds; }
+size_t ht_glyph_cache_bytes(void) { return sizeof glyph_cache; }
+
+static bool glyph_cache_prepare(const ht_font_t *f, uint16_t fg, uint16_t bg)
+{
+ if (!glyph_cache_enabled || f->first != 32 || f->last != 126 ||
+ !f->width || f->width > 5 || !f->height || f->height > 10) return false;
+ if (glyph_cache.font != f || glyph_cache.fg != fg || glyph_cache.bg != bg) {
+ memset(glyph_cache.index, 0, sizeof glyph_cache.index);
+ memset(glyph_cache.code, 0, sizeof glyph_cache.code);
+ glyph_cache.next = 0;
+ glyph_cache.font = f; glyph_cache.fg = fg; glyph_cache.bg = bg;
+ }
+ return true;
+}
+static const uint16_t *glyph_cached(uint32_t c, const uint8_t *glyph,
+ const uint16_t palette[4])
+{
+ unsigned code = c - 32;
+ if (glyph_cache.index[code]) return glyph_cache.pixels[glyph_cache.index[code] - 1];
+ unsigned slot = glyph_cache.next;
+ glyph_cache.next = (slot + 1) % GLYPH_SLOTS;
+ if (glyph_cache.code[slot]) glyph_cache.index[glyph_cache.code[slot] - 1] = 0;
+ glyph_cache.index[code] = slot + 1;
+ glyph_cache.code[slot] = code + 1;
+ unsigned pixels = glyph_cache.font->width * glyph_cache.font->height;
+ for (unsigned k = 0; k < pixels; k++)
+ glyph_cache.pixels[slot][k] = palette[(glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3];
+ glyph_builds++;
+ return glyph_cache.pixels[slot];
+}
+
+// Each row of an arc has two narrow bands, separated by transparent space.
+// Pack those bands independently instead of retaining a mostly empty rectangle.
+// All 64 count/edge geometries fit in 3968 bytes; 4096 leaves a little headroom.
+// Upper/lower text have independent keys, so they never evict each other.
+// Scenes retain immutable text, allowing old scenes to rasterize correctly.
+enum { ARC_HALF = HT_ARC_WIDTH / 2, ARC_MASK_BYTES = 4096 };
+typedef struct {
+ uint16_t offset;
+ uint8_t first, last;
+ uint8_t ink_first, ink_last;
+} arc_span_t;
+typedef struct {
+ uint8_t mask[ARC_MASK_BYTES];
+ arc_span_t spans[HT_ARC_HEIGHT][2];
+ char text[HT_TEXT_BYTES];
+ uint16_t mask_bytes;
+ uint8_t columns;
+ bool valid;
+} arc_cache_t;
+_Static_assert(ARC_HALF <= UINT8_MAX, "arc span coordinates must fit in a byte");
+static arc_cache_t arc_caches[2];
+static uint32_t arc_builds;
+uint32_t ht_arc_cache_builds(void) { return arc_builds; }
+#ifdef DEVICE_LAYOUT_BENCH
+static bool arc_fast = true, arc_tight = true;
+void ht_arc_tight_bounds(bool enabled)
+{
+ arc_tight = enabled;
+ arc_caches[0].valid = arc_caches[1].valid = false;
+}
+void ht_arc_fast_sampling(bool enabled)
+{
+ arc_fast = enabled;
+ arc_caches[0].valid = arc_caches[1].valid = false;
+}
+static unsigned glyph_alpha_reference(const uint8_t *glyph, int x, int y)
+{
+ if (x < 0 || x >= 12 || y < 0 || y >= 28) return 0;
+ unsigned k = (unsigned)y * 12 + (unsigned)x;
+ return (glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3;
+}
+#endif
+
+static void glyph_coverage(const uint8_t *glyph, uint8_t padded[14 * 30])
+{
+ // One glyph plus a transparent one-pixel border. Bilinear sampling below
+ // then needs four byte loads instead of four checked packed-bit lookups.
+ // This 420-byte scratch lives only while a changed curved label is built.
+ memset(padded, 0, 14 * 30);
+ for (unsigned y = 0; y < 28; y++) for (unsigned x = 0; x < 12; x++) {
+ unsigned k = y * 12 + x;
+ padded[(y + 1) * 14 + x + 1] = (glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3;
+ }
+}
+static bool arc_pack_geometry(const ht_run_t *r, arc_cache_t *cache, int count)
+{
+ if (cache->columns == count && cache->mask_bytes) return true;
+ for (int y = 0; y < HT_ARC_HEIGHT; y++) for (int h = 0; h < 2; h++)
+ cache->spans[y][h] = (arc_span_t){.first=ARC_HALF};
+ // These are the original full-cell bounds, before glyph ink trimming.
+ // Their union includes every possible glyph/antialiasing value at this
+ // length, so geometry can be reused when only the label's letters change.
+ for (int i = 0; i < count; i++) {
+ int step = 2 * i - (count - 1), absolute = step < 0 ? -step : step;
+ int sn = arc_trig[absolute][0] * (step < 0 ? -1 : 1), cs = arc_trig[absolute][1];
+ int cx = (233 - HT_ARC_X) * 256 + (205 * sn * 256 >> 14);
+ int cy = (233 - r->y) * 256 + (r->arc == 2 ? 1 : -1) * (205 * cs * 256 >> 14);
+ int sin_abs = sn < 0 ? -sn : sn;
+ int half_w = ((13 * cs + 29 * sin_abs) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sin_abs) >> 15) + 2;
+ int x0 = imax(0, (cx >> 8) - half_w), x1 = imin(HT_ARC_WIDTH, (cx >> 8) + half_w + 1);
+ int y0 = imax(0, (cy >> 8) - half_h), y1 = imin(HT_ARC_HEIGHT, (cy >> 8) + half_h + 1);
+ for (int y = y0; y < y1; y++) for (int h = 0; h < 2; h++) {
+ int left = imax(0, x0 - h * ARC_HALF), right = imin(ARC_HALF, x1 - h * ARC_HALF);
+ if (left >= right) continue;
+ arc_span_t *span = &cache->spans[y][h];
+ if (left < span->first) span->first = left;
+ if (right > span->last) span->last = right;
+ }
+ }
+ unsigned used = 0;
+ for (int y = 0; y < HT_ARC_HEIGHT; y++) for (int h = 0; h < 2; h++) {
+ arc_span_t *span = &cache->spans[y][h];
+ span->offset = used;
+ if (span->first < span->last) used += (span->last - span->first + 3) / 4;
+ }
+ cache->columns = count;
+ cache->mask_bytes = used <= sizeof cache->mask ? used : 0;
+ return cache->mask_bytes != 0;
+}
+static void arc_prepare(const ht_run_t *r, arc_cache_t *cache)
+{
+ if (cache->valid && !strcmp(cache->text, r->text)) return;
+ strcpy(cache->text, r->text);
+ cache->valid = true; arc_builds++;
+ uint32_t cp[HT_ARC_COLS];
+ int count = 0;
+ const char *p = r->text;
+ while (*p && count < HT_ARC_COLS) cp[count++] = ht_utf8_next(&p);
+ if (!arc_pack_geometry(r, cache, count)) return;
+ memset(cache->mask, 0, cache->mask_bytes);
+ for (int y = 0; y < HT_ARC_HEIGHT; y++) for (int h = 0; h < 2; h++) {
+ cache->spans[y][h].ink_first = ARC_HALF;
+ cache->spans[y][h].ink_last = 0;
+ }
+ uint8_t coverage[14 * 30];
+ for (int i = 0; i < count; i++) {
+ uint32_t c = font_codepoint(&ht_mono_20, cp[i]);
+ if (c == ' ') continue;
+ const ht_font_t *f = glyph_font(&ht_mono_20, c);
+ const uint8_t *glyph = f->pixels + (c - f->first) * 84;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (arc_fast)
+#endif
+ glyph_coverage(glyph, coverage);
+ int step = 2 * i - (count - 1), absolute = step < 0 ? -step : step;
+ int sn = arc_trig[absolute][0] * (step < 0 ? -1 : 1), cs = arc_trig[absolute][1];
+ int cx = (233 - HT_ARC_X) * 256 + (205 * sn * 256 >> 14);
+ int cy = (233 - r->y) * 256 + (r->arc == 2 ? 1 : -1) * (205 * cs * 256 >> 14);
+ if (r->arc == 2) sn = -sn; // lower arc reads left-to-right with upright letters
+ int sin_abs = sn < 0 ? -sn : sn;
+ int half_w, half_h;
+ int box_x = cx, box_y = cy;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (!arc_tight) {
+ half_w = ((13 * cs + 29 * sin_abs) >> 15) + 2;
+ half_h = ((29 * cs + 13 * sin_abs) >> 15) + 2;
+ } else
+#endif
+ {
+ const uint8_t *ink = f == &ht_open_20 ? ht_open_20_ink[0] : ht_mono_20_ink[c - f->first];
+ // Source pixels outside this box are transparent. Include a full
+ // bilinear halo and two destination pixels for fixed-point rounding.
+ int ox = (ink[0] + ink[2]) * 128 - (6 * 256 - 128);
+ int oy = (ink[1] + ink[3]) * 128 - (14 * 256 - 128);
+ box_x += (ox * cs - oy * sn) >> 14;
+ box_y += (ox * sn + oy * cs) >> 14;
+ int w = ink[2] - ink[0] + 2, h = ink[3] - ink[1] + 2;
+ half_w = ((w * cs + h * sin_abs) >> 15) + 2;
+ half_h = ((h * cs + w * sin_abs) >> 15) + 2;
+ }
+ int x0 = imax(0, (box_x >> 8) - half_w), x1 = imin(HT_ARC_WIDTH, (box_x >> 8) + half_w + 1);
+ int y0 = imax(0, (box_y >> 8) - half_h), y1 = imin(HT_ARC_HEIGHT, (box_y >> 8) + half_h + 1);
+ for (int y = y0; y < y1; y++) for (int x = x0; x < x1; x++) {
+ int dx = x * 256 + 128 - cx, dy = y * 256 + 128 - cy;
+ int sx = ((dx * cs + dy * sn) >> 14) + 6 * 256 - 128;
+ int sy = ((-dx * sn + dy * cs) >> 14) + 14 * 256 - 128;
+ if (sx < -256 || sx >= 12 * 256 || sy < -256 || sy >= 28 * 256) continue;
+ int gx = sx >> 8, gy = sy >> 8;
+ unsigned fx = sx & 255, fy = sy & 255;
+ // Fixed-point bilinear coverage preserves the existing font's soft
+ // edges. This runs only on a title change, never per animation tick.
+ unsigned a;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (!arc_fast) {
+ a = (glyph_alpha_reference(glyph,gx,gy)*(256-fx)*(256-fy) +
+ glyph_alpha_reference(glyph,gx+1,gy)*fx*(256-fy) +
+ glyph_alpha_reference(glyph,gx,gy+1)*(256-fx)*fy +
+ glyph_alpha_reference(glyph,gx+1,gy+1)*fx*fy + 32768) >> 16;
+ } else
+#endif
+ {
+ const uint8_t *alpha = coverage + (gy + 1) * 14 + gx + 1;
+ unsigned upper = alpha[0]*(256-fx) + alpha[1]*fx;
+ unsigned lower = alpha[14]*(256-fx) + alpha[15]*fx;
+ a = (upper*(256-fy) + lower*fy + 32768) >> 16;
+ }
+ if (!a) continue;
+ arc_span_t *span = &cache->spans[y][x >= ARC_HALF];
+ int local = x - (x >= ARC_HALF ? ARC_HALF : 0);
+ if (local < span->first || local >= span->last) continue;
+ unsigned k = (unsigned)(local - span->first), shift = (3 - (k & 3)) * 2;
+ uint8_t *packed = &cache->mask[span->offset + (k >> 2)];
+ unsigned old = (*packed >> shift) & 3;
+ if (a > old) {
+ *packed = (uint8_t)((*packed & ~(3u << shift)) | (a << shift));
+ if (local < span->ink_first) span->ink_first = local;
+ if (local + 1 > span->ink_last) span->ink_last = local + 1;
+ }
+ }
+ }
+}
+static void arc_raster(const ht_run_t *r, ht_rect_t clip, uint16_t *out)
+{
+ arc_cache_t *cache = &arc_caches[r->arc == 2];
+ arc_prepare(r, cache);
+ if (!cache->mask_bytes) return;
+ uint16_t palette[4] = {0, blend(r->fg,r->bg,1), blend(r->fg,r->bg,2), be16(r->fg)};
+ int x0 = imax(clip.x,r->x), x1 = imin(clip.x+clip.w,r->x+r->w);
+ int y0 = imax(clip.y,r->y), y1 = imin(clip.y+clip.h,r->y+HT_ARC_HEIGHT);
+ for (int y = y0; y < y1; y++) for (int h = 0; h < 2; h++) {
+ const arc_span_t *span = &cache->spans[y-r->y][h];
+ int base = r->x + h * ARC_HALF;
+ int left = imax(x0, base + span->ink_first);
+ int right = imin(x1, base + span->ink_last);
+ if (left >= right) continue;
+ unsigned k = (unsigned)(left - base - span->first);
+ const uint8_t *mask = cache->mask + span->offset;
+ uint16_t *dst = out + (y-clip.y)*clip.w + left-clip.x;
+ for (int x = left; x < right; x++, k++, dst++) {
+ unsigned a = (mask[k >> 2] >> ((3-(k&3))*2)) & 3;
+ if (a) *dst = palette[a];
+ }
+ }
+}
+void ht_raster(const ht_scene_t *s, ht_rect_t clip, uint16_t *out)
+{
+ fill(out, (size_t)clip.w * clip.h, be16(s->background));
+ for (int i = 0; i < s->count; i++) {
+ const ht_run_t *r = &s->runs[i];
+ const ht_font_t *f = r->font;
+ ht_rect_t box = ht_run_bounds(r);
+ if (!intersect(box, clip))
+ continue;
+ if (r->arc) { arc_raster(r, clip, out); continue; }
+ int y1 = imax(clip.y, r->y), y2 = imin(clip.y + clip.h, r->y + f->height),
+ x1 = imax(clip.x, r->x), x2 = imin(clip.x + clip.w, r->x + r->w);
+ if (r->bg != s->background)
+ for (int y = y1; y < y2; y++)
+ fill(out + (y - clip.y) * clip.w + x1 - clip.x, (size_t)(x2 - x1), be16(r->bg));
+ uint16_t palette[4] = {be16(r->bg), blend(r->fg, r->bg, 1), blend(r->fg, r->bg, 2),
+ be16(r->fg)};
+ bool cached = glyph_cache_prepare(f, r->fg, r->bg);
+ bool ascii = f->first == 32 && f->last >= 126;
+#ifdef DEVICE_LAYOUT_BENCH
+ ascii = ascii && raster_fast_ascii;
+#endif
+ const char *p = r->text;
+ int gx = r->x;
+ while (*p && gx < x2) {
+ uint32_t c = (uint8_t)*p;
+ if (ascii && c < 128) {
+ p++;
+ if (c < 32 || c > f->last) c = '?';
+ } else {
+ c = ht_utf8_next(&p);
+ c = font_codepoint(f, c);
+ }
+ if (gx + f->width > x1 && c != ' ') {
+ const ht_font_t *face = glyph_font(f, c);
+ size_t stride = ((size_t)face->width * face->height + 3) / 4;
+ const uint8_t *glyph = face->pixels + (c - face->first) * stride;
+ int xa = imax(x1, gx), xb = imin(x2, gx + f->width);
+ const uint16_t *colored = cached ? glyph_cached(c, glyph, palette) : NULL;
+ for (int y = y1; y < y2; y++) {
+ uint16_t *dst = out + (y - clip.y) * clip.w + xa - clip.x;
+ size_t k = (size_t)(y - r->y) * f->width + xa - gx;
+ if (colored) {
+ // At most five pixels. A general memcpy call costs more
+ // than these aligned 16-bit loads/stores on the ESP32.
+ const uint16_t *src = colored + k;
+ switch (xb - xa) {
+ case 5: dst[4] = src[4]; /* fall through */
+ case 4: dst[3] = src[3]; /* fall through */
+ case 3: dst[2] = src[2]; /* fall through */
+ case 2: dst[1] = src[1]; /* fall through */
+ case 1: dst[0] = src[0];
+ }
+ continue;
+ }
+ for (int x = xa; x < xb; x++, k++)
+ *dst++ = palette[(glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3];
+ }
+ }
+ gx += f->width;
+ }
+ }
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/terminal.h b/devices/harness-device/firmware/main/ui/habitat/terminal.h
new file mode 100644
index 000000000..f5a3ae2a0
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/terminal.h
@@ -0,0 +1,83 @@
+#pragma once
+// Allocation-free text compositor. No ESP-IDF, LVGL or floating point.
+// Rasterization owns two bounded curved-text caches; call it from one renderer.
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#define HT_WIDTH 466
+#define HT_HEIGHT 466
+#define HT_RUNS 40
+#define HT_TEXT_BYTES 128
+#define HT_DAMAGE_MAX 24
+typedef struct {
+ uint16_t first, last;
+ uint8_t width, height;
+ const uint8_t *pixels;
+} ht_font_t;
+extern const ht_font_t ht_mono_16, ht_mono_20, ht_mono_24, ht_mono_28, ht_pixel_40;
+// One precomputed ↗ glyph with the same cell metrics as ht_mono_20.
+extern const ht_font_t ht_open_20;
+extern const uint8_t ht_mono_20_ink[224][4], ht_open_20_ink[1][4];
+// The lock's dot is the only 40 px glyph used by the daily UI. Keep its exact
+// pixels without retaining the other 94 glyphs of the gallery font in flash.
+extern const ht_font_t ht_lock_dot;
+typedef struct {
+ int16_t x, y, w, h;
+} ht_rect_t;
+typedef struct {
+ int16_t x, y, w;
+ uint8_t arc; // 0 = straight, 1 = upper arc, 2 = lower arc
+ uint16_t fg, bg;
+ const ht_font_t *font;
+ char text[HT_TEXT_BYTES];
+} ht_run_t;
+typedef struct {
+ uint16_t background;
+ uint8_t count;
+ ht_run_t runs[HT_RUNS];
+} ht_scene_t;
+enum { HT_ARC_COLS = 32, HT_ARC_X = 25, HT_ARC_Y = 12,
+ HT_ARC_WIDTH = 416, HT_ARC_HEIGHT = 128 };
+typedef struct {
+ uint8_t count;
+ ht_rect_t rect[HT_DAMAGE_MAX];
+ uint32_t pixels;
+} ht_damage_t;
+uint16_t ht_rgb(unsigned rgb);
+void ht_scene_clear(ht_scene_t *scene, uint16_t background);
+bool ht_text(ht_scene_t *scene, int x, int y, int width, const ht_font_t *font, uint16_t fg,
+ uint16_t bg, const char *text);
+// Prevalidated printable ASCII assets: exactly `cells` readable bytes, one cell
+// each. Copies into the scene; no UTF-8 scan, allocation, or retained pointer.
+bool ht_ascii_text(ht_scene_t *scene, int x, int y, int width, const ht_font_t *font,
+ uint16_t fg, uint16_t bg, const char *text, size_t cells);
+void ht_center(ht_scene_t *scene, int y, const ht_font_t *font, uint16_t fg, const char *text);
+// Fixed 20 px upper/lower arcs. Text stays in the scene; each mask is cached on
+// first rasterization and reused across strips, animation and color changes.
+void ht_arc_title(ht_scene_t *scene, uint16_t fg, const char *text);
+void ht_arc_status(ht_scene_t *scene, uint16_t fg, const char *text);
+// Same conservative bounds used for damage; useful for matching curved hit areas.
+ht_rect_t ht_run_bounds(const ht_run_t *run);
+uint32_t ht_arc_cache_builds(void);
+#ifdef DEVICE_LAYOUT_BENCH
+void ht_arc_fast_sampling(bool enabled);
+void ht_arc_tight_bounds(bool enabled);
+void ht_damage_fast_ascii(bool enabled);
+void ht_damage_banded(bool enabled);
+void ht_raster_fast_ascii(bool enabled);
+#endif
+// Bounded small-ASCII cache. Toggle only from the renderer, for A/B profiling.
+void ht_glyph_cache_enable(bool enabled);
+uint32_t ht_glyph_cache_builds(void);
+size_t ht_glyph_cache_bytes(void);
+// Consume one word-wrapped UTF-8 line; shared by rectangular and round reading areas.
+const char *ht_take_line(const char **cursor, int cells);
+int ht_wrap(ht_scene_t *scene, int x, int y, int width, int lines, int skip, const ht_font_t *font,
+ uint16_t fg, const char *text);
+void ht_damage(const ht_scene_t *before, const ht_scene_t *after, ht_damage_t *out);
+// Output is big-endian RGB565, ready for CO5300 DMA. Buffer holds region.w * region.h pixels.
+void ht_raster(const ht_scene_t *scene, ht_rect_t region, uint16_t *out);
+uint32_t ht_utf8_next(const char **cursor);
+// Question/answer text must fit in full and contain glyphs available on this device.
+bool ht_can_display(const char *text, const ht_font_t *font, int width, int lines);
+int ht_text_rows(const char *text, const ht_font_t *font, int width);
diff --git a/devices/harness-device/firmware/main/ui/habitat/theme.h b/devices/harness-device/firmware/main/ui/habitat/theme.h
new file mode 100644
index 000000000..32ce5ba67
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/theme.h
@@ -0,0 +1,12 @@
+#pragma once
+
+// One charcoal surface, two neutral inks, one companion/action accent.
+// Canvas matches the desktop terminal pane and Cmd N / Cmd P surfaces.
+// All colors are RGB565-representable at full brightness. Conversion and the
+// existing saved brightness setting remain at the UI boundary; no theme heap.
+#define HT_THEME_CANVAS 0x181818u
+#define HT_THEME_TEXT 0xefe7deu
+#define HT_THEME_SECONDARY 0xada6adu
+#define HT_THEME_ACCENT 0xc6aaefu
+#define HT_THEME_SELECTION 0x392c4au
+#define HT_THEME_ERROR 0xe7a6adu
diff --git a/devices/harness-device/firmware/main/ui/habitat/tim.c b/devices/harness-device/firmware/main/ui/habitat/tim.c
new file mode 100644
index 000000000..1f94bffc5
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/tim.c
@@ -0,0 +1,152 @@
+#include "tim.h"
+#include <stdio.h>
+#include <string.h>
+
+static bool due(uint32_t now, uint32_t deadline) { return (int32_t)(now - deadline) >= 0; }
+static void deadline(ht_tim_motion_t *m, uint32_t now, uint32_t at)
+{
+ uint32_t left = due(now, at) ? 1 : at - now;
+ if (left < m->next_ms) m->next_ms = left;
+}
+bool ht_tim_motion_tick(ht_tim_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, int x, unsigned level, uint32_t activity)
+{
+ ht_tim_pose_t old = m->pose, p = {0};
+ m->next_ms = 1000;
+ if (!m->initialized) {
+ m->initialized = true;
+ m->next_blink = now + 5700;
+ m->blink_until = m->reaction_until = m->release_until = now;
+ m->mood = mood; m->activity = activity;
+ }
+ if (!visible || quiet || mood == HT_TIM_ASLEEP || mood == HT_TIM_OFFLINE) {
+ m->next_blink = now + 5700;
+ m->blink_until = m->reaction_until = m->release_until = now;
+ } else {
+ if ((activity != m->activity || mood != m->mood) &&
+ (mood == HT_TIM_WORKING || mood == HT_TIM_DONE || mood == HT_TIM_ATTENTION)) {
+ // Repeated tool packets cannot restart an endless busy animation.
+ bool completed = mood == HT_TIM_DONE && m->mood != HT_TIM_DONE;
+ if (completed || (due(now, m->reaction_until) && (!m->reaction_at || now - m->reaction_at >= 2000))) {
+ m->reaction_at = now;
+ m->reaction_until = now + (completed ? 1320 : 720);
+ }
+ }
+ if (down) {
+ int gaze = (x - 233) / 40;
+ p.look = gaze < -2 ? -2 : gaze > 2 ? 2 : gaze;
+ p.pressed = true;
+ m->release_until = now + 400;
+ } else if (m->was_down || !due(now, m->release_until)) {
+ p.look = old.look;
+ deadline(m, now, m->release_until);
+ }
+ if (!down && due(now, m->next_blink)) {
+ m->blink_until = now + 110;
+ m->sequence++;
+ m->next_blink = now + 5700 + (m->sequence % 5) * 413;
+ }
+ p.blink = !down && !due(now, m->blink_until);
+ if (!down) deadline(m, now, p.blink ? m->blink_until : m->next_blink);
+ if (!due(now, m->reaction_until)) {
+ p.hands = (uint8_t)(1 + (now - m->reaction_at) / 120 % 2);
+ if (mood == HT_TIM_DONE && !down) {
+ // A brief glance right, glance left, then a blink and smile.
+ // The completion event owns this finite cue; repeated status
+ // packets cannot sustain it, and touch always keeps its gaze.
+ uint32_t age = now - m->reaction_at;
+ p.look = age < 360 ? 2 : age < 720 ? -2 : 0;
+ p.blink = age >= 840 && age < 960;
+ }
+ deadline(m, now, now + 120 - (now - m->reaction_at) % 120);
+ }
+ if (mood == HT_TIM_LISTENING) {
+ p.level = old.level;
+ if (m->mood != mood || now - m->level_at >= 125) {
+ p.level = level > 4 ? 4 : (uint8_t)level;
+ m->level_at = now;
+ }
+ deadline(m, now, m->level_at + 125);
+ }
+ }
+ m->pose = p; m->mood = mood; m->activity = activity; m->was_down = down;
+ return p.look != old.look || p.hands != old.hands || p.level != old.level ||
+ p.blink != old.blink || p.pressed != old.pressed;
+}
+static void portrait(ht_scene_t *s, int y, ht_tim_mood_t mood, ht_tim_pose_t p, uint16_t ink, bool carrying)
+{
+ static const char eyes[] = {'o', 'o', '?', '^', 'x', '-', 'O', 'O'};
+ static const char *mouth[] = {"\\_/", "---", " o ", "\\_/", "/-\\", " . ", " O ", " . "};
+ static const char *levels[] = {" . ", " - ", " o ", " O ", "(O)"};
+ static const char flags[] = {'*', '#', '!', '*', '!', '~', '*', '*'};
+ if ((unsigned)mood > HT_TIM_LISTENING) mood = HT_TIM_CONTENT;
+ char eye = p.blink ? '-' : p.pressed ? 'O' : eyes[mood];
+ char left[6] = " ", right[6] = " ";
+ int offset = 2 + (p.look < -2 ? -2 : p.look > 2 ? 2 : p.look);
+ left[offset] = right[offset] = eye;
+ char lhand = p.hands == 1 || mood == HT_TIM_DONE ? '\\' : '-';
+ char rhand = p.hands == 2 || mood == HT_TIM_DONE ? '/' : '-';
+ if (mood == HT_TIM_LISTENING || p.pressed) { lhand = '\\'; rhand = '/'; }
+ char rows[6][24] = {" ___________ ", " | | | ", "", "", "", " /_\\ /_\\ "};
+ snprintf(rows[2], sizeof(rows[2]), " %c|%s|%s|%c ", lhand, left, right, rhand);
+ snprintf(rows[3], sizeof(rows[3]), " | %s | ", mood == HT_TIM_LISTENING ? levels[p.level > 4 ? 4 : p.level] : mouth[mood]);
+ snprintf(rows[4], sizeof(rows[4]), " |_[0]_tim%c__| ", flags[mood]);
+ if (carrying) snprintf(rows[4], sizeof(rows[4]), " |_[=]_tim%c__| ", flags[mood]);
+ for (int i = 0; i < 6; i++) {
+ if (i != 2) { ht_center(s, y + i * 28, &ht_mono_20, ink, rows[i]); continue; }
+ // Independent eyes/arms keep a blink from repainting the space between them.
+ static const int cells[] = {3, 5, 1, 5, 3};
+ int cell = 0, x = (HT_WIDTH - 17 * ht_mono_20.width) / 2;
+ for (int j = 0; j < 5; j++) {
+ char part[6] = {0}; memcpy(part, rows[i] + cell, (size_t)cells[j]);
+ ht_text(s, x + cell * ht_mono_20.width, y + i * 28, cells[j] * ht_mono_20.width,
+ &ht_mono_20, ink, s->background, part);
+ cell += cells[j];
+ }
+ }
+}
+void ht_tim_portrait(ht_scene_t *s, int y, ht_tim_mood_t mood, uint16_t ink)
+{
+ portrait(s, y, mood, (ht_tim_pose_t){0}, ink, false);
+}
+static void lines(ht_scene_t *s, int y, int width, int count, const ht_font_t *font,
+ uint16_t ink, const char *text)
+{
+ if (!text) text = "";
+ int start = s->count;
+ ht_wrap(s, (HT_WIDTH - width) / 2, y, width, count, 0, font, ink, text);
+ if (!ht_can_display(text, font, width, count) && s->count > start) {
+ char *p = s->runs[s->count - 1].text;
+ int keep = width / font->width - 3;
+ for (int i = 0; *p && i < keep; i++) { const char *next = p; ht_utf8_next(&next); p = (char *)next; }
+ strcpy(p, "...");
+ }
+ for (int i = start; i < s->count; i++) {
+ ht_run_t *r = &s->runs[i]; const char *p = r->text; int n = 0;
+ while (*p) { ht_utf8_next(&p); n++; }
+ r->w = n * font->width; r->x = (HT_WIDTH - r->w) / 2;
+ }
+}
+void ht_tim_face(ht_scene_t *s, const ht_tim_face_t *f)
+{
+ lines(s, 61, 300, 2, &ht_mono_20, f->foreground, f->recipient);
+ if (f->focus) {
+ char eye = f->pose.blink ? '-' : f->pose.pressed ? 'O' :
+ f->mood == HT_TIM_ATTENTION ? '?' : f->mood == HT_TIM_WORKING ? '=' :
+ f->mood == HT_TIM_ASLEEP ? '-' : f->mood == HT_TIM_OFFLINE ? 'x' : 'o';
+ char mini[16]; snprintf(mini, sizeof(mini), "[ %c | %c ]", eye, eye);
+ int x = (HT_WIDTH - 9 * ht_mono_20.width) / 2;
+ for (int i = 0; i < 3; i++) {
+ char part[4] = {0}; memcpy(part, mini + i * 3, 3);
+ ht_text(s, x + i * 3 * ht_mono_20.width, 135, 3 * ht_mono_20.width,
+ &ht_mono_20, f->ink, s->background, part);
+ }
+ lines(s, 194, 340, 3, &ht_mono_28, f->foreground,
+ f->detail && *f->detail ? f->detail : f->status);
+ } else {
+ portrait(s, 128, f->mood, f->pose, f->ink, f->carrying);
+ lines(s, 310, 340, 1, &ht_mono_16, f->dim, f->detail);
+ }
+ lines(s, 349, 336, 1, &ht_mono_20, f->ink, f->status);
+ lines(s, 395, 280, 1, &ht_mono_16, f->dim, f->hint);
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/tim.h b/devices/harness-device/firmware/main/ui/habitat/tim.h
new file mode 100644
index 000000000..1fedb86ab
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/tim.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "terminal.h"
+typedef enum {
+ HT_TIM_CONTENT, HT_TIM_WORKING, HT_TIM_ATTENTION, HT_TIM_DONE,
+ HT_TIM_OFFLINE, HT_TIM_ASLEEP, HT_TIM_BOOPED, HT_TIM_LISTENING
+} ht_tim_mood_t;
+typedef struct { int8_t look; uint8_t hands, level; bool blink, pressed; } ht_tim_pose_t;
+typedef struct {
+ ht_tim_pose_t pose;
+ ht_tim_mood_t mood;
+ uint32_t next_blink, blink_until, reaction_at, reaction_until, release_until;
+ uint32_t activity, sequence, next_ms, level_at;
+ bool initialized, was_down;
+} ht_tim_motion_t;
+// Sparse blink deadlines and finite event reactions. No heap, animation thread or hidden-screen work.
+bool ht_tim_motion_tick(ht_tim_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, int x, unsigned level, uint32_t activity);
+void ht_tim_portrait(ht_scene_t *scene, int y, ht_tim_mood_t mood, uint16_t ink);
+typedef struct {
+ const char *recipient, *status, *hint, *detail;
+ ht_tim_mood_t mood;
+ ht_tim_pose_t pose;
+ bool focus, carrying, footer_action, straight_title, unread, primary_title, roomy_reading;
+ uint16_t ink, foreground, dim;
+} ht_tim_face_t;
+void ht_tim_face(ht_scene_t *scene, const ht_tim_face_t *face);
diff --git a/devices/harness-device/firmware/main/ui/habitat/touch_habitat.c b/devices/harness-device/firmware/main/ui/habitat/touch_habitat.c
new file mode 100644
index 000000000..d14ec0f1a
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/touch_habitat.c
@@ -0,0 +1,183 @@
+#include "runtime.h"
+#include "touch.h"
+#include "display.h"
+#include "board.h"
+#include "board_pins.h"
+#include "board_i2c.h"
+#include "driver/i2c_master.h"
+#include "esp_lcd_panel_io.h"
+#include "esp_lcd_touch_cst816s.h"
+#include "esp_lcd_touch_cst9217.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <stdatomic.h>
+#include <assert.h>
+static esp_lcd_touch_handle_t controller;
+static esp_lcd_panel_io_handle_t io;
+static TaskHandle_t touch_task_handle;
+static atomic_uint presses, failures, inferred, last_press;
+static atomic_bool held, controller_ready;
+static void touch_irq(esp_lcd_touch_handle_t tp)
+{
+ (void)tp;
+ BaseType_t wake = pdFALSE;
+ if (touch_task_handle)
+ vTaskNotifyGiveFromISR(touch_task_handle, &wake);
+ if (wake)
+ portYIELD_FROM_ISR();
+}
+static bool open_touch(void)
+{
+ const board_t *b = board();
+ if (b->touch == TOUCH_NONE)
+ return false;
+ esp_lcd_panel_io_i2c_config_t c =
+ b->touch == TOUCH_CST816S
+ ? (esp_lcd_panel_io_i2c_config_t)ESP_LCD_TOUCH_IO_I2C_CST816S_CONFIG()
+ : (esp_lcd_panel_io_i2c_config_t)ESP_LCD_TOUCH_IO_I2C_CST9217_CONFIG();
+ c.scl_speed_hz = BSP_I2C_FREQ_HZ;
+ if (esp_lcd_new_panel_io_i2c(board_i2c_get(), &c, &io) != ESP_OK)
+ return false;
+ esp_lcd_touch_config_t t = {.x_max = 466,
+ .y_max = 466,
+ .rst_gpio_num = b->touch_rst,
+ .int_gpio_num = BSP_TOUCH_INT,
+ .flags = {.mirror_x = b->touch_mirror, .mirror_y = b->touch_mirror},
+ .interrupt_callback = touch_irq};
+ esp_err_t err = b->touch == TOUCH_CST816S ? esp_lcd_touch_new_i2c_cst816s(io, &t, &controller)
+ : esp_lcd_touch_new_i2c_cst9217(io, &t, &controller);
+ if (err != ESP_OK) {
+ controller = NULL;
+ esp_lcd_panel_io_del(io);
+ io = NULL;
+ return false;
+ }
+ atomic_store(&controller_ready, true);
+ return true;
+}
+static void task(void *arg)
+{
+ (void)arg;
+ bool prev = false, swallow = false;
+ unsigned errors = 0;
+ int64_t last_good = 0, retry_at = 0;
+ uint16_t last_x = 0, last_y = 0;
+ for (;;) {
+ int64_t now = esp_timer_get_time();
+ if (!controller) {
+ if (now >= retry_at) {
+ open_touch();
+ retry_at = now + 5000000;
+ }
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(100));
+ continue;
+ }
+ uint16_t x = last_x, y = last_y, strength = 0;
+ uint8_t count = 0;
+ bool down = false, trusted = true, invalidate = true;
+ esp_err_t rc = esp_lcd_touch_read_data(controller);
+ if (rc == ESP_OK) {
+ errors = 0;
+ down = esp_lcd_touch_get_coordinates(controller, &x, &y, &strength, &count, 1) &&
+ count > 0;
+ // A malformed controller coordinate must never become an action or a swipe.
+ if (down && (x >= HT_WIDTH || y >= HT_HEIGHT)) {
+ down = false;
+ trusted = false;
+ }
+ if (down) {
+ last_good = now;
+ last_x = x;
+ last_y = y;
+ }
+ } else if (rc == ESP_ERR_INVALID_RESPONSE && board()->touch == TOUCH_CST9217) {
+ trusted = false;
+ // This controller also returns stale ACKs while idle. With a previously verified
+ // UP there is no contact to infer; ignore that idle sample, without swallowing the
+ // next real DOWN. During a contact, however, any missing sample invalidates taps.
+ invalidate = prev;
+ // Preserve the proven stale-ACK recovery, expressed in time so a faster poll cannot
+ // split a touch.
+ errors = 0;
+ down = prev && now - last_good < 100000;
+ if (prev && !down)
+ atomic_fetch_add(&inferred, 1);
+ } else {
+ trusted = false;
+ atomic_fetch_add(&failures, 1);
+ if (++errors >= 8) {
+ atomic_store(&controller_ready, false);
+ esp_lcd_touch_del(controller);
+ controller = NULL;
+ esp_lcd_panel_io_del(io);
+ io = NULL;
+ retry_at = now + 100000;
+ errors = 0;
+ }
+ }
+ if (!trusted && invalidate) {
+ // Neither a stale ACK, a malformed coordinate nor a failed read is a tap release.
+ // Do not re-arm on the next DOWN from the same still-held finger.
+ display_lock();
+ habitat_touch_cancel();
+ display_unlock();
+ swallow = swallow || prev || count > 0;
+ }
+ if (down && !prev) {
+ atomic_fetch_add(&presses, 1);
+#ifdef DEVICE_PERF_BENCH
+ if (atomic_load(&presses) <= 16) ESP_LOGI("PERF", "touch raw x=%u y=%u", x, y);
+#endif
+ atomic_store(&last_press, (uint32_t)(now / 1000));
+ if (display_is_asleep()) {
+ display_lock();
+ habitat_touch_cancel();
+ display_wake();
+ display_unlock();
+ swallow = true;
+ } else
+ habitat_input_stamp(now);
+ }
+ if (down)
+ display_bump_activity();
+ if (!swallow && (down || prev)) {
+ display_lock();
+ // PWR can put the screen to sleep halfway through a contact, even
+ // while this task waits for the UI lock. Cancel under that same lock
+ // and consume the rest of the contact, including after a PWR wake.
+ if (display_is_asleep()) {
+ habitat_touch_cancel();
+ swallow = true;
+ } else {
+ habitat_touch(down, x, y, (uint32_t)(now / 1000));
+ }
+ display_unlock();
+ }
+ if (!down && trusted)
+ swallow = false;
+ prev = down;
+ atomic_store(&held, down);
+ // GPIO wakes immediately. Active samples have a 4ms fallback; idle fallback catches a
+ // missed IRQ.
+ ulTaskNotifyTake(pdTRUE, pdMS_TO_TICKS(down ? 4 : 20));
+ }
+}
+void touch_init(void)
+{
+ assert(xTaskCreatePinnedToCore(task, "habitat_touch", 4096, NULL, 7, &touch_task_handle, 1) ==
+ pdPASS);
+}
+uint32_t touch_activity_generation(void) { return atomic_load(&presses); }
+void touch_stats(touch_stats_t *out)
+{
+ uint32_t pressed_at = atomic_load(&last_press);
+ *out = (touch_stats_t){.presses = atomic_load(&presses),
+ .last_press_ms_ago =
+ (uint32_t)(esp_timer_get_time() / 1000) - pressed_at,
+ .read_failures = atomic_load(&failures),
+ .inferred_releases = atomic_load(&inferred),
+ .controller_ok = atomic_load(&controller_ready),
+ .held_now = atomic_load(&held)};
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/transport_bench.c b/devices/harness-device/firmware/main/ui/habitat/transport_bench.c
new file mode 100644
index 000000000..2d376aaf0
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/transport_bench.c
@@ -0,0 +1,146 @@
+// Diagnostic only. All buffers stay in RAM; no synthetic input reaches the app.
+#include "cable_frame.h"
+#include "cable_client.h"
+#include "esp_rom_crc.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "esp_attr.h"
+#include "esp_app_desc.h"
+#include "esp_heap_caps.h"
+#include "esp_task_wdt.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+uint16_t reference_crc16(const uint8_t *data, size_t len);
+void reference_decoder_init(cable_decoder_t *d);
+void reference_decoder_feed(cable_decoder_t *d, const uint8_t *data, size_t n,
+ cable_frame_cb cb, void *ctx);
+
+static RTC_NOINIT_ATTR uint32_t attempted[2];
+static uint8_t payload[CABLE_MAX_PAYLOAD + 4];
+static uint8_t frame[CABLE_MAX_FRAME];
+static cable_decoder_t decoder;
+
+static void decoded(uint8_t version, uint8_t type, const uint8_t *data, size_t n, void *ctx)
+{
+ (void)ctx;
+ assert(version == CABLE_FRAME_VERSION && type == CABLE_TYPE_PCM);
+ assert(n <= CABLE_MAX_PAYLOAD && !memcmp(data, payload, n));
+ // No forwarding, UI state or app callback: local parser work only.
+ payload[CABLE_MAX_PAYLOAD + 3]++;
+}
+
+static uint16_t crc_nibble(const uint8_t *data, size_t len)
+{
+ static const uint16_t table[16] = {
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef
+ };
+ uint16_t crc = 0xffff;
+ for (size_t i = 0; i < len; i++) {
+ crc ^= (uint16_t)data[i] << 8;
+ crc = (uint16_t)((crc << 4) ^ table[crc >> 12]);
+ crc = (uint16_t)((crc << 4) ^ table[crc >> 12]);
+ }
+ return crc;
+}
+static uint16_t crc_rom(const uint8_t *data, size_t len)
+{
+ // Espressif's documented CRC-16/CCITT-FALSE adaptation. The ROM API
+ // complements both ends; the wire protocol's init is 0xffff, xorout zero.
+ return (uint16_t)~esp_rom_crc16_be(0, data, (uint32_t)len);
+}
+static int compare(const void *a, const void *b)
+{
+ uint32_t x = *(const uint32_t *)a, y = *(const uint32_t *)b;
+ return x < y ? -1 : x > y;
+}
+void cable_transport_benchmark(void)
+{
+ uint32_t key = 2166136261u;
+ for (const char *p = esp_app_get_description()->version; *p; p++)
+ key = (key ^ (uint8_t)*p) * 16777619u;
+ if (attempted[0] == key && attempted[1] == ~key) return;
+ attempted[0] = key; attempted[1] = ~key;
+ int64_t deadline = esp_timer_get_time() + 15000000;
+ while (!cable_client_is_connected() && esp_timer_get_time() < deadline) {
+ esp_task_wdt_reset(); vTaskDelay(pdMS_TO_TICKS(100));
+ }
+ uint32_t rng = 0x41be9587;
+ for (size_t i = 0; i < sizeof payload; i++) {
+ rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5;
+ payload[i] = (uint8_t)rng;
+ }
+ static const size_t sizes[] = {0, 4, 48, 84, 324, 1028, 4100, 8196};
+ static const char *modes[] = {"bitwise91", "nibble92", "rom92"};
+ uint16_t (*const crc[])(const uint8_t *, size_t) = {reference_crc16, crc_nibble, crc_rom};
+ uint32_t times[40];
+ for (size_t size = 0; size < sizeof sizes / sizeof sizes[0]; size++) {
+ uint16_t expected = crc[0](payload, sizes[size]);
+ assert(crc[1](payload, sizes[size]) == expected);
+ assert(crc[2](payload, sizes[size]) == expected);
+ }
+ unsigned before = heap_caps_get_free_size(MALLOC_CAP_INTERNAL);
+ ESP_LOGI("transport-bench", "BEGIN 1920 local CRCs; bitwise/nibble/ROM; no USB/app commands");
+ for (int pass = 0; pass < 2; pass++) for (int order = 0; order < 3; order++) {
+ int mode = pass ? 2 - order : order;
+ for (size_t size = 0; size < sizeof sizes / sizeof sizes[0]; size++) {
+ uint16_t expected = crc[0](payload, sizes[size]);
+ for (int i = 0; i < 40; i++) {
+ int64_t start = esp_timer_get_time();
+ uint16_t result = crc[mode](payload, sizes[size]);
+ times[i] = (uint32_t)(esp_timer_get_time() - start);
+ assert(result == expected);
+ esp_task_wdt_reset(); vTaskDelay(1);
+ }
+ qsort(times, 40, sizeof *times, compare);
+ ESP_LOGI("transport-bench", "pass=%d mode=%s bytes=%u n=40 min=%lu median=%lu p95=%lu max=%lu",
+ pass, modes[mode], (unsigned)sizes[size], (unsigned long)times[0],
+ (unsigned long)((times[19] + times[20]) / 2),
+ (unsigned long)times[37], (unsigned long)times[39]);
+ }
+ }
+ assert(heap_caps_check_integrity_all(true));
+ ESP_LOGI("transport-bench", "END internal=%u/%u; excludes queue, USB and desktop",
+ before, (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
+
+ static const size_t lengths[] = {48, 320, 1024, 4096, 8192};
+ static const size_t chunks[] = {1, 64, 512, CABLE_MAX_FRAME};
+ ESP_LOGI("transport-decode", "BEGIN 3200 local decodes; original91/ROM-block93; no USB/app commands");
+ for (int pass = 0; pass < 2; pass++) for (int order = 0; order < 2; order++) {
+ int mode = pass ? 1 - order : order;
+ for (size_t size = 0; size < sizeof lengths / sizeof lengths[0]; size++) {
+ int n = cable_frame_encode(CABLE_TYPE_PCM, payload, lengths[size], frame, sizeof frame);
+ assert(n > 0);
+ for (size_t chunk = 0; chunk < sizeof chunks / sizeof chunks[0]; chunk++) {
+ for (int i = 0; i < 40; i++) {
+ uint8_t count = payload[CABLE_MAX_PAYLOAD + 3];
+ int64_t start = esp_timer_get_time();
+ if (mode) cable_decoder_init(&decoder); else reference_decoder_init(&decoder);
+ for (size_t offset = 0; offset < (size_t)n;) {
+ size_t take = (size_t)n - offset;
+ if (take > chunks[chunk]) take = chunks[chunk];
+ if (mode) cable_decoder_feed(&decoder, frame + offset, take, decoded, NULL);
+ else reference_decoder_feed(&decoder, frame + offset, take, decoded, NULL);
+ offset += take;
+ }
+ times[i] = (uint32_t)(esp_timer_get_time() - start);
+ assert(payload[CABLE_MAX_PAYLOAD + 3] == (uint8_t)(count + 1));
+ assert(!decoder.len && !decoder.corrupt_frames && !decoder.discarded_bytes);
+ esp_task_wdt_reset(); vTaskDelay(1);
+ }
+ qsort(times, 40, sizeof *times, compare);
+ ESP_LOGI("transport-decode", "pass=%d mode=%s bytes=%u chunk=%u n=40 min=%lu median=%lu p95=%lu max=%lu",
+ pass, mode ? "rom-block93" : "original91", (unsigned)lengths[size], (unsigned)chunks[chunk],
+ (unsigned long)times[0], (unsigned long)((times[19] + times[20]) / 2),
+ (unsigned long)times[37], (unsigned long)times[39]);
+ }
+ }
+ }
+ assert(heap_caps_check_integrity_all(true));
+ ESP_LOGI("transport-decode", "END internal=%u/%u; excludes queue, USB and desktop",
+ before, (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL));
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
new file mode 100644
index 000000000..33ec0abc5
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/ui_habitat.c
@@ -0,0 +1,3817 @@
+// Habitat: bounded state + text runs. Protocol callbacks update data, never create widgets.
+#include "runtime.h"
+#include "scroll.h"
+#include "workspace.h"
+#include "selection.h"
+#include "carry.h"
+#include "visit.h"
+#include "form.h"
+#include "draft.h"
+#include "gestures.h"
+#include "octopus.h"
+#include "perf_bench.h"
+#include "command_face.h"
+#include "theme.h"
+#ifdef DEVICE_CREATURE_GALLERY
+#include "creature_gallery.h"
+static ht_gallery_t gallery;
+#endif
+#include "ui_screens.h"
+#include "display.h"
+#include "audio_client.h"
+#include "audio_capture.h"
+#include "config_store.h"
+#include "cable_client.h"
+#include "esp_attr.h"
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "esp_app_desc.h"
+#include "esp_random.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/queue.h"
+#include "cJSON.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdatomic.h>
+#include <assert.h>
+
+#define NOTICES 24
+#define QUESTION_MAX 4
+#define OPTION_MAX 6
+#define TAB_ROWS 5
+#define TAB_ROW_HEIGHT 56
+#define TAB_TOP 112
+#define PANE_MEMORY_MAX 128
+#define PANE_RESULT_BYTES 1024
+typedef enum {
+ HOME,
+ AGENTS,
+ AGENT,
+ READER,
+ QUESTION,
+ CHOICE,
+ ANSWER_REVIEW,
+ INBOX,
+ TABS,
+ MACHINES,
+ VOICE,
+ SELECTION,
+ FORM,
+ DRAFT,
+ DRAFT_OPTIONS,
+ COMPANION,
+ SETTINGS,
+ STOP,
+ MODELS,
+ MESSAGE,
+ OTA
+} view_t;
+typedef enum {
+ A_NONE,
+ A_FIND, A_FORM, A_FORM_MAIN, A_FORM_BACK, A_FORM_SEND, A_FORM_SAY,
+ A_HOME,
+ A_AGENTS,
+ A_AGENT,
+ A_READER,
+ A_QUESTION,
+ A_CHOICE,
+ A_ANSWER, A_QUESTION_READ, A_QUESTION_CHOICES, A_QUESTION_REVIEW, A_QUESTION_BACK, A_QUESTION_SAY,
+ A_INBOX,
+ A_NOTICE,
+ A_TABS,
+ A_TAB, A_TAB_REFRESH,
+ A_MACHINES,
+ A_MACHINE,
+ A_VOICE,
+ A_VOICE_STOP,
+ A_VOICE_ABORT,
+ A_PET,
+ A_COMPANION,
+ A_NAP,
+ A_QUIET,
+ A_FACE,
+ A_RIM,
+ A_HABITAT_SAVE,
+ A_MUTE,
+ A_SETTINGS,
+ A_BRIGHT,
+ A_STOP,
+ A_STOP_YES,
+ A_MODELS,
+ A_MODEL,
+ A_RECAP_DISMISS,
+ A_DESKTOP,
+ A_UP,
+ A_DOWN,
+ A_LOCK,
+ A_SCROLL,
+ A_SELECT_BEGIN, A_SELECT_FIND, A_SELECT_EXTEND, A_SELECT_SEND, A_RETURN, A_LATEST, A_VISIT_SEND,
+ A_CARRY, A_CARRY_DROP, A_CARRY_SEND,
+ A_DRAFT_EDIT, A_DRAFT_APPEND, A_DRAFT_UNDO, A_DRAFT_SEND, A_DRAFT_DISCARD,
+ A_DRAFT_STATE, A_DRAFT_OPTIONS, A_DRAFT_BACK, A_DRAFT_COMMAND
+} action_kind_t;
+typedef struct {
+ action_kind_t kind;
+ int value;
+ char id[ID_MAX];
+ char text[192];
+ uint32_t revision;
+ int dy, velocity;
+} action_t;
+typedef struct {
+ ht_rect_t rect;
+ action_kind_t action;
+ int value;
+ bool enabled;
+} hit_t;
+typedef struct {
+ char id[ID_MAX], session[80], preview[240], full[PANE_RESULT_BYTES], activity[100];
+ uint32_t used, busy_ms, last_busy;
+ bool busy, live_summary, dismissed, awaiting_result;
+} pane_memory_t;
+typedef struct {
+ char id[ID_MAX], name[CABLE_NAME_MAX], engine[12], machine_id[ID_MAX], machine[CABLE_NAME_MAX], model[192],
+ session[80];
+ // The row receives the same bounded result stored in pane memory. Keeping
+ // an unused 4 KB tail here wasted RAM and enlarged every roster swap.
+ char preview[240], full[PANE_RESULT_BYTES], tool[100];
+ bool busy, has_event, recap_ready;
+ uint32_t busy_ms, last_busy;
+ int tokens;
+} agent_t;
+typedef struct {
+ char key[256], prompt[256], options[OPTION_MAX][256], answer[1600];
+ int count;
+ bool multi, can_text;
+ char draft[48];
+ uint8_t selected;
+} question_item_t;
+typedef struct {
+ char agent[ID_MAX], request[80], name[64];
+ question_item_t item[QUESTION_MAX];
+ int count, index, choice, drag;
+ bool valid, pending, supported, loading, uncertain;
+ char token[48], fetch[48], error[120], speech_error[96];
+ uint32_t revision, deadline;
+} question_t;
+typedef struct {
+ char agent[ID_MAX], fetch[48], token[48];
+ uint8_t choices[QUESTION_MAX];
+ char drafts[QUESTION_MAX][48];
+ int count;
+} question_submit_t;
+static EXT_RAM_BSS_ATTR struct {
+ agent_t agents[MAX_PROJECTS];
+ pane_memory_t memory[PANE_MEMORY_MAX];
+ uint32_t memory_serial;
+ int count, active, total;
+ bool connected, window, loading, ready, dirty;
+ int bulk, offset;
+ view_t view, voice_return;
+ bool quiet, nap, locked, lock_armed, rim_enabled, focus_face, straight_title;
+ bool muted;
+ int pet_pose;
+ uint32_t pet_until, nap_until, last_celebration;
+ cable_swarm_t tabs[SWARMS_MAX];
+ int tab_count, tab_drag;
+ char selected_tab[ID_MAX];
+ cable_machine_t machines[CABLE_MAX_MACHINES];
+ int machine_count;
+ char selected_machine[ID_MAX], pending_machine[ID_MAX];
+ uint32_t machine_deadline;
+ cable_notif_t notice[NOTICES];
+ int notice_count;
+ question_t q;
+ char message[256], title[80], pending_focus[ID_MAX], opening_notice[ID_MAX];
+ char voice_target[CABLE_NAME_MAX];
+ uint32_t message_until;
+ model_item_t models[48];
+ int model_count;
+ bool model_request;
+ char model_agent[ID_MAX], model_selected[192];
+ char stop_agent[ID_MAX];
+ int brightness;
+ uint32_t voice_started, voice_second;
+ bool voice_open, voice_start_pending, voice_waiting, voice_carry;
+ bool voice_review, voice_review_preview, voice_draft_append, voice_search;
+ uint32_t voice_draft_revision;
+ int draft_drag;
+ uint32_t voice_generation, voice_question_revision;
+ int voice_question_index;
+ uint32_t voice_wait_until;
+ hit_t hits[24];
+ ht_rect_t inbox_arc;
+ int hit_count, pressed;
+ bool touch_down, touch_cancelled;
+ bool touch_brake, coasting;
+ bool quick_open;
+ int quick_choice;
+ uint32_t coast_until;
+ uint32_t tim_activity;
+ int start_x, start_y, last_x, last_y;
+ uint32_t touch_started;
+ char pattern[32];
+ uint16_t pattern_mask;
+ int pattern_len;
+ bool pattern_error;
+} s;
+static QueueHandle_t actions;
+static _Atomic(TaskHandle_t) reload_waiter;
+static atomic_bool reload_requested;
+static bool scroll_reversed;
+static ht_scroll_t scroll;
+static ht_selection_t selection;
+static ht_workspace_t workspace;
+static ht_carry_t carry;
+static ht_visit_t visit;
+static ht_form_t form;
+static ht_draft_t draft;
+static bool selection_emit(const ht_select_command_t *command, void *ctx);
+static ht_gesture_t gesture;
+static ht_octopus_motion_t octopus_motion;
+static action_t pressed_action;
+static uint32_t ms(void) { return (uint32_t)(esp_timer_get_time() / 1000); }
+static void copy(char *dst, size_t cap, const char *src)
+{
+ if (!cap)
+ return;
+ if (!src)
+ src = "";
+ size_t n = strnlen(src, cap - 1);
+ memmove(dst, src, n);
+ dst[n] = 0;
+}
+#define COPY(dst, src) copy(dst, sizeof(dst), src)
+static void recap_preview(char *dst, size_t cap, const char *src)
+{
+ if (!cap)
+ return;
+ size_t used = 0;
+ bool space = false;
+ const unsigned char *p = (const unsigned char *)(src ? src : "");
+ while (*p) {
+ if (*p == ' ' || (*p >= '\t' && *p <= '\r')) {
+ space = used > 0;
+ p++;
+ continue;
+ }
+ size_t n = *p < 0x80 ? 1 : *p >= 0xc2 && *p <= 0xdf ? 2 :
+ *p >= 0xe0 && *p <= 0xef ? 3 : *p >= 0xf0 && *p <= 0xf4 ? 4 : 0;
+ for (size_t i = 1; i < n; i++) {
+ if ((p[i] & 0xc0) != 0x80) {
+ n = 0;
+ break;
+ }
+ }
+ size_t bytes = n ? n : 1;
+ if (used + space + bytes >= cap)
+ break; // Keep whole UTF-8 characters, including at the buffer edge.
+ if (space)
+ dst[used++] = ' ';
+ if (n)
+ memcpy(dst + used, p, n);
+ else
+ dst[used] = '?';
+ used += bytes;
+ p += bytes;
+ space = false;
+ }
+ // Older hosts cached their clipping marker as U+2026. Render that trailing
+ // marker with the same printable-ASCII continuation sign as new recaps.
+ if (used >= 3 && !memcmp(dst + used - 3, "\xe2\x80\xa6", 3)) {
+ dst[used - 3] = '+';
+ used -= 2;
+ }
+ // Give the continuation sign breathing room, including recaps cached by
+ // older hosts. Do not change a literal C++ or add a second existing space.
+ if (used > 1 && dst[used - 1] == '+' && dst[used - 2] != '+' &&
+ dst[used - 2] != ' ' && used + 1 < cap) {
+ dst[used - 1] = ' ';
+ dst[used++] = '+';
+ }
+ dst[used] = 0;
+}
+static void change(void)
+{
+ s.dirty = true;
+ habitat_render_notify();
+}
+static int find(const char *id)
+{
+ if (!id)
+ return -1;
+ for (int i = 0; i < s.count; i++)
+ if (!strcmp(id, s.agents[i].id))
+ return i;
+ return -1;
+}
+static agent_t *active(void)
+{
+ return s.active >= 0 && s.active < s.count ? &s.agents[s.active] : NULL;
+}
+static pane_memory_t *pane_memory(const char *id, bool create)
+{
+ if (!id || !*id || strnlen(id, ID_MAX) >= ID_MAX) return NULL;
+ pane_memory_t *slot = NULL;
+ for (int i = 0; i < PANE_MEMORY_MAX; i++) {
+ pane_memory_t *m = &s.memory[i];
+ if (!strcmp(m->id, id)) {
+ m->used = ++s.memory_serial;
+ return m;
+ }
+ if (!m->id[0] && !slot) slot = m;
+ }
+ if (!create) return NULL;
+ if (!slot) {
+ // Keep every on-screen pane pinned. Evict only the least recently used
+ // off-tab record; the normal roster is much smaller than this cache.
+ uint32_t age = 0;
+ for (int i = 0; i < PANE_MEMORY_MAX; i++) {
+ pane_memory_t *m = &s.memory[i];
+ uint32_t elapsed = s.memory_serial - m->used;
+ if (find(m->id) < 0 && (!slot || elapsed > age)) { slot = m; age = elapsed; }
+ }
+ }
+ if (!slot) return NULL;
+ memset(slot, 0, sizeof *slot);
+ COPY(slot->id, id);
+ slot->used = ++s.memory_serial;
+ return slot;
+}
+static void pane_memory_apply(agent_t *a, pane_memory_t *m)
+{
+ if (!a || !m) return;
+ if (m->busy && ms() - m->last_busy > 25000) m->busy = false;
+ COPY(a->session, m->session);
+ COPY(a->preview, m->preview);
+ COPY(a->full, m->full);
+ COPY(a->tool, m->activity);
+ a->busy = m->busy;
+ a->busy_ms = m->busy_ms;
+ a->last_busy = m->last_busy;
+ a->has_event = m->preview[0] != 0;
+ a->recap_ready = a->has_event && !m->dismissed && !m->awaiting_result && !m->busy;
+}
+static void dismiss_result(const char *id)
+{
+ pane_memory_t *m = pane_memory(id, true);
+ if (!m) return;
+ m->dismissed = true;
+ int i = find(id);
+ if (i >= 0) s.agents[i].recap_ready = false;
+ change();
+}
+static void activity_text(char *dst, size_t cap, const char *src)
+{
+ // Keep the engine's word; trailing spinner dots unbalance the curved label.
+ // This is presentation only. Do not alter dots inside a phrase or the recap.
+ copy(dst, cap, src);
+ size_t n = strlen(dst);
+ if (n >= 3 && (!memcmp(dst + n - 3, "...", 3) ||
+ !memcmp(dst + n - 3, "\xe2\x80\xa6", 3))) dst[n - 3] = 0;
+}
+
+static int ensure(const char *id)
+{
+ if (!id || !*id || strnlen(id, ID_MAX) >= ID_MAX) return -1;
+ int i = find(id);
+ if (i >= 0)
+ return i;
+ if (s.count >= MAX_PROJECTS)
+ return -1;
+ i = s.count++;
+ memset(&s.agents[i], 0, sizeof(agent_t));
+ COPY(s.agents[i].id, id);
+ pane_memory_apply(&s.agents[i], pane_memory(id, false));
+ return i;
+}
+static void input_cancel(void)
+{
+ ht_gesture_cancel(&gesture);
+ ht_workspace_cancel_touch(&workspace);
+ ht_scroll_cancel(&scroll);
+ s.coasting = false;
+ s.quick_open = false;
+ s.voice_review_preview = false;
+ if (s.touch_down) s.touch_cancelled = true;
+ s.pressed = -1;
+}
+static void view(view_t v)
+{
+ // A swipe, desktop refresh or late reply must not hide a live microphone. Only an
+ // explicit finish/cancel or the matching voice result releases this screen.
+ if (form.id[0] && s.view == FORM && v != FORM &&
+ !(v == VOICE && s.voice_open && s.voice_return == FORM)) return;
+ if (draft.page.active && v != DRAFT && v != DRAFT_OPTIONS &&
+ !(v == VOICE && s.voice_open && s.voice_return == DRAFT)) return;
+ if (s.voice_open && v != VOICE)
+ return;
+ if (carry.pending && v != SELECTION) ht_carry_close(&carry);
+ if (selection.active && v != SELECTION && v != VOICE) ht_selection_close(&selection);
+ if (s.view == INBOX && v != INBOX) s.opening_notice[0] = 0;
+ input_cancel();
+ s.view = v;
+ s.offset = 0;
+ s.pressed = -1;
+ change();
+}
+static void voice_close(void)
+{
+ s.voice_open = s.voice_start_pending = s.voice_waiting = false;
+ s.voice_carry = false;
+ s.voice_review = s.voice_review_preview = false;
+ s.voice_generation++; // invalidate a start still queued behind another cable action
+}
+static int workspace_index(const char *id)
+{
+ if (!id || !*id) return -1;
+ for (int i=0;i<s.tab_count;i++) if (!strcmp(id,s.tabs[i].id)) return i;
+ return -1;
+}
+static void workspace_failed(const char *message)
+{
+ ht_workspace_cancel_request(&workspace);
+ s.loading=false; s.active=-1;
+ COPY(s.title,"Workspaces"); COPY(s.message,message); view(MESSAGE);
+}
+static int waiting(void)
+{
+ int n = 0;
+ for (int i = 0; i < s.notice_count; i++)
+ n += s.notice[i].question;
+ return n;
+}
+static int working(void)
+{
+ int n = 0;
+ for (int i = 0; i < s.count; i++)
+ n += s.agents[i].busy;
+ return n;
+}
+static bool is_question(const char *id)
+{
+ for (int i = 0; i < s.notice_count; i++)
+ if (s.notice[i].question && !strcmp(id, s.notice[i].agent_id))
+ return true;
+ return false;
+}
+static uint16_t color(unsigned rgb)
+{
+ unsigned b = s.brightness < 8 ? 8 : s.brightness;
+ if (rgb == HT_THEME_CANVAS) {
+ // RGB565 has an extra green bit. Independently truncating a dim gray
+ // makes it green; the canvas's 0..24 range has exact neutral steps of 8.
+ unsigned gray = (((rgb & 255) * b + 400) / 800) * 8;
+ return ht_rgb(gray * 0x010101u);
+ }
+ return ht_rgb((((rgb >> 16) * b / 100) << 16) | ((((rgb >> 8) & 255) * b / 100) << 8) |
+ ((rgb & 255) * b / 100));
+}
+#define BG color(HT_THEME_CANVAS)
+#define FG color(HT_THEME_TEXT)
+#define DIM color(HT_THEME_SECONDARY)
+#define ACCENT color(HT_THEME_ACCENT)
+#define ERROR color(HT_THEME_ERROR)
+#define SEL color(HT_THEME_SELECTION)
+static void text(ht_scene_t *f, int x, int y, int w, const char *t, uint16_t c)
+{
+ ht_text(f, x, y, w, &ht_mono_20, c, BG, t);
+}
+static void center(ht_scene_t *f, int y, const char *t, uint16_t c)
+{
+ ht_center(f, y, &ht_mono_20, c, t);
+}
+static void control(ht_scene_t *f, int x, int y, int w, const char *label, action_kind_t a,
+ int value, bool enabled)
+{
+ if (s.hit_count >= 24)
+ return;
+ int n = s.hit_count++;
+ s.hits[n] = (hit_t){{x, y - 14, w, 60}, a, value, enabled};
+ ht_text(f, x, y, w, &ht_mono_20, enabled ? (a == A_STOP_YES ? ERROR : n == s.pressed ? ACCENT : FG) : DIM,
+ n == s.pressed ? SEL : BG, label);
+}
+static bool home_footer(action_kind_t action)
+{
+ return action == A_TABS || action == A_INBOX || action == A_RETURN || action == A_CARRY_DROP;
+}
+static bool hit_contains(const hit_t *hit, int x, int y, bool surface)
+{
+ ht_rect_t r = hit->rect;
+ if (x >= r.x && x < r.x + r.w && y >= r.y && y < r.y + r.h) return true;
+ if (!surface || hit->action != A_INBOX || s.straight_title) return false;
+ r = s.inbox_arc;
+ if (x < r.x || x >= r.x + r.w || y < r.y || y >= r.y + r.h) return false;
+ int dx = x - 233, dy = y - 233, radius = dx * dx + dy * dy;
+ // Follow the bottom label's visible extent without stealing the central
+ // companion. Its rising ends can sit well above the broad bottom target.
+ return y > 233 && radius >= 180 * 180 && radius <= 233 * 233;
+}
+static void footer_control(ht_scene_t *f, int x, int w, const char *label,
+ action_kind_t action, bool enabled)
+{
+ if (s.hit_count >= 24) return;
+ int n = s.hit_count++;
+ bool inbox = action == A_INBOX;
+ s.hits[n] = (hit_t){{x, inbox ? 359 : 389, w, inbox ? 80 : 50}, action, 0, enabled};
+ // These short footer labels are ASCII. The two targets stay separate and
+ // retain a full finger-height hit area even at the bottom of the circle.
+ int width = (int)strlen(label) * ht_mono_20.width;
+ if (inbox && width > 276) width = 276;
+ ht_text(f, x + (w - width) / 2, inbox ? 385 : 399, width, &ht_mono_20,
+ enabled ? (inbox || n == s.pressed ? ACCENT : FG) : DIM,
+ inbox && n == s.pressed ? SEL : BG, label);
+}
+static void heading(ht_scene_t *f, const char *title)
+{
+ control(f, 87, 67, 48, "<", A_HOME, 0, true);
+ text(f, 147, 67, 252, title, FG);
+}
+static ht_tim_mood_t tim_mood(void)
+{
+ if (!s.connected)
+ return HT_TIM_OFFLINE;
+ if (waiting())
+ return HT_TIM_ATTENTION;
+ if (s.nap)
+ return HT_TIM_ASLEEP;
+ if (!s.quiet && (s.pet_pose == 1 || s.pet_pose == 2))
+ return HT_TIM_BOOPED;
+ if (!s.quiet && s.pet_pose == 3)
+ return HT_TIM_DONE;
+ if (working() > 0)
+ return HT_TIM_WORKING;
+ return HT_TIM_CONTENT;
+}
+static void surface_tick(uint32_t now)
+{
+ bool main = s.view == HOME || s.view == AGENT;
+ bool inbox = s.view == INBOX && s.offset >= 0 && s.offset < s.notice_count;
+ bool visible = !s.locked && !display_is_asleep() && (main || s.view == VOICE || inbox);
+ uint32_t held = now - s.touch_started;
+ bool review_preview = cable_client_supports(CABLE_FEATURE_DRAFT) &&
+ visible && s.view == VOICE && s.voice_open && !s.voice_search &&
+ !s.voice_waiting && !s.voice_start_pending && audio_client_recording() &&
+ (s.voice_return == HOME || s.voice_return == AGENT || s.voice_return == SELECTION) &&
+ s.touch_down && !s.touch_cancelled && gesture.live && !gesture.moved && !gesture.guarded &&
+ pressed_action.kind == A_PET && held >= 650 && held <= 1800;
+ if (review_preview != s.voice_review_preview) { s.voice_review_preview = review_preview; change(); }
+ if (visible && main && s.touch_down && !s.touch_cancelled && gesture.live && !gesture.guarded) {
+ uint32_t held = now - s.touch_started;
+ if (!s.quick_open && pressed_action.kind == A_PET && !gesture.moved && held >= 650 && held < 5000) {
+ s.quick_open = true;
+ s.quick_choice = 0;
+ ht_scroll_cancel(&scroll);
+ change();
+ } else if (s.quick_open && held >= 5000) {
+ input_cancel(); // resting a hand cannot eventually open a menu or start voice
+ change();
+ }
+ }
+ ht_tim_mood_t mood = s.view == VOICE ?
+ (!s.voice_start_pending && !s.voice_waiting && audio_client_recording() ? HT_TIM_LISTENING : HT_TIM_WORKING) :
+ inbox ? (s.notice[s.offset].question ? HT_TIM_ATTENTION : HT_TIM_CONTENT) : tim_mood();
+ if (ht_octopus_motion_tick(&octopus_motion, now, mood, s.quiet, visible && !s.quick_open,
+ s.touch_down && !s.touch_cancelled, s.last_x,
+ mood == HT_TIM_LISTENING ? audio_client_input_level() : 0, s.tim_activity))
+ change();
+}
+static void render_quick(ht_scene_t *f)
+{
+ static const char *destinations[] = {"release to stay", "release for panes", "release for inbox", "release for tabs", "release for controls"};
+ ht_arc_title(f, DIM, "slide, then release");
+ ht_center(f, 125, &ht_mono_20, s.quick_choice == 1 ? ACCENT : DIM, "panes");
+ ht_text(f, 62, 224, 108, &ht_mono_20, s.quick_choice == 3 ? ACCENT : DIM, BG, "tabs");
+ ht_text(f, 326, 224, 84, &ht_mono_20, s.quick_choice == 2 ? ACCENT : DIM, BG, "inbox");
+ ht_tim_face_t face = {.mood=HT_TIM_CONTENT, .dim=DIM, .pose=octopus_motion.reaction.pose};
+ face.pose.look = s.quick_choice == 3 ? -1 : s.quick_choice == 2 ? 1 : 0;
+ ht_octopus_portrait(f, &face, octopus_motion.frame, ACCENT, &ht_octopus_font_4, 180);
+ ht_center(f, 322, &ht_mono_20, s.quick_choice == 4 ? ACCENT : DIM, "controls");
+ ht_arc_status(f, FG, destinations[s.quick_choice]);
+}
+static void page_controls(ht_scene_t *f, int count)
+{
+ control(f, 111, 390, 60, "<", A_UP, 0, s.offset > 0);
+ control(f, 183, 390, 108, "[ home ]", A_HOME, 0, true);
+ control(f, 321, 390, 36, ">", A_DOWN, count, s.offset + 3 < count);
+}
+// Secondary screens retain explicit choices. The main face is the touch surface itself.
+static void command_face(ht_scene_t *f, const char *heading_, const char *subject,
+ const char *context, const char *primary, const char *secondary,
+ bool attention, hit_t links[4])
+{
+ ht_command_face_t face_ = {.heading = heading_, .subject = subject, .context = context,
+ .primary = primary, .secondary = secondary,
+ .foreground = FG, .dim = DIM, .accent = attention ? ERROR : ACCENT,
+ .selection = SEL, .pressed = s.pressed, .enabled = links[2].enabled};
+ ht_command_face(f, &face_);
+ for (int i = 0; i < 4; i++) {
+ links[i].rect = ht_command_targets[i];
+ s.hits[s.hit_count++] = links[i];
+ }
+}
+static void render_workspace_preview(ht_scene_t *f)
+{
+ int i=workspace.choice;
+ if (i<0 || i>=s.tab_count) return;
+ hit_t links[4]={0};
+ command_face(f,"workspaces",s.tabs[i].name,"",
+ i==workspace.origin ? "release to stay" : "release to open","slide back to cancel",false,links);
+}
+static void render_home(ht_scene_t *f)
+{
+ s.inbox_arc = (ht_rect_t){0};
+ if (s.quick_open) { render_quick(f); return; }
+ if (workspace.touching && workspace.moved && !workspace.cancelled) { render_workspace_preview(f); return; }
+ agent_t *a = active();
+ // Two alternating states: current work owns the large companion; only its
+ // completed result gets the reading layout. Never pair old prose with live work.
+ const char *recap = a && !a->busy && a->recap_ready && s.connected && !s.loading &&
+ !s.nap && !carry.active && !carry.error[0] ? a->preview : NULL;
+ const char *activity = a && a->busy && s.connected && !s.loading && !s.nap ? a->tool : "";
+ char status[100];
+ if (!s.connected) COPY(status, "Reconnect Harness");
+ else if (s.loading) COPY(status, "Connecting...");
+ else if (!a) COPY(status, "Choose a pane");
+ else if (s.notice_count && !carry.active && !carry.error[0] && !visit.available)
+ snprintf(status, sizeof status, "[%d]%s%.60s", s.notice_count, activity[0] ? " " : "", activity);
+ else COPY(status, activity);
+ ht_tim_face_t f_ = {.recipient = a ? a->name : "harness", .status = status,
+ .hint = (s.connected && !s.loading) ? "" : "hold for controls",
+ .detail = "", .unread = s.notice_count > 0,
+ .mood = tim_mood(), .pose = octopus_motion.reaction.pose, .straight_title = s.straight_title,
+ .footer_action = carry.active || carry.error[0] || visit.available,
+ .ink = s.notice_count ? ACCENT : FG, .foreground = FG, .dim = DIM,
+ .primary_title = true, .roomy_reading = true};
+ char carried[128];
+ if (carry.active) {
+ snprintf(carried,sizeof(carried),"%d line%s from %.70s",carry.rows,carry.rows==1?"":"s",carry.source);
+ f_.detail=carried; f_.carrying=true; f_.hint="";
+ } else if (carry.error[0]) {
+ f_.status="Text expired"; f_.detail="Select it again or drop text"; f_.hint=""; f_.focus=true;
+ }
+ if (visit.available) f_.hint = "";
+ if (s.touch_down && scroll.axis == 3) {
+ f_.hint = "turn rim to scroll";
+ f_.status = "scrolling";
+ }
+ ht_octopus_face(f, &f_, octopus_motion.frame, ACCENT, recap);
+ if ((carry.active || carry.error[0]) && visit.available) {
+ footer_control(f, 95, 156, "[return]", A_RETURN, s.connected && !visit.pending);
+ footer_control(f, 263, 108, "[drop]", A_CARRY_DROP, true);
+ } else if (carry.active || carry.error[0]) {
+ footer_control(f, 113, 240, "[ drop text ]", A_CARRY_DROP, true);
+ } else if (visit.available) {
+ footer_control(f, 113, 240, "[ return ]", A_RETURN, s.connected && !visit.pending);
+ }
+ if (s.notice_count && s.connected && !s.loading && !carry.active && !carry.error[0] && !visit.available) {
+ // The compact curved count owns a generous bottom-edge target.
+ // It never shares the title/pane picker or the voice portrait.
+ s.hits[s.hit_count++] = (hit_t){{83, 400, 300, 66}, A_INBOX, 0, true};
+ for (int i = 0; i < f->count; i++) if (f->runs[i].arc == 2) {
+ ht_rect_t r = ht_run_bounds(&f->runs[i]);
+ s.inbox_arc = (ht_rect_t){r.x - 14, r.y - 14, r.w + 28, r.h + 28};
+ break;
+ }
+ }
+ // The portrait is the large gesture area. Labels retain a few discoverable single-tap paths.
+ bool result = recap && *recap;
+ // The name stays on the upper arc in both states. Its rising ends stay
+ // outside the companion's central voice target.
+ s.hits[s.hit_count++] = (hit_t){{53, 8, 360, 92}, A_AGENTS, 0, true};
+ if (!s.straight_title) {
+ s.hits[s.hit_count++] = (hit_t){{33, 100, 90, 40}, A_AGENTS, 0, true};
+ s.hits[s.hit_count++] = (hit_t){{343, 100, 90, 40}, A_AGENTS, 0, true};
+ }
+ if (result) {
+ int reading_y = (ht_octopus_short_recap(recap) ? HT_OCTOPUS_BRIEF_TEXT_Y : HT_OCTOPUS_READING_TEXT_Y) - 4;
+ s.hits[s.hit_count++] = (hit_t){{29, reading_y, 408, 396 - reading_y}, A_RECAP_DISMISS, 0, true};
+ s.hits[s.hit_count++] = (hit_t){{143, 100, 180, reading_y - 106}, A_PET, 0, true};
+ } else s.hits[s.hit_count++] = (hit_t){{53, 100, 360, 259}, A_PET, 0, true};
+ if (!a)
+ s.hits[s.hit_count++] = (hit_t){{65, 359, 336, 30}, A_AGENTS, 0, true};
+
+}
+static void render_agents(ht_scene_t *f)
+{
+ heading(f, "panes");
+ int last = s.count > TAB_ROWS ? s.count - TAB_ROWS : 0;
+ if (s.offset > last) s.offset = last;
+ if (s.offset < 0) s.offset = 0;
+ if (!s.count) {
+ center(f, 192, s.loading ? "Loading..." : "No panes in this tab.", FG);
+ control(f, 155, 283, 156, "Choose a tab", A_TABS, 0, s.connected);
+ return;
+ }
+ for (int row = 0; row < TAB_ROWS && s.offset + row < s.count; row++) {
+ int i = s.offset + row, y = TAB_TOP + row * TAB_ROW_HEIGHT;
+ agent_t *a = &s.agents[i];
+ int hit = s.hit_count++;
+ s.hits[hit] = (hit_t){{59, y, 348, TAB_ROW_HEIGHT}, A_AGENT, i, s.connected};
+ bool selected = i == s.active || hit == s.pressed;
+ char label[HT_TEXT_BYTES]; snprintf(label, sizeof label, " %s", a->name);
+ ht_text(f, 71, y + 14, 324, &ht_mono_20,
+ !s.connected ? DIM : is_question(a->id) || selected ? ACCENT : FG,
+ selected ? SEL : BG, label);
+ }
+}
+static void render_agent(ht_scene_t *f)
+{
+ render_home(f); // One companion surface; changing panes only changes its recipient.
+}
+static bool question_view(view_t v)
+{
+ return v == QUESTION || v == CHOICE || v == ANSWER_REVIEW;
+}
+static int question_rows(const char *value)
+{
+ return ht_text_rows(value, &ht_mono_20, 348);
+}
+static void question_text(ht_scene_t *f, const char *value)
+{
+ int rows = question_rows(value), last = rows > 5 ? rows - 5 : 0;
+ if (s.offset > last) s.offset = last;
+ if (s.offset < 0) s.offset = 0;
+ ht_wrap(f, 59, 146, 348, 5, s.offset, &ht_mono_20, FG, value);
+ char position[40];
+ if (rows > 5) snprintf(position,sizeof position,"%d-%d / %d drag to read",s.offset+1,s.offset+5,rows);
+ else if (s.view==CHOICE) COPY(position,"drag for choices");
+ else position[0] = 0;
+ if (!s.q.speech_error[0]) text(f, 85, 301, 296, position, DIM);
+}
+static void render_question(ht_scene_t *f)
+{
+ heading(f, s.q.name[0] ? s.q.name : "Question");
+ if (s.q.loading) {
+ center(f, 214, "Reading the question...", DIM);
+ control(f, 149, 381, 168, "[ later ]", A_HOME, 0, true);
+ return;
+ }
+ if (s.q.error[0] || !s.q.valid || !s.q.supported) {
+ ht_wrap(f, 65, 173, 336, 5, 0, &ht_mono_20, DIM,
+ s.q.error[0] ? s.q.error : !s.q.valid ? "Answered elsewhere." : "This question needs the desktop.");
+ control(f, 137, 355, 192, "[ on desktop ]", A_DESKTOP, 1, s.connected);
+ return;
+ }
+ question_item_t *q = &s.q.item[s.q.index];
+ char label[40]; snprintf(label,sizeof label,"question %d / %d",s.q.index+1,s.q.count);
+ text(f, 125, 109, 216, label, DIM);
+ question_text(f, q->prompt);
+ if (s.q.speech_error[0]) ht_wrap(f,77,319,312,2,0,&ht_mono_20,ERROR,s.q.speech_error);
+ if (q->can_text) {
+ control(f,77,379,96,"[later]",A_HOME,0,true);
+ control(f,185,379,84,q->draft[0] ? "[draft]" : "[say]",
+ q->draft[0] ? A_QUESTION_REVIEW : A_QUESTION_SAY,0,!s.q.pending);
+ control(f,277,379,120,"[choices]",A_QUESTION_CHOICES,0,!s.q.pending);
+ } else {
+ control(f,96,381,108,"[ later ]",A_HOME,0,true);
+ control(f,226,381,168,"[ choices ]",A_QUESTION_CHOICES,0,!s.q.pending);
+ }
+}
+static void render_choices(ht_scene_t *f)
+{
+ heading(f, s.q.name);
+ question_item_t *q = &s.q.item[s.q.index];
+ char label[64]; snprintf(label,sizeof label,"%s %d / %d",q->multi ? "choose any" : "choose one",s.q.choice+1,q->count);
+ text(f, 107, 109, 252, label, DIM);
+ question_text(f, q->options[s.q.choice]);
+ bool chosen = (q->selected & (1u << s.q.choice)) != 0;
+ control(f, 137, 325, 192, chosen ? "[ selected ]" : "[ select ]", A_CHOICE, s.q.choice, !s.q.pending);
+ control(f, 84, 387, 108, "[ back ]", A_QUESTION_BACK, 0, true);
+ control(f, 240, 387, 144, "[ review ]", A_QUESTION_REVIEW, 0, q->selected && !s.q.pending);
+}
+static void render_answer_review(ht_scene_t *f)
+{
+ heading(f, s.q.name);
+ if (s.q.error[0]) {
+ ht_wrap(f,65,166,336,5,0,&ht_mono_20,DIM,s.q.error);
+ control(f,137,355,192,"[ on desktop ]",A_DESKTOP,1,s.connected);
+ return;
+ }
+ question_item_t *q = &s.q.item[s.q.index];
+ char label[40]; snprintf(label,sizeof label,"answer %d / %d",s.q.index+1,s.q.count);
+ text(f,125,109,216,label,DIM);
+ question_text(f,q->answer);
+ if (s.q.speech_error[0]) ht_wrap(f,77,319,312,2,0,&ht_mono_20,ERROR,s.q.speech_error);
+ control(f,84,387,108,"[ back ]",A_QUESTION_BACK,0,!s.q.pending);
+ if (q->draft[0]) control(f,198,387,84,"[again]",A_QUESTION_SAY,0,!s.q.pending);
+ control(f,q->draft[0] ? 294 : 232,387,q->draft[0] ? 96 : 152,s.q.pending ? "Waiting..." : s.q.index+1 < s.q.count ? "[ next ]" : "[ send ]",
+ A_ANSWER,0,s.connected && !s.q.pending && (q->selected || q->draft[0]));
+}
+static const char *settings_item(int wanted, action_kind_t *action)
+{
+ static const struct { const char *label; action_kind_t action; uint32_t feature; } items[] = {
+ {"Inbox", A_INBOX, 0}, {"Machines", A_MACHINES, 0},
+ {"Model", A_MODELS, 0}, {"Stop current turn", A_STOP, 0},
+ {"Octopus / gestures", A_COMPANION, 0}, {"Brightness", A_BRIGHT, 0},
+ {"Sound", A_MUTE, 0},
+ {"Find Harness", A_FIND, CABLE_FEATURE_FORM},
+ {"New Harness", A_FORM, CABLE_FEATURE_FORM},
+ {"Latest output", A_LATEST, CABLE_FEATURE_VISIT},
+ {"Select text", A_SELECT_BEGIN, CABLE_FEATURE_SELECTION},
+ };
+ for (unsigned i = 0; i < sizeof items / sizeof items[0]; i++) {
+ if (items[i].feature && !cable_client_supports(items[i].feature)) continue;
+ if (wanted-- == 0) {
+ if (action) *action = items[i].action;
+ return items[i].label;
+ }
+ }
+ return NULL;
+}
+static int settings_count(void)
+{
+ int count = 0;
+ while (settings_item(count, NULL)) count++;
+ return count;
+}
+static void tabs_move(int dy)
+{
+ // Move by one name while the finger is down, rather than paging by three
+ // after release. The existing gesture recognizer owns tap cancellation.
+ s.tab_drag += dy;
+ int step = s.tab_drag / TAB_ROW_HEIGHT;
+ if (!step) return;
+ s.tab_drag %= TAB_ROW_HEIGHT;
+ int count = s.view == AGENTS ? s.count : s.view == SETTINGS ? settings_count() : s.tab_count;
+ int last = count > TAB_ROWS ? count - TAB_ROWS : 0;
+ int next = s.offset + step;
+ if (next < 0) next = 0;
+ if (next > last) next = last;
+ if (next != s.offset) { s.offset = next; change(); }
+ else s.tab_drag = 0; // Overscroll never builds up travel to undo on reversal.
+}
+static void render_tabs(ht_scene_t *f)
+{
+ heading(f, "tabs");
+ int last = s.tab_count > TAB_ROWS ? s.tab_count - TAB_ROWS : 0;
+ if (s.offset > last) s.offset = last;
+ if (s.offset < 0) s.offset = 0;
+ if (!s.tab_count) {
+ center(f, 218, "No tabs yet.", DIM);
+ return;
+ }
+ for (int row = 0; row < TAB_ROWS && s.offset + row < s.tab_count; row++) {
+ int i = s.offset + row, y = TAB_TOP + row * TAB_ROW_HEIGHT;
+ int hit = s.hit_count++;
+ s.hits[hit] = (hit_t){{59, y, 348, TAB_ROW_HEIGHT}, A_TAB, i, s.connected};
+ bool selected = !strcmp(s.selected_tab, s.tabs[i].id);
+ char label[HT_TEXT_BYTES];
+ snprintf(label, sizeof label, " %s", s.tabs[i].name);
+ ht_text(f, 71, y + 14, 324, &ht_mono_20,
+ !s.connected ? DIM : selected || hit == s.pressed ? ACCENT : FG,
+ selected || hit == s.pressed ? SEL : BG, label);
+ }
+}
+static void render_notice(ht_scene_t *f)
+{
+ if (s.offset >= s.notice_count) s.offset = s.notice_count - 1;
+ if (s.offset < 0) s.offset = 0;
+ const cable_notif_t *n = &s.notice[s.offset];
+ // A notification is a readable message, with the same text budget and
+ // curved name as a completed turn. Swipes browse without focusing the app.
+ int body = s.hit_count++;
+ s.hits[body] = (hit_t){{53, 108, 360, 288}, A_NOTICE, s.offset, s.connected};
+ bool footer_pressed = s.pressed == body + 1 ||
+ (s.connected && (s.pressed == body || s.pressed == body + 2));
+ ht_tim_face_t face = {.recipient = n->name,
+ .status = s.connected ? "[ back ] [ open ]" : "[ back ]", .hint = "",
+ .mood = n->question ? HT_TIM_ATTENTION : HT_TIM_CONTENT,
+ .pose = octopus_motion.reaction.pose,
+ .foreground = n->summary[0] ? FG : DIM,
+ .dim = DIM, .ink = footer_pressed ? FG : ACCENT, .primary_title = true, .roomy_reading = true};
+ ht_octopus_face(f, &face, octopus_motion.frame, ACCENT,
+ n->summary[0] ? n->summary : "No preview available.");
+ s.hits[s.hit_count++] = (hit_t){{53, 400, s.connected ? 180 : 360, 66}, A_HOME, 0, true};
+ if (s.connected)
+ s.hits[s.hit_count++] = (hit_t){{233, 400, 180, 66}, A_NOTICE, s.offset, true};
+}
+static void render_list(ht_scene_t *f)
+{
+ if (s.view == TABS) { render_tabs(f); return; }
+ if (s.view == INBOX && s.notice_count) {
+ render_notice(f);
+ return;
+ }
+ const char *title = s.view == MACHINES ? "machines" : "inbox";
+ heading(f, title);
+ int count = s.view == MACHINES ? s.machine_count : s.notice_count;
+ if (!count) {
+ center(f, 198, s.view == INBOX ? "All caught up." : "Nothing here yet.", DIM);
+ }
+ for (int i = s.offset; i < count && i < s.offset + 3; i++) {
+ char label[80], detail[80] = "";
+ action_kind_t a;
+ bool enabled = true;
+ int y = 140 + (i - s.offset) * 76;
+ if (s.view == MACHINES) {
+ snprintf(label, sizeof(label), "@ %s", s.machines[i].name);
+ COPY(detail, s.machines[i].state);
+ a = A_MACHINE;
+ enabled = s.connected && (!strcmp(s.machines[i].state, "ready") || s.machines[i].local);
+ } else {
+ snprintf(label, sizeof(label), "%s %s", s.notice[i].question ? "?" : "+",
+ s.notice[i].name);
+ COPY(detail, s.notice[i].question ? "Needs your answer" : s.notice[i].summary);
+ a = A_NOTICE;
+ }
+ control(f, 59, y, 348, label, a, i, enabled);
+ text(f, 71, y + 31, 324, detail, DIM);
+ }
+ page_controls(f, count);
+}
+static void render_voice(ht_scene_t *f)
+{
+ char status[64];
+ char draft_detail[64];
+ snprintf(draft_detail, sizeof draft_detail, s.voice_draft_append ? "Add to your message" : "Replace part %d / %d",
+ draft.page.position, draft.page.total);
+ if (s.voice_start_pending) COPY(status, "Starting...");
+ else if (!audio_client_recording() || s.voice_waiting) COPY(status, (s.voice_return == FORM || s.voice_search) ? "Finding..." : question_view(s.voice_return) || s.voice_return == DRAFT || s.voice_review ? "Writing..." : "Sending...");
+ else if (s.voice_review_preview) COPY(status, "Release to review");
+ else snprintf(status, sizeof(status), "Listening %lu:%02lu", (unsigned long)(s.voice_second / 60),
+ (unsigned long)(s.voice_second % 60));
+ ht_tim_face_t f_ = {.recipient = s.voice_target, .status = status,
+ .hint = "", .footer_action = true, .straight_title = s.straight_title,
+ .mood = !s.voice_start_pending && !s.voice_waiting && audio_client_recording() ? HT_TIM_LISTENING : HT_TIM_WORKING,
+ .pose = octopus_motion.reaction.pose, .ink = FG, .foreground = FG, .dim = DIM, .primary_title = true,
+ .detail = s.voice_search ? "Say a phrase from the output" : s.voice_return == DRAFT ? draft_detail :
+ question_view(s.voice_return) ? "Your answer" :
+ s.voice_carry ? carry.excerpt : selection.active ? selection.excerpt : NULL,
+ .carrying = s.voice_carry};
+ f_.focus = f_.detail && *f_.detail;
+ ht_octopus_face(f, &f_, octopus_motion.frame, ACCENT, NULL);
+ s.hits[s.hit_count++] = (hit_t){{33, 97, 400, 274}, A_PET, 0, true};
+ control(f, 167, 413, 144, "[ discard ]", A_VOICE_ABORT, 0, true);
+}
+static void render_selection(ht_scene_t *f)
+{
+ heading(f, selection.query[0] ? "find in output" : "select text");
+ agent_t *a = active();
+ text(f, 71, 116, 324, selection.query[0] ? selection.query : a ? a->name : "Harness", DIM);
+ if (carry.pending) {
+ center(f, 207, "Picking up the text...", FG);
+ center(f, 285, "Then choose who gets it", DIM);
+ return;
+ }
+ if (selection.error[0]) {
+ ht_wrap(f, 65, 180, 336, 5, 0, &ht_mono_20, FG, selection.error);
+ control(f, 137, 349, 192, "[ try again ]", A_SELECT_BEGIN, 0, s.connected);
+ return;
+ }
+ char status[64];
+ snprintf(status, sizeof(status), "%s%d line%s", selection.pending ? "choosing / " : "", selection.rows,
+ selection.rows == 1 ? "" : "s");
+ if (selection.query[0]) {
+ if (selection.matches) snprintf(status, sizeof status, "%d / %d matches", selection.match, selection.matches);
+ else COPY(status, "No matches");
+ }
+ center(f, 167, (selection.rows || selection.query[0]) ? status : "Look at your desktop", FG);
+ ht_wrap(f, 65, 211, 336, 4, 0, &ht_mono_20, FG,
+ selection.excerpt[0] ? selection.excerpt : selection.pending ? "Finding the text..." : selection.query[0] ? "Try another phrase." : "Blank line");
+ if (ht_selection_ready(&selection) && selection.excerpt[0]) {
+ s.hits[s.hit_count++] = (hit_t){{53, 151, 360, 184}, A_PET, 0, true};
+ }
+ if (selection.query[0] && !selection.matches && !selection.pending) {
+ control(f, 137, 349, 192, "[ find ]", A_SELECT_FIND, 0, ht_selection_ready(&selection));
+ return;
+ }
+ control(f, 55, 349, 108, "[ find ]", A_SELECT_FIND, 0, ht_selection_ready(&selection));
+ control(f, 173, 349, 108, selection.query[0] ? "[ lines ]" : selection.extending ? "[ range ]" : "[ line ]",
+ A_SELECT_EXTEND, 0, ht_selection_ready(&selection) && selection.rows > 0);
+ control(f, 291, 349, 120, "[ carry ]", A_CARRY, 0,
+ ht_selection_ready(&selection) && selection.excerpt[0]);
+ center(f, 395, selection.pending ? "choosing..." : "drag / tap to talk", DIM);
+}
+static void render_form(ht_scene_t *f)
+{
+ const ht_form_page_t *p = &form.page;
+ bool finding = !strncmp(form.id, "find-", 5);
+ center(f, 79, p->title[0] ? p->title : !strncmp(form.id, "find-", 5) ? "Find Harness" : "New Harness", DIM);
+ char count[32]; snprintf(count, sizeof count, "%d / %d", p->position, p->total);
+ if (p->query[0]) text(f, 95, 113, 276, p->query, DIM);
+ else if (p->total) center(f, 113, count, DIM);
+ text(f, 77, 158, 312, p->previous, DIM);
+ ht_wrap(f, 65, 199, 336, 2, 0, &ht_mono_20, ACCENT,
+ p->label[0] ? p->label : form.failed ? "Could not open" : "Opening...");
+ ht_wrap(f, 65, 261, 336, 2, 0, &ht_mono_20, FG, p->detail);
+ if (!form.pending && p->active && p->enabled && !p->busy && !form.failed)
+ s.hits[s.hit_count++] = (hit_t){{49, 185, 368, 124}, A_FORM_MAIN, 0, true};
+ if (p->error[0]) ht_wrap(f, 71, 319, 324, 2, 0, &ht_mono_20, ERROR, p->error);
+ else text(f, 77, 339, 312, p->busy ? p->status : p->next, DIM);
+ control(f, 83, 379, 96, "[back]", A_FORM_BACK, 0, !form.pending || finding);
+ control(f, 185, 379, 84, "[say]", A_FORM_SAY, 0,
+ !form.pending && !form.failed && p->active && p->can_query && !p->busy);
+ char action[44];
+ snprintf(action, sizeof action, "[%.23s]", form.failed ? "retry" : p->busy ? "wait" :
+ form.pending && form.pending_op != HT_FORM_STATE ? "..." : !strcmp(p->action, "check status") ? "check" : p->action[0] ? p->action : "wait");
+ control(f, 277, 379, 120, action, A_FORM_MAIN, 0,
+ !form.pending && (form.failed || (p->active && p->enabled && !p->busy)));
+}
+static void render_draft(ht_scene_t *f)
+{
+ const ht_draft_page_t *p = &draft.page;
+ control(f, 83, 67, 48, "<", A_DRAFT_OPTIONS, 0, !draft.pending);
+ text(f, 137, 67, 264, p->name, FG);
+ char position[48];
+ snprintf(position, sizeof position, "draft / part %d of %d", p->position, p->total);
+ center(f, 111, position, DIM);
+ int rows = question_rows(p->text), last = rows > 5 ? rows - 5 : 0;
+ if (s.offset > last) s.offset = last;
+ ht_wrap(f, 59, 153, 348, 5, s.offset, &ht_mono_20, FG, p->text);
+ if (rows > 5) snprintf(position, sizeof position, "%d-%d / %d drag to read", s.offset+1, s.offset+5, rows);
+ else COPY(position, p->total > 1 ? "drag for other parts" : p->context);
+ text(f, 71, 297, 324, position, DIM);
+ if (p->error[0]) ht_wrap(f, 65, 326, 336, 2, 0, &ht_mono_20, ERROR, p->error);
+ else if (!p->can_send) ht_wrap(f, 65, 326, 336, 2, 0, &ht_mono_20, DIM,
+ "Some characters cannot display. Re-speak that part.");
+ else center(f, 333, draft.pending ? (draft.op == HT_DRAFT_SEND ? "Sending..." : "One moment...") :
+ "tap to re-speak part", DIM);
+ bool editable = !draft.pending && !draft.failed && !p->locked;
+ s.hits[s.hit_count++] = (hit_t){{49, 139, 368, 151}, A_DRAFT_EDIT, 0, editable};
+ control(f, 83, 386, 156, p->locked ? "[ close ]" : "[ discard ]", A_DRAFT_DISCARD, 0, !draft.pending);
+ bool checking = draft.failed || p->locked;
+ control(f, 281, 386, 120, checking ? "[ check ]" : "[ send ]",
+ checking ? A_DRAFT_STATE : A_DRAFT_SEND, 0, !draft.pending && (checking || p->can_send));
+}
+static void render_draft_options(ht_scene_t *f)
+{
+ center(f, 83, "Your draft", FG);
+ text(f, 77, 118, 312, draft.page.context, DIM);
+ bool editable = !draft.pending && !draft.failed && !draft.page.locked;
+ control(f, 65, 167, 336, "Add to message", A_DRAFT_APPEND, 0, editable);
+ control(f, 65, 245, 336, "Undo last edit", A_DRAFT_UNDO, 0, editable && draft.page.can_undo);
+ control(f, 65, 323, 336, "Back to draft", A_DRAFT_BACK, 0, true);
+ center(f, 395, draft.page.locked ? "Check the terminal" : "Nothing sent yet", DIM);
+}
+static void render_settings(ht_scene_t *f)
+{
+ heading(f, "controls");
+ int last = settings_count() - TAB_ROWS;
+ if (last < 0) last = 0;
+ if (s.offset > last) s.offset = last;
+ if (s.offset < 0) s.offset = 0;
+ for (int row = 0; row < TAB_ROWS; row++) {
+ action_kind_t action;
+ const char *label = settings_item(s.offset + row, &action);
+ if (!label) break;
+ char dynamic[48];
+ if (action == A_BRIGHT) {
+ snprintf(dynamic, sizeof dynamic, "Brightness %d%%", s.brightness);
+ label = dynamic;
+ } else if (action == A_MUTE) label = s.muted ? "Sound muted" : "Sound on";
+ bool enabled = action == A_INBOX || action == A_BRIGHT || action == A_MUTE || action == A_COMPANION ||
+ (s.connected && ((action != A_STOP && action != A_MODELS && action != A_SELECT_BEGIN && action != A_LATEST) ||
+ (active() && (action != A_STOP || active()->busy) && (action != A_LATEST || !visit.pending))));
+ int y = TAB_TOP + row * TAB_ROW_HEIGHT, hit = s.hit_count++;
+ s.hits[hit] = (hit_t){{59, y, 348, TAB_ROW_HEIGHT}, action, 0, enabled};
+ ht_text(f, 83, y + 14, 300, &ht_mono_20,
+ !enabled ? DIM : hit == s.pressed ? ACCENT : FG, hit == s.pressed ? SEL : BG, label);
+ }
+}
+static void render_lock(ht_scene_t *f)
+{
+ center(f, 89, "Draw your pattern", FG);
+ for (int i = 0; i < 9; i++) {
+ int x = 137 + (i % 3) * 80, y = 156 + (i / 3) * 74;
+ ht_text(f, x, y, 40, &ht_lock_dot, s.pattern_mask & (1 << i) ? ACCENT : DIM, BG, "o");
+ }
+ center(f, 386, s.pattern_error ? "Try again" : "Locked", DIM);
+}
+bool habitat_scene_take(ht_scene_t *f)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ // App snapshots never choose a scene in this visual-only build.
+ if (!s.ready) return false;
+ return ht_gallery_take(&gallery, f, ms());
+#endif
+ if (!s.ready || !s.dirty || s.bulk)
+ return false;
+ s.dirty = false;
+ s.hit_count = 0;
+ ht_scene_clear(f, BG);
+ if (s.locked) {
+ render_lock(f);
+ return true;
+ }
+ switch (s.view) {
+ case FORM:
+ render_form(f);
+ break;
+ case DRAFT:
+ render_draft(f);
+ break;
+ case DRAFT_OPTIONS:
+ render_draft_options(f);
+ break;
+ case HOME:
+ render_home(f);
+ break;
+ case AGENTS:
+ render_agents(f);
+ break;
+ case AGENT:
+ render_agent(f);
+ break;
+ case QUESTION:
+ render_question(f);
+ break;
+ case CHOICE:
+ render_choices(f);
+ break;
+ case ANSWER_REVIEW:
+ render_answer_review(f);
+ break;
+ case TABS:
+ case MACHINES:
+ case INBOX:
+ render_list(f);
+ break;
+ case VOICE:
+ render_voice(f);
+ break;
+ case SELECTION:
+ render_selection(f);
+ break;
+ case SETTINGS:
+ render_settings(f);
+ break;
+ case READER: {
+ agent_t *a = active();
+ heading(f, "latest result");
+ if (a)
+ ht_wrap(f, 59, 125, 348, 8, s.offset, &ht_mono_20, FG, a->full);
+ control(f, 119, 387, 72, "<", A_UP, 0, s.offset > 0);
+ control(f, 217, 387, 144, "[ desktop ]", A_DESKTOP, 0, s.connected);
+ break;
+ }
+ case COMPANION:
+ heading(f, "octopus");
+ control(f, 71, 147, 324, s.straight_title ? "Edge text Straight" : "Edge text Curved", A_FACE, 0, true);
+ text(f, 83, 180, 300, "tap to change", DIM);
+ control(f, 71, 223, 324, s.rim_enabled ? "[x] Rim scrolling" : "[ ] Rim scrolling", A_RIM, 0, true);
+ text(f, 83, 256, 300, "turn near the edge", DIM);
+ control(f, 71, 299, 324, s.quiet ? "[x] Still octopus" : "[ ] Still octopus", A_QUIET, 0, true);
+ control(f, 95, 381, 120, s.nap ? "[ wake ]" : "[ nap ]", A_NAP, 0, true);
+ control(f, 251, 381, 120, "[ home ]", A_HOME, 0, true);
+ break;
+ case STOP:
+ heading(f, "stop this turn?");
+ center(f, 185, "Your work stays.", FG);
+ center(f, 227, "This turn stops.", DIM);
+ control(f, 83, 355, 156, "[ keep going ]", A_HOME, 0, true);
+ control(f, 263, 355, 120, "[ stop ]", A_STOP_YES, 0, s.connected);
+ break;
+ case MODELS:
+ heading(f, "model");
+ if (s.model_count < 0)
+ center(f, 211, "Loading models...", DIM);
+ else if (!s.model_count)
+ center(f, 211, "No models available.", DIM);
+ else
+ for (int i = s.offset; i < s.model_count && i < s.offset + 3; i++) {
+ const char *label = strrchr(s.models[i].id, ':');
+ control(f, 59, 153 + (i - s.offset) * 72, 348, label ? label + 1 : s.models[i].id,
+ A_MODEL, i, s.connected);
+ }
+ page_controls(f, s.model_count);
+ break;
+ case MESSAGE:
+ case OTA:
+ heading(f, s.title);
+ ht_wrap(f, 65, 161, 336, 6, 0, &ht_mono_20, FG, s.message);
+ break;
+ }
+ return true;
+}
+
+static bool queue(action_t a)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ (void)a;
+ return false; // Never enqueue a desktop or audio action in the visual study.
+#endif
+ // A live scroll owns the final slot, so a stalled USB writer cannot drop its UP.
+ if (actions && ((!scroll.live && !selection.active && !visit.id[0]) || uxQueueSpacesAvailable(actions) > 1) &&
+ xQueueSend(actions, &a, 0) == pdPASS)
+ return true;
+ COPY(s.title, "One moment");
+ COPY(s.message, "The cable is busy. Try again.");
+ view(MESSAGE);
+ return false;
+}
+static bool scroll_emit(ht_scroll_phase_t phase, int dy, int velocity, void *ctx)
+{
+ (void)ctx;
+ action_t a = {.kind = A_SCROLL, .value = (int)phase, .dy = dy, .velocity = velocity};
+ unsigned required = phase == HT_SCROLL_UP ? 1 : 2;
+ if (!actions || uxQueueSpacesAvailable(actions) < required) return false;
+ bool ok = xQueueSend(actions, &a, 0) == pdPASS;
+ // Every producer holds display_lock. DOWN/MOVE and other actions reserve this slot.
+ if (phase == HT_SCROLL_UP) assert(ok);
+ return ok;
+}
+static bool form_emit(const ht_form_command_t *c, void *ctx)
+{
+ (void)ctx;
+ if (!actions || uxQueueSpacesAvailable(actions) < 2) return false;
+ action_t a = {.kind = A_FORM_SEND, .value = c->op, .revision = c->request,
+ .dy = (int)c->revision, .velocity = c->delta};
+ COPY(a.id, c->id);
+ return xQueueSend(actions, &a, 0) == pdPASS;
+}
+static bool draft_emit(const ht_draft_command_t *c, void *ctx)
+{
+ (void)ctx;
+ if (!actions || uxQueueSpacesAvailable(actions) < 2) return false;
+ action_t a = {.kind = A_DRAFT_COMMAND, .value = c->op, .revision = c->request,
+ .dy = (int)c->revision, .velocity = c->delta};
+ COPY(a.id, c->id);
+ return xQueueSend(actions, &a, 0) == pdPASS;
+}
+static bool visit_emit(const ht_visit_command_t *c, void *ctx)
+{
+ (void)ctx;
+ if (!actions || uxQueueSpacesAvailable(actions) < (c->op == HT_VISIT_CANCEL ? 1 : 2)) return false;
+ action_t a = {.kind = A_VISIT_SEND, .value = c->op, .revision = c->request};
+ COPY(a.id, c->agent); COPY(a.text, c->id);
+ return xQueueSend(actions, &a, 0) == pdPASS;
+}
+static bool selection_emit(const ht_select_command_t *c, void *ctx)
+{
+ (void)ctx;
+ // Selection keeps a slot for cancellation, just as scrolling keeps one for UP.
+ if (!actions || uxQueueSpacesAvailable(actions) < (c->op == HT_SELECT_CANCEL ? 1 : 2)) return false;
+ action_t a = {.kind = A_SELECT_SEND, .value = c->op, .revision = c->revision,
+ .dy = c->delta, .velocity = (int)c->request};
+ COPY(a.id, c->agent); COPY(a.text, c->id);
+ return xQueueSend(actions, &a, 0) == pdPASS;
+}
+static bool carry_emit(const ht_carry_command_t *c, void *ctx)
+{
+ (void)ctx;
+ if (!actions || uxQueueSpacesAvailable(actions) < (c->cancel ? 1 : 2)) return false;
+ action_t a = {.kind=A_CARRY_SEND,.value=c->cancel,.revision=c->revision,.dy=(int)c->request};
+ COPY(a.id,c->agent); copy(a.text,48,c->id); copy(a.text+48,48,c->selection);
+ return xQueueSend(actions,&a,0)==pdPASS;
+}
+static action_t make_action(hit_t h)
+{
+ action_t a = {.kind = h.action, .value = h.value, .revision = s.q.revision};
+ if (s.view == DRAFT || s.view == DRAFT_OPTIONS) {
+ a.revision = draft.page.revision; a.dy = (int)draft.page.revision;
+ copy(a.text, sizeof draft.page.id, draft.page.id);
+ } else if (h.action == A_FORM_MAIN || h.action == A_FORM_BACK || h.action == A_FORM_SAY) {
+ a.revision = form.page.revision;
+ a.dy = (int)form.page.revision;
+ copy(a.text, sizeof form.id, form.id);
+ } else if (s.view == SELECTION && (h.action == A_PET || h.action == A_CARRY || h.action == A_SELECT_FIND)) {
+ COPY(a.id, selection.agent);
+ copy(a.text, sizeof selection.id, selection.id);
+ a.dy = (int)selection.revision;
+ } else if ((s.view == HOME || s.view == AGENT) && h.action == A_PET && carry.active) {
+ if (active()) COPY(a.id,active()->id);
+ copy(a.text,sizeof carry.id,carry.id); a.value=3;
+ } else if (h.action == A_RETURN) {
+ copy(a.text,sizeof visit.id,visit.id); a.revision=visit.request;
+ } else if (h.action == A_CARRY_DROP) {
+ copy(a.text,sizeof carry.id,carry.id); a.revision=carry.serial;
+ } else if (h.action == A_AGENT && h.value < s.count)
+ COPY(a.id, s.agents[h.value].id);
+ else if (h.action == A_NOTICE && h.value < s.notice_count)
+ COPY(a.id, s.notice[h.value].agent_id);
+ else if (h.action == A_TAB && h.value < s.tab_count)
+ COPY(a.id, s.tabs[h.value].id);
+ else if (h.action == A_MACHINE && h.value < s.machine_count)
+ COPY(a.id, s.machines[h.value].id);
+ else if (h.action == A_MODEL && h.value < s.model_count) {
+ COPY(a.id, s.model_agent);
+ COPY(a.text, s.models[h.value].id);
+ } else if (question_view(s.view) && h.action != A_HOME) {
+ COPY(a.id,s.q.agent); a.dy=s.q.index;
+ } else if (h.action == A_DESKTOP && h.value == 1)
+ COPY(a.id, s.q.agent);
+ else if (active())
+ COPY(a.id, active()->id);
+ return a;
+}
+static void open_question(void)
+{
+ if (!s.connected || !active()) return;
+ if (!cable_client_supports(CABLE_FEATURE_QUESTIONS)) {
+ action_t open={.kind=A_DESKTOP}; COPY(open.id,active()->id);
+ queue(open);
+ return;
+ }
+ char agent[ID_MAX], name[64]; COPY(agent,active()->id); copy(name,sizeof active()->name,active()->name);
+ uint32_t revision = s.q.revision + 1;
+ memset(&s.q,0,sizeof s.q); s.q.revision=revision; s.q.loading=true;
+ COPY(s.q.agent,agent); COPY(s.q.name,name);
+ snprintf(s.q.fetch,sizeof s.q.fetch,"q-%08lx%08lx",(unsigned long)esp_random(),(unsigned long)esp_random());
+ s.q.deadline=ms()+4000;
+ action_t a={.kind=A_QUESTION_READ,.revision=revision}; COPY(a.id,agent); copy(a.text,sizeof s.q.fetch,s.q.fetch);
+ if (!queue(a)) { s.q.loading=false; COPY(s.q.error,"Could not load. Open the alert again."); }
+ view(QUESTION);
+}
+static bool question_answer(void)
+{
+ question_item_t *q=&s.q.item[s.q.index];
+ if (!s.q.supported) return false;
+ if (q->draft[0]) return q->can_text && q->answer[0];
+ if (!q->selected) return false;
+ q->answer[0]=0; size_t used=0;
+ for (int i=0;i<q->count;i++) if (q->selected & (1u<<i)) {
+ int n=snprintf(q->answer+used,sizeof q->answer-used,"%s%s",used ? "\n\n" : "",q->options[i]);
+ if (n<0 || (size_t)n>=sizeof q->answer-used) return false;
+ used+=(size_t)n;
+ }
+ return used>0;
+}
+static void question_move(int delta)
+{
+ if (!question_view(s.view) || !s.q.valid || !s.q.supported || s.q.loading || s.q.pending || s.q.error[0]) return;
+ s.q.drag+=delta;
+ while (s.q.drag>=40 || s.q.drag<=-40) {
+ int step=s.q.drag>0 ? 1 : -1; s.q.drag-=step*40;
+ question_item_t *q=&s.q.item[s.q.index];
+ const char *value=s.view==QUESTION ? q->prompt : s.view==CHOICE ? q->options[s.q.choice] : q->answer;
+ int last=question_rows(value)-5; if (last<0) last=0;
+ if (step>0 && s.offset<last) s.offset++;
+ else if (step<0 && s.offset>0) s.offset--;
+ else if (s.view==CHOICE && s.q.choice+step>=0 && s.q.choice+step<q->count) {
+ s.q.choice+=step; s.offset=step>0 ? 0 : question_rows(q->options[s.q.choice])-5;
+ if (s.offset<0) s.offset=0;
+ }
+ change();
+ }
+}
+static void send_answer(void)
+{
+ if (!s.connected || s.view!=ANSWER_REVIEW || !s.q.valid || s.q.pending ||
+ !s.q.supported || !s.q.token[0] || !question_answer()) return;
+ if (s.q.index+1<s.q.count) { s.q.index++; s.q.choice=0; view(QUESTION); return; }
+ for (int i=0;i<s.q.count;i++) if (!s.q.item[i].selected && !s.q.item[i].draft[0]) return;
+ action_t a={.kind=A_ANSWER,.revision=s.q.revision}; COPY(a.id,s.q.agent);
+ if (queue(a)) { s.q.pending=true; s.q.deadline=ms()+15000; change(); }
+}
+static void draft_move(int delta, uint32_t now)
+{
+ if (s.view != DRAFT || draft.pending || draft.failed || draft.page.locked) return;
+ s.draft_drag += delta;
+ while (s.draft_drag >= 40 || s.draft_drag <= -40) {
+ int step = s.draft_drag > 0 ? 1 : -1;
+ s.draft_drag -= step * 40;
+ int last = question_rows(draft.page.text) - 5;
+ if (last < 0) last = 0;
+ if (step > 0 && s.offset < last) s.offset++;
+ else if (step < 0 && s.offset > 0) s.offset--;
+ else if ((step > 0 && draft.page.position < draft.page.total) || (step < 0 && draft.page.position > 1)) {
+ ht_draft_command(&draft, HT_DRAFT_MOVE, draft.page.revision, step, now);
+ s.draft_drag = 0; change(); return;
+ }
+ change();
+ }
+}
+static void dispatch(action_t a)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ (void)a;
+ return; // Defense in depth: no voice, commands, approvals, or pane navigation.
+#endif
+ if (s.locked)
+ return;
+ switch (a.kind) {
+ case A_DRAFT_EDIT:
+ case A_DRAFT_APPEND:
+ case A_DRAFT_UNDO:
+ case A_DRAFT_SEND:
+ case A_DRAFT_DISCARD:
+ case A_DRAFT_STATE:
+ case A_DRAFT_OPTIONS:
+ case A_DRAFT_BACK:
+ if ((s.view != DRAFT && s.view != DRAFT_OPTIONS) || !draft.page.active || draft.pending ||
+ a.revision != draft.page.revision || strcmp(a.text, draft.page.id)) break;
+ if (a.kind == A_DRAFT_OPTIONS) view(DRAFT_OPTIONS);
+ else if (a.kind == A_DRAFT_BACK) view(DRAFT);
+ else if (a.kind == A_DRAFT_EDIT || a.kind == A_DRAFT_APPEND) {
+ if (draft.failed || draft.page.locked) break;
+ view(DRAFT);
+ a.value = a.kind == A_DRAFT_APPEND ? 6 : 5; a.kind = A_VOICE;
+ ht_gesture_guard(&gesture, ms()); dispatch(a);
+ } else {
+ ht_draft_op_t op = a.kind == A_DRAFT_SEND ? HT_DRAFT_SEND : a.kind == A_DRAFT_DISCARD ? HT_DRAFT_DISCARD :
+ a.kind == A_DRAFT_UNDO ? HT_DRAFT_UNDO : HT_DRAFT_STATE;
+ if (ht_draft_command(&draft, op, a.revision, 0, ms())) {
+ view(DRAFT); ht_gesture_guard(&gesture, ms());
+ }
+ }
+ break;
+ case A_HOME:
+ if (workspace.phase!=HT_WORKSPACE_IDLE) {
+ ht_workspace_cancel_request(&workspace); s.loading=false; s.active=-1;
+ }
+ if (visit.pending) { ht_visit_close(&visit); s.pending_focus[0] = 0; }
+ view(HOME);
+ break;
+ case A_AGENTS: {
+ view(AGENTS);
+ int last = s.count > TAB_ROWS ? s.count - TAB_ROWS : 0;
+ s.offset = s.active - TAB_ROWS / 2;
+ if (s.offset > last) s.offset = last;
+ if (s.offset < 0) s.offset = 0;
+ break;
+ }
+ case A_AGENT: {
+ int i = find(a.id);
+ if (i < 0)
+ break;
+ if (visit.available && strcmp(visit.agent, a.id)) ht_visit_close(&visit);
+ s.active = i;
+ view(AGENT);
+ if (s.connected)
+ queue(a);
+ break;
+ }
+ case A_READER:
+ view(READER);
+ break;
+ case A_QUESTION:
+ if (find(a.id) >= 0) s.active = find(a.id);
+ open_question();
+ break;
+ case A_QUESTION_CHOICES:
+ case A_QUESTION_REVIEW:
+ case A_QUESTION_BACK:
+ case A_QUESTION_SAY:
+ case A_CHOICE:
+ case A_ANSWER:
+ if (!question_view(s.view) || a.revision!=s.q.revision || a.dy!=s.q.index ||
+ !s.q.valid || s.q.loading || s.q.pending || s.q.error[0] || strcmp(a.id,s.q.agent)) break;
+ if (a.kind==A_QUESTION_SAY && s.q.item[s.q.index].can_text) {
+ a.kind=A_VOICE; a.value=4; copy(a.text,sizeof s.q.token,s.q.token);
+ ht_gesture_guard(&gesture,ms()); dispatch(a);
+ } else if (a.kind==A_QUESTION_CHOICES && s.view==QUESTION) view(CHOICE);
+ else if (a.kind==A_QUESTION_BACK) view(s.view==ANSWER_REVIEW && !s.q.item[s.q.index].draft[0] ? CHOICE : QUESTION);
+ else if (a.kind==A_CHOICE && s.view==CHOICE && a.value>=0 && a.value<s.q.item[s.q.index].count) {
+ question_item_t *q=&s.q.item[s.q.index];
+ q->draft[0]=q->answer[0]=0; s.q.speech_error[0]=0;
+ if (q->multi) q->selected^=1u<<a.value;
+ else q->selected=1u<<a.value;
+ change();
+ } else if (a.kind==A_QUESTION_REVIEW && (s.view==CHOICE || (s.view==QUESTION && s.q.item[s.q.index].draft[0])) && question_answer()) {
+ view(ANSWER_REVIEW); ht_gesture_guard(&gesture,ms());
+ }
+ else if (a.kind==A_ANSWER) send_answer();
+ break;
+ case A_INBOX:
+ view(s.notice_count ? INBOX : HOME);
+ break;
+ case A_NOTICE: {
+ if (s.connected && !visit.pending && a.id[0]) {
+ // The shipping bridge supports agent.open, but not the experiment's
+ // visit/bookmark protocol. Stay in the inbox while the app opens it;
+ // its usual focus/seen messages reconcile the recipient and inbox.
+ action_t open={.kind=A_DESKTOP}; COPY(open.id,a.id);
+ if (queue(open)) {
+ ht_visit_close(&visit);
+ COPY(s.opening_notice, a.id);
+ // The outcome was already read on this card. Keep its pane in
+ // presence mode, including panes whose history arrives later.
+ // Opening a question never answers or dismisses that question.
+ for (int i = 0; i < s.notice_count; i++)
+ if (!strcmp(s.notice[i].agent_id, a.id) && !s.notice[i].question) {
+ dismiss_result(a.id);
+ break;
+ }
+ }
+ else {
+ COPY(s.title,"Device busy");
+ COPY(s.message,"Open the update again.");
+ view(MESSAGE);
+ }
+ }
+ break;
+ }
+ case A_LATEST:
+ if (cable_client_supports(CABLE_FEATURE_VISIT) && s.connected && !s.voice_open && !s.loading && !visit.pending &&
+ active() && !strcmp(active()->id,a.id)) {
+ char id[48];
+ if (visit.available) COPY(id,visit.id);
+ else snprintf(id,sizeof id,"visit-%08lx%08lx",(unsigned long)esp_random(),(unsigned long)esp_random());
+ if (!ht_visit_latest(&visit,id,a.id,ms(),visit_emit,NULL)) {
+ COPY(s.title,"Latest output"); COPY(s.message,"The cable is busy. Try again."); view(MESSAGE);
+ break;
+ }
+ COPY(s.title,"Latest output");
+ COPY(s.message,"Keeping your reading place...");
+ view(MESSAGE);
+ }
+ break;
+ case A_RETURN:
+ if (!s.connected || !visit.available || visit.pending || !a.text[0] ||
+ strcmp(a.text,visit.id) || a.revision!=visit.request) break;
+ if (ht_visit_back(&visit, ms())) {
+ COPY(s.title, "Returning");
+ snprintf(s.message, sizeof(s.message), "%.79s", visit.label[0] ? visit.label : "Your previous pane");
+ view(MESSAGE);
+ } else {
+ COPY(s.title,"Return"); COPY(s.message,"The cable is busy. Try again."); view(MESSAGE);
+ }
+ break;
+ case A_TABS: {
+ view(TABS);
+ int index=workspace_index(s.selected_tab);
+ int last=s.tab_count>TAB_ROWS ? s.tab_count-TAB_ROWS : 0;
+ int first=index-TAB_ROWS/2;
+ s.offset=first<0 ? 0 : first>last ? last : first;
+ break;
+ }
+ case A_MACHINES:
+ view(MACHINES);
+ break;
+ case A_TAB:
+ if (!s.connected || s.voice_open || s.loading || workspace_index(a.id)<0) break;
+ if (!strcmp(a.id,s.selected_tab)) { view(HOME); break; }
+ if (ht_workspace_request(&workspace,a.id,ms())) {
+ a.revision=workspace.serial;
+ if (!queue(a)) { workspace_failed("Device busy. Choose the tab again."); break; }
+ ht_visit_close(&visit); s.pending_focus[0]=0;
+ COPY(s.title,"Switching tab"); COPY(s.message,"Opening your workspace...");
+ view(MESSAGE); s.loading=true;
+ }
+ break;
+ case A_MACHINE:
+ if (s.connected && queue(a)) {
+ ht_visit_close(&visit);
+ COPY(s.pending_machine, a.id);
+ s.machine_deadline = ms() + 6000;
+ change();
+ }
+ break;
+ case A_SELECT_FIND:
+ a.kind = A_VOICE; a.value = 7;
+ dispatch(a); break;
+ case A_VOICE:
+ if (a.value != 2 && a.value != 4 && a.value != 5 && a.value != 6 && a.value != 7 && s.view != SELECTION && carry.error[0]) {
+ COPY(s.title,"Carried text"); copy(s.message,sizeof carry.error,carry.error); view(MESSAGE); break;
+ }
+ if (a.value == 4 && (!question_view(s.view) || !s.q.valid || !s.q.supported || s.q.pending ||
+ a.revision!=s.q.revision || a.dy!=s.q.index || !s.q.item[s.q.index].can_text ||
+ strcmp(a.id,s.q.agent) || strcmp(a.text,s.q.token))) break;
+ if (a.value == 3 && (!carry.active || strcmp(a.text,carry.id) || !a.id[0])) break;
+ if (a.value == 5 || a.value == 6) {
+ if (s.view != DRAFT || !draft.page.active || draft.pending || draft.failed || draft.page.locked ||
+ a.revision != draft.page.revision || strcmp(a.text, draft.page.id)) break;
+ a.id[0] = 0;
+ } else if (draft.page.active) { view(DRAFT); break; }
+ if (a.value == 2) {
+ if (s.view != FORM || form.pending || form.failed || !form.page.active ||
+ !form.page.can_query || form.page.busy || strcmp(a.text, form.id) ||
+ a.dy < 0 || (uint32_t)a.dy != form.page.revision) break;
+ } else if (form.id[0]) { view(FORM); break; }
+ if (a.value == 7 && (s.view != SELECTION || strcmp(a.id,selection.agent) ||
+ strcmp(a.text,selection.id) || a.dy <= 0 || (uint32_t)a.dy != selection.revision)) break;
+ if (s.view == SELECTION && (carry.pending || !ht_selection_ready(&selection) ||
+ (a.value != 7 && !selection.excerpt[0]))) break;
+ if (s.voice_open || audio_client_active() || s.voice_waiting) {
+ s.voice_open = true;
+ view(VOICE);
+ break;
+ }
+ if (s.connected && !visit.pending) {
+ // Main-surface voice always has an explicit recipient. Home orchestration is deferred.
+ if (s.view == HOME || s.view == AGENT) {
+ if (!a.id[0] || s.loading) break;
+ }
+ if (a.value==4) {
+ s.voice_question_revision=s.q.revision; s.voice_question_index=s.q.index;
+ s.q.speech_error[0]=0;
+ }
+ a.revision = ++s.voice_generation;
+ if (!queue(a))
+ break;
+ s.voice_open = s.voice_start_pending = true;
+ s.voice_carry = a.value == 3;
+ s.voice_search = a.value == 7;
+ s.voice_review = a.value == 5 || a.value == 6;
+ s.voice_draft_append = a.value == 6;
+ s.voice_draft_revision = (uint32_t)a.dy;
+ s.nap = false;
+ s.voice_return = s.view;
+ int target = find(a.id);
+ if (a.value == 2) snprintf(s.voice_target, sizeof s.voice_target, "Find %.48s",
+ !strcmp(form.page.title, "Find Harness") ? "Harness" :
+ !strcmp(form.page.title, "New Harness") ? form.page.label : form.page.title);
+ else if (a.value == 7) COPY(s.voice_target, "Find in output");
+ else if (a.value == 5 || a.value == 6) COPY(s.voice_target, draft.page.name);
+ else COPY(s.voice_target, target >= 0 ? s.agents[target].name : "harness");
+ s.voice_started = ms();
+ s.voice_second = 0;
+ view(VOICE);
+ ESP_LOGI("habitat", "voice queued generation=%lu", (unsigned long)a.revision);
+ }
+ break;
+ case A_VOICE_STOP:
+ if (s.voice_open && !s.voice_start_pending && !s.voice_waiting && audio_client_recording()) {
+ if (a.value == 1 && cable_client_supports(CABLE_FEATURE_DRAFT) && !s.voice_search && (s.voice_return == HOME || s.voice_return == AGENT || s.voice_return == SELECTION)) {
+ s.voice_review = true; audio_client_request_review();
+ }
+ audio_client_stop();
+ s.voice_waiting = true;
+ s.voice_wait_until = ms() + 65000;
+ change();
+ }
+ break;
+ case A_VOICE_ABORT:
+ audio_client_abort();
+ audio_client_copy_upload_id(a.text, sizeof(a.text));
+ voice_close();
+ queue(a); // also cancel host work after capture has already finished
+ ht_gesture_guard(&gesture, ms());
+ view(s.voice_return == DRAFT && draft.page.active ? DRAFT : s.voice_return == FORM && form.id[0] ? FORM : question_view(s.voice_return) && s.q.valid ? s.voice_return : HOME);
+ if (s.view == DRAFT) ht_draft_command(&draft, HT_DRAFT_STATE, draft.page.revision, 0, ms());
+ break;
+ case A_PET:
+ s.nap = false;
+ s.pet_pose = 1;
+ s.pet_until = ms() + 900;
+ change();
+ break;
+ case A_SELECT_BEGIN:
+ if (cable_client_supports(CABLE_FEATURE_SELECTION) && s.connected && !s.loading && active()) {
+ ht_carry_close(&carry);
+ char id[48]; snprintf(id, sizeof(id), "pick-%08lx%08lx", (unsigned long)esp_random(), (unsigned long)esp_random());
+ view(SELECTION);
+ ht_selection_open(&selection, id, active()->id, ms(), selection_emit, NULL);
+ change();
+ }
+ break;
+ case A_SELECT_EXTEND:
+ ht_selection_extend(&selection, ms()); change();
+ break;
+ case A_CARRY:
+ if (s.view == SELECTION && !carry.pending && ht_selection_ready(&selection) &&
+ selection.excerpt[0] && !strcmp(a.id,selection.agent) &&
+ !strcmp(a.text,selection.id) && (uint32_t)a.dy==selection.revision) {
+ char id[48]; snprintf(id,sizeof(id),"carry-%08lx%08lx",(unsigned long)esp_random(),(unsigned long)esp_random());
+ ht_carry_open(&carry,id,a.id,a.text,(uint32_t)a.dy,ms(),carry_emit,NULL);
+ if (carry.error[0]) COPY(selection.error,carry.error);
+ change();
+ }
+ break;
+ case A_CARRY_DROP:
+ if (a.revision==carry.serial && !strcmp(a.text,carry.id)) {
+ ht_carry_close(&carry); change();
+ }
+ break;
+ case A_COMPANION:
+ view(COMPANION);
+ break;
+ case A_NAP:
+ s.nap = !s.nap;
+ s.nap_until = ms() + 15 * 60 * 1000;
+ change();
+ break;
+ case A_QUIET:
+ case A_FACE:
+ case A_RIM: {
+ if (a.kind == A_QUIET) s.quiet = !s.quiet;
+ if (a.kind == A_FACE) s.straight_title = !s.straight_title;
+ if (a.kind == A_RIM) s.rim_enabled = !s.rim_enabled;
+ action_t save = {.kind = A_HABITAT_SAVE,
+ .value = (s.focus_face ? 1 : 0) | (s.rim_enabled ? 2 : 0) | (s.quiet ? 4 : 0) | (s.straight_title ? 8 : 0)};
+ bool saved = queue(save);
+ if (a.kind == A_FACE && saved) view(HOME); // compare immediately, without hunting for a back button
+ change();
+ break;
+ }
+ case A_MUTE:
+ s.muted = !s.muted;
+ a.value = s.muted;
+ queue(a);
+ change();
+ break;
+ case A_FIND:
+ case A_FORM: {
+ if (!s.connected || s.voice_open) break;
+ if (!cable_client_supports(CABLE_FEATURE_FORM)) {
+ if (a.kind == A_FIND) view(AGENTS);
+ else { COPY(s.title,"New Harness"); COPY(s.message,"Open New Harness on your computer."); view(MESSAGE); }
+ break;
+ }
+ if (!form.id[0]) {
+ char id[48]; snprintf(id, sizeof id, "%s-%08lx-%08lx", a.kind == A_FIND ? "find" : "form",
+ (unsigned long)esp_random(), (unsigned long)ms());
+ ht_visit_close(&visit);
+ ht_form_open(&form, id, ms(), form_emit, NULL);
+ }
+ ht_gesture_guard(&gesture, ms());
+ view(FORM);
+ break;
+ }
+ case A_FORM_SAY:
+ if (s.view == FORM) {
+ a.kind = A_VOICE; a.value = 2;
+ ht_gesture_guard(&gesture, ms());
+ dispatch(a);
+ }
+ break;
+ case A_FORM_MAIN:
+ if (s.view == FORM && s.connected) {
+ if (form.failed) {
+ action_kind_t destination = !strncmp(form.id, "find-", 5) ? A_FIND : A_FORM;
+ ht_form_reset(&form); dispatch((action_t){.kind = destination});
+ } else ht_form_command(&form, HT_FORM_ACTIVATE, a.revision, 0, ms());
+ ht_gesture_guard(&gesture, ms()); change();
+ }
+ break;
+ case A_FORM_BACK:
+ if (s.view == FORM && (!form.id[0] ||
+ (!strncmp(form.id,"find-",5) && (!s.connected || form.pending || form.failed || !form.page.active)))) {
+ ht_form_dismiss(&form); view(HOME); ht_gesture_guard(&gesture,ms());
+ } else if (s.view == FORM && s.connected) {
+ if (form.failed) {
+ action_kind_t destination = !strncmp(form.id, "find-", 5) ? A_FIND : A_FORM;
+ ht_form_reset(&form); dispatch((action_t){.kind = destination});
+ } else ht_form_command(&form, HT_FORM_BACK, a.revision, 0, ms());
+ change();
+ }
+ break;
+ case A_SETTINGS:
+ view(SETTINGS);
+ break;
+ case A_BRIGHT:
+ // Saved stock settings can be any percentage (the default is 60).
+ // Advance to a preset, never beyond 100 or through an overflowing byte.
+ s.brightness = s.brightness >= 100 ? 25 : (s.brightness / 25 + 1) * 25;
+ a.value = s.brightness;
+ queue(a);
+ change();
+ break;
+ case A_STOP:
+ COPY(s.stop_agent, a.id);
+ view(STOP);
+ break;
+ case A_STOP_YES:
+ if (s.connected && find(s.stop_agent) >= 0 && s.agents[find(s.stop_agent)].busy) {
+ COPY(a.id, s.stop_agent);
+ queue(a);
+ view(AGENT);
+ }
+ break;
+ case A_MODELS:
+ if (s.connected && active()) {
+ COPY(s.model_agent, active()->id);
+ COPY(s.model_selected, active()->model);
+ s.model_count = -1;
+ s.model_request = true;
+ view(MODELS);
+ if (reload_waiter)
+ xTaskNotifyGive(reload_waiter);
+ }
+ break;
+ case A_MODEL:
+ if (s.connected) {
+ queue(a);
+ view(AGENT);
+ }
+ break;
+ case A_RECAP_DISMISS:
+ dismiss_result(a.id);
+ break;
+ case A_DESKTOP:
+ if (s.connected)
+ queue(a);
+ break;
+ case A_UP:
+ s.offset -= s.view == READER ? 5 : 3;
+ if (s.offset < 0)
+ s.offset = 0;
+ change();
+ break;
+ case A_DOWN:
+ if (s.view == INBOX)
+ s.offset = s.notice_count ? (s.offset + 1) % s.notice_count : 0;
+ else s.offset += s.view == READER ? 5 : 3;
+ change();
+ break;
+ case A_LOCK:
+ if (config_lock_enabled()) {
+ s.locked = true;
+ change();
+ }
+ break;
+ case A_QUESTION_READ:
+ case A_TAB_REFRESH:
+ case A_NONE:
+ case A_SELECT_SEND:
+ case A_CARRY_SEND:
+ case A_FORM_SEND:
+ case A_DRAFT_COMMAND:
+ case A_VISIT_SEND:
+ case A_SCROLL:
+ case A_HABITAT_SAVE:
+ break;
+ }
+}
+static void worker(void *unused)
+{
+ (void)unused;
+ action_t a;
+ static EXT_RAM_BSS_ATTR question_submit_t packet;
+ while (xQueueReceive(actions, &a, portMAX_DELAY) == pdTRUE) {
+ switch (a.kind) {
+ case A_DRAFT_COMMAND: {
+ static const char *ops[] = {"state", "move", "undo", "discard", "send"};
+ if (a.value >= 0 && a.value <= HT_DRAFT_SEND)
+ cable_client_draft(a.id, ops[a.value], a.revision, (uint32_t)a.dy, a.velocity);
+ break;
+ }
+ case A_CARRY_SEND:
+ cable_client_carry(a.text,a.id,a.text+48,(uint32_t)a.dy,a.revision,a.value!=0);
+ break;
+ case A_FORM_SEND: {
+ static const char *ops[] = {"open", "state", "move", "activate", "back", "close"};
+ if (a.value >= 0 && a.value < 6)
+ cable_client_form(a.id, a.revision, ops[a.value], (uint32_t)a.dy, a.velocity);
+ break;
+ }
+ case A_VISIT_SEND: {
+ static const char *ops[] = {"open", "back", "cancel", "latest"};
+ display_lock();
+ bool current=a.value==HT_VISIT_CANCEL ||
+ (visit.pending && a.revision==visit.request && a.value==(int)visit.op && !strcmp(a.text,visit.id));
+ display_unlock();
+ if (current && a.value >= 0 && a.value <= HT_VISIT_LATEST)
+ cable_client_visit(a.text, a.revision, ops[a.value], a.id);
+ break;
+ }
+ case A_SELECT_SEND: {
+ static const char *ops[] = {"begin", "step", "extend", "extend", "cancel", "match", "lines"};
+ if (a.value >= 0 && a.value <= HT_SELECT_LINES)
+ cable_client_select_text(a.id, a.text, (uint32_t)a.velocity, a.revision,
+ ops[a.value], a.dy, a.value == HT_SELECT_EXTEND);
+ break;
+ }
+ case A_SCROLL:
+ cable_client_send_scroll((cable_scroll_phase_t)a.value, a.dy, a.velocity);
+ break;
+ case A_AGENT:
+ cable_client_send_focus(a.id);
+ break;
+ case A_DESKTOP:
+ cable_client_send_open(a.id, NULL);
+ break;
+ case A_TAB: {
+ display_lock();
+ bool valid=s.connected && workspace.phase==HT_WORKSPACE_WAIT_TAB &&
+ a.revision==workspace.serial && !strcmp(a.id,workspace.pending);
+ display_unlock();
+ if (valid) cable_client_select_swarm(a.id);
+ break;
+ }
+ case A_TAB_REFRESH: {
+ uint32_t generation=cable_client_agent_generation();
+ display_lock();
+ bool valid=s.connected && ht_workspace_refresh(&workspace,a.revision,generation);
+ display_unlock();
+ if (valid && !cable_client_request_agents()) {
+ display_lock();
+ if (a.revision==workspace.serial && workspace.phase!=HT_WORKSPACE_IDLE)
+ workspace_failed("Could not refresh the tab. Try again.");
+ display_unlock();
+ }
+ break;
+ }
+ case A_MACHINE:
+ cable_client_select_machine(a.id);
+ break;
+ case A_VOICE:
+ display_lock();
+ if (s.connected && s.voice_open && s.voice_start_pending &&
+ a.revision == s.voice_generation) {
+ if (a.value == 7) audio_client_start_search(a.id, a.text, (unsigned)a.dy);
+ else if (a.value == 5 || a.value == 6) audio_client_start_draft(a.text, (unsigned)a.dy, a.value == 6);
+ else if (a.value == 4) audio_client_start_question(a.id,a.text,(unsigned)a.dy);
+ else if (a.value == 2) audio_client_start_form(a.text, (unsigned)a.dy);
+ else if (a.value == 3) audio_client_start_carry(a.id,a.text);
+ else if (a.text[0] && a.dy > 0) audio_client_start_selection(a.id, a.text, (unsigned)a.dy);
+ else audio_client_start_cable(a.id[0] ? a.id : NULL,
+ a.value == 1 ? VOICE_CMD_GOAL : VOICE_CMD_NONE);
+ s.voice_start_pending = false;
+ change();
+ }
+ display_unlock();
+ break;
+ case A_VOICE_ABORT:
+ cable_client_voice_cancel(a.text);
+ break;
+ case A_STOP_YES:
+ cable_client_stop_turn(a.id);
+ break;
+ case A_MODEL: {
+ const char *p = strrchr(a.text, ':');
+ char model[128];
+ COPY(model, p ? p + 1 : a.text);
+ char *effort = strrchr(model, '@');
+ if (effort)
+ *effort++ = 0;
+ cable_client_agent_update(a.id, model, effort);
+ break;
+ }
+ case A_BRIGHT:
+ config_save_brightness((uint8_t)((a.value * 255 + 50) / 100));
+ break;
+ case A_HABITAT_SAVE:
+ if (!config_save_habitat_options((uint8_t)a.value))
+ ui_cable_toast("Preference changed; saving failed.");
+ break;
+ case A_MUTE:
+ if (!audio_notify_set_muted(a.value != 0))
+ ui_cable_toast("Sound changed; saving failed.");
+ break;
+ case A_QUESTION_READ:
+ cable_client_question_read(a.id,a.text);
+ break;
+ case A_ANSWER: {
+ display_lock();
+ bool valid=s.q.valid && s.q.pending && s.q.revision==a.revision && !strcmp(a.id,s.q.agent);
+ if (valid) {
+ COPY(packet.agent,s.q.agent); COPY(packet.fetch,s.q.fetch); COPY(packet.token,s.q.token);
+ packet.count=s.q.count;
+ for (int i=0;i<packet.count;i++) {
+ packet.choices[i]=s.q.item[i].selected; COPY(packet.drafts[i],s.q.item[i].draft);
+ }
+ }
+ display_unlock();
+ if (!valid) break;
+ bool sent=cable_client_answer_reviewed(packet.agent,packet.fetch,packet.token,packet.choices,packet.drafts,packet.count);
+ if (!sent) {
+ display_lock();
+ if (s.q.revision==a.revision) {
+ s.q.uncertain=true; COPY(s.q.error,"Could not confirm sending. Check the terminal."); change();
+ }
+ display_unlock();
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+}
+void habitat_touch(bool down, int x, int y, uint32_t now)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ if (s.ready) {
+ ht_gallery_touch(&gallery, down, x, y, now);
+ habitat_render_notify();
+ }
+ return;
+#endif
+ if (!s.ready)
+ return;
+ if (s.locked) {
+ if (down && !s.touch_down) {
+ s.pattern[0] = 0;
+ s.pattern_mask = 0;
+ s.pattern_len = 0;
+ s.pattern_error = false;
+ }
+ if (down)
+ for (int i = 0; i < 9; i++) {
+ int dx = x - (157 + i % 3 * 80), dy = y - (180 + i / 3 * 74);
+ if (dx * dx + dy * dy < 30 * 30 && !(s.pattern_mask & (1 << i))) {
+ size_t n = strlen(s.pattern);
+ snprintf(s.pattern + n, sizeof(s.pattern) - n, "%s%d", n ? "," : "", i);
+ s.pattern_mask |= 1 << i;
+ s.pattern_len++;
+ change();
+ }
+ }
+ if (!down && s.touch_down) {
+ if (s.pattern_len >= 4 && config_check_lock(s.pattern)) {
+ s.locked = false;
+ s.lock_armed = false;
+ view(HOME);
+ } else {
+ s.pattern_error = true;
+ s.pattern_mask = 0;
+ change();
+ }
+ }
+ s.touch_down = down;
+ return;
+ }
+ bool surface = s.view == HOME || s.view == AGENT;
+ if (s.touch_down && !s.touch_cancelled) surface_tick(now);
+ if (down && !s.touch_down) {
+ s.touch_cancelled = false;
+ s.touch_brake = s.coasting && (int32_t)(now - s.coast_until) < 0;
+ s.coasting = false;
+ ht_scroll_cancel(&scroll);
+ scroll = (ht_scroll_t){0};
+ s.start_x = x;
+ s.start_y = y;
+ s.touch_started = now;
+ if (question_view(s.view)) s.q.drag=0;
+ s.draft_drag = 0;
+ s.tab_drag = 0;
+ s.pressed = -1;
+ pressed_action = make_action((hit_t){.action = A_NONE});
+ for (int i = 0; i < s.hit_count; i++) {
+ hit_t h = s.hits[i];
+ if (h.enabled && hit_contains(&h, x, y, surface)) {
+ s.pressed = i;
+ pressed_action = make_action(h);
+ break;
+ }
+ }
+ // A visible footer owns its entire contact, including the nearby rim.
+ if (surface && !home_footer(pressed_action.kind) && s.rim_enabled && ht_scroll_on_rim(x, y)) pressed_action.kind = A_NONE;
+ if (surface && pressed_action.kind==A_TABS && !s.touch_brake)
+ ht_workspace_touch(&workspace,workspace_index(s.selected_tab),s.tab_count,x,y,now);
+ ht_gesture_begin(&gesture, x, y, now, ((uint32_t)s.view << 8) | pressed_action.kind);
+ if (pressed_action.kind != A_PET && pressed_action.kind != A_FORM_MAIN && pressed_action.kind != A_FORM_SAY &&
+ pressed_action.kind != A_ANSWER && pressed_action.kind != A_DRAFT_SEND && pressed_action.kind != A_DRAFT_EDIT &&
+ pressed_action.kind != A_DRAFT_APPEND && pressed_action.kind != A_DRAFT_UNDO) gesture.guarded = false; // Discard is always immediate.
+ if (s.pressed >= 0 && ((!surface && s.view != VOICE) || home_footer(pressed_action.kind))) change();
+ if (ui_scroll_reportable()) {
+ if (surface && home_footer(pressed_action.kind)) {
+ // Footer choices send no terminal scroll. A contact
+ // that stops an existing fling still has to reach the app.
+ if (s.touch_brake) {
+ ht_scroll_begin(&scroll,x,y,now,scroll_reversed,false,scroll_emit,NULL);
+ ht_scroll_cancel(&scroll);
+ }
+ } else ht_scroll_begin(&scroll, x, y, now, scroll_reversed, s.rim_enabled, scroll_emit, NULL);
+ }
+ } else if (down && !s.touch_cancelled) {
+ ht_gesture_move(&gesture, x, y);
+ if (surface && home_footer(pressed_action.kind)) {
+ if (pressed_action.kind==A_TABS && ht_workspace_move(&workspace,x,y,gesture.axis,now)) change();
+ } else if (s.quick_open) {
+ int dx = x - s.start_x, dy = y - s.start_y;
+ int choice = 0;
+ if (dx * dx + dy * dy > 54 * 54)
+ choice = abs(dx) > abs(dy) ? (dx < 0 ? 3 : 2) : (dy < 0 ? 1 : 4);
+ if (choice != s.quick_choice) { s.quick_choice = choice; change(); }
+ } else if ((s.view == TABS || s.view == AGENTS || s.view == SETTINGS) && gesture.axis == 1) {
+ tabs_move((s.last_y - y) * (scroll_reversed ? -1 : 1));
+ } else if (s.view == DRAFT && gesture.axis == 1) {
+ draft_move((s.last_y - y) * (scroll_reversed ? -1 : 1), now);
+ } else if (s.view == FORM && gesture.axis == 1) {
+ ht_form_move(&form, (s.last_y - y) * (scroll_reversed ? -1 : 1), now);
+ } else if (question_view(s.view) && gesture.axis == 1) {
+ question_move((s.last_y-y)*(scroll_reversed ? -1 : 1));
+ } else if (s.view == SELECTION && gesture.axis == 1) {
+ int travel = (s.last_y - y) * (scroll_reversed ? -1 : 1);
+ ht_selection_move(&selection, travel, now);
+ change();
+ } else ht_scroll_move(&scroll, x, y, now);
+ if (gesture.moved && s.pressed >= 0) {
+ s.pressed = -1;
+ if ((!surface && s.view != VOICE) || home_footer(pressed_action.kind)) change();
+ }
+ }
+ if (!down && s.touch_down) {
+ ht_touch_result_t result = ht_gesture_end(&gesture, x, y, now);
+ if (!s.touch_cancelled && (s.view == TABS || s.view == AGENTS || s.view == SETTINGS) && gesture.axis == 1)
+ tabs_move((s.last_y - y) * (scroll_reversed ? -1 : 1));
+ bool scrolled = ht_scroll_end(&scroll, x, y, now);
+ if (scrolled) {
+ uint32_t coast = ht_scroll_coast_ms(scroll.velocity);
+ s.coasting = coast > 0;
+ s.coast_until = now + coast;
+ }
+ int dx = x - s.start_x, dy = y - s.start_y;
+ s.pressed = -1;
+ if (s.quick_open && !s.touch_cancelled) {
+ // Use the release coordinates too: lifting after sliding back to
+ // the center cancels, even if no final MOVE sample was delivered.
+ int choice = 0;
+ if (dx * dx + dy * dy > 54 * 54)
+ choice = abs(dx) > abs(dy) ? (dx < 0 ? 3 : 2) : (dy < 0 ? 1 : 4);
+ static const action_kind_t destinations[] = {A_NONE, A_AGENTS, A_INBOX, A_TABS, A_SETTINGS};
+ s.quick_open = false;
+ if (choice) dispatch((action_t){.kind = destinations[choice]});
+ change();
+ } else if (scrolled || s.touch_cancelled) {
+ // Motion owns this entire contact, even if the finger returns to its starting point.
+ } else if (result == HT_TOUCH_TAP && s.touch_brake) {
+ // DOWN already stopped desktop inertia. This entire tap is only a brake.
+ } else if (surface && pressed_action.kind==A_TABS) {
+ bool cancelled=workspace.cancelled || (workspace.touching && now-workspace.began>=5000);
+ int chosen=ht_workspace_release(&workspace,x,y,gesture.axis,now);
+ if (!s.touch_brake && !cancelled) {
+ if (chosen>=0 && chosen<s.tab_count) {
+ action_t tab={.kind=A_TAB}; COPY(tab.id,s.tabs[chosen].id); dispatch(tab);
+ } else if (result==HT_TOUCH_TAP || result==HT_TOUCH_HOLD) dispatch((action_t){.kind=A_TABS});
+ }
+ change();
+ } else if (surface && home_footer(pressed_action.kind)) {
+ // Dragging off a footer button cancels the choice; it cannot become
+ // a pane swipe, a rim scroll, or speech on the portrait.
+ if (result == HT_TOUCH_TAP) dispatch(pressed_action);
+ change();
+ } else if (result == HT_TOUCH_TAP && pressed_action.kind == A_PET &&
+ (surface || s.view == VOICE || s.view == SELECTION)) {
+ ht_gesture_guard(&gesture, now);
+ if (s.view == VOICE) {
+ ESP_LOGI("habitat", "gesture tap: finish voice");
+ dispatch((action_t){.kind = A_VOICE_STOP});
+ } else if (s.connected && !s.loading && pressed_action.id[0]) {
+ ESP_LOGI("habitat", "gesture tap: start voice");
+ pressed_action.kind = A_VOICE;
+ dispatch(pressed_action);
+ }
+ } else if (result == HT_TOUCH_HOLD) {
+ if (s.view == VOICE && pressed_action.kind == A_PET && cable_client_supports(CABLE_FEATURE_DRAFT)) {
+ ht_gesture_guard(&gesture, now);
+ dispatch((action_t){.kind = A_VOICE_STOP, .value = 1});
+ } else if (s.view == DRAFT && pressed_action.kind == A_DRAFT_EDIT) {
+ pressed_action.kind = A_DRAFT_OPTIONS; dispatch(pressed_action);
+ } else if ((surface && pressed_action.kind == A_PET) || pressed_action.kind == A_HOME || pressed_action.kind == A_TABS)
+ dispatch((action_t){.kind = A_SETTINGS});
+ } else if (result == HT_TOUCH_TAP) {
+ if (pressed_action.kind == A_PET) {
+ if (surface) dispatch(pressed_action); // immediate, harmless acknowledgement
+ } else {
+ ht_gesture_cancel(&gesture);
+ dispatch(pressed_action);
+ }
+ } else if (gesture.axis == 1 && abs(dy) > 55 && abs(dy) > abs(dx)) {
+ if (s.view == TABS || s.view == AGENTS || s.view == SETTINGS) {
+ // The list consumed the drag already, including its final sample.
+ } else if (s.view == DRAFT || s.view == DRAFT_OPTIONS) {
+ // Reading a draft never submits or starts recording.
+ } else if (s.view == FORM) {
+ // The form cursor consumed the drag; never launch from motion.
+ } else if (question_view(s.view)) {
+ // Reading/choosing consumed this contact; motion cannot submit an answer.
+ } else if (s.view == SELECTION) {
+ // Its bounded reading cursor already consumed this vertical drag.
+ } else if (surface) {
+ // A congested scroll queue cannot turn a scroll into navigation or voice.
+ } else if (s.start_y >= 400 && dy < 0)
+ view(HOME);
+ else if (s.view == READER) {
+ int next = s.offset + (dy < 0 ? 5 : -5);
+ s.offset = next < 0 ? 0 : next;
+ } else if (s.view == INBOX && s.notice_count)
+ s.offset = (s.offset + (dy < 0 ? 1 : s.notice_count - 1)) % s.notice_count;
+ else {
+ int count = s.view == AGENTS ? s.count
+ : s.view == TABS ? s.tab_count
+ : s.view == MACHINES ? s.machine_count
+ : s.view == MODELS ? s.model_count
+ : s.view == SETTINGS ? 9
+ : s.view == QUESTION ? s.q.item[s.q.index].count : 0;
+ int next = s.offset + (dy < 0 ? 3 : -3);
+ if (next >= 0 && next < count) s.offset = next;
+ }
+ } else if (gesture.axis == 2 && abs(dx) > 60 && abs(dx) > abs(dy)) {
+ if (s.view == DRAFT || s.view == DRAFT_OPTIONS) {
+ if (dx > 0) {
+ action_t a = make_action((hit_t){.action = s.view == DRAFT ? A_DRAFT_OPTIONS : A_DRAFT_BACK});
+ dispatch(a);
+ }
+ } else if (s.view == FORM) {
+ if (dx > 0) dispatch((action_t){.kind = A_FORM_BACK, .revision = form.page.revision});
+ } else if (question_view(s.view)) {
+ if (dx>0 && !s.q.pending) view(s.view==ANSWER_REVIEW ? CHOICE : s.view==CHOICE ? QUESTION : HOME);
+ } else if (s.view == INBOX && s.notice_count)
+ s.offset = (s.offset + (dx < 0 ? 1 : s.notice_count - 1)) % s.notice_count;
+ else if (surface && s.count && s.connected && !s.loading) {
+ int i = s.active < 0 ? 0 : (s.active + (dx < 0 ? 1 : s.count - 1)) % s.count;
+ action_t a = {.kind = A_AGENT};
+ COPY(a.id, s.agents[i].id);
+ dispatch(a);
+ } else if (!surface)
+ view(HOME);
+ }
+ change();
+ }
+ s.touch_down = down;
+ s.last_x = x;
+ s.last_y = y;
+ surface_tick(now);
+}
+void habitat_touch_cancel(void)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ ht_gallery_cancel(&gallery);
+ return;
+#endif
+ bool visible = s.touch_down || s.pressed >= 0;
+ input_cancel();
+ s.touch_down = false; // driver swallows the rest of this contact until a trustworthy UP
+ if (visible) change();
+}
+bool habitat_is_voice_view(void) { return s.view == VOICE; }
+uint32_t habitat_next_wake_ms(void)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ return display_is_asleep() ? 1000 : ht_gallery_wake(&gallery, ms());
+#endif
+ uint32_t delay = 1000, now = ms();
+ if (!s.ready)
+ return delay;
+ if (s.voice_open)
+ delay = 125;
+ if (selection.pending && delay > 100) delay = 100;
+ if (visit.pending && delay > 100) delay = 100;
+ if (s.view == FORM && delay > 100) delay = 100;
+ if (octopus_motion.next_ms && octopus_motion.next_ms < delay) delay = octopus_motion.next_ms;
+ if ((s.view == HOME || s.view == AGENT) && pressed_action.kind == A_PET && s.touch_down && !s.touch_cancelled &&
+ gesture.live && !gesture.moved && !gesture.guarded) {
+ uint32_t elapsed = now - s.touch_started;
+ uint32_t due = s.quick_open ? 5000 : 650;
+ uint32_t left = elapsed >= due ? 1 : due - elapsed;
+ if (left < delay) delay = left;
+ }
+ uint32_t deadlines[] = {s.pet_pose ? s.pet_until : 0, s.nap ? s.nap_until : 0};
+ for (unsigned i = 0; i < sizeof(deadlines) / sizeof(deadlines[0]); i++)
+ if (deadlines[i]) {
+ int32_t left = (int32_t)(deadlines[i] - now);
+ if (left <= 0)
+ return 1;
+ if ((uint32_t)left < delay)
+ delay = (uint32_t)left;
+ }
+ return delay;
+}
+void habitat_tick(void)
+{
+#ifdef DEVICE_CREATURE_GALLERY
+ if (s.ready && !display_is_asleep()) ht_gallery_tick(&gallery, ms());
+ return;
+#endif
+ if (!s.ready)
+ return;
+ uint32_t now = ms();
+ surface_tick(now);
+ if (ht_workspace_tick(&workspace,now)) workspace_failed("The tab did not open. Choose it again.");
+ if ((s.q.loading || (s.q.pending && !s.q.uncertain)) && (int32_t)(now-s.q.deadline)>=0) {
+ if (s.q.loading) { s.q.loading=false; COPY(s.q.error,"Question did not arrive. Open the alert again."); }
+ else { s.q.uncertain=true; COPY(s.q.error,"No answer receipt. Check the terminal before trying again."); }
+ change();
+ }
+ if (ht_selection_tick(&selection, now)) change();
+ if (!(s.voice_open && s.voice_carry) && ht_carry_tick(&carry,now)) {
+ if (carry.error[0] && s.view==SELECTION) COPY(selection.error,carry.error);
+ change();
+ }
+ // A background read must not begin halfway through a person's tap/drag.
+ // An already pending request still settles or times out normally.
+ if (s.view == FORM && (!s.touch_down || form.pending) && ht_form_tick(&form, now)) change();
+ if (ht_draft_tick(&draft, now)) change();
+ if (ht_visit_tick(&visit, now)) {
+ s.pending_focus[0] = 0;
+ COPY(s.title, "Visit ended");
+ COPY(s.message, "The app did not answer. Try the alert again.");
+ view(MESSAGE);
+ }
+ if (selection.active && !s.voice_open &&
+ (!s.connected || !active() || strcmp(active()->id, selection.agent))) view(HOME);
+ if (s.pet_pose && (int32_t)(now - s.pet_until) >= 0) {
+ s.pet_pose = 0;
+ change();
+ }
+ if (s.nap && (int32_t)(now - s.nap_until) >= 0) {
+ s.nap = false;
+ change();
+ }
+ if (s.voice_open) {
+ display_bump_activity();
+ uint32_t second = (now - s.voice_started) / 1000;
+ if (second != s.voice_second) {
+ s.voice_second = second;
+ change();
+ }
+ // Recording is explicitly started and finished by the person. The energy estimate can
+ // miss quiet speech and normal gaps between syllables; it must never discard their words.
+ // Keep the existing duration cap, using the same finalization as tapping Done.
+ if (audio_client_recording() && !s.voice_waiting && second >= 600) {
+ audio_client_stop();
+ s.voice_waiting = true;
+ s.voice_wait_until = now + 65000;
+ change();
+ }
+ if (!s.voice_start_pending && !audio_client_active() && !s.voice_waiting &&
+ now - s.voice_started > 700) {
+ dispatch((action_t){.kind = A_VOICE_ABORT});
+ if (s.view == FORM) {
+ COPY(form.page.error, "Recording stopped. Say the name again."); form.poll = now + 6000; change();
+ } else if (s.view == DRAFT) {
+ COPY(draft.page.error, "Recording stopped. Checking your draft."); change();
+ } else {
+ COPY(s.title, "Voice"); COPY(s.message, "Recording stopped. Please try again."); view(MESSAGE);
+ }
+ }
+ if (s.voice_waiting && (int32_t)(now - s.voice_wait_until) >= 0) {
+ dispatch((action_t){.kind = A_VOICE_ABORT});
+ if (s.view == FORM) {
+ COPY(form.page.error, "Search timed out. Say the name again."); form.poll = now + 6000; change();
+ } else if (s.view == DRAFT) {
+ COPY(draft.page.error, "No voice reply. Checking your draft."); change();
+ } else {
+ COPY(s.title, "Voice"); COPY(s.message, "No response yet. Check Harness on your computer."); view(MESSAGE);
+ }
+ }
+ }
+}
+static void power(bool on)
+{
+ if (!on) {
+ input_cancel();
+ if (!s.voice_open && selection.active) view(HOME);
+ s.lock_armed = config_lock_enabled();
+ return;
+ }
+ if (s.lock_armed) {
+ s.locked = true;
+ s.pattern[0] = 0;
+ s.pattern_mask = 0;
+ s.pattern_len = 0;
+ change();
+ }
+}
+void ui_init(void)
+{
+ display_lock();
+ memset(&s, 0, sizeof(s));
+ s.active = -1;
+ s.pressed = -1;
+ s.brightness = (config_load_brightness() * 100 + 127) / 255;
+ s.muted = config_load_muted();
+ uint8_t options = config_load_habitat_options();
+ s.focus_face = (options & 1) != 0;
+ s.rim_enabled = (options & 2) != 0;
+ s.quiet = (options & 4) != 0;
+ s.straight_title = (options & 8) != 0;
+ s.ready = true;
+#ifdef DEVICE_CREATURE_GALLERY
+ ht_gallery_init(&gallery, ms());
+ ESP_LOGI("gallery", "20 text creatures / local only; swipe X creature, Y mood or speed, tap replay");
+#endif
+ s.loading = true;
+ s.view = HOME;
+ s.dirty = true;
+ scroll_reversed = config_load_scroll_reversed();
+ s.locked = config_lock_enabled();
+ display_set_power_cb(power);
+ actions = xQueueCreate(8, sizeof(action_t));
+ assert(actions);
+ assert(xTaskCreate(worker, "habitat_actions", 6144, NULL, 4, NULL) == pdPASS);
+ display_unlock();
+ habitat_render_notify();
+}
+void ui_set_brightness(uint8_t level)
+{
+ display_lock();
+ s.brightness = (level * 100 + 127) / 255;
+ change();
+ display_unlock();
+}
+
+// Protocol-facing adapter. The cable reader never waits for rendering or a DMA transaction.
+void ui_set_connected(bool value)
+{
+ display_lock();
+ if (!value) {
+ input_cancel();
+ s.pending_machine[0] = 0;
+ // A reconnect may bring a newer saved result than our last live event.
+ for (int i = 0; i < PANE_MEMORY_MAX; i++) s.memory[i].live_summary = false;
+ if (workspace.phase!=HT_WORKSPACE_IDLE) {
+ ht_workspace_cancel_request(&workspace); s.loading=false; s.active=-1; view(HOME);
+ }
+ s.q.valid=s.q.loading=s.q.pending=false; s.q.revision++;
+ if (question_view(s.view)) view(HOME);
+ ht_visit_close(&visit);
+ ht_carry_close(&carry);
+ }
+ s.connected = value;
+ if (!value && form.id[0]) { ht_form_reset(&form); view(HOME); }
+ if (!value && draft.page.active) { ht_draft_reset(&draft); view(HOME); }
+ if (!value && (s.voice_open || audio_client_active())) {
+ audio_client_abort();
+ voice_close();
+ view(HOME);
+ }
+ change();
+ display_unlock();
+}
+void ui_project_set_name(const char *id, const char *name)
+{
+ display_lock();
+ int i = ensure(id);
+ if (i >= 0) {
+ COPY(s.agents[i].name, name);
+ change();
+ }
+ display_unlock();
+}
+void ui_project_set_engine(const char *id, const char *engine)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ COPY(s.agents[i].engine, engine);
+ change();
+ }
+ display_unlock();
+}
+void ui_project_set_machine(const char *id, const char *machine_id, const char *name)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ COPY(s.agents[i].machine_id, machine_id);
+ COPY(s.agents[i].machine, name);
+ change();
+ }
+ display_unlock();
+}
+void ui_project_fill_missing_engine(const char *engine)
+{
+ display_lock();
+ for (int i = 0; i < s.count; i++)
+ if (!s.agents[i].engine[0])
+ COPY(s.agents[i].engine, engine);
+ change();
+ display_unlock();
+}
+void ui_project_set_selected_model(const char *id, const char *model)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ COPY(s.agents[i].model, model);
+ change();
+ }
+ display_unlock();
+}
+void ui_project_reconcile_selected_model(const char *id, const char *model)
+{
+ ui_project_set_selected_model(id, model);
+}
+void ui_projects_bulk_begin(void)
+{
+ display_lock();
+ s.bulk++;
+ display_unlock();
+}
+void ui_projects_bulk_end(void)
+{
+ display_lock();
+ if (s.bulk)
+ s.bulk--;
+ change();
+ display_unlock();
+}
+void ui_project_remove(const char *id)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ if (s.active == i) {
+ input_cancel();
+ }
+ memmove(&s.agents[i], &s.agents[i + 1], (size_t)(s.count - i - 1) * sizeof(agent_t));
+ s.count--;
+ if (s.active > i)
+ s.active--;
+ else if (s.active >= s.count)
+ s.active = s.count - 1;
+ change();
+ }
+ display_unlock();
+}
+void ui_project_clear_all(void)
+{
+ display_lock();
+ input_cancel();
+ s.count = 0;
+ s.active = -1;
+ change();
+ display_unlock();
+}
+void ui_project_apply_order(const char *const *ids, int n)
+{
+ static EXT_RAM_BSS_ATTR agent_t swap;
+ display_lock();
+ char selected[ID_MAX] = "";
+ if (active())
+ COPY(selected, active()->id);
+ for (int i = 0; i < n && i < s.count; i++) {
+ int j = find(ids[i]);
+ if (j >= 0 && j != i) {
+ swap = s.agents[i];
+ s.agents[i] = s.agents[j];
+ s.agents[j] = swap;
+ }
+ }
+ s.active = find(selected);
+ change();
+ display_unlock();
+}
+int ui_project_count(void)
+{
+ display_lock();
+ int n = s.count;
+ display_unlock();
+ return n;
+}
+bool ui_project_id_at(int i, char *buf, size_t n)
+{
+ display_lock();
+ bool ok = i >= 0 && i < s.count;
+ if (ok)
+ copy(buf, n, s.agents[i].id);
+ display_unlock();
+ return ok;
+}
+bool ui_project_known(const char *id)
+{
+ display_lock();
+ bool ok = find(id) >= 0;
+ display_unlock();
+ return ok;
+}
+bool ui_project_has_event(const char *id)
+{
+ display_lock();
+ int i = find(id);
+ bool ok = i >= 0 && s.agents[i].has_event;
+ display_unlock();
+ return ok;
+}
+bool ui_project_is_busy(const char *id)
+{
+ display_lock();
+ int i = find(id);
+ bool ok = i >= 0 && s.agents[i].busy;
+ display_unlock();
+ return ok;
+}
+static void event(const char *id, const char *session, const char *kind, const char *text_,
+ const char *recap, bool restore)
+{
+ display_lock();
+ pane_memory_t *m = pane_memory(id, true);
+ if (!m) { display_unlock(); return; }
+ int i = find(id);
+ agent_t *a = i >= 0 ? &s.agents[i] : NULL;
+ if (session && *session)
+ COPY(m->session, session);
+ if (kind && !strcmp(kind, "activity")) {
+ // Activity is a read of the current terminal, not a new turn or a recap.
+ // A late read must never reanimate an idle pane.
+ if (m->busy && ms() - m->last_busy <= 25000) {
+ activity_text(m->activity, sizeof m->activity, text_);
+ if (a) { COPY(a->tool, m->activity); change(); }
+ }
+ display_unlock(); return;
+ }
+ if (kind && (!strcmp(kind, "processing") || !strcmp(kind, "summarizing"))) {
+ if (!restore) {
+ if (!m->busy) {
+ m->busy_ms = ms();
+ m->activity[0] = 0;
+ if (a && i == s.active) s.tim_activity++;
+ }
+ m->busy = true;
+ m->awaiting_result = true;
+ m->last_busy = ms();
+ // Old bridges send these generic labels. Keep liveness, but do not
+ // pretend they are words being displayed by the agent itself.
+ if (text_ && *text_ && strcmp(text_, "Processing") &&
+ strcmp(text_, "Summarizing...") && strcmp(text_, "Summarizing\xe2\x80\xa6"))
+ activity_text(m->activity, sizeof m->activity, text_);
+ if (a) {
+ a->busy = true;
+ a->recap_ready = false;
+ a->busy_ms = m->busy_ms;
+ a->last_busy = m->last_busy;
+ COPY(a->session, m->session);
+ COPY(a->tool, m->activity);
+ }
+ }
+ if (a) change();
+ display_unlock();
+ return;
+ }
+ if (!restore) { m->busy = false; m->activity[0] = 0; }
+ bool has_text = text_ && *text_ && strcmp(text_, "done");
+ if ((has_text || (recap && *recap)) && !(restore && (m->live_summary || m->awaiting_result || m->busy))) {
+ char preview[sizeof m->preview];
+ recap_preview(preview, sizeof preview, recap && *recap ? recap : text_);
+ // Retain history privately, but a new turn stays in presence mode until
+ // its own live result arrives. Late history cannot resurrect an old recap.
+ if (preview[0]) {
+ m->awaiting_result = false;
+ // An opened off-tab notification can precede its first history
+ // snapshot. Fill that empty record without showing the same result
+ // twice. Every new live result still becomes visible normally.
+ if (!restore || (m->preview[0] && strcmp(m->preview, preview))) m->dismissed = false;
+ COPY(m->preview, preview);
+ COPY(m->full, has_text ? text_ : recap);
+ if (!restore) m->live_summary = true;
+ }
+ }
+ pane_memory_apply(a, m);
+ // Agent events may belong to an earlier turn. Only the voice result finishes voice UI.
+ if (a) change();
+ display_unlock();
+}
+void ui_project_emit(const char *id, const char *session, const char *kind, const char *text_,
+ const char *recap)
+{
+ event(id, session, kind, text_, recap, false);
+}
+void ui_project_restore_event(const char *id, const char *kind, const char *text_,
+ const char *recap)
+{
+ event(id, NULL, kind, text_, recap, true);
+}
+void ui_project_clear_event(const char *id)
+{
+ display_lock();
+ pane_memory_t *m = pane_memory(id, false);
+ if (m) { m->preview[0] = m->full[0] = 0; m->live_summary = false; }
+ int i = find(id);
+ if (i >= 0) {
+ s.agents[i].preview[0] = 0;
+ s.agents[i].full[0] = 0;
+ s.agents[i].has_event = false;
+ s.agents[i].recap_ready = false;
+ change();
+ }
+ display_unlock();
+}
+void ui_project_set_busy_tokens(const char *id, int tokens)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0)
+ s.agents[i].tokens = tokens;
+ display_unlock();
+}
+void ui_project_set_tool(const char *id, const char *name, const char *title, const char *hex,
+ const char *detail)
+{
+ (void)hex;
+ (void)detail;
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ char next[sizeof(s.agents[i].tool)];
+ snprintf(next, sizeof(next), "%s%s%s", name ? name : "",
+ title && *title ? ": " : "", title ? title : "");
+ if (i == s.active && strcmp(next, s.agents[i].tool)) s.tim_activity++;
+ snprintf(s.agents[i].tool, sizeof(s.agents[i].tool), "%s%s%s", name ? name : "",
+ title && *title ? ": " : "", title ? title : "");
+ change();
+ }
+ display_unlock();
+}
+void ui_project_set_todos(const char *id, const cJSON *todos)
+{
+ display_lock();
+ int i = find(id);
+ if (i >= 0) {
+ const cJSON *t;
+ cJSON_ArrayForEach(t, todos)
+ {
+ const cJSON *status = cJSON_GetObjectItemCaseSensitive(t, "status"),
+ *content = cJSON_GetObjectItemCaseSensitive(t, "content");
+ if (cJSON_IsString(status) && !strcmp(status->valuestring, "in_progress") &&
+ cJSON_IsString(content)) {
+ if (i == s.active && strcmp(s.agents[i].tool, content->valuestring)) s.tim_activity++;
+ COPY(s.agents[i].tool, content->valuestring);
+ change();
+ break;
+ }
+ }
+ }
+ display_unlock();
+}
+void ui_project_set_agents(const char *id, const cJSON *agents)
+{
+ (void)id;
+ (void)agents; /* Detail stays on the desktop; the face shows the current tool. */
+}
+int ui_prune_stale_busy(void)
+{
+ display_lock();
+ int n = 0;
+ uint32_t now = ms();
+ for (int i = 0; i < s.count; i++)
+ if (s.agents[i].busy && now - s.agents[i].last_busy > 25000) {
+ s.agents[i].busy = false;
+ pane_memory_t *m = pane_memory(s.agents[i].id, false);
+ if (m) m->busy = false;
+ n++;
+ }
+ if (n)
+ change();
+ display_unlock();
+ return n;
+}
+void ui_cancel_acked(const char *session)
+{
+ display_lock();
+ for (int i = 0; i < s.count; i++)
+ if (session && !strcmp(s.agents[i].session, session)) {
+ s.agents[i].busy = false;
+ pane_memory_t *m = pane_memory(s.agents[i].id, false);
+ if (m) m->busy = false;
+ change();
+ }
+ display_unlock();
+}
+void ui_fleet_set(int total, bool window)
+{
+ display_lock();
+ s.total = total;
+ s.window = window;
+ change();
+ display_unlock();
+}
+void ui_focus_project(const char *id)
+{
+ if (!id || !*id || strnlen(id, ID_MAX) >= ID_MAX) return;
+ display_lock();
+ int i = find(id);
+ if (i < 0) {
+ COPY(s.pending_focus, id);
+ display_unlock();
+ return;
+ }
+ bool requested = s.pending_focus[0] && !strcmp(s.pending_focus, id);
+ s.pending_focus[0] = 0;
+ bool opened = s.opening_notice[0] && !strcmp(s.opening_notice, id);
+ if (opened) s.opening_notice[0] = 0;
+ if (s.active != i) {
+ input_cancel();
+ }
+ s.active = i;
+ // Focus changes the main surface's recipient. Voice and confirmations keep their pinned targets.
+ // A requested remote open lands only after the host has supplied that agent.
+ if (opened && s.view == INBOX) view(HOME);
+ else if (requested && s.view == MESSAGE && !visit.pending) {
+ if (visit.available && !strcmp(visit.agent,id) && is_question(id)) open_question();
+ else view(AGENT);
+ }
+ if (visit.available && !visit.pending && strcmp(visit.agent, id)) ht_visit_close(&visit);
+ change();
+ display_unlock();
+}
+void ui_apply_pending_focus(void)
+{
+ display_lock();
+ char id[ID_MAX];
+ COPY(id, s.pending_focus);
+ display_unlock();
+ if (id[0] && ui_project_known(id))
+ ui_focus_project(id);
+}
+void ui_show_projects(void)
+{
+ display_lock();
+ view(HOME);
+ display_unlock();
+}
+void ui_enter_boot_loading(void)
+{
+ display_lock();
+ s.loading = true;
+ view(HOME);
+ display_unlock();
+}
+void ui_land_after_reload(void)
+{
+ display_lock();
+ if (s.loading && (workspace.phase==HT_WORKSPACE_IDLE || workspace.phase==HT_WORKSPACE_READY)) {
+ ht_workspace_cancel_request(&workspace);
+ s.loading = false;
+ view(HOME);
+ }
+ change();
+ display_unlock();
+}
+void ui_workspace_applied(const char *tab, uint32_t generation)
+{
+ display_lock();
+ if (!strcmp(s.selected_tab,workspace.pending)) ht_workspace_applied(&workspace,tab,generation);
+ display_unlock();
+}
+void ui_report_active_agent(void)
+{
+ display_lock();
+ action_t a = {.kind = A_AGENT};
+ if (active())
+ COPY(a.id, active()->id);
+ if (a.id[0])
+ queue(a);
+ display_unlock();
+}
+int ui_get_active_project_index(void)
+{
+ display_lock();
+ int i = s.view == HOME || s.view == AGENT || s.view == READER || s.view == QUESTION ? s.active : -1;
+ display_unlock();
+ return i;
+}
+const char *ui_get_active_project_id(void) { return active() ? active()->id : NULL; }
+const char *ui_get_active_session_id(void) { return active() ? active()->session : NULL; }
+bool ui_is_projects_active(void)
+{
+ return !s.locked && (s.view == HOME || s.view == AGENT || s.view == AGENTS);
+}
+bool ui_reader_is_open(void) { return s.view == READER; }
+bool ui_picker_is_open(void) { return s.view == MODELS || s.view == MACHINES || s.view == TABS; }
+bool ui_switch_is_open(void) { return s.view == TABS; }
+bool ui_scroll_reportable(void)
+{
+ return s.ready && s.connected && !s.loading && !s.locked && (s.view == HOME || s.view == AGENT) && active() &&
+ !display_is_asleep() && !s.voice_open && !audio_client_active();
+}
+int ui_notif_pull_zone_px(void) { return 0; }
+bool ui_action_hit(uint16_t x, uint16_t y)
+{
+ (void)x;
+ (void)y;
+ return true;
+}
+void ui_swipe_begin(void) {}
+void ui_swipe_end(int dir)
+{
+ display_lock();
+ if (s.count) {
+ s.active = (s.active + (dir > 0 ? 1 : s.count - 1)) % s.count;
+ view(AGENT);
+ }
+ display_unlock();
+}
+void ui_home_overview(void)
+{
+ display_lock();
+ view(HOME);
+ display_unlock();
+}
+void ui_tap(int32_t x, int32_t y)
+{
+ display_lock();
+ habitat_touch(true, x, y, ms());
+ habitat_touch(false, x, y, ms());
+ display_unlock();
+}
+void ui_notif_open(void)
+{
+ display_lock();
+ view(s.notice_count ? INBOX : HOME);
+ display_unlock();
+}
+void ui_notif_close(void)
+{
+ display_lock();
+ if (s.view == INBOX)
+ view(HOME);
+ display_unlock();
+}
+bool ui_notif_is_open(void) { return s.view == INBOX; }
+bool ui_notif_pill_hit(uint16_t x, uint16_t y)
+{
+ (void)x;
+ (void)y;
+ return false;
+}
+void ui_notif_swipe_up(void) { ui_notif_close(); }
+static void notice_remove(const char *id, bool questions_too)
+{
+ if (!id) return;
+ for (int i = s.notice_count - 1; i >= 0; i--)
+ if (!strcmp(s.notice[i].agent_id, id) && (questions_too || !s.notice[i].question)) {
+ memmove(&s.notice[i], &s.notice[i + 1],
+ (size_t)(s.notice_count - i - 1) * sizeof(cable_notif_t));
+ s.notice_count--;
+ if (s.view == INBOX && i < s.offset) s.offset--;
+ }
+}
+static void notice_sync_view(void)
+{
+ if (s.view != INBOX) return;
+ // Reconcile after the complete mutation, never during remove-then-add.
+ // Cancel a finger already down so the new home cannot receive its release.
+ input_cancel();
+ if (!s.notice_count) view(HOME);
+ else if (s.offset >= s.notice_count) s.offset = s.notice_count - 1;
+}
+static void notice_selection(char *id, size_t capacity)
+{
+ copy(id, capacity, s.view == INBOX && s.offset >= 0 && s.offset < s.notice_count
+ ? s.notice[s.offset].agent_id : "");
+}
+static void notice_restore_selection(const char *id)
+{
+ if (s.view != INBOX || !id[0]) return;
+ for (int i = 0; i < s.notice_count; i++)
+ if (!strcmp(id, s.notice[i].agent_id)) { s.offset = i; return; }
+}
+static void notice_add(const char *id, const char *name, const char *machine, const char *recap,
+ bool question)
+{
+ if (!id || !*id || strnlen(id, ID_MAX) >= ID_MAX) return;
+ char selected[ID_MAX]; notice_selection(selected, sizeof selected);
+ notice_remove(id, true);
+ if (s.notice_count == NOTICES) {
+ // Keep a message being read even when the bounded inbox fills. The
+ // oldest other message gives way; arrival never moves the current card.
+ int drop = s.notice_count - 1;
+ if (!strcmp(selected, s.notice[drop].agent_id)) drop--;
+ memmove(&s.notice[drop], &s.notice[drop + 1],
+ (size_t)(s.notice_count - drop - 1) * sizeof(cable_notif_t));
+ s.notice_count--;
+ }
+ int pos = 0;
+ if (!question)
+ while (pos < s.notice_count && s.notice[pos].question)
+ pos++;
+ memmove(&s.notice[pos + 1], &s.notice[pos],
+ (size_t)(s.notice_count - pos) * sizeof(cable_notif_t));
+ s.notice_count++;
+ cable_notif_t *n = &s.notice[pos];
+ memset(n, 0, sizeof(*n));
+ COPY(n->agent_id, id);
+ COPY(n->name, name && *name ? name : "Harness");
+ COPY(n->machine, machine);
+ recap_preview(n->summary, sizeof n->summary, recap);
+ n->question = question;
+ notice_restore_selection(selected);
+ notice_sync_view();
+}
+void ui_notify_task_done(const char *id, const char *name, const char *machine, const char *recap)
+{
+ if (!id || !*id || strnlen(id, ID_MAX) >= ID_MAX) return;
+ display_lock();
+ notice_add(id, name, machine, recap, false);
+ uint32_t now = ms();
+ if (!waiting() && !s.nap && !s.quiet && (!s.last_celebration || now - s.last_celebration >= 20000)) {
+ s.pet_pose = 3;
+ s.pet_until = now + 2000;
+ s.last_celebration = now;
+ }
+ change();
+ display_wake();
+ display_unlock();
+}
+void ui_notif_seen(const char *id)
+{
+ display_lock();
+ bool opened = id && s.opening_notice[0] && !strcmp(s.opening_notice, id);
+ notice_remove(id, false);
+ notice_sync_view();
+ change();
+ display_unlock();
+ // An already-focused desktop pane may only echo "seen", with no focus
+ // change. That acknowledgement also completes the requested inbox open.
+ if (opened) ui_focus_project(id);
+}
+void ui_notif_replace(const cable_notif_t *rows, int count)
+{
+ display_lock();
+ char selected[ID_MAX]; notice_selection(selected, sizeof selected);
+ if (!rows || count < 0) count = 0;
+ if (count > NOTICES) count = NOTICES;
+ s.notice_count = 0;
+ for (int i = count - 1; i >= 0; i--)
+ notice_add(rows[i].agent_id, rows[i].name, rows[i].machine, rows[i].summary,
+ rows[i].question);
+ notice_restore_selection(selected);
+ notice_sync_view();
+ change();
+ display_unlock();
+}
+static void question_load(const cJSON *questions)
+{
+ s.q.count=s.q.index=s.q.choice=0; s.q.supported=true; s.q.valid=false;
+ memset(s.q.item,0,sizeof s.q.item);
+ const cJSON *item;
+ cJSON_ArrayForEach(item,questions) {
+ if (s.q.count==QUESTION_MAX) { s.q.supported=false; break; }
+ question_item_t *q=&s.q.item[s.q.count++];
+ const cJSON *key=cJSON_GetObjectItemCaseSensitive(item,"key"),
+ *prompt=cJSON_GetObjectItemCaseSensitive(item,"q"),
+ *options=cJSON_GetObjectItemCaseSensitive(item,"options");
+ COPY(q->key,cJSON_IsString(key) ? key->valuestring : "");
+ COPY(q->prompt,cJSON_IsString(prompt) ? prompt->valuestring : "");
+ q->multi=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(item,"multi"));
+ q->can_text=!q->multi && cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(item,"canText"));
+ if (!cJSON_IsString(key) || !q->key[0] || strlen(key->valuestring)>=sizeof q->key ||
+ !cJSON_IsString(prompt) || !q->prompt[0] || strlen(prompt->valuestring)>=sizeof q->prompt ||
+ !ht_can_display(q->prompt,&ht_mono_20,348,256)) s.q.supported=false;
+ const cJSON *option;
+ cJSON_ArrayForEach(option,options) {
+ if (q->count==OPTION_MAX) { s.q.supported=false; break; }
+ if (!cJSON_IsString(option) || !option->valuestring[0]) { s.q.supported=false; continue; }
+ if (strlen(option->valuestring)>=sizeof q->options[0] ||
+ !ht_can_display(option->valuestring,&ht_mono_20,348,256)) s.q.supported=false;
+ COPY(q->options[q->count++],option->valuestring);
+ }
+ if (!q->count) s.q.supported=false;
+ }
+ s.q.valid=s.q.count>0;
+}
+void ui_question_show(const char *id, const char *name, const char *machine, const char *request,
+ const cJSON *questions)
+{
+ if (!id || !request) return;
+ display_lock();
+ const cJSON *first=cJSON_GetArrayItem(questions,0);
+ const cJSON *prompt=cJSON_GetObjectItemCaseSensitive(first,"q");
+ notice_add(id,name,machine,cJSON_IsString(prompt) ? prompt->valuestring : "Needs your answer",true);
+ // A different agent's alert cannot replace the question being read.
+ if (s.q.valid && !strcmp(s.q.agent,id) && strcmp(s.q.request,request)) {
+ s.q.valid=false; s.q.pending=false; s.q.revision++;
+ if (question_view(s.view)) { COPY(s.q.error,"The question changed. Open the alert again."); view(QUESTION); }
+ }
+ change(); display_unlock();
+}
+void ui_question_state(const cJSON *p)
+{
+ const cJSON *agent=cJSON_GetObjectItemCaseSensitive(p,"agentId"),
+ *fetch=cJSON_GetObjectItemCaseSensitive(p,"requestId"),
+ *id=cJSON_GetObjectItemCaseSensitive(p,"id"),
+ *token=cJSON_GetObjectItemCaseSensitive(p,"token"),
+ *name=cJSON_GetObjectItemCaseSensitive(p,"name"),
+ *error=cJSON_GetObjectItemCaseSensitive(p,"error");
+ if (!cJSON_IsString(agent) || !cJSON_IsString(fetch)) return;
+ display_lock();
+ if (s.q.loading && s.view==QUESTION && !strcmp(agent->valuestring,s.q.agent) && !strcmp(fetch->valuestring,s.q.fetch)) {
+ s.q.loading=false;
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"ok")) && cJSON_IsString(id) &&
+ strlen(id->valuestring)<sizeof s.q.request && cJSON_IsString(token) && token->valuestring[0] &&
+ strlen(token->valuestring)<sizeof s.q.token) {
+ COPY(s.q.request,id->valuestring); COPY(s.q.token,token->valuestring);
+ if (cJSON_IsString(name)) COPY(s.q.name,name->valuestring);
+ question_load(cJSON_GetObjectItemCaseSensitive(p,"questions"));
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"submitted"))) {
+ s.q.pending=s.q.uncertain=true;
+ COPY(s.q.error,"An answer was already sent. Check the terminal.");
+ }
+ } else COPY(s.q.error,cJSON_IsString(error) ? error->valuestring : "Could not load the question.");
+ input_cancel(); change();
+ }
+ display_unlock();
+}
+void ui_answer_receipt(const cJSON *p)
+{
+ const cJSON *agent=cJSON_GetObjectItemCaseSensitive(p,"agentId"),
+ *fetch=cJSON_GetObjectItemCaseSensitive(p,"requestId"),
+ *token=cJSON_GetObjectItemCaseSensitive(p,"token"),
+ *error=cJSON_GetObjectItemCaseSensitive(p,"error");
+ if (!cJSON_IsString(agent) || !cJSON_IsString(fetch) || !cJSON_IsString(token)) return;
+ display_lock();
+ if (s.q.pending && !strcmp(s.q.agent,agent->valuestring) && !strcmp(s.q.fetch,fetch->valuestring) &&
+ !strcmp(s.q.token,token->valuestring)) {
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"ok"))) {
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"pending"))) { display_unlock(); return; }
+ s.q.valid=s.q.pending=false; s.q.revision++; notice_remove(s.q.agent,true);
+ if (question_view(s.view)) view(HOME);
+ notice_sync_view();
+ } else {
+ s.q.uncertain=true;
+ COPY(s.q.error,cJSON_IsString(error) ? error->valuestring : "Could not confirm. Check the terminal.");
+ change();
+ }
+ }
+ display_unlock();
+}
+void ui_question_close(const char *id, const char *request)
+{
+ if (!id || !request) return;
+ display_lock();
+ if (!strcmp(s.q.agent,id) && !strcmp(s.q.request,request)) {
+ s.q.valid=s.q.pending=s.q.loading=false; s.q.revision++;
+ if (question_view(s.view)) view(HOME);
+ notice_remove(id,true);
+ } else if (strcmp(s.q.agent,id)) notice_remove(id,true);
+ notice_sync_view();
+ change(); display_unlock();
+}
+
+void ui_service_model_picker(void)
+{
+ char id[ID_MAX], selected[192];
+ display_lock();
+ bool request = s.model_request;
+ s.model_request = false;
+ COPY(id, s.model_agent);
+ COPY(selected, s.model_selected);
+ display_unlock();
+ if (!request)
+ return;
+ static EXT_RAM_BSS_ATTR model_item_t results[48];
+ int n = cable_client_models_list(id, "model", selected, results, 48);
+ display_lock();
+ if (s.view == MODELS && !strcmp(id, s.model_agent)) {
+ s.model_count = n < 0 ? 0 : n;
+ memcpy(s.models, results, (size_t)s.model_count * sizeof(model_item_t));
+ change();
+ }
+ display_unlock();
+}
+void ui_swarms_replace(const cable_swarm_t *rows, int count, const char *selected)
+{
+ display_lock();
+ int bounded=count<0 ? 0 : count>SWARMS_MAX ? SWARMS_MAX : count;
+ if (!rows) bounded=0;
+ bool changed=bounded!=s.tab_count || strcmp(s.selected_tab,selected ? selected : "");
+ for (int i=0;!changed && i<bounded;i++) {
+ changed=strcmp(rows[i].id,s.tabs[i].id) || strcmp(rows[i].name,s.tabs[i].name) || rows[i].panes!=s.tabs[i].panes;
+ }
+ if (changed && (workspace.touching || s.view == TABS)) input_cancel();
+ s.tab_count=bounded;
+ if (bounded) memcpy(s.tabs,rows,(size_t)bounded*sizeof *rows);
+ COPY(s.selected_tab,selected);
+ if (workspace.phase!=HT_WORKSPACE_IDLE && workspace_index(workspace.pending)<0) {
+ workspace_failed("That workspace is gone. Choose another.");
+ } else if (ht_workspace_selected(&workspace,s.selected_tab)) {
+ // Even identical/empty tabs need a fresh roster to acknowledge landing.
+ // A narrow refresh forces that snapshot without replaying other state.
+ if (!queue((action_t){.kind=A_TAB_REFRESH,.revision=workspace.serial}))
+ workspace_failed("Device busy. Choose the tab again.");
+ }
+ change(); display_unlock();
+}
+void ui_show_machines(void)
+{
+ display_lock();
+ view(MACHINES);
+ display_unlock();
+}
+void ui_machines_replace(const cable_machine_t *rows, int count, const char *selected,
+ const char *previous)
+{
+ (void)previous;
+ display_lock();
+ s.machine_count = !rows || count < 0 ? 0 : count > CABLE_MAX_MACHINES ? CABLE_MAX_MACHINES : count;
+ if (s.machine_count > 0)
+ memcpy(s.machines, rows, (size_t)s.machine_count * sizeof(*rows));
+ COPY(s.selected_machine, selected);
+ change();
+ display_unlock();
+}
+void ui_machines_replace_one(const cable_machine_t *row, const char *selected)
+{
+ if (!row) return;
+ display_lock();
+ for (int i = 0; i < s.machine_count; i++)
+ if (!strcmp(s.machines[i].id, row->id)) {
+ s.machines[i] = *row;
+ break;
+ }
+ COPY(s.selected_machine, selected);
+ change();
+ display_unlock();
+}
+void ui_machines_source(const char *source) { (void)source; }
+void ui_machines_clear(void)
+{
+ display_lock();
+ s.machine_count = 0;
+ change();
+ display_unlock();
+}
+void ui_set_selected_machine(const char *id)
+{
+ display_lock();
+ COPY(s.selected_machine, id);
+ change();
+ display_unlock();
+}
+void ui_machine_selected_ack(const char *id)
+{
+ if (!id || !*id || strlen(id) >= sizeof s.selected_machine) return;
+ display_lock();
+ COPY(s.selected_machine, id);
+ // The host owns actual selection. Its older acknowledgement must not
+ // consume a more recent request that is still waiting for its own reply.
+ if (!strcmp(s.pending_machine, id)) s.pending_machine[0] = 0;
+ change();
+ display_unlock();
+}
+void ui_machine_select_error(const char *id, const char *code, const char *message)
+{
+ (void)code;
+ display_lock();
+ if (!id || !s.pending_machine[0] || strcmp(s.pending_machine, id)) {
+ display_unlock();
+ return;
+ }
+ s.pending_machine[0] = 0;
+ display_unlock();
+ ui_show_error("Machine", message);
+}
+void ui_tick_machine_select(void)
+{
+ display_lock();
+ if (s.pending_machine[0] && (int32_t)(ms() - s.machine_deadline) >= 0) {
+ s.pending_machine[0] = 0;
+ COPY(s.title, "No response");
+ COPY(s.message, "The machine did not answer. Please try again.");
+ view(MESSAGE);
+ }
+ display_unlock();
+}
+void ui_machines_refresh(void)
+{
+ display_lock();
+ change();
+ display_unlock();
+}
+bool ui_selected_machine_is_local(void)
+{
+ return !s.selected_machine[0] || !strcmp(s.selected_machine, cable_client_machine_id());
+}
+void ui_set_reload_waiter(TaskHandle_t task) { atomic_store(&reload_waiter, task); }
+void ui_request_agent_reload(void)
+{
+ atomic_store(&reload_requested, true);
+ TaskHandle_t waiter = atomic_load(&reload_waiter);
+ if (waiter)
+ xTaskNotifyGive(waiter);
+}
+bool ui_take_agent_reload_req(void) { return atomic_exchange(&reload_requested, false); }
+bool ui_peek_agent_reload_req(void) { return atomic_load(&reload_requested); }
+bool ui_scroll_is_reversed(void) { return scroll_reversed; }
+bool ui_take_portal_req(void) { return false; }
+bool ui_take_wifi_retry_req(void) { return false; }
+void ui_set_creating(bool on)
+{
+ display_lock();
+ if (on) {
+ COPY(s.title, "A new thought");
+ COPY(s.message, "Finding its home...");
+ view(MESSAGE);
+ }
+ change();
+ display_unlock();
+}
+void ui_show_error(const char *title, const char *detail)
+{
+ display_lock();
+ COPY(s.title, title);
+ COPY(s.message, detail);
+ view(MESSAGE);
+ display_unlock();
+}
+void ui_carry_state(const cJSON *p)
+{
+ const cJSON *request=cJSON_GetObjectItemCaseSensitive(p,"requestId"),
+ *id=cJSON_GetObjectItemCaseSensitive(p,"carryId"),
+ *source=cJSON_GetObjectItemCaseSensitive(p,"sourceName"),
+ *excerpt=cJSON_GetObjectItemCaseSensitive(p,"excerpt"),
+ *rows=cJSON_GetObjectItemCaseSensitive(p,"rows"),
+ *ttl=cJSON_GetObjectItemCaseSensitive(p,"ttlMs"),
+ *error=cJSON_GetObjectItemCaseSensitive(p,"error");
+ if (!cJSON_IsString(request) || strncmp(request->valuestring,"carry-",6) || !cJSON_IsString(id)) return;
+ char *end=NULL; unsigned long serial=strtoul(request->valuestring+6,&end,10);
+ if (!serial || !end || *end || serial>UINT32_MAX) return;
+ bool ok=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"ok"));
+ if (ok && (!cJSON_IsString(source) || !cJSON_IsString(excerpt) ||
+ !cJSON_IsNumber(rows) || rows->valuedouble!=rows->valueint ||
+ !cJSON_IsNumber(ttl) || ttl->valuedouble!=ttl->valueint || ttl->valueint<1)) return;
+ display_lock();
+ if (ht_carry_reply(&carry,id->valuestring,(uint32_t)serial,ok,
+ cJSON_IsString(source)?source->valuestring:NULL,
+ cJSON_IsString(excerpt)?excerpt->valuestring:NULL,
+ cJSON_IsNumber(rows)?rows->valueint:0,cJSON_IsNumber(ttl)?(uint32_t)ttl->valueint:0,
+ cJSON_IsString(error)?error->valuestring:NULL,ms())) {
+ if (carry.active && s.view==SELECTION) {
+ ht_selection_close(&selection);
+ dispatch((action_t){.kind=A_FIND});
+ } else if (s.view==SELECTION) COPY(selection.error,carry.error);
+ ht_gesture_guard(&gesture,ms()); change();
+ }
+ display_unlock();
+}
+static bool selection_search_fields(const cJSON *p, const char **query, int *match, int *matches)
+{
+ const cJSON *q = cJSON_GetObjectItemCaseSensitive(p,"query"),
+ *m = cJSON_GetObjectItemCaseSensitive(p,"match"), *n = cJSON_GetObjectItemCaseSensitive(p,"matches");
+ *query = NULL; *match = *matches = 0;
+ if (!q) return !m && !n;
+ if (!cJSON_IsString(q) || !q->valuestring[0] || strlen(q->valuestring) > 120 ||
+ !cJSON_IsNumber(m) || !cJSON_IsNumber(n) || m->valuedouble != m->valueint ||
+ n->valuedouble != n->valueint || m->valueint < 0 || n->valueint < 0 || m->valueint > n->valueint) return false;
+ *query = q->valuestring; *match = m->valueint; *matches = n->valueint; return true;
+}
+void ui_voice_search(const cJSON *p)
+{
+ const cJSON *id = cJSON_GetObjectItemCaseSensitive(p,"selectionId"),
+ *agent = cJSON_GetObjectItemCaseSensitive(p,"agentId"),
+ *revision = cJSON_GetObjectItemCaseSensitive(p,"revision"),
+ *excerpt = cJSON_GetObjectItemCaseSensitive(p,"excerpt"),
+ *rows = cJSON_GetObjectItemCaseSensitive(p,"rows");
+ const char *query; int match, matches;
+ if (!cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p,"ok")) || !cJSON_IsString(id) || !cJSON_IsString(agent) ||
+ !cJSON_IsNumber(revision) || revision->valueint < 1 || revision->valuedouble != revision->valueint ||
+ !cJSON_IsNumber(rows) || rows->valuedouble != rows->valueint || !cJSON_IsString(excerpt) ||
+ !selection_search_fields(p,&query,&match,&matches) || !query) return;
+ display_lock();
+ if (s.voice_open && s.voice_waiting && s.voice_search && s.voice_return == SELECTION &&
+ ht_selection_found(&selection,id->valuestring,agent->valuestring,(uint32_t)revision->valueint,
+ excerpt->valuestring,rows->valueint,query,match,matches)) {
+ voice_close(); view(SELECTION); ht_gesture_guard(&gesture,ms());
+ }
+ display_unlock();
+}
+void ui_selection_state(const cJSON *p)
+{
+ const cJSON *request = cJSON_GetObjectItemCaseSensitive(p, "requestId");
+ if (!cJSON_IsString(request) || strncmp(request->valuestring, "pick-", 5)) return;
+ char *end = NULL;
+ unsigned long serial = strtoul(request->valuestring + 5, &end, 10);
+ if (!serial || !end || *end || serial > UINT32_MAX) return;
+ const cJSON *id = cJSON_GetObjectItemCaseSensitive(p, "selectionId"),
+ *revision = cJSON_GetObjectItemCaseSensitive(p, "revision"),
+ *excerpt = cJSON_GetObjectItemCaseSensitive(p, "excerpt"),
+ *rows = cJSON_GetObjectItemCaseSensitive(p, "rows"),
+ *error = cJSON_GetObjectItemCaseSensitive(p, "error");
+ bool ok = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok"));
+ if (ok && (!cJSON_IsNumber(revision) || revision->valueint < 1 ||
+ revision->valuedouble != revision->valueint || !cJSON_IsNumber(rows) ||
+ rows->valuedouble != rows->valueint || !cJSON_IsString(id) || !cJSON_IsString(excerpt))) return;
+ const char *query; int match, matches;
+ if (ok && !selection_search_fields(p,&query,&match,&matches)) return;
+ if (!ok) { query = NULL; match = matches = 0; }
+ display_lock();
+ if (ht_selection_reply_search(&selection, (uint32_t)serial, cJSON_IsString(id) ? id->valuestring : NULL, ok,
+ cJSON_IsNumber(revision) ? (uint32_t)revision->valueint : 0,
+ cJSON_IsString(excerpt) ? excerpt->valuestring : "", cJSON_IsNumber(rows) ? rows->valueint : 0,
+ cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "extending")),
+ cJSON_IsString(error) ? error->valuestring : NULL, query, match, matches, ms())) change();
+ display_unlock();
+}
+
+static bool form_page(const cJSON *p, ht_form_page_t *page)
+{
+#define FORM_TEXT(field) do { const cJSON *v = cJSON_GetObjectItemCaseSensitive(p, #field); \
+ if (cJSON_IsString(v)) COPY(page->field, v->valuestring); } while (0)
+ FORM_TEXT(title); FORM_TEXT(label); FORM_TEXT(detail); FORM_TEXT(previous); FORM_TEXT(next);
+ FORM_TEXT(error); FORM_TEXT(status); FORM_TEXT(action); FORM_TEXT(query);
+#undef FORM_TEXT
+ page->active = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "active"));
+ page->busy = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "busy"));
+ page->enabled = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "enabled"));
+ const cJSON *revision = cJSON_GetObjectItemCaseSensitive(p, "revision"),
+ *position = cJSON_GetObjectItemCaseSensitive(p, "position"),
+ *total = cJSON_GetObjectItemCaseSensitive(p, "total");
+ if (page->active && (!cJSON_IsNumber(revision) || revision->valuedouble < 0 || revision->valuedouble > INT32_MAX ||
+ !cJSON_IsNumber(position) || position->valuedouble < 0 || position->valuedouble > INT32_MAX ||
+ !cJSON_IsNumber(total) || total->valuedouble < 0 || total->valuedouble > INT32_MAX)) return false;
+ page->revision = cJSON_IsNumber(revision) ? (uint32_t)revision->valueint : 0;
+ page->position = cJSON_IsNumber(position) ? position->valueint : 0;
+ page->total = cJSON_IsNumber(total) ? total->valueint : 0;
+ page->can_query = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "canQuery"));
+ return true;
+}
+static bool draft_page(const cJSON *p, ht_draft_page_t *page)
+{
+ const cJSON *id = cJSON_GetObjectItemCaseSensitive(p, "id"),
+ *revision = cJSON_GetObjectItemCaseSensitive(p, "revision"),
+ *position = cJSON_GetObjectItemCaseSensitive(p, "position"),
+ *total = cJSON_GetObjectItemCaseSensitive(p, "total"),
+ *text_ = cJSON_GetObjectItemCaseSensitive(p, "text"),
+ *agent = cJSON_GetObjectItemCaseSensitive(p, "agentId");
+ if (!cJSON_IsString(id) || !id->valuestring[0] || strlen(id->valuestring) >= sizeof page->id ||
+ !cJSON_IsNumber(revision) || revision->valuedouble < 1 || revision->valuedouble > INT32_MAX ||
+ revision->valuedouble != revision->valueint) return false;
+ COPY(page->id, id->valuestring); page->revision = (uint32_t)revision->valueint;
+ page->active = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "active"));
+ const cJSON *error = cJSON_GetObjectItemCaseSensitive(p, "error");
+ if (cJSON_IsString(error)) COPY(page->error, error->valuestring);
+ if (!page->active) return true;
+ if (!cJSON_IsNumber(position) || !cJSON_IsNumber(total) ||
+ position->valuedouble != position->valueint || total->valuedouble != total->valueint ||
+ position->valueint < 1 || position->valueint > total->valueint || total->valueint > 128 ||
+ !cJSON_IsString(text_) || !text_->valuestring[0] || strlen(text_->valuestring) > 480 ||
+ !cJSON_IsString(agent) || !agent->valuestring[0] || strlen(agent->valuestring) >= sizeof page->agent) return false;
+ COPY(page->text, text_->valuestring); COPY(page->agent, agent->valuestring);
+ const cJSON *name = cJSON_GetObjectItemCaseSensitive(p, "name"),
+ *context = cJSON_GetObjectItemCaseSensitive(p, "context");
+ COPY(page->name, cJSON_IsString(name) ? name->valuestring : "Harness");
+ if (cJSON_IsString(context)) COPY(page->context, context->valuestring);
+ page->position = position->valueint; page->total = total->valueint;
+ page->can_undo = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "canUndo"));
+ page->locked = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "locked"));
+ page->can_send = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "canSend")) &&
+ ht_can_display(page->text, &ht_mono_20, 348, 512);
+ return true;
+}
+void ui_voice_draft(const cJSON *p)
+{
+ ht_draft_page_t page = {0};
+ if (!draft_page(p, &page) || !page.active || !cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok"))) return;
+ display_lock();
+ if (!s.voice_open || !s.voice_waiting || !s.voice_review ||
+ (s.voice_return == DRAFT && (!draft.page.active || strcmp(page.id, draft.page.id) ||
+ draft.page.revision != s.voice_draft_revision || page.revision <= s.voice_draft_revision))) {
+ display_unlock(); return;
+ }
+ voice_close(); ht_draft_open(&draft, &page, draft_emit, NULL);
+ view(DRAFT); ht_gesture_guard(&gesture, ms());
+ display_unlock();
+}
+void ui_draft_state(const cJSON *p)
+{
+ const cJSON *request = cJSON_GetObjectItemCaseSensitive(p, "requestId");
+ if (!cJSON_IsString(request) || strncmp(request->valuestring, "draft-", 6)) return;
+ char *end = NULL; unsigned long serial = strtoul(request->valuestring+6, &end, 10);
+ if (!serial || !end || *end || serial > UINT32_MAX) return;
+ ht_draft_page_t page = {0};
+ if (!draft_page(p, &page)) return;
+ bool ok = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok"));
+ display_lock();
+ ht_draft_op_t op = draft.op; int direction = draft.delta;
+ if (ht_draft_reply(&draft, page.id, (uint32_t)serial, ok, &page)) {
+ if (!draft.page.active) {
+ const cJSON *carried = cJSON_GetObjectItemCaseSensitive(p, "carryId");
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "sent")) &&
+ cJSON_IsString(carried) && !strcmp(carried->valuestring, carry.id)) ht_carry_close(&carry);
+ if (!ok) { COPY(s.title, "Draft"); copy(s.message, sizeof page.error, page.error); view(MESSAGE); }
+ else view(HOME);
+ } else if (s.view == DRAFT || s.view == DRAFT_OPTIONS) {
+ if (ok && op == HT_DRAFT_MOVE) {
+ s.offset = direction < 0 ? question_rows(page.text)-5 : 0;
+ if (s.offset < 0) s.offset = 0;
+ } else if (ok && op == HT_DRAFT_UNDO) s.offset = 0;
+ input_cancel(); change();
+ }
+ ht_gesture_guard(&gesture, ms());
+ }
+ display_unlock();
+}
+void ui_form_state(const cJSON *p)
+{
+ const cJSON *request = cJSON_GetObjectItemCaseSensitive(p, "requestId"),
+ *id = cJSON_GetObjectItemCaseSensitive(p, "formId");
+ if (!cJSON_IsString(request) || strncmp(request->valuestring, "form-", 5) || !cJSON_IsString(id)) return;
+ char *end = NULL;
+ unsigned long serial = strtoul(request->valuestring + 5, &end, 10);
+ if (!serial || !end || *end || serial > UINT32_MAX) return;
+ ht_form_page_t page = {0};
+ if (!form_page(p, &page)) return;
+ display_lock();
+ bool ok=cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok"));
+ if (form.pending && form.request==(uint32_t)serial && !strcmp(form.id,id->valuestring) &&
+ (form.pending_op!=HT_FORM_STATE || !ok))
+ ESP_LOGI("habitat","picker reply req=%lu ok=%d active=%d query=%d busy=%d",
+ serial,ok,page.active,page.can_query,page.busy);
+ if (ht_form_reply(&form, id->valuestring, (uint32_t)serial,
+ ok, &page, ms())) {
+ if (!form.id[0]) { ht_gesture_guard(&gesture, ms()); view(HOME); }
+ else if (s.view == FORM) change();
+ }
+ display_unlock();
+}
+void ui_voice_question(const cJSON *p)
+{
+ const cJSON *agent=cJSON_GetObjectItemCaseSensitive(p,"agentId"),
+ *token=cJSON_GetObjectItemCaseSensitive(p,"token"),
+ *index=cJSON_GetObjectItemCaseSensitive(p,"questionIndex"),
+ *draft=cJSON_GetObjectItemCaseSensitive(p,"draftId"),
+ *text=cJSON_GetObjectItemCaseSensitive(p,"text");
+ display_lock();
+ if (!s.voice_open || !s.voice_waiting || !question_view(s.voice_return)) { display_unlock(); return; }
+ if (!s.q.valid || s.q.revision!=s.voice_question_revision ||
+ !cJSON_IsString(agent) || strcmp(agent->valuestring,s.q.agent) ||
+ !cJSON_IsString(token) || strcmp(token->valuestring,s.q.token) ||
+ !cJSON_IsNumber(index) || index->valuedouble!=s.voice_question_index || s.q.index!=s.voice_question_index) {
+ voice_close(); COPY(s.title,"Question changed"); COPY(s.message,"Open the alert again."); view(MESSAGE);
+ display_unlock(); return;
+ }
+ question_item_t *q=&s.q.item[s.q.index];
+ voice_close();
+ if (!q->can_text || !cJSON_IsString(draft) || !draft->valuestring[0] || strlen(draft->valuestring)>=sizeof q->draft ||
+ !cJSON_IsString(text) || !text->valuestring[0] || strlen(text->valuestring)>1200 ||
+ !ht_can_display(text->valuestring,&ht_mono_20,348,1200)) {
+ q->draft[0]=q->answer[0]=0; q->selected=0;
+ COPY(s.q.speech_error,"Cannot show that answer. Say it again or use the terminal."); view(QUESTION);
+ } else {
+ COPY(q->draft,draft->valuestring); COPY(q->answer,text->valuestring); q->selected=0;
+ s.q.speech_error[0]=0; view(ANSWER_REVIEW);
+ }
+ ht_gesture_guard(&gesture,ms());
+ display_unlock();
+}
+void ui_voice_form(const cJSON *p)
+{
+ const cJSON *id = cJSON_GetObjectItemCaseSensitive(p, "formId");
+ if (!cJSON_IsString(id)) return;
+ ht_form_page_t page = {0};
+ if (!form_page(p, &page)) return;
+ display_lock();
+ if (!s.voice_open || !s.voice_waiting || s.voice_return != FORM || strcmp(form.id, id->valuestring)) {
+ display_unlock(); return;
+ }
+ voice_close();
+ if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok")) && !page.active) {
+ ht_form_reset(&form); view(HOME);
+ } else {
+ if (page.active) form.page = page;
+ else COPY(form.page.error, page.error[0] ? page.error : "Say the name again.");
+ form.poll = ms() + (form.page.error[0] ? 6000 : 1000);
+ view(FORM);
+ }
+ ht_gesture_guard(&gesture, ms());
+ display_unlock();
+}
+void ui_visit_state(const cJSON *p)
+{
+ const cJSON *request = cJSON_GetObjectItemCaseSensitive(p, "requestId"),
+ *id = cJSON_GetObjectItemCaseSensitive(p, "visitId"),
+ *label = cJSON_GetObjectItemCaseSensitive(p, "label"),
+ *agent = cJSON_GetObjectItemCaseSensitive(p, "agentId"),
+ *error = cJSON_GetObjectItemCaseSensitive(p, "error"),
+ *note = cJSON_GetObjectItemCaseSensitive(p, "note");
+ if (!cJSON_IsString(request) || strncmp(request->valuestring, "visit-", 6) || !cJSON_IsString(id)) return;
+ char *end = NULL;
+ unsigned long serial = strtoul(request->valuestring + 6, &end, 10);
+ if (!serial || !end || *end || serial > UINT32_MAX) return;
+ bool ok = cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "ok"));
+ if (ok && (!cJSON_IsString(agent) || !agent->valuestring[0] || strlen(agent->valuestring) >= ID_MAX)) return;
+ display_lock();
+ bool inspect=visit.op==HT_VISIT_OPEN;
+ bool latest=visit.op==HT_VISIT_LATEST;
+ if (ht_visit_reply(&visit, id->valuestring, (uint32_t)serial,
+ cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(p, "active")),
+ cJSON_IsString(label) ? label->valuestring : "")) {
+ s.pending_focus[0] = 0;
+ if (ok) {
+ int i = find(agent->valuestring);
+ if (i >= 0) {
+ input_cancel(); s.active = i;
+ if (inspect && visit.available && is_question(agent->valuestring)) open_question();
+ else view(HOME);
+ } else {
+ COPY(s.pending_focus, agent->valuestring);
+ COPY(s.title, "On your desktop");
+ COPY(s.message, "Waiting for that pane...");
+ view(MESSAGE);
+ }
+ if (cJSON_IsString(note) && note->valuestring[0]) {
+ COPY(s.title, "Returned"); COPY(s.message, note->valuestring); view(MESSAGE);
+ }
+ } else {
+ if (latest) COPY(s.title,"Latest output");
+ else COPY(s.title,"Visit");
+ COPY(s.message, cJSON_IsString(error) ? error->valuestring : "Open the alert again.");
+ view(MESSAGE);
+ }
+ change();
+ }
+ display_unlock();
+}
+
+void ui_cable_toast(const char *message)
+{
+ display_lock();
+ // General desktop notices must not dismiss a live recording or routing request.
+ if (s.voice_open) {
+ display_unlock();
+ return;
+ }
+ display_unlock();
+ ui_show_error("Harness", message);
+}
+void ui_voice_error(const char *message)
+{
+ display_lock();
+ if (!s.voice_open || !s.voice_waiting) {
+ display_unlock();
+ return;
+ }
+ voice_close();
+ if (s.voice_search && selection.active) {
+ COPY(selection.error, message); view(SELECTION);
+ } else if (s.voice_return == DRAFT && draft.page.active) {
+ COPY(draft.page.error, message); draft.failed = true; view(DRAFT);
+ } else if (question_view(s.voice_return) && s.q.valid && s.q.revision==s.voice_question_revision) {
+ COPY(s.q.speech_error,message); view(s.voice_return);
+ } else if (s.voice_return == FORM && form.id[0]) {
+ COPY(form.page.error, message); form.poll = ms() + 6000; view(FORM);
+ } else {
+ COPY(s.title, "Voice"); COPY(s.message, message); view(MESSAGE);
+ }
+ ht_gesture_guard(&gesture, ms());
+ display_unlock();
+}
+void ui_show_connecting(const char *step) { ui_show_error("Connecting", step); }
+void ui_enter_remote_offline(void)
+{
+ ui_show_error("Machine offline", "Open Harness on that computer.");
+}
+void ui_enter_link_guide(void)
+{
+ ui_show_error(
+ "Link this machine",
+ "On that computer:\nharness link create\n\nOn this computer:\nharness link import");
+}
+void ui_leave_remote_offline_loading(void) { ui_enter_boot_loading(); }
+void ui_leave_error_screen(void) { ui_home_overview(); }
+void ui_show_pairing(const char *code, int seconds)
+{
+ (void)seconds;
+ ui_show_error("Pair device", code);
+}
+void ui_show_e2ee_pair(const char *code, int seconds)
+{
+ (void)seconds;
+ ui_show_error("Pair machine", code);
+}
+void ui_show_e2ee_paired(const char *fingerprint) { ui_show_error("Machine paired", fingerprint); }
+void ui_show_unpaired(void) { ui_show_error("Connect Harness", "Plug into your computer."); }
+void ui_show_ota_restarting(void) { ui_show_error("Update ready", "Restarting..."); }
+void ui_ota_boot_show(const char *version)
+{
+ audio_client_abort();
+ display_lock();
+ voice_close();
+ display_unlock();
+ ui_show_error("Updating", version);
+ display_lock();
+ s.view = OTA;
+ change();
+ display_unlock();
+}
+void ui_ota_boot_pct(int percent)
+{
+ display_lock();
+ snprintf(s.message, sizeof(s.message), "Writing firmware\n\n%d%%\n\nKeep the cable connected.",
+ percent);
+ change();
+ display_unlock();
+}
+bool ui_voice_is_recording(void) { return audio_client_recording(); }
+bool ui_voice_is_active(void) { return audio_client_active(); }
+uint32_t ui_voice_start_tick(void) { return s.voice_started; }
+void ui_voice_start(void)
+{
+ display_lock();
+ action_t a = {.kind = A_VOICE};
+ if ((s.view == HOME || s.view == AGENT) && active())
+ COPY(a.id, active()->id);
+ dispatch(a);
+ display_unlock();
+}
+void ui_voice_start_goal(void)
+{
+ display_lock();
+ action_t a = {.kind = A_VOICE, .value = 1};
+ if ((s.view == HOME || s.view == AGENT) && active())
+ COPY(a.id, active()->id);
+ dispatch(a);
+ display_unlock();
+}
+void ui_voice_stop(void)
+{
+ display_lock();
+ dispatch((action_t){.kind = A_VOICE_STOP});
+ display_unlock();
+}
+void ui_voice_routed(bool auto_sent, bool need_new, const char *route, const char *id,
+ const char *name, double confidence)
+{
+ (void)name;
+ (void)confidence;
+ display_lock();
+ if (!s.voice_open || !s.voice_waiting || s.voice_review || s.voice_search || s.voice_return == DRAFT ||
+ s.voice_return == FORM || question_view(s.voice_return)) {
+ display_unlock();
+ return;
+ }
+ if (auto_sent && s.voice_carry) ht_carry_close(&carry);
+ voice_close();
+ if (!need_new && id && *id) {
+ int i = find(id);
+ if (i >= 0)
+ s.active = i;
+ else
+ COPY(s.pending_focus, id);
+ view(AGENT);
+ } else
+ view(HOME);
+ display_unlock();
+ if (!auto_sent && route && *route && id && *id)
+ cable_client_voice_confirm(route, id);
+}
+void ui_voice_route_abort(void)
+{
+ display_lock();
+ dispatch((action_t){.kind = A_VOICE_ABORT});
+ display_unlock();
+}
+void ui_voice_quota_status(int seconds)
+{
+ (void)seconds; /* Server still enforces quota; exceeded immediately aborts capture below. */
+}
+void ui_voice_quota_exceeded(void)
+{
+ ui_voice_route_abort();
+ ui_cable_toast("Voice allowance reached.");
+}
+void ui_stop_active_turn(void)
+{
+ display_lock();
+ if (!s.locked && active() && active()->busy) {
+ COPY(s.stop_agent, active()->id);
+ view(STOP);
+ }
+ display_unlock();
+}
+void ui_boot_pressed(void)
+{
+ display_lock();
+ if (!s.locked) {
+ if (s.voice_open || audio_client_active()) {
+ dispatch((action_t){.kind = A_VOICE_ABORT});
+ } else if (s.view == AGENT && active() && active()->busy) {
+ COPY(s.stop_agent, active()->id);
+ view(STOP);
+ } else
+ view(HOME);
+ }
+ display_unlock();
+}
+void ui_lock_init_gate(void)
+{
+ display_lock();
+ s.locked = config_lock_enabled();
+ change();
+ display_unlock();
+}
+void ui_lock_setup(void)
+{
+ display_lock();
+ if (config_lock_enabled()) {
+ s.locked = true;
+ change();
+ } else {
+ COPY(s.title, "Pattern setup");
+ COPY(s.message, "Pattern editing is available in the standard firmware.");
+ view(MESSAGE);
+ }
+ display_unlock();
+}
+bool ui_lock_active(void) { return s.locked; }
+void ui_log_state_if_changed(void) {}
+
+#ifdef DEVICE_OCTOPUS_BENCH
+// Local fixtures only. No setting is saved and no action is sent to the desktop.
+void habitat_bench_prepare(bool animate)
+{
+ (void)animate; // The benchmark switches only the body clock in octopus.c.
+ display_lock();
+ habitat_touch_cancel();
+ s.quiet = s.nap = s.locked = s.focus_face = s.straight_title = false;
+ s.pet_pose = 0;
+ s.notice_count = 0;
+ s.tab_count = 0;
+ s.connected = true;
+ s.loading = false;
+ s.voice_open = false;
+ memset(&s.q, 0, sizeof s.q);
+ memset(&octopus_motion, 0, sizeof octopus_motion);
+ view(HOME);
+ display_bump_activity();
+ display_wake();
+ display_unlock();
+}
+void habitat_bench_reader(void)
+{
+ display_lock();
+ dispatch((action_t){.kind = A_READER});
+ display_unlock();
+}
+void habitat_bench_question(const cJSON *questions)
+{
+ display_lock();
+ s.q.loading = s.q.pending = false;
+ s.q.error[0] = 0;
+ COPY(s.q.name, "Benchmark question");
+ question_load(questions);
+ view(QUESTION);
+ display_unlock();
+}
+bool habitat_bench_pressed(void)
+{
+ return s.touch_down && octopus_motion.reaction.pose.pressed;
+}
+#endif
diff --git a/devices/harness-device/firmware/main/ui/habitat/visit.c b/devices/harness-device/firmware/main/ui/habitat/visit.c
new file mode 100644
index 000000000..b0b52ea40
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/visit.c
@@ -0,0 +1,64 @@
+#include "visit.h"
+#include <stdio.h>
+#include <string.h>
+
+static bool send(ht_visit_t *s, ht_visit_op_t op, uint32_t now)
+{
+ ht_visit_command_t c = {op, s->id, s->agent, ++s->serial};
+ if (!s->emit || !s->emit(&c, s->ctx)) return false;
+ s->request = c.request;
+ s->op = op;
+ s->pending = true;
+ s->deadline = now + 3500;
+ return true;
+}
+void ht_visit_close(ht_visit_t *s)
+{
+ if (s->id[0] && s->emit) {
+ ht_visit_command_t c = {HT_VISIT_CANCEL, s->id, s->agent, ++s->serial};
+ s->emit(&c, s->ctx);
+ }
+ uint32_t serial = s->serial;
+ memset(s, 0, sizeof(*s));
+ s->serial = serial;
+}
+static bool begin(ht_visit_t *s, const char *id, const char *agent, uint32_t now,
+ ht_visit_emit_t emit, void *ctx, ht_visit_op_t op)
+{
+ if (s->pending || !id || !*id || !agent || !*agent || strlen(id) >= sizeof s->id || strlen(agent) >= sizeof s->agent) return false;
+ if (strcmp(id, s->id)) ht_visit_close(s);
+ char previous_agent[sizeof s->agent];
+ memcpy(previous_agent, s->agent, sizeof previous_agent);
+ snprintf(s->id, sizeof s->id, "%s", id);
+ snprintf(s->agent, sizeof s->agent, "%s", agent);
+ s->emit = emit; s->ctx = ctx;
+ if (send(s, op, now)) return true;
+ memcpy(s->agent, previous_agent, sizeof s->agent);
+ return false;
+}
+bool ht_visit_open(ht_visit_t *s, const char *id, const char *agent, uint32_t now, ht_visit_emit_t emit, void *ctx)
+{
+ return begin(s,id,agent,now,emit,ctx,HT_VISIT_OPEN);
+}
+bool ht_visit_latest(ht_visit_t *s, const char *id, const char *agent, uint32_t now, ht_visit_emit_t emit, void *ctx)
+{
+ return begin(s,id,agent,now,emit,ctx,HT_VISIT_LATEST);
+}
+bool ht_visit_back(ht_visit_t *s, uint32_t now)
+{
+ return s->available && !s->pending && send(s, HT_VISIT_BACK, now);
+}
+bool ht_visit_reply(ht_visit_t *s, const char *id, uint32_t request, bool available, const char *label)
+{
+ if (!s->pending || !id || strcmp(id, s->id) || request != s->request) return false;
+ s->pending = false; s->available = available;
+ snprintf(s->label, sizeof s->label, "%s", label ? label : "");
+ if (!available) { s->id[0] = 0; s->agent[0] = 0; }
+ return true;
+}
+bool ht_visit_tick(ht_visit_t *s, uint32_t now)
+{
+ if (!s->pending || (int32_t)(now - s->deadline) < 0) return false;
+ ht_visit_close(s);
+ return true;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/visit.h b/devices/harness-device/firmware/main/ui/habitat/visit.h
new file mode 100644
index 000000000..22f0b88b0
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/visit.h
@@ -0,0 +1,21 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum { HT_VISIT_OPEN, HT_VISIT_BACK, HT_VISIT_CANCEL, HT_VISIT_LATEST } ht_visit_op_t;
+typedef struct { ht_visit_op_t op; const char *id, *agent; uint32_t request; } ht_visit_command_t;
+typedef bool (*ht_visit_emit_t)(const ht_visit_command_t *, void *);
+typedef struct {
+ char id[48], agent[64], label[80];
+ uint32_t serial, request, deadline;
+ bool pending, available;
+ ht_visit_op_t op;
+ ht_visit_emit_t emit;
+ void *ctx;
+} ht_visit_t;
+bool ht_visit_open(ht_visit_t *, const char *id, const char *agent, uint32_t now, ht_visit_emit_t, void *);
+bool ht_visit_latest(ht_visit_t *, const char *id, const char *agent, uint32_t now, ht_visit_emit_t, void *);
+bool ht_visit_back(ht_visit_t *, uint32_t now);
+void ht_visit_close(ht_visit_t *);
+bool ht_visit_reply(ht_visit_t *, const char *id, uint32_t request, bool available, const char *label);
+bool ht_visit_tick(ht_visit_t *, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/habitat/workspace.c b/devices/harness-device/firmware/main/ui/habitat/workspace.c
new file mode 100644
index 000000000..1a94782eb
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/workspace.c
@@ -0,0 +1,73 @@
+#include "workspace.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+void ht_workspace_cancel_touch(ht_workspace_t *w)
+{
+ w->touching = w->moved = w->cancelled = false;
+}
+void ht_workspace_touch(ht_workspace_t *w, int index, int count, int x, int y, uint32_t now)
+{
+ ht_workspace_cancel_touch(w);
+ if (w->phase != HT_WORKSPACE_IDLE || index < 0 || index >= count || count > 24) return;
+ w->touching = true; w->x = x; w->y = y; w->origin = w->choice = index;
+ w->count = count; w->began = now;
+}
+bool ht_workspace_move(ht_workspace_t *w, int x, int y, unsigned axis, uint32_t now)
+{
+ if (!w->touching || w->cancelled) return false;
+ bool before = w->moved;
+ int choice = w->choice;
+ if (axis == 1 || abs(y - w->y) > 64 || now - w->began >= 5000) {
+ w->cancelled = true; return true;
+ }
+ if (axis == 2) {
+ w->moved = true;
+ // Match the pane swipe direction: pulling left reveals the next tab.
+ int target = w->origin + (w->x - x) / 56;
+ w->choice = target < 0 ? 0 : target >= w->count ? w->count - 1 : target;
+ }
+ return before != w->moved || choice != w->choice;
+}
+int ht_workspace_release(ht_workspace_t *w, int x, int y, unsigned axis, uint32_t now)
+{
+ ht_workspace_move(w,x,y,axis,now);
+ int selected = w->touching && w->moved && !w->cancelled && now - w->began >= 25 &&
+ w->choice != w->origin ? w->choice : -1;
+ ht_workspace_cancel_touch(w);
+ return selected;
+}
+void ht_workspace_cancel_request(ht_workspace_t *w)
+{
+ w->pending[0] = 0; w->phase = HT_WORKSPACE_IDLE; w->deadline = 0;
+}
+bool ht_workspace_request(ht_workspace_t *w, const char *id, uint32_t now)
+{
+ if (w->phase != HT_WORKSPACE_IDLE || !id || !*id || strlen(id) >= sizeof w->pending) return false;
+ snprintf(w->pending,sizeof w->pending,"%s",id);
+ w->serial++; if (!w->serial) w->serial++;
+ w->deadline = now + 8000; w->phase = HT_WORKSPACE_WAIT_TAB;
+ return true;
+}
+bool ht_workspace_selected(ht_workspace_t *w, const char *id)
+{
+ if (w->phase != HT_WORKSPACE_WAIT_TAB || !id || strcmp(w->pending,id)) return false;
+ w->phase = HT_WORKSPACE_REFRESH; return true;
+}
+bool ht_workspace_refresh(ht_workspace_t *w, uint32_t serial, uint32_t generation)
+{
+ if (w->phase != HT_WORKSPACE_REFRESH || w->serial != serial) return false;
+ w->floor = generation; w->phase = HT_WORKSPACE_WAIT_SNAPSHOT; return true;
+}
+bool ht_workspace_applied(ht_workspace_t *w, const char *id, uint32_t generation)
+{
+ if (w->phase != HT_WORKSPACE_WAIT_SNAPSHOT || !id || strcmp(w->pending,id) ||
+ (int32_t)(generation - w->floor) <= 0) return false;
+ w->phase = HT_WORKSPACE_READY; return true;
+}
+bool ht_workspace_tick(ht_workspace_t *w, uint32_t now)
+{
+ if (w->phase == HT_WORKSPACE_IDLE || (int32_t)(now - w->deadline) < 0) return false;
+ ht_workspace_cancel_request(w); return true;
+}
diff --git a/devices/harness-device/firmware/main/ui/habitat/workspace.h b/devices/harness-device/firmware/main/ui/habitat/workspace.h
new file mode 100644
index 000000000..d20d4a53f
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/habitat/workspace.h
@@ -0,0 +1,26 @@
+#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+
+typedef enum { HT_WORKSPACE_IDLE, HT_WORKSPACE_WAIT_TAB, HT_WORKSPACE_REFRESH,
+ HT_WORKSPACE_WAIT_SNAPSHOT, HT_WORKSPACE_READY } ht_workspace_phase_t;
+typedef struct {
+ bool touching, moved, cancelled;
+ int x, y, origin, choice, count;
+ uint32_t began;
+ char pending[64];
+ uint32_t serial, deadline, floor;
+ ht_workspace_phase_t phase;
+} ht_workspace_t;
+
+void ht_workspace_touch(ht_workspace_t *, int index, int count, int x, int y, uint32_t now);
+bool ht_workspace_move(ht_workspace_t *, int x, int y, unsigned axis, uint32_t now);
+// -1 means no navigation; the UI handles a stationary tap by opening its list.
+int ht_workspace_release(ht_workspace_t *, int x, int y, unsigned axis, uint32_t now);
+void ht_workspace_cancel_touch(ht_workspace_t *);
+bool ht_workspace_request(ht_workspace_t *, const char *id, uint32_t now);
+bool ht_workspace_selected(ht_workspace_t *, const char *id);
+bool ht_workspace_refresh(ht_workspace_t *, uint32_t serial, uint32_t generation);
+bool ht_workspace_applied(ht_workspace_t *, const char *id, uint32_t generation);
+void ht_workspace_cancel_request(ht_workspace_t *);
+bool ht_workspace_tick(ht_workspace_t *, uint32_t now);
diff --git a/devices/harness-device/firmware/main/ui/panel_dial.c b/devices/harness-device/firmware/main/ui/panel_dial.c
index 9a8fdd844..b7745e31b 100644
--- a/devices/harness-device/firmware/main/ui/panel_dial.c
+++ b/devices/harness-device/firmware/main/ui/panel_dial.c
@@ -13,6 +13,7 @@
#include "board.h"
#include "board_pins.h"
#include "display.h"
+#include "ui_perf.h"
#include "driver/spi_master.h"
#include "esp_heap_caps.h"
@@ -63,6 +64,7 @@ static const co5300_lcd_init_cmd_t s_co5300_init_cmds[] = {
// has started, so it is always valid by then).
static bool on_color_done(esp_lcd_panel_io_handle_t io, esp_lcd_panel_io_event_data_t *e, void *ctx)
{
+ ui_perf_flush_done();
if (s_disp) lv_display_flush_ready(s_disp);
return false;
}
@@ -74,6 +76,7 @@ static void lvgl_flush(lv_display_t *disp, const lv_area_t *area, uint8_t *px)
// Asleep: the panel is off — don't push pixels (events still update the offscreen tree and are
// shown on wake). Ack immediately so LVGL doesn't block waiting for the (skipped) DMA done.
if (display_is_asleep()) { lv_display_flush_ready(disp); return; }
+ ui_perf_flush((size_t)(area->x2-area->x1+1)*(area->y2-area->y1+1)*2);
esp_lcd_panel_draw_bitmap(s_panel, area->x1, area->y1, area->x2 + 1, area->y2 + 1, px);
}
diff --git a/devices/harness-device/firmware/main/ui/ui_perf.c b/devices/harness-device/firmware/main/ui/ui_perf.c
new file mode 100644
index 000000000..c10497810
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/ui_perf.c
@@ -0,0 +1,211 @@
+// Same scripted UI API calls on both renderers, before the live cable session starts.
+#include "ui_perf.h"
+#ifdef DEVICE_PERF_BENCH
+#include "ui_screens.h"
+#include "display.h"
+#include "touch.h"
+#include "audio_probe.h"
+#ifdef DEVICE_HABITAT
+#include "habitat/runtime.h"
+#endif
+#include "esp_timer.h"
+#include "esp_log.h"
+#include "esp_heap_caps.h"
+#include "freertos/FreeRTOS.h"
+#include "freertos/task.h"
+#include "freertos/portmacro.h"
+#include "cJSON.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+static portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;
+static uint32_t total_bytes, flushes;
+static int64_t last_done;
+int64_t ui_perf_last_done(void)
+{
+ portENTER_CRITICAL(&mux);
+ int64_t done = last_done;
+ portEXIT_CRITICAL(&mux);
+ return done;
+}
+void ui_perf_flush(size_t bytes)
+{
+ portENTER_CRITICAL(&mux);
+ total_bytes += (uint32_t)bytes;
+ flushes++;
+ portEXIT_CRITICAL(&mux);
+}
+void ui_perf_flush_done(void)
+{
+ portENTER_CRITICAL_ISR(&mux);
+ last_done = esp_timer_get_time();
+ portEXIT_CRITICAL_ISR(&mux);
+}
+#ifndef DEVICE_OCTOPUS_BENCH
+typedef struct {
+ uint32_t api, visible, bytes, flushes, frames;
+} sample_t;
+static void counters(uint32_t *bytes, uint32_t *n, int64_t *done)
+{
+ portENTER_CRITICAL(&mux);
+ *bytes = total_bytes;
+ *n = flushes;
+ *done = last_done;
+ portEXIT_CRITICAL(&mux);
+}
+static int cmp(const void *a, const void *b)
+{
+ uint32_t x = *(const uint32_t *)a, y = *(const uint32_t *)b;
+ return (x > y) - (x < y);
+}
+static void report(const char *name, sample_t *s, int n)
+{
+ uint32_t us[48], api[48], bytes[48], count[48];
+ int missed = 0;
+ for (int i = 0; i < n; i++) {
+ us[i] = s[i].visible;
+ api[i] = s[i].api;
+ bytes[i] = s[i].bytes;
+ count[i] = s[i].flushes;
+ if (!s[i].visible)
+ missed++;
+ }
+ qsort(us, n, sizeof(*us), cmp);
+ qsort(api, n, sizeof(*api), cmp);
+ qsort(bytes, n, sizeof(*bytes), cmp);
+ qsort(count, n, sizeof(*count), cmp);
+ ESP_LOGI("PERF",
+ "case=%s n=%d api_p50_us=%lu api_p95_us=%lu visible_p50_us=%lu visible_p95_us=%lu "
+ "visible_max_us=%lu bytes_p50=%lu flush_p50=%lu no_frame=%d",
+ name, n, (unsigned long)api[n / 2], (unsigned long)api[n * 95 / 100],
+ (unsigned long)us[n / 2], (unsigned long)us[n * 95 / 100], (unsigned long)us[n - 1],
+ (unsigned long)bytes[n / 2], (unsigned long)count[n / 2], missed);
+}
+static void run_case(const char *name, int kind)
+{
+ sample_t samples[40];
+ cJSON *qs = cJSON_Parse("[{\"key\":\"direction\",\"q\":\"Which direction should we "
+ "take?\",\"multi\":false,\"options\":[\"Keep it very quiet\",\"A "
+ "little character\",\"Show both directions\"]}]");
+ for (int i = 0; i < 40; i++) {
+ if (kind == 2)
+ cJSON_SetValuestring(cJSON_GetObjectItem(cJSON_GetArrayItem(qs, 0), "q"),
+ (i & 1) ? "Which direction should we take?"
+ : "What should we explore next?");
+ uint32_t b0, f0, b1, f1;
+ int64_t done, ignored;
+#ifdef DEVICE_HABITAT
+ habitat_perf_t before, after;
+ habitat_perf_get(&before);
+#endif
+ counters(&b0, &f0, &ignored);
+ int64_t t = esp_timer_get_time();
+ if (kind == 0)
+ ui_fleet_set(16 + ((i + 1) & 1), true);
+ else if (kind == 1) {
+ char id[32];
+ snprintf(id, sizeof(id), "perf-%d", i & 1);
+ ui_focus_project(id);
+ } else if (kind == 2) {
+ char req[32];
+ snprintf(req, sizeof(req), "perf-q-%d", i);
+ ui_question_show("perf-0", "Welcome screen", "M2", req, qs);
+ } else {
+ ui_projects_bulk_begin();
+ for (int j = 0; j < 16; j++) {
+ char id[32], title[40];
+ snprintf(id, sizeof(id), "perf-%d", j);
+ snprintf(title, sizeof(title), "Thread %02d %s", j, (i & 1) ? "bravo" : "alpha");
+ ui_project_set_name(id, title);
+ }
+ ui_projects_bulk_end();
+ }
+ samples[i].api = (uint32_t)(esp_timer_get_time() - t);
+ // Settling is outside the measured interval. Completion is recorded in the SPI DMA ISR.
+ vTaskDelay(pdMS_TO_TICKS(160));
+ counters(&b1, &f1, &done);
+ samples[i].visible = done > t ? (uint32_t)(done - t) : 0;
+ samples[i].bytes = b1 - b0;
+ samples[i].flushes = f1 - f0;
+#ifdef DEVICE_HABITAT
+ habitat_perf_get(&after);
+ samples[i].frames = after.frames - before.frames;
+#else
+ samples[i].frames = 0;
+#endif
+ }
+ cJSON_Delete(qs);
+ report(name, samples, 40);
+#ifdef DEVICE_HABITAT
+ for (int i = 0; i < 40; i++)
+ if (samples[i].visible > 10000 || !samples[i].visible || samples[i].frames > 1)
+ ESP_LOGI("PERF", "detail case=%s i=%d frames=%lu bytes=%lu visible_us=%lu", name, i,
+ (unsigned long)samples[i].frames, (unsigned long)samples[i].bytes,
+ (unsigned long)samples[i].visible);
+#endif
+ touch_stats_t touch;
+ touch_stats(&touch);
+ ESP_LOGI("PERF", "touch presses=%lu inferred=%lu failures=%lu held=%d",
+ (unsigned long)touch.presses, (unsigned long)touch.inferred_releases,
+ (unsigned long)touch.read_failures, touch.held_now);
+}
+#endif
+#ifdef DEVICE_OCTOPUS_BENCH
+#include "habitat/perf_bench.h"
+void ui_perf_run(void) { octopus_perf_run(); }
+#else
+void ui_perf_run(void)
+{
+#ifdef DEVICE_HABITAT
+ const char *renderer = "habitat-direct-c";
+#else
+ const char *renderer = "0.0.86-lvgl";
+#endif
+ ESP_LOGI("PERF", "BEGIN renderer=%s cpu_mhz=240 panel_qspi_mhz=40 samples=40 settle_ms=160",
+ renderer);
+ ui_enter_boot_loading();
+ ui_set_connected(true);
+ ui_projects_bulk_begin();
+ for (int i = 0; i < 16; i++) {
+ char id[32], name[40];
+ snprintf(id, sizeof(id), "perf-%d", i);
+ snprintf(name, sizeof(name), "Thread %02d alpha", i);
+ ui_project_set_name(id, name);
+ ui_project_set_engine(id, "codex");
+ ui_project_set_machine(id, "perf-machine", "M2");
+ ui_project_restore_event(
+ id, "done",
+ "A quiet terminal workspace. Text, one selected row, and enough room to think.",
+ "Ready for a look.");
+ }
+ ui_projects_bulk_end();
+ ui_fleet_set(16, true);
+ ui_land_after_reload();
+ vTaskDelay(pdMS_TO_TICKS(600));
+ ESP_LOGI("PERF", "memory int_free=%u int_largest=%u psram_free=%u",
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT),
+ (unsigned)heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT),
+ (unsigned)heap_caps_get_free_size(MALLOC_CAP_SPIRAM));
+ run_case("home_count", 0);
+ ui_show_projects();
+ ui_focus_project("perf-1");
+ vTaskDelay(pdMS_TO_TICKS(300));
+ run_case("agent_focus", 1);
+ run_case("agent_burst16", 3);
+ run_case("question", 2);
+ uint32_t b0, f0, b1, f1;
+ int64_t done;
+ counters(&b0, &f0, &done);
+ vTaskDelay(pdMS_TO_TICKS(2000));
+ counters(&b1, &f1, &done);
+ ESP_LOGI("PERF", "idle_ms=2000 bytes=%lu flushes=%lu", (unsigned long)(b1 - b0),
+ (unsigned long)(f1 - f0));
+ audio_probe_run();
+ ui_question_close("perf-0", NULL);
+ ui_project_clear_all();
+ ui_set_connected(false);
+ ui_enter_boot_loading();
+ ESP_LOGI("PERF", "END renderer=%s", renderer);
+}
+#endif
+#endif
diff --git a/devices/harness-device/firmware/main/ui/ui_perf.h b/devices/harness-device/firmware/main/ui/ui_perf.h
new file mode 100644
index 000000000..d9520db8a
--- /dev/null
+++ b/devices/harness-device/firmware/main/ui/ui_perf.h
@@ -0,0 +1,12 @@
+#pragma once
+#include <stddef.h>
+#include <stdint.h>
+#ifdef DEVICE_PERF_BENCH
+void ui_perf_flush(size_t bytes);
+void ui_perf_flush_done(void);
+int64_t ui_perf_last_done(void);
+void ui_perf_run(void);
+#else
+static inline void ui_perf_flush(size_t bytes) { (void)bytes; }
+static inline void ui_perf_flush_done(void) {}
+#endif
diff --git a/devices/harness-device/firmware/main/ui/ui_screens.c b/devices/harness-device/firmware/main/ui/ui_screens.c
index addcc74b8..be62b90e3 100644
--- a/devices/harness-device/firmware/main/ui/ui_screens.c
+++ b/devices/harness-device/firmware/main/ui/ui_screens.c
@@ -509,7 +509,7 @@ typedef struct {
// every machine at once, in the same order the desktop app's rail reads them. `machine_id` is what a
// machine row uses to find its first agent to land on; `machine` is the name the tile draws.
char machine_id[48];
- char machine[NAME_MAX];
+ char machine[CABLE_NAME_MAX];
char mode[8]; // MODEL: per-agent autonomy for voice turns — "plan" | "" (empty = auto/bypass)
// Runtime model/effort (REMOTE machines). selected_model = opaque runtime-v1:<sid>:<engine>:<model>@<effort>,
@@ -7978,7 +7978,7 @@ static EXT_RAM_BSS_ATTR struct {
bool active;
char request_id[80];
char who[64]; // the asker's name, from the frame — it may be on a tab the dial does not hold
- char machine[NAME_MAX]; // and its machine's name, shown when it is not the cabled computer
+ char machine[CABLE_NAME_MAX]; // and its machine's name, shown when it is not the cabled computer
char project[48];
qitem_t q[Q_MAX];
char answer[Q_MAX][256]; // chosen label(s) or transcript, per question
@@ -8121,10 +8121,10 @@ static void q_render(void)
int ai = s_q.who[0] ? -1 : find_proj(s_q.project);
const char *nm = s_q.who[0] ? s_q.who : (ai >= 0 && s_proj[ai].name[0]) ? s_proj[ai].name : "Agent";
const char *here = cable_client_machine_name();
- static char who[64 + NAME_MAX + 4];
+ static char who[64 + CABLE_NAME_MAX + 4];
char nmf[64]; utf8_filter(nm, nmf, sizeof(nmf));
if (s_q.machine[0] && strcmp(s_q.machine, here ? here : "") != 0) {
- char mf[NAME_MAX]; utf8_filter(s_q.machine, mf, sizeof(mf));
+ char mf[CABLE_NAME_MAX]; utf8_filter(s_q.machine, mf, sizeof(mf));
snprintf(who, sizeof who, "%s \xC2\xB7 %s", nmf, mf);
} else {
snprintf(who, sizeof who, "%s", nmf);
@@ -8460,6 +8460,17 @@ static void machine_toast(const char *msg)
// The cabled Mac has one short thing to say — a routing refusal, a delivery that did not land. It arrives
// as the answer to a wait, so the loading overlay comes down FIRST and the message is shown over whatever
// is on screen; leaving the overlay up behind a toast would say "still working" next to "it failed".
+void ui_voice_error(const char *msg) { ui_cable_toast(msg); }
+
+void ui_selection_state(const struct cJSON *payload) { (void)payload; }
+void ui_draft_state(const cJSON *p) { (void)p; }
+void ui_voice_draft(const cJSON *p) { (void)p; }
+void ui_voice_question(const cJSON *p) { (void)p; }
+void ui_voice_form(const cJSON *p) { (void)p; }
+void ui_form_state(const struct cJSON *payload) { (void)payload; }
+void ui_carry_state(const struct cJSON *payload) { (void)payload; }
+void ui_visit_state(const struct cJSON *payload) { (void)payload; }
+
void ui_cable_toast(const char *msg)
{
ui_voice_route_abort();
@@ -9643,3 +9654,10 @@ void ui_log_state_if_changed(void)
}
}
}
+
+void ui_question_state(const cJSON *p) { (void)p; }
+void ui_answer_receipt(const cJSON *p) { (void)p; }
+
+void ui_voice_search(const cJSON *p) { (void)p; }
+
+void ui_workspace_applied(const char *tab, uint32_t generation) { (void)tab; (void)generation; }
diff --git a/devices/harness-device/firmware/main/ui/ui_screens.h b/devices/harness-device/firmware/main/ui/ui_screens.h
index d5d82cfc3..a99546329 100644
--- a/devices/harness-device/firmware/main/ui/ui_screens.h
+++ b/devices/harness-device/firmware/main/ui/ui_screens.h
@@ -313,6 +313,15 @@ void ui_voice_route_abort(void);
// One short line from the cabled Mac (a routing refusal, a send that did not land). Releases the routing
// overlay first, then shows the message for ~2s over whatever is on screen.
void ui_cable_toast(const char *msg);
+void ui_selection_state(const struct cJSON *payload);
+void ui_draft_state(const struct cJSON *p);
+void ui_voice_draft(const struct cJSON *p);
+void ui_voice_question(const struct cJSON *p);
+void ui_voice_form(const struct cJSON *p);
+void ui_form_state(const struct cJSON *payload);
+void ui_carry_state(const struct cJSON *payload);
+void ui_visit_state(const struct cJSON *payload);
+void ui_voice_error(const char *msg);
// Backend daily voice quota. Status caps the current recording to the remaining allowance; exceeded
// stops capture, restores the previous screen and shows a short non-fatal toast.
void ui_voice_quota_status(int remaining_seconds);
@@ -407,3 +416,10 @@ bool ui_lock_active(void);
// One line on the log whenever what covers the face changes (screen, overlay, drawer, lock, sleep).
// Called from the LVGL task every loop; cheap when nothing changed.
void ui_log_state_if_changed(void);
+
+void ui_question_state(const struct cJSON *payload);
+void ui_answer_receipt(const struct cJSON *payload);
+
+void ui_voice_search(const struct cJSON *p);
+
+void ui_workspace_applied(const char *tab, uint32_t generation);
diff --git a/devices/harness-device/firmware/main/voice_buffer.c b/devices/harness-device/firmware/main/voice_buffer.c
new file mode 100644
index 000000000..91e7e21a4
--- /dev/null
+++ b/devices/harness-device/firmware/main/voice_buffer.c
@@ -0,0 +1,82 @@
+#include "voice_buffer.h"
+#include <assert.h>
+#include <string.h>
+void voice_buffer_init(voice_buffer_t *b, uint8_t *storage, uint32_t capacity)
+{
+ assert(capacity && !(capacity & (capacity - 1)));
+ b->data = storage;
+ b->capacity = capacity;
+ atomic_store(&b->head, 0);
+ atomic_store(&b->tail, 0);
+}
+bool voice_buffer_write(voice_buffer_t *b, const uint8_t *data, size_t size)
+{
+ uint32_t head = atomic_load_explicit(&b->head, memory_order_relaxed);
+ uint32_t tail = atomic_load_explicit(&b->tail, memory_order_acquire);
+ if (size > b->capacity - (uint32_t)(head - tail))
+ return false;
+ uint32_t pos = head & (b->capacity - 1);
+ size_t first = b->capacity - pos;
+ if (first > size)
+ first = size;
+ memcpy(b->data + pos, data, first);
+ memcpy(b->data, data + first, size - first);
+ atomic_store_explicit(&b->head, head + (uint32_t)size, memory_order_release);
+ return true;
+}
+size_t voice_buffer_peek(voice_buffer_t *b, const uint8_t **data, size_t limit)
+{
+ uint32_t tail = atomic_load_explicit(&b->tail, memory_order_relaxed);
+ uint32_t head = atomic_load_explicit(&b->head, memory_order_acquire);
+ uint32_t pos = tail & (b->capacity - 1);
+ size_t size = head - tail;
+ if (size > b->capacity - pos)
+ size = b->capacity - pos;
+ if (size > limit)
+ size = limit;
+ *data = b->data + pos;
+ return size;
+}
+void voice_buffer_consume(voice_buffer_t *b, size_t size)
+{
+ assert(size <= voice_buffer_used(b));
+ atomic_fetch_add_explicit(&b->tail, (unsigned)size, memory_order_release);
+}
+uint32_t voice_buffer_used(voice_buffer_t *b)
+{
+ // Called by either owner for telemetry, never to decide overwrite permission.
+ uint32_t tail = atomic_load_explicit(&b->tail, memory_order_acquire);
+ return atomic_load_explicit(&b->head, memory_order_acquire) - tail;
+}
+void voice_gate_feed(voice_gate_t *gate, const int16_t *pcm, size_t samples, unsigned rate)
+{
+ if (gate->heard || !samples)
+ return;
+ uint32_t energy = 0;
+ for (size_t i = 0; i < samples; i++) {
+ int v = pcm[i];
+ energy += (uint32_t)(v < 0 ? -v : v);
+ }
+ if (energy / samples > 600)
+ gate->loud_samples += (uint32_t)samples;
+ else
+ gate->loud_samples = 0;
+ if (gate->loud_samples >= rate * 320 / 1000)
+ gate->heard = true;
+}
+
+unsigned voice_level_feed(voice_level_t *meter, const int16_t *pcm, size_t samples)
+{
+ if (!samples) return 0;
+ int lo = pcm[0], hi = pcm[0];
+ for (size_t i = 1; i < samples; i++) {
+ if (pcm[i] < lo) lo = pcm[i];
+ if (pcm[i] > hi) hi = pcm[i];
+ }
+ // Peak-to-peak rejects DC offsets; release smoothing survives the slower visual sampling.
+ uint32_t span = (uint32_t)(hi - lo);
+ meter->envelope = meter->envelope * 31 / 32;
+ if (span > meter->envelope) meter->envelope = span;
+ uint32_t value = meter->envelope;
+ return value < 64 ? 0 : value < 180 ? 1 : value < 500 ? 2 : value < 1600 ? 3 : 4;
+}
diff --git a/devices/harness-device/firmware/main/voice_buffer.h b/devices/harness-device/firmware/main/voice_buffer.h
new file mode 100644
index 000000000..c1e069d4f
--- /dev/null
+++ b/devices/harness-device/firmware/main/voice_buffer.h
@@ -0,0 +1,27 @@
+#pragma once
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdatomic.h>
+
+// One producer, one consumer. Publish bytes only after copying; release space only after sending.
+typedef struct {
+ uint8_t *data;
+ uint32_t capacity;
+ atomic_uint head, tail;
+} voice_buffer_t;
+void voice_buffer_init(voice_buffer_t *b, uint8_t *storage, uint32_t capacity);
+bool voice_buffer_write(voice_buffer_t *b, const uint8_t *data, size_t size);
+size_t voice_buffer_peek(voice_buffer_t *b, const uint8_t **data, size_t limit);
+void voice_buffer_consume(voice_buffer_t *b, size_t size);
+uint32_t voice_buffer_used(voice_buffer_t *b);
+
+typedef struct {
+ uint32_t loud_samples;
+ bool heard;
+} voice_gate_t;
+void voice_gate_feed(voice_gate_t *gate, const int16_t *pcm, size_t samples, unsigned rate);
+
+// Visual mic envelope only. Never used to stop capture, gate speech or modify PCM.
+typedef struct { uint32_t envelope; } voice_level_t;
+unsigned voice_level_feed(voice_level_t *meter, const int16_t *pcm, size_t samples);
diff --git a/devices/harness-device/firmware/scripts/analyze_layout_perf.py b/devices/harness-device/firmware/scripts/analyze_layout_perf.py
new file mode 100644
index 000000000..7a04c9dce
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/analyze_layout_perf.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python3
+"""Validate a complete two-renderer ESP32 layout run and retain every stage.
+
+Input must contain one BEGIN/END run, filtered from the device's technical log.
+No incomplete/watchdog-restarted run is silently presented as a benchmark.
+"""
+import argparse
+import itertools
+import json
+import re
+import statistics
+from pathlib import Path
+
+
+def parse(text, allow_region_change=False):
+ lines = [line for line in text.splitlines() if 'layout-bench:' in line]
+ if sum('BEGIN 4800' in line for line in lines) != 1 or sum('END complete' in line for line in lines) != 1:
+ raise ValueError('Expected exactly one complete 4800-update run')
+ if any('CANCEL' in line for line in lines):
+ raise ValueError('Physical input cancelled this run')
+ blocks, checks = [], []
+ block = None
+ stages = {'model_us', 'damage_us', 'raster_us', 'total_us', 'pixel_bytes'}
+ for line in lines:
+ match = re.search(r'BLOCK pass=(\d+) renderer=(\w+) path=(\w+) layout=(\w+) event=(\w+)', line)
+ if match:
+ block = dict(zip(['pass', 'renderer', 'path', 'layout', 'event'], match.groups()))
+ block['pass'] = int(block['pass'])
+ block['stages'] = {}
+ blocks.append(block)
+ match = re.search(r'(model_us|damage_us|raster_us|total_us|pixel_bytes) n=(\d+) min=(\d+) median=(\d+) p95=(\d+) max=(\d+)', line)
+ if match:
+ if block is None or match[1] in block['stages']:
+ raise ValueError('Unpaired or duplicate measurement stage')
+ values = dict(zip(['n', 'min', 'median', 'p95', 'max'], map(int, match.groups()[1:])))
+ if values['n'] != 40 or not values['min'] <= values['median'] <= values['p95'] <= values['max']:
+ raise ValueError('Invalid sample count or percentile ordering')
+ block['stages'][match[1]] = values
+ if re.search(r'(before|block|after) internal=', line):
+ checks.append(line)
+ modes = list(dict.fromkeys(b['renderer'] for b in blocks))
+ layouts, events, paths = ['straight', 'curved', 'reading'], ['animation', 'name', 'status', 'gaze', 'recap'], ['CPU', 'DMA']
+ keys = [(b['pass'], b['renderer'], b['path'], b['layout'], b['event']) for b in blocks]
+ expected = set(itertools.product(range(2), modes, paths, layouts, events))
+ if len(modes) != 2 or len(keys) != 120 or len(set(keys)) != 120 or set(keys) != expected:
+ raise ValueError('Missing, duplicate or unexpected workload blocks')
+ if any(set(b['stages']) != stages for b in blocks):
+ raise ValueError('Incomplete measurement stages')
+ if len(checks) != 6 or any('touches=0 failures=0' not in line for line in checks):
+ raise ValueError('Missing memory checkpoints or physical input/read failure')
+ memory = [re.search(r'internal=(\d+) largest=(\d+) psram=(\d+)', line).groups() for line in checks]
+ if len(set(memory)) != 1:
+ raise ValueError('Memory changed during the run; investigate before publishing')
+ index = dict(zip(keys, blocks))
+ comparisons = []
+ for path, layout, event in itertools.product(paths, layouts, events):
+ a = [index[(p, modes[0], path, layout, event)]['stages'] for p in range(2)]
+ b = [index[(p, modes[1], path, layout, event)]['stages'] for p in range(2)]
+ if not allow_region_change and any(a[p]['pixel_bytes'] != b[p]['pixel_bytes'] for p in range(2)):
+ raise ValueError(f'Different transferred pixel workload: {path}/{layout}/{event}')
+ am = [v['total_us']['median'] for v in a]
+ bm = [v['total_us']['median'] for v in b]
+ comparisons.append(dict(path=path, layout=layout, event=event,
+ baseline_median_us=am, current_median_us=bm,
+ baseline_pixel_bytes=[v['pixel_bytes']['median'] for v in a],
+ current_pixel_bytes=[v['pixel_bytes']['median'] for v in b],
+ less_time_percent=100 * (1 - statistics.mean(bm) / statistics.mean(am))))
+ return dict(samples=4800, renderers=modes, blocks=blocks, comparisons=comparisons,
+ memory_checkpoints=checks,
+ region_change_permitted=allow_region_change,
+ scope='Scene construction through final DMA fence, or CPU-only rendering. Excludes event queues, touch sensor, panel scanout and voice. Percentages compare the means of two block medians, not pooled medians; n=40, median midpoint ranks19/20, p95 rank37.')
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('log', type=Path)
+ parser.add_argument('--json', type=Path, required=True)
+ parser.add_argument('--allow-region-change', action='store_true',
+ help='Use only after native pixel-equivalence tests verify the smaller dirty regions')
+ args = parser.parse_args()
+ result = parse(args.log.read_text(), args.allow_region_change)
+ args.json.write_text(json.dumps(result, indent=2) + '\n')
+ print('baseline/current:', ' / '.join(result['renderers']))
+ for row in result['comparisons']:
+ if row['layout'] == 'straight':
+ continue
+ print(f"{row['path']:3} {row['layout']:7} {row['event']:9} "
+ f"{row['baseline_median_us']} -> {row['current_median_us']} us; "
+ f"{row['less_time_percent']:.1f}% less time")
+
+
+if __name__ == '__main__':
+ main()
diff --git a/devices/harness-device/firmware/scripts/analyze_octopus_perf.py b/devices/harness-device/firmware/scripts/analyze_octopus_perf.py
new file mode 100644
index 000000000..5048345c5
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/analyze_octopus_perf.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python3
+"""Validate and summarize the event-tagged octopus ABBA device benchmark."""
+import argparse
+from pathlib import Path
+import re,json,math,hashlib,collections
+parser=argparse.ArgumentParser(description=__doc__)
+parser.add_argument('log', type=Path)
+parser.add_argument('output', type=Path)
+args=parser.parse_args()
+raw=args.log.read_text(errors='replace')
+raw=re.sub(r'\x1b\[[0-9;]*m','',raw)
+lines=raw.splitlines()
+def kv(s):
+ d=dict(re.findall(r'(\w+)=([^\s]+)',s))
+ return {k:int(v) if re.fullmatch(r'-?\d+',v) else v for k,v in d.items()}
+def pct(xs,p):
+ return sorted(xs)[min(len(xs)-1,math.floor(len(xs)*p))] if xs else None
+samples=[kv(l) for l in lines if 'OCTO_PERF: sample ' in l]
+result={'protocol':'octopus27-abba-v1','metric':'request to final SPI DMA completion of matching scene; not finger-to-photon',
+ 'body_modes':'same image; ABBA=frozen,animated,animated,frozen; touch/blink/mic reactions retained in both',
+ 'sample_count':len(samples),'samples':samples,'cases':{},
+ 'ambient':[kv(l) for l in lines if 'OCTO_PERF: ambient ' in l],
+ 'memory':[kv(l) for l in lines if 'OCTO_PERF: memory ' in l],
+ 'touch':[kv(l) for l in lines if 'OCTO_PERF: touch ' in l],
+ 'complete':any('END completed=960' in l for l in lines)}
+for key in ('working_count','agent_switch','agent_burst16','recap_open','question_update','touch_feedback'):
+ result['cases'][key]={}
+ for animate in (0,1):
+ ss=[s for s in samples if s['case']==key and s['animate']==animate]
+ if not ss: continue
+ values={metric:{'p50':pct([s[metric] for s in ss],.5),'p95':pct([s[metric] for s in ss],.95),'max':max(s[metric] for s in ss)} for metric in ('dma_us','api_us','bytes','model_us','damage_us','raster_us','paint_us')}
+ values['n']=len(ss);values['no_frame']=sum(not s['bytes'] for s in ss);values['mismatched']=sum(not s['matches'] for s in ss)
+ result['cases'][key]['animated' if animate else 'frozen']=values
+ a=result['cases'][key]
+ if all(k in a for k in ('animated','frozen')):
+ a['added_median_us']=a['animated']['dma_us']['p50']-a['frozen']['dma_us']['p50']
+ a['added_p95_us']=a['animated']['dma_us']['p95']-a['frozen']['dma_us']['p95']
+audio=[]; context=None
+for line in lines:
+ if 'OCTO_PERF: audio_begin ' in line: context=kv(line)
+ if 'AUDIO_PERF: case=' in line: audio.append({**(context or {}),**kv(line)})
+ if 'OCTO_PERF: audio_end ' in line: context=None
+result['audio']=audio
+result['log_sha256']=hashlib.sha256(args.log.read_bytes()).hexdigest()
+args.output.write_text(json.dumps(result,indent=2)+'\n')
+for key,d in result['cases'].items():
+ print(key, {mode:(v['n'],v['dma_us']) for mode,v in d.items() if isinstance(v,dict)})
+print('complete',result['complete'],'samples',len(samples))
+print('ambient',result['ambient'])
+print('audio',audio)
+if result['complete']:
+ assert len(samples)==960
+ assert all(s['bytes']>0 and s['matches']==1 for s in samples)
+ assert len({(s['round'],s['case'],s['i']) for s in samples})==960
+ assert all(v['n']==80 for c in result['cases'].values() for v in c.values() if isinstance(v,dict))
+ assert all(s['presses']==0 for s in result['touch'])
+ assert len(audio)==4 and all(s['produced']==s['delivered'] and s['rx_overruns']==0 and not s['aborted'] for s in audio)
+
+if not result['complete']:
+ raise SystemExit('Incomplete capture: no successful END marker.')
diff --git a/devices/harness-device/firmware/scripts/analyze_transport_perf.py b/devices/harness-device/firmware/scripts/analyze_transport_perf.py
new file mode 100644
index 000000000..ccaa2c550
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/analyze_transport_perf.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env python3
+"""Validate complete on-device transport benchmark blocks and retain all quantiles."""
+import argparse
+import json
+from pathlib import Path
+import re
+
+parser = argparse.ArgumentParser()
+parser.add_argument('log', type=Path)
+parser.add_argument('--json', type=Path, required=True)
+args = parser.parse_args()
+text = args.log.read_text().replace('\0', '')
+result = {'units': 'microseconds', 'scope': 'Local CPU work only; excludes USB, queues and desktop'}
+for tag, modes, sizes, chunks, samples in (
+ ('transport-bench', ('bitwise91', 'nibble92', 'rom92'), (0, 4, 48, 84, 324, 1028, 4100, 8196), None, 1920),
+ ('transport-decode', ('original91', 'rom-block93'), (48, 320, 1024, 4096, 8192), (1, 64, 512, 8200), 3200),
+):
+ lines = [line for line in text.splitlines() if tag + ':' in line]
+ if not lines:
+ continue
+ assert sum('BEGIN ' in line for line in lines) == 1, (tag, 'expected one BEGIN')
+ assert sum('END internal=' in line for line in lines) == 1, (tag, 'expected one END')
+ rows = []
+ for line in lines:
+ match = re.search(r'pass=(\d) mode=(\S+) bytes=(\d+)(?: chunk=(\d+))? n=(\d+) min=(\d+) median=(\d+) p95=(\d+) max=(\d+)', line)
+ if not match:
+ continue
+ row = {'pass': int(match[1]), 'mode': match[2], 'bytes': int(match[3]),
+ 'chunk': int(match[4]) if match[4] else None}
+ row.update(zip(('n', 'min', 'median', 'p95', 'max'), (int(match[i]) for i in range(5, 10))))
+ assert row['n'] == 40 and row['min'] <= row['median'] <= row['p95'] <= row['max'], row
+ rows.append(row)
+ expected = {(p, m, size, chunk) for p in range(2) for m in modes for size in sizes for chunk in (chunks or (None,))}
+ seen = [(r['pass'], r['mode'], r['bytes'], r['chunk']) for r in rows]
+ assert len(seen) == len(set(seen)) and set(seen) == expected, (tag, 'missing or duplicate block')
+ assert sum(r['n'] for r in rows) == samples
+ heap = re.search(r'END internal=(\d+)/(\d+)', '\n'.join(lines))
+ assert heap and heap[1] == heap[2], (tag, 'heap changed')
+ result[tag] = {'samples': samples, 'stable_internal_bytes': int(heap[1]), 'blocks': rows}
+assert 'transport-bench' in result, 'No complete CRC run'
+args.json.write_text(json.dumps(result, indent=2) + '\n')
+for tag in ('transport-bench', 'transport-decode'):
+ if tag in result:
+ print(f"{tag}: {result[tag]['samples']} samples, complete two-pass blocks, stable heap PASS")
diff --git a/devices/harness-device/firmware/scripts/gen_creature_art.py b/devices/harness-device/firmware/scripts/gen_creature_art.py
new file mode 100644
index 000000000..9a3ec2243
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/gen_creature_art.py
@@ -0,0 +1,197 @@
+#!/usr/bin/env python3
+"""Original ASCII portraits for the gallery, inspired by terminal-art traditions.
+
+These are new drawings, not copied cowsay/Joan Stark/Nyan Cat assets.
+Six poses per creature: two calm, two playful, two asleep. % = eye, ? = mouth.
+Everything emitted is printable ASCII. See prototype/habitat/CREATURE_GALLERY.md.
+"""
+from pathlib import Path
+import json
+
+ROOT = Path(__file__).resolve().parents[1]
+COLS, ROWS = 25, 9
+portraits = []
+
+def add(name, lines, alternate, play_a, play_b, sleep_a, sleep_b):
+ base = lines.splitlines()
+ assert len(base) <= ROWS
+ base += [''] * (ROWS - len(base))
+ poses = [base]
+ for patch in (alternate, play_a, play_b, sleep_a, sleep_b):
+ pose = base.copy()
+ for row, value in patch.items():
+ pose[row] = value
+ poses.append(pose)
+ for pose in poses:
+ for line in pose:
+ assert len(line) <= COLS, (name, len(line), line)
+ assert all(32 <= ord(c) <= 126 for c in line)
+ assert sum(row.count('%') for row in pose) == 2, (name, pose)
+ portraits.append((name, poses))
+
+add('Miso', r'''
+ /\ /\
+ / \_____/ \
+ ( % % )
+ (= ? =)
+ / \__
+ /| | )
+ (_|____/ \____|_/''',
+ {1:" /\\_____/ \\", 5:" / \\ )", 6:" /| |__/", 7:" (_|____/ \\____|)"},
+ {0:' *', 1:" /\\ /\\", 2:" / \\_____/ \\", 3:" ( % % )", 4:" (= ? =)", 5:" / / \\ \\", 6:" (_/| |\\_)", 7:" |___/ \\___|", 8:' . .'},
+ {0:'', 1:" /\\ /\\", 2:" / \\_____/ \\", 3:" \\ ( % % ) /", 4:" \\(= ? =)/", 5:" / \\", 6:" | |", 7:" |___/ \\___|", 8:' * *'},
+ {0:'',1:'',2:'',3:" /\\____/\\",4:" ( % % )___",5:" (= ? =) `.",6:" (_________ )",7:" `--------\\_/"},
+ {0:'',1:'',2:'',3:" /\\____/\\",4:" ( % % )____",5:" (= ? =) )",6:" (_________ /",7:" `--------\\/"})
+
+add('Hopper', r'''
+ .--. .--.
+ ( % ) ( % )
+ / `--' `--' \
+ ( ? )
+ \ ._______. /
+ / / \ \
+ _/ / \ \_
+ (___) (___)''',
+ {4:" ( ? )",5:" \\ ._______. /",6:" / / \\ \\",7:" (_/ \\_)",8:" ) ("},
+ {0:' * *',1:' .--. .--.',2:' ( % ) ( % )',3:" / `--' `--' \\",4:' ( ? )',5:" \\ ._______. /",6:" _/ / \\ \\_",7:" (__/ \\__)",8:''},
+ {0:' .--. .--.',1:' ( % ) ( % )',2:" / `--' `--' \\",3:' ( ? )',4:" \\ ._______. /",5:" / / \\ \\",6:" | | | |",7:" \\_) (_/",8:' . .'},
+ {0:'',1:'',2:'',3:' .--. .--.',4:' ( % ) ( % )',5:" / `--' `--' \\",6:' ( ? )',7:" \\_____________/",8:" (___) (___)"},
+ {0:'',1:'',2:'',3:' .--. .--.',4:' ( % ) ( % )',5:" / `--' `--' \\",6:' ( ? )',7:" \\_______________/",8:" (___) (___)"})
+
+add('Pip', r''' /\ /\
+ / \ / \
+ | | | |
+ | |_| |
+ / % % \
+ \ ? /
+ /| |\
+ (_|__u_u__|_)
+''',
+ {0:" /\\",1:" / \\ __",2:" | | / /",3:" | |/ /"},
+ {0:" /\\ /\\",1:" / \\ / \\",2:" | |_| |",3:" / % % \\",4:" \\ ? /",5:" _/ / \\ \\_",6:" (__/| |\\__)",7:" |__u_u__|",8:' . .'},
+ {0:" /\\ /\\",1:" / \\ / \\",2:" \\ \\_/ /",3:" / % % \\",4:" \\ ? /",5:" /| |\\",6:" (_| |_)",7:" |__u_u__|",8:' * *'},
+ {0:'',1:'',2:" ____ ____",3:" / __\\/__ \\",4:" \\ ( % % ) /",5:" \\( ? )/",6:" / \\",7:" (___u_u___)"},
+ {0:'',1:'',2:" ____ ____",3:" / __\\/__ \\",4:" \\ ( % % ) /",5:" \\( ? )/",6:" / \\",7:" (____u_u____)"})
+
+add('Rook', r''' .---.
+ / \
+ | % % |
+ | ? |
+ /| |\
+ / | | \
+ \_| |_/
+ / ___ \
+ (_/ \_)''',
+ {4:" /| |\\__",5:" / | |___)",6:" \\_| |",7:" / ___ \\",8:" (_/ \\_)"},
+ {0:' .---.',1:" / \\",2:' | % % |',3:" __ | ? |",4:" ( \\_| |\\",5:" \\___| | \\",6:" | |_/ ",7:" / ___ \\",8:" (_/ \\_)"},
+ {0:' .---.',1:" / \\",2:' | % % |',3:" | ? | __",4:" /| |_/ )",5:" / | |___/",6:" \\_| |",7:" / ___ \\",8:" (_/ \\_)"},
+ {0:'',1:' .---.',2:" / \\",3:' | % % |',4:' | ? |',5:" /| |\\",6:" ( | | )",7:" \\|_____|/",8:" (___ ___)"},
+ {0:'',1:' .---.',2:" / \\",3:' | % % |',4:' | ? |',5:" / | | \\",6:" ( | | )",7:" \\_|_____|_/",8:" (___ ___)"})
+
+add('Moo', r'''
+ /) (\
+ __/ \_______/ \__
+ (___ % % ___)
+ | _____ |
+ | (o o) |
+ | \_?_/ |
+ / \
+ (____/ \____)''',
+ {2:" ___/ \\_______/ \\___",3:" (____ % % ____)",6:" | ( ? ) |"},
+ {0:' * *',1:" /) (\\",2:" __/ \\_______/ \\__",3:" (___ % % ___)",4:" | _____ |",5:" | (o o) |",6:" | \\_?_/ |",7:" __/ \\__",8:" (___/ \\___)"},
+ {0:' * *',1:" /) (\\",2:" __/ \\_________/ \\__",3:" (____ % % ____)",4:" | _____ |",5:" | (o o) |",6:" | ( ? ) |",7:" / \\",8:" (____/ \\____)"},
+ {0:'',1:'',2:" /) (\\",3:" __/ \\_______/ \\__",4:" (___ % % ___)",5:" | _____ |",6:" | (o ? o) |",7:" \\_______/",8:" (____/ \\____)"},
+ {0:'',1:'',2:" /) (\\",3:" ___/ \\_______/ \\___",4:" (____ % % ____)",5:" | _____ |",6:" | (o ? o) |",7:" \\_______/",8:" (____/ \\____)"})
+
+add('Boo', r'''
+ .-------.
+ .' '.
+ / % % \
+ | ? |
+ | |
+ | |
+ \_/\___/\___/\_/
+''',
+ {7:" \\___/\\___/\\___/"},
+ {0:' * *',1:' .-------.',2:" .' '.",3:" __/ % % \\__",4:" ( ? )",5:" \\ /",6:" | |",7:" \\_/\\___/\\___/\\_/",8:''},
+ {0:' *',1:' .-------.',2:" .' '.",3:" _/ % % \\_",4:" ( ? )",5:" | |",6:" | |",7:" \\___/\\___/\\___/",8:''},
+ {0:'',1:'',2:'',3:' .-------.',4:" .' % % '.",5:" / ? \\",6:" | |",7:" \\_/\\___/\\___/\\_/"},
+ {0:'',1:'',2:'',3:' .-------.',4:" .' % % '.",5:" / ? \\",6:" | |",7:" \\__/\\___/\\___/\\__/"})
+
+add('Sprout', r''' .-.
+ .-. \ /
+ \ / |
+ \_____|
+ | ()
+ .------|---.
+ | % % |
+ | ? |
+ '----------' ''',
+ {0:' .-.',1:" .-. \\ /",2:" \\ / |",3:" \\_____|",4:" | ()",5:" .-----|----."},
+ {0:' .-@-.',1:' (@ @ @)',2:" '-@-'",3:" (\\ | /)",4:" \\___|__/",5:" .---|------.",6:" | % % |",7:" | ? |",8:r" '----------'"},
+ {0:' .-@-. *',1:' (@ @ @)',2:" '-@-'",3:" (\\ | /)",4:" \\____|___/",5:" .---|------.",6:" | % % |",7:" | ? |",8:r" '----------'"},
+ {0:'',1:'',2:" .----.",3:" ( ) \\ ()",4:" | /",5:" .------|---.",6:" | % % |",7:" | ? |",8:r" '----------'"},
+ {0:'',1:'',2:" .---.",3:" ( ) \\ ()",4:" | /",5:" .------|---.",6:" | % % |",7:" | ? |",8:r" '----------'"})
+
+add('Drift', r'''
+ .-------.
+ .' . . . . '.
+ / % % \
+ ( ? )
+ '---.---.---.-'
+ / | | \
+ \ | | /
+ J U J U''',
+ {1:' .-----.',2:" .' . . . '.",3:" / % % \\",4:" ( ? )",5:r" '--.---.---.'",6:" \\ | /",7:" / | \\",8:" U J U"},
+ {0:' o o',1:' .-----.',2:" .' . . . '.",3:" / % % \\",4:" ( ? )",5:r" '--.---.---.'",6:" __/ | | \\__",7:" ( __/ \\__ )",8:" ( )"},
+ {0:' o',1:' .-------.',2:" .' . . . . '.",3:" / % % \\",4:" ( ? )",5:r" '---.---.---.-'",6:" / | | \\",7:" ( / \\ )",8:" ) U J ("},
+ {0:'',1:'',2:' .-------.',3:" .' % % '.",4:" ( ? )",5:r" '---.---.---'",6:" / | | \\",7:" U U J U",8:''},
+ {0:'',1:'',2:' .-------.',3:" .' % % '.",4:" ( ? )",5:r" '----.---.----'",6:" \\ | | /",7:" JUUJ",8:''})
+
+add('Bolt', r''' o
+ |
+ .----'----.
+ | % % |
+ | [?] |
+ o-+---------+-o
+ | [=] |
+ '----+----'
+ / \ ''',
+ {0:' o',1:" /",5:" o-+---------+--o"},
+ {0:' *',1:' |',2:" o .----'----.",3:" | | % % |",4:" \\__| [?] |",5:" +---------+--o",6:" | [=] |",7:r" '----+----'",8:" _/ \\_"},
+ {0:' o',1:' |',2:" .----'----. o",3:" | % % | |",4:" | [?] |__/",5:" o--+---------+",6:" | [=] |",7:r" '----+----'",8:" /\\"},
+ {0:'',1:'',2:" .----o----.",3:" | % % |",4:" | [?] |",5:" +---------+",6:" o| [-] |o",7:r" '----+----'",8:" / \\"},
+ {0:'',1:'',2:" .----o----.",3:" | % % |",4:" | [?] |",5:" +---------+",6:" o| [ ] |o",7:r" '----+----'",8:" / \\"})
+
+add('Echo', r'''
+ /\ /\
+ / \ /\_/\ / \
+ / \_(% %)___/ \
+( \ ? / )
+ \ /\ \_/ /\ /
+ \/ \ / \ / \__/
+ \_/ \_/
+''',
+ {1:'',2:" /\\_/\\",3:" /\\___(% %)___/\\",4:" / \\ ? / \\",5:"( /\\ \\_/ /\\ )",6:" \\_/ \\ / \\ / \\_/",7:" \\/ \\/"},
+ {0:" /\\ /\\",1:" / \\ /\\_/\\ / \\",2:"/ \\__(% %)____/ \\",3:"\\ \\ ? / /",4:" \\ /\\ \\_/ /\\ /",5:" \\/ \\ / \\ / \\__/",6:" \\_/ \\_/",7:'',8:''},
+ {0:'',1:'',2:" /\\_/\\",3:" (% %)",4:" ___/\\ ? /\\___",5:" / \\_/ \\",6:" / /\\ / \\ /\\ \\",7:" \\/ \\_/ \\_/ \\/",8:''},
+ {0:'',1:'',2:" /\\_/\\",3:" (% %)",4:" / \\ ? / \\",5:" /\\ \\_/ /\\",6:" \\ \\ / \\ / /",7:" \\ V V /",8:r" '-----'"},
+ {0:'',1:'',2:" /\\_/\\",3:" (% %)",4:" / \\ ? / \\",5:" /\\ \\_/ /\\",6:" \\ \\ / \\ / /",7:" \\ V V /",8:r" '-------'"})
+
+assert len(portraits) == 10
+dest = ROOT / 'main/ui/habitat/creature_art.inc'
+with dest.open('w') as out:
+ out.write('// Generated by gen_creature_art.py; original drawings. Printable ASCII only.\n')
+ out.write('static const char *const names[HT_ORIGINAL_CREATURES] = {')
+ out.write(','.join(json.dumps(name) for name, _ in portraits))
+ out.write('};\nstatic const char art[HT_ORIGINAL_CREATURES][6][HT_CREATURE_ROWS][HT_CREATURE_COLS+1] = {\n')
+ for name, poses in portraits:
+ out.write(' { // ' + name + '\n')
+ for pose in poses:
+ out.write(' {\n')
+ for line in pose:
+ out.write(' ' + json.dumps(line.ljust(COLS)) + ',\n')
+ out.write(' },\n')
+ out.write(' },\n')
+ out.write('};\n')
+print(f'{len(portraits)} original creatures, {len(portraits)*6} poses, {COLS}x{ROWS} cells')
diff --git a/devices/harness-device/firmware/scripts/gen_creature_clips.py b/devices/harness-device/firmware/scripts/gen_creature_clips.py
new file mode 100644
index 000000000..9ee10f6c4
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/gen_creature_clips.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python3
+"""Compile curated text animation, not images, into immutable C frame data.
+
+The source JSON preserves the inspected character frames, timing, provenance,
+and adaptation notes. No downloader, converter or decoder runs on the ESP32.
+"""
+from pathlib import Path
+import json
+
+root = Path(__file__).resolve().parents[1]
+source = root.parent / 'prototype/habitat/assets/creature-references/clips.json'
+clips = json.loads(source.read_text())
+fonts = {'ascii12': 'ht_ascii_art_12', 'ascii14': 'ht_ascii_art_14',
+ 'ascii16': 'ht_ascii_art_16', 'ascii20': 'ht_ascii_art_20',
+ 'ascii28': 'ht_ascii_art_28', 'ascii48': 'ht_ascii_art_48',
+ 'block16': 'ht_block_art_16', 'block_square': 'ht_block_art_square_10'}
+out = ['// Generated from prototype/habitat/assets/creature-references/clips.json.',
+ '// Source/artist/adaptation credits are preserved there and in CREATURE_GALLERY_02.md.']
+total = 0
+for i, clip in enumerate(clips):
+ assert clip['rows'] <= 40 and len(clip['frames']) == len(clip['holds'])
+ ends = []; elapsed = 0
+ out.append(f'static const char *const clip_{i}_frames[] = {{')
+ for frame, hold in zip(clip['frames'], clip['holds']):
+ assert len(frame) == clip['rows'] and 0 < hold < 65536
+ assert all(len(row) == clip['cols'] and len(row.encode()) < 128 for row in frame)
+ allowed = lambda cp: cp == 32 or (0x2580 <= cp <= 0x259f if clip['font'].startswith('block') else 32 <= cp <= 126)
+ assert all(allowed(ord(ch)) for row in frame for ch in row)
+ text = '\n'.join(frame)
+ out.append(' ' + json.dumps(text, ensure_ascii=False) + ',')
+ total += len(text.encode()) + 1
+ elapsed += hold; ends.append(elapsed)
+ out.append('};')
+ out.append(f'static const uint32_t clip_{i}_ends[] = {{'+','.join(map(str,ends))+'};')
+out.append('static const ht_gallery_clip_t clips[] = {')
+for i, clip in enumerate(clips):
+ out.append(' {' + ','.join([json.dumps(clip['name']),str(clip['cols']),str(clip['rows']),
+ str(len(clip['frames'])),str(sum(clip['holds'])), '&'+fonts[clip['font']],
+ '0x'+clip['color'],f'clip_{i}_frames',f'clip_{i}_ends']) + '},')
+out.append('};')
+out.append('_Static_assert(sizeof(clips)/sizeof(clips[0]) == HT_CREATURES-HT_ORIGINAL_CREATURES, "gallery clip count");')
+(root/'main/ui/habitat/creature_clips.inc').write_text('\n'.join(out)+'\n')
+print(f'{len(clips)} text clips, {sum(len(c["frames"]) for c in clips)} poses, {total} UTF-8 frame bytes')
diff --git a/devices/harness-device/firmware/scripts/gen_creature_font.py b/devices/harness-device/firmware/scripts/gen_creature_font.py
new file mode 100644
index 000000000..84bd802ad
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/gen_creature_font.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+"""Pre-rasterize OFL Jgs7 into an ASCII-only, 2-bit fixed-cell atlas.
+
+Derived atlas name: Habitat ASCII Art 28. Jgs7 is a Reserved Font Name.
+Copyright (c) 2022 Adel Faure; original distributed by Velvetyne.
+Source and full license: fonts/jgs7.ttf and fonts/Jgs-OFL.txt.
+"""
+from pathlib import Path
+from PIL import Image, ImageDraw, ImageFont
+
+root = Path(__file__).resolve().parents[1]
+def pack(im):
+ values = [min(3, (v+42)//85) for v in im.get_flattened_data()]
+ values += [0] * (-len(values) % 4)
+ return [sum(values[j+k] << (6-2*k) for k in range(4)) for j in range(0, len(values), 4)]
+
+atlases = []
+for height in (12, 14, 16, 20, 28, 48):
+ width = height // 2
+ font = ImageFont.truetype(str(root / 'fonts/jgs7.ttf'), height)
+ data = []
+ for cp in range(32, 127):
+ im = Image.new('L', (width, height))
+ ImageDraw.Draw(im).text((0, round(height*22/28)), chr(cp), font=font, fill=255, anchor='ls')
+ data.extend(pack(im))
+ atlases.append((f'ht_ascii_art_{height}',32,126,width,height,data))
+
+# Standard Unicode block/shade glyphs, authored geometrically. No character image
+# is stored in the font: the same tiny alphabet is reused by every text frame.
+width, height = 8, 16
+data = []
+square_data = []
+for cp in range(0x2580, 0x25a0):
+ im = Image.new('L', (width,height)); px = im.load()
+ for y in range(height):
+ for x in range(width):
+ on = False
+ if cp == 0x2580: on = y < height//2
+ elif 0x2581 <= cp <= 0x2588: on = y >= height-(cp-0x2580)*height//8
+ elif 0x2589 <= cp <= 0x258f: on = x < (0x2590-cp)*width//8
+ elif cp == 0x2590: on = x >= width//2
+ elif cp in (0x2591,0x2592,0x2593):
+ rank = ((0,2),(3,1))[y%2][x%2]
+ on = rank < cp-0x2590
+ elif cp == 0x2594: on = y < height//8
+ elif cp == 0x2595: on = x >= width-width//8
+ elif cp >= 0x2596:
+ masks = (4,8,1,13,9,7,11,2,6,14)
+ bit = (1 if x<width//2 else 2) * (1 if y<height//2 else 4)
+ on = bool(masks[cp-0x2596]&bit)
+ px[x,y] = 255 if on else 0
+ data.extend(pack(im))
+ square_data.extend(pack(im.resize((10,10),Image.Resampling.NEAREST)))
+atlases.append(('ht_block_art_16',0x2580,0x259f,width,height,data))
+atlases.append(('ht_block_art_square_10',0x2580,0x259f,10,10,square_data))
+out = root / 'main/ui/habitat/creature_font.c'
+with out.open('w') as f:
+ f.write('// Generated by gen_creature_font.py. Habitat ASCII Art 28.\n')
+ f.write('// Derived from Jgs7, (c) 2022 Adel Faure, Velvetyne; SIL OFL 1.1.\n')
+ f.write('// This atlas remains OFL-licensed; see fonts/Jgs-OFL.txt.\n#include "creature_gallery.h"\n')
+ for name,first,last,width,height,data in atlases:
+ f.write(f'static const uint8_t {name}_pixels[] = {{\n')
+ for i in range(0,len(data),24):
+ f.write(' '+','.join(map(str,data[i:i+24]))+',\n')
+ f.write(f'}};\nconst ht_font_t {name} = {{{first},{last},{width},{height},{name}_pixels}};\n')
+ print(f'{name}: {len(data)} bytes, {width}x{height} cells')
diff --git a/devices/harness-device/firmware/scripts/gen_habitat_fonts.py b/devices/harness-device/firmware/scripts/gen_habitat_fonts.py
new file mode 100644
index 000000000..b90398756
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/gen_habitat_fonts.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+"""Deterministic fixed-cell, 2-bit font atlases. Requires Pillow 12.2.0.
+
+Geist Mono: SIL OFL, vendored beside Geist. Unscii-8: public domain, from LVGL 9.5.0.
+No font engine runs on the ESP32. Regenerate from the repository root.
+"""
+from pathlib import Path
+from PIL import Image, ImageDraw, ImageFont
+root = Path(__file__).resolve().parents[1]
+dest = root / 'main/ui/habitat/fonts.c'
+mono = root / 'fonts/GeistMono-Regular.ttf'
+pixel = root.parent / 'prototype/habitat/assets/unscii-8.ttf'
+fonts = [('ht_mono_16',mono,16,10,22,17),('ht_mono_20',mono,20,12,28,22),
+ ('ht_mono_24',mono,24,15,32,26),('ht_mono_28',mono,28,17,38,31),
+ ('ht_pixel_40',pixel,40,40,48,40),('ht_open_20',mono,20,12,28,22),
+ ('ht_lock_dot',pixel,40,40,48,40)]
+with dest.open('w') as out:
+ out.write('// Generated by scripts/gen_habitat_fonts.py. Do not edit.\n#include "terminal.h"\n')
+ curved_bounds=[]
+ for name,path,size,width,height,baseline in fonts:
+ font=ImageFont.truetype(str(path),size)
+ data=[]
+ bounds=[]
+ # Latin-1 keeps common names readable; unknown Unicode renders ?, never changes wire text.
+ first,last=(0x2197,0x2197) if name=='ht_open_20' else (ord('o'),ord('o')) if name=='ht_lock_dot' else (32,255 if name!='ht_pixel_40' else 126)
+ for cp in range(first,last+1):
+ im=Image.new('L',(width,height));ImageDraw.Draw(im).text((0,baseline),chr(cp),font=font,fill=255,anchor='ls',stroke_width=0)
+ values=[min(3,(v+42)//85) for v in im.get_flattened_data()]
+ if name in ('ht_mono_20','ht_open_20'):
+ ink=[(i%width,i//width) for i,a in enumerate(values) if a]
+ bounds.append((min(x for x,y in ink),min(y for x,y in ink),
+ max(x for x,y in ink),max(y for x,y in ink)) if ink else (0,0,0,0))
+ values += [0]*((-len(values))%4)
+ data.extend(sum(values[j+k]<<(6-2*k) for k in range(4)) for j in range(0,len(values),4))
+ out.write(f'static const uint8_t {name}_pixels[] = {{\n')
+ for j in range(0,len(data),24):out.write(' '+','.join(map(str,data[j:j+24]))+',\n')
+ out.write(f'}};\nconst ht_font_t {name} = {{{first},{last},{width},{height},{name}_pixels}};\n')
+ print(f'{name}: {len(data)} bytes, {width} x {height} fixed cell')
+ if bounds: curved_bounds.append((name,bounds))
+ # These tiny immutable bounds let rotated labels skip transparent margins.
+ # The actual atlas and interpolation stay unchanged; no runtime font engine.
+ for name,bounds in curved_bounds:
+ out.write(f'const uint8_t {name}_ink[{len(bounds)}][4] = {{\n')
+ for b in bounds: out.write(' {'+','.join(map(str,b))+'},\n')
+ out.write('};\n')
diff --git a/devices/harness-device/firmware/scripts/gen_octopus.py b/devices/harness-device/firmware/scripts/gen_octopus.py
new file mode 100644
index 000000000..391f5239e
--- /dev/null
+++ b/devices/harness-device/firmware/scripts/gen_octopus.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+"""Build only the confirmed ASCII octopus into the connected firmware.
+
+The gallery JSON remains the source of truth. Frames are unmodified printable
+ASCII, not a runtime GIF. A small registration table follows the eyes as the
+head moves, so touch/voice expressions stay attached to the original creature.
+"""
+import json
+import itertools
+import sys
+from pathlib import Path
+from PIL import Image, ImageDraw, ImageFont
+
+root = Path(__file__).resolve().parents[1]
+check = '--check' in sys.argv
+def emit(path, text):
+ if check:
+ assert path.read_text() == text, f'{path.name} is stale; run gen_octopus.py'
+ else:
+ path.write_text(text)
+
+clip = json.loads((root.parent / 'prototype/habitat/assets/creature-references/clips.json').read_text())[0]
+assert clip['name'] == 'Octopus / ASCII' and (clip['cols'], clip['rows']) == (54, 27)
+assert len(clip['frames']) == len(clip['holds']) == 63
+out = ['// Generated by scripts/gen_octopus.py. Do not edit.',
+ '// Adapted from ferrebarrat/brrtfetch, gifs/defaults/brrt.gif.',
+ '// Exact approved gallery text frames; see prototype/habitat/CREATURE_GALLERY_02.md.',
+ '// Shared rows, lossless nibble RLE. No images or runtime conversion.']
+rows = [row for frame in clip['frames'] for row in frame]
+unique = list(dict.fromkeys(rows))
+row_keys = {row: i for i, row in enumerate(unique)}
+alphabet = ''.join(sorted(set(''.join(rows))))
+assert 1 <= len(alphabet) <= 16 and all(32 <= ord(ch) <= 126 for ch in alphabet)
+encoded = []
+offsets = [0]
+for row in unique:
+ for ch, group in itertools.groupby(row):
+ count = len(list(group))
+ while count:
+ take = min(count, 16)
+ encoded.append(((take - 1) << 4) | alphabet.index(ch))
+ count -= take
+ offsets.append(len(encoded))
+assert len(encoded) <= 65535 and len(unique) <= 65535
+for key, row in enumerate(unique):
+ assert ''.join(alphabet[b & 15] * ((b >> 4) + 1)
+ for b in encoded[offsets[key]:offsets[key + 1]]) == row
+def array(name, ctype, values):
+ out.append(f'static const {ctype} {name}[] = {{')
+ out.extend(' ' + ','.join(map(str, values[i:i+24])) + ',' for i in range(0, len(values), 24))
+ out.append('};')
+array('octopus_data', 'uint8_t', encoded)
+array('octopus_row_offsets', 'uint16_t', offsets)
+array('octopus_frame_rows', 'uint16_t', [row_keys[row] for row in rows])
+out += [f'static const char octopus_alphabet[] = {json.dumps(alphabet)};',
+ 'static const ht_ascii_clip_t octopus_clip = {',
+ f' .cols=54, .rows=27, .symbols={len(alphabet)}, .frames=63,',
+ f' .unique_rows={len(unique)}, .data_bytes=sizeof octopus_data,',
+ ' .alphabet=octopus_alphabet, .frame_rows=octopus_frame_rows,',
+ ' .row_offsets=octopus_row_offsets, .data=octopus_data,',
+ '};']
+eyes = []
+ends = []
+elapsed = 0
+for frame, hold in zip(clip['frames'], clip['holds']):
+ assert len(frame) == 27 and all(len(row) == 54 for row in frame)
+ assert all(32 <= ord(ch) <= 126 for row in frame for ch in row)
+ # The first opening in both solid forehead columns is the upper eyelid.
+ row = next(y for y in range(6, 11)
+ if sum(ch in ' .,:;xo' for ch in frame[y][19:22]) >= 2
+ and sum(ch in ' .,:;xo' for ch in frame[y][30:33]) >= 2) + 1
+ assert 8 <= row <= 11
+ eyes.append(row)
+ elapsed += hold
+ ends.append(elapsed)
+out += ['static const uint8_t octopus_eyes[] = {' + ','.join(map(str, eyes)) + '};',
+ 'static const uint16_t octopus_ends[] = {' + ','.join(map(str, ends)) + '};']
+emit(root / 'main/ui/habitat/octopus_art.inc', '\n'.join(out) + '\n')
+
+out = ['// Generated by scripts/gen_octopus.py. Habitat Octopus ASCII atlas.',
+ '// Derived from Jgs7, (c) 2022 Adel Faure, Velvetyne; SIL OFL 1.1.',
+ '// This atlas remains OFL-licensed; see fonts/Jgs-OFL.txt.', '#include "octopus.h"']
+for height in (2, 4, 6, 8, 10):
+ width = height // 2
+ font = ImageFont.truetype(str(root / 'fonts/jgs7.ttf'), height)
+ data = []
+ for cp in range(32, 127):
+ im = Image.new('L', (width, height))
+ ImageDraw.Draw(im).text((0, round(height * 22 / 28)), chr(cp), font=font, fill=255, anchor='ls')
+ values = [min(3, (v + 42) // 85) for v in im.get_flattened_data()]
+ values += [0] * (-len(values) % 4)
+ data.extend(sum(values[j+k] << (6-2*k) for k in range(4)) for j in range(0, len(values), 4))
+ out.append(f'static const uint8_t octopus_{height}_pixels[] = {{')
+ out.extend(' ' + ','.join(map(str, data[i:i+24])) + ',' for i in range(0, len(data), 24))
+ out.append(f'}};\nconst ht_font_t ht_octopus_font_{height} = {{32,126,{width},{height},octopus_{height}_pixels}};')
+ print(f'Octopus font: {width}x{height}, {len(data)} bytes')
+emit(root / 'main/ui/habitat/octopus_font.c', '\n'.join(out) + '\n')
+packed = len(encoded) + 2 * (len(offsets) + len(rows)) + len(alphabet) + 1
+print(f'Octopus: {len(eyes)} ASCII poses, {elapsed} ms loop, {63*27*55} -> {packed} frame bytes')
diff --git a/devices/harness-device/firmware/test/arc_pixels.inc b/devices/harness-device/firmware/test/arc_pixels.inc
new file mode 100644
index 000000000..c2b4b7fec
--- /dev/null
+++ b/devices/harness-device/firmware/test/arc_pixels.inc
@@ -0,0 +1,64 @@
+UINT64_C(0x05c57ec9ed1c6185),
+UINT64_C(0x99d17160453f1399),
+UINT64_C(0x50386e665ea52b0c),
+UINT64_C(0x16805912687786e0),
+UINT64_C(0x087d84f9160e329e),
+UINT64_C(0xa76cae1d913ef46c),
+UINT64_C(0x32a47329ddff00a4),
+UINT64_C(0x493cbc3b8ca2fe5e),
+UINT64_C(0x721a2224079dbf90),
+UINT64_C(0x5504dbe50bcff31f),
+UINT64_C(0xaa9245d1396646ef),
+UINT64_C(0x2aab7697552923f5),
+UINT64_C(0x4847a2cf5f79eae3),
+UINT64_C(0x2f9b3c8c2d76d583),
+UINT64_C(0xe931334bb71296fb),
+UINT64_C(0xfd48e7a571ee47cd),
+UINT64_C(0x2557963af3377f86),
+UINT64_C(0xada1e2c0243de594),
+UINT64_C(0x9c8af478bd7412c4),
+UINT64_C(0xc9596c615a6dcdb9),
+UINT64_C(0xf923a3e8d487dd19),
+UINT64_C(0x916403e07931bd62),
+UINT64_C(0x179e8ad5591425b2),
+UINT64_C(0x4000c6e75a351ebc),
+UINT64_C(0x071847255ab93cdd),
+UINT64_C(0xafef1e104a76c69b),
+UINT64_C(0x8bc60238c90e4e9d),
+UINT64_C(0x827a37bd602b16d3),
+UINT64_C(0xe7ab1110698250b7),
+UINT64_C(0xc8f5ea57c94ea03e),
+UINT64_C(0x5c0c1a600f6b0c10),
+UINT64_C(0xdb74169755d6a3d0),
+UINT64_C(0xa99be54b493ab645),
+UINT64_C(0xb4c18327c8eff801),
+UINT64_C(0x3f7bbd1e3e703e8f),
+UINT64_C(0x1f81ee93943eb998),
+UINT64_C(0x550467e3a31e9525),
+UINT64_C(0x9e7670054387ca40),
+UINT64_C(0x4a0f367db798a2d4),
+UINT64_C(0xc5a1a1afcb6b4dbc),
+UINT64_C(0x466591d713d2c40d),
+UINT64_C(0xbd97273855362ef9),
+UINT64_C(0x167aaf8ae0e0e905),
+UINT64_C(0x6672e51fa7984b3b),
+UINT64_C(0x35f3d26fbe640025),
+UINT64_C(0xd9da8deb85293dd4),
+UINT64_C(0x4be687adafacc5e9),
+UINT64_C(0x401a43b0bf82b0c9),
+UINT64_C(0x901a4fba4b0bbb19),
+UINT64_C(0xb06d6269c4ecba2b),
+UINT64_C(0x7dc186ab83ea87b0),
+UINT64_C(0xb30faf76d0eb3492),
+UINT64_C(0x38c93ca152543b5e),
+UINT64_C(0x87667bd4688c4e69),
+UINT64_C(0x97d5ab4f261f1aa9),
+UINT64_C(0x5f77a5df5943e801),
+UINT64_C(0xd5b9e79d598e3e39),
+UINT64_C(0x0347c0c604cf3ea3),
+UINT64_C(0x8a33e0f848c9d25a),
+UINT64_C(0xa6f65a7c646a2313),
+UINT64_C(0x72a3847fdfd06398),
+UINT64_C(0x3f3dcc1982f61b71),
+UINT64_C(0xe094a9779d354457),
+UINT64_C(0xcfdab402d05f2285),
diff --git a/devices/harness-device/firmware/test/bridge_flow_replay.py b/devices/harness-device/firmware/test/bridge_flow_replay.py
new file mode 100644
index 000000000..01b526ac0
--- /dev/null
+++ b/devices/harness-device/firmware/test/bridge_flow_replay.py
@@ -0,0 +1,64 @@
+"""Replay frames emitted by a built bridge through the C parser, handlers and renderer.
+
+Only the four turn/result handlers are selected from production here. This does
+not claim coverage of the whole cable dispatcher, physical USB, or the display.
+"""
+import json
+import re
+from pathlib import Path
+
+
+def instrument(code, trace_file, main):
+ traces = json.loads(Path(trace_file).read_text())
+ assert {t['id'] for t in traces} >= {'codex-working', 'claude-activity', 'completed', 'next-turn'}
+ start = code.index('typedef struct cJSON {')
+ end = code.index('static action_t pressed_action;', start)
+ code = code[:start] + '#include "cJSON.h"\nenum { JSTRING=cJSON_String,JTRUE=cJSON_True };\n' + code[end:]
+ cable = (main / 'cable_client.c').read_text()
+
+ def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', cable, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+ handler = function('handle_message')
+ prefix = handler[:handler.index(' if (strcmp(t, "welcome")')]
+ identity = handler[handler.index(' const char *agent_id ='):handler.index(' if (strcmp(t, "focus")')]
+ events = handler[handler.index(' if (strcmp(t, "turn.started")'):handler.index(' // The WINDOW looked')]
+ extra = r'''
+#include "cJSON.h"
+#include "cable_frame.h"
+#include "cable_json_guard.h"
+#define DEVICE_HABITAT 1
+static int64_t s_last_rx_us;
+static uint32_t s_bad, s_unknown;
+static int64_t esp_timer_get_time(void) { return (int64_t)fake_ms * 1000 + 1; }
+static void fw_update_slice(const uint8_t *p, size_t n) { (void)p; (void)n; assert(!"Unexpected firmware write in replay"); }
+static void audio_notify_done(void) {} // no real speaker or audio hardware in this harness
+'''
+ extra += function('str_of') + function('bool_of')
+ extra += prefix + identity + events + ' assert(!"Unexpected message in turn/result replay");\n}\n'
+ extra += function('on_frame')
+ extra += '\nstatic void bridge_flow_checks(void) {\n'
+ for i, trace in enumerate(traces):
+ assert trace['frames']
+ raw = bytes.fromhex(''.join(trace['frames']))
+ assert 0 < len(raw) <= 65536
+ wanted = trace['expect']
+ extra += '{\nstatic const uint8_t bytes[]={' + ','.join(str(x) for x in raw) + '};\n'
+ extra += 'static const size_t chunks[]={1,7,512,8200};\n'
+ extra += 'for(unsigned c=0;c<4;c++) {\nreset();s_bad=s_unknown=0;fake_ms=1000;\n'
+ extra += 'cable_decoder_t decoder;cable_decoder_init(&decoder);\n'
+ extra += 'for(size_t at=0;at<sizeof bytes;at+=chunks[c]) {size_t n=sizeof bytes-at;if(n>chunks[c])n=chunks[c];cable_decoder_feed(&decoder,bytes+at,n,on_frame,NULL);}\n'
+ extra += 'assert(!decoder.corrupt_frames && !decoder.discarded_bytes && !s_bad && !s_unknown && s_last_rx_us);scene_take();\n'
+ extra += f'assert(active()->busy=={str(wanted["busy"]).lower()});assert(result_visible()=={str(wanted["recap"]).lower()});\n'
+ extra += 'assert(!strcmp(active()->tool,' + json.dumps(wanted['status']) + '));\n'
+ if wanted['status']:
+ extra += 'bool found=false;for(int r=0;r<scene.count;r++) if(scene.runs[r].arc==2 && !strcmp(scene.runs[r].text,' + json.dumps(wanted['status']) + ')) {assert(scene.runs[r].fg==FG);found=true;}assert(found);\n'
+ extra += 'uint16_t pixels[466],bg=(uint16_t)((scene.background<<8)|(scene.background>>8));unsigned ink=0;uint32_t hash=2166136261u;for(int y=0;y<466;y++) {ht_raster(&scene,(ht_rect_t){0,y,466,1},pixels);for(int x=0;x<466;x++){ink+=pixels[x]!=bg;hash=(hash^pixels[x])*16777619u;}}assert(ink>100 && ink<466*466/2);\n'
+ extra += 'if(c==0){printf("bridge flow: %s rendered hash=%08x ink=%u PASS\\n",' + json.dumps(trace['id']) + ',hash,ink);const char *dir=getenv("HABITAT_PREVIEW_DIR");if(dir)portrait(dir,' + json.dumps('bridge-' + trace['id']) + ');}\n'
+ extra += '}\n}\n'
+ extra += 'reset();puts("Built bridge -> framed bytes -> production C JSON/turn handlers -> scene/raster PASS");\n}\n'
+ marker = 'int main(int argc, char **argv) {'
+ assert code.count(marker) == 1
+ return code.replace(marker, extra + marker + '\n bridge_flow_checks();\n')
diff --git a/devices/harness-device/firmware/test/device_release_check.py b/devices/harness-device/firmware/test/device_release_check.py
new file mode 100644
index 000000000..f63af90b7
--- /dev/null
+++ b/devices/harness-device/firmware/test/device_release_check.py
@@ -0,0 +1,112 @@
+#!/usr/bin/env python3
+"""Check an exact bridge artifact against the native device implementation.
+
+Offline: does not launch the app, open USB, send a prompt, or transcribe audio.
+Physical display/touch/audio checks are a separate, explicitly recorded step.
+"""
+import argparse
+import hashlib
+import json
+import os
+from pathlib import Path
+import re
+import shutil
+import subprocess
+import sys
+import time
+
+HERE = Path(__file__).resolve().parent
+ROOT = HERE.parents[3]
+CLI = ROOT / 'cli'
+
+
+def fingerprint(file):
+ data = file.read_bytes()
+ return {'bytes': len(data), 'sha256': hashlib.sha256(data).hexdigest()}
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument('--bundle', required=True, type=Path)
+ parser.add_argument('--out', required=True, type=Path)
+ parser.add_argument('--firmware-image', type=Path,
+ help='Record its hash; this does not prove binary/source equivalence.')
+ args = parser.parse_args()
+ args.bundle = args.bundle.resolve(strict=True)
+ args.out = args.out.resolve()
+ if args.out.exists() and any(args.out.iterdir()):
+ parser.error('--out must be an empty directory so old results cannot look current')
+ args.out.mkdir(parents=True, exist_ok=True)
+ sdk = Path(os.environ.get('IDF_PATH', '')) / 'components/json/cJSON/cJSON.c'
+ if not sdk.is_file():
+ parser.error('Set IDF_PATH to the firmware SDK; real cJSON replay is required')
+ for tool in ['node', 'cc', 'bash']:
+ if not shutil.which(tool):
+ parser.error(f'{tool} is required')
+ loader = CLI / 'node_modules/tsx/dist/loader.mjs'
+ if not loader.is_file():
+ parser.error('Install the CLI test dependencies first')
+
+ def inputs():
+ files = {args.bundle, sdk, sdk.with_name('cJSON.h'), CLI / 'package-lock.json'}
+ if args.firmware_image:
+ files.add(args.firmware_image.resolve(strict=True))
+ for rel in ['devices/harness-device/firmware/main',
+ 'devices/harness-device/firmware/test', 'cli/src', 'cli/scripts']:
+ files.update(p for p in (ROOT / rel).rglob('*')
+ if p.is_file() and '__pycache__' not in p.parts
+ and p.suffix in {'.c', '.h', '.inc', '.py', '.sh', '.ts', '.mts', '.mjs'})
+ # The installed repair can use a standalone parser. Include its bytes too.
+ for helper in re.findall(r'[\'"](\./device-activity[^\'\"]+)[\'"]',
+ args.bundle.read_text()):
+ files.add((args.bundle.parent / helper).resolve(strict=True))
+ return {str(p): fingerprint(p) for p in sorted(files)}
+
+ before = inputs()
+ report = {'started': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()),
+ 'scope': 'Built bridge + framed turn/result replay + native sanitizer suite; not hardware E2E',
+ 'inputs': before, 'stages': [], 'passed': False}
+ env = dict(os.environ, SANITIZERS='address,undefined')
+
+ def stage(name, command, cwd=ROOT, timeout=600):
+ print(f'{name}: running', flush=True)
+ start = time.monotonic()
+ with (args.out / (name + '.log')).open('w') as log:
+ result = subprocess.run(command, cwd=cwd, env=env, stdout=log,
+ stderr=subprocess.STDOUT, timeout=timeout)
+ report['stages'].append({'name': name, 'exit_code': result.returncode,
+ 'seconds': round(time.monotonic() - start, 2)})
+ print(f'{name}: {"PASS" if result.returncode == 0 else "FAIL"}', flush=True)
+ if result.returncode:
+ raise RuntimeError(f'{name} failed; see {args.out / (name + ".log")}')
+
+ try:
+ stage('built-bridge', ['node', '--import', str(loader),
+ str(CLI / 'scripts/device-release-check.mts'), '--bundle', str(args.bundle),
+ '--out', str(args.out / 'bridge')])
+ stage('host-contracts', [str(CLI / 'node_modules/.bin/vitest'), 'run',
+ 'src/cable', 'src/device/deviceFleet.spec.ts',
+ 'src/lib/deviceRecap.spec.ts', 'src/lib/deriveTurnSummary.spec.ts',
+ 'src/lib/sessionInput.spec.ts', 'src/lib/askQuestion.spec.ts',
+ 'src/lib/summarize.spec.ts'], cwd=CLI)
+ env['HABITAT_BRIDGE_TRACE'] = str(args.out / 'bridge/firmware-traces.json')
+ env['HABITAT_PREVIEW_DIR'] = str(args.out / 'previews')
+ stage('native-sanitizers-and-wire-replay', ['bash', str(HERE / 'run.sh')])
+ report['passed'] = True
+ except (RuntimeError, subprocess.TimeoutExpired) as error:
+ report['error'] = str(error)
+ finally:
+ after = inputs()
+ report['inputs_unchanged'] = before == after
+ if before != after:
+ report['passed'] = False
+ report['changed_inputs'] = [p for p in sorted(before.keys() | after.keys())
+ if before.get(p) != after.get(p)]
+ report['ended'] = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
+ (args.out / 'release-report.json').write_text(json.dumps(report, indent=2) + '\n')
+ print(f'Release checks: {"PASS" if report["passed"] else "FAIL"}; {args.out}', flush=True)
+ return 0 if report['passed'] else 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/devices/harness-device/firmware/test/native_shapes.py b/devices/harness-device/firmware/test/native_shapes.py
new file mode 100644
index 000000000..6a06a25a7
--- /dev/null
+++ b/devices/harness-device/firmware/test/native_shapes.py
@@ -0,0 +1,18 @@
+"""Use the firmware's real protocol capacities and POD structs in host tests."""
+from pathlib import Path
+import re
+
+MAIN = Path(__file__).resolve().parent / '../main'
+PROTOCOL = (MAIN / 'cable_client.h').read_text()
+
+
+def defines(*names, source=PROTOCOL):
+ return ''.join(re.search(r'^#define ' + re.escape(name) + r'\s+[^\n]+$', source, re.M).group(0) + '\n'
+ for name in names)
+
+
+def typedef(name, source=PROTOCOL):
+ for match in re.finditer(r'typedef struct\s*\{[^}]*\}\s*(\w+);', source):
+ if match[1] == name:
+ return match[0] + '\n'
+ raise ValueError(f'No flat production struct named {name}')
diff --git a/devices/harness-device/firmware/test/reference48/README.md b/devices/harness-device/firmware/test/reference48/README.md
new file mode 100644
index 000000000..3df46ee72
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/README.md
@@ -0,0 +1,19 @@
+# Renderer reference before the overnight optimizations
+
+These are byte-for-byte captures of the `.48` text compositor and octopus layout,
+before the glyph cache, packed artwork, ASCII fast paths, and curved glyph bounds.
+The terminal capture was made before `.49`; the unchanged octopus implementation
+and unpacked poses were captured before `.50`. File hashes and snapshot paths are
+recorded in `source-hashes.json`.
+
+The small wrapper translation units give public functions an `ht48_` namespace.
+Both versions use the same font atlases, geometry table, scene structures, input
+fixtures, and display driver. A native regression compares their complete scenes,
+damage rectangles, and final pixels before the hardware A/B benchmark is run.
+
+This is a rendering reference, not the stock LVGL UI. It already includes the
+larger `.48` reading layout. Timing it does not measure touch sampling, app command
+delivery, speech recognition, panel scanout, or time to photons.
+
+These sources and the unpacked reference artwork are excluded from normal images.
+Do not optimize them or use their image size as the production image size.
diff --git a/devices/harness-device/firmware/test/reference48/octopus.c.inc b/devices/harness-device/firmware/test/reference48/octopus.c.inc
new file mode 100644
index 000000000..b8ecad29e
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/octopus.c.inc
@@ -0,0 +1,235 @@
+#include "octopus.h"
+#include <string.h>
+#include "perf_bench.h"
+
+#include "octopus_art.inc"
+_Static_assert(sizeof octopus_frames / sizeof octopus_frames[0] == HT_OCTOPUS_FRAMES, "octopus poses");
+
+bool ht_octopus_motion_tick(ht_octopus_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, int x,
+ unsigned level, uint32_t activity)
+{
+ bool changed = ht_tim_motion_tick(&m->reaction, now, mood, quiet, visible, down, x, level, activity);
+ bool running = visible && !quiet && !down && mood != HT_TIM_LISTENING &&
+ mood != HT_TIM_ASLEEP && mood != HT_TIM_OFFLINE;
+#ifdef DEVICE_OCTOPUS_BENCH
+ // Freeze only the body; preserve identical gaze, blink, mic and touch code for the A/B.
+ running = running && octopus_perf_animate();
+#endif
+ // The exact gallery cadence when working; a gentler half-speed idle swim.
+ uint8_t rate = mood == HT_TIM_CONTENT ? 2 : 1;
+ uint8_t old_frame = m->frame;
+ if (m->initialized && m->running && running) {
+ uint32_t elapsed = now - m->last_ms;
+ // Reduce before multiplying/adding, including across the millisecond wrap.
+ uint32_t scaled = elapsed % (HT_OCTOPUS_DURATION * m->rate) + m->remainder;
+ m->phase = (m->phase + scaled / m->rate) % HT_OCTOPUS_DURATION;
+ m->remainder = scaled % m->rate;
+ } else m->remainder = 0;
+ if (m->rate != rate) m->remainder = 0;
+ m->initialized = true; m->running = running; m->rate = rate; m->last_ms = now;
+ m->frame = 0;
+ while (m->frame + 1 < HT_OCTOPUS_FRAMES && m->phase >= octopus_ends[m->frame]) m->frame++;
+ m->next_ms = m->reaction.next_ms;
+ if (running) {
+ uint32_t next = (octopus_ends[m->frame] - m->phase) * rate - m->remainder;
+ if (next < m->next_ms) m->next_ms = next ? next : 1;
+ }
+ return changed || m->frame != old_frame;
+}
+
+static void lines(ht_scene_t *s, int y, int width, int count, const ht_font_t *font,
+ uint16_t ink, const char *text, bool mark, const int *widths)
+{
+ if (!text) text = "";
+ int start = s->count;
+ const char *rest = text;
+ for (int row = 0; row < count; row++) {
+ int w = widths ? widths[row] : width;
+ const char *begin = rest, *end = ht_take_line(&rest, w / font->width);
+ char line[HT_TEXT_BYTES];
+ size_t n = (size_t)(end - begin);
+ if (n >= sizeof line) n = sizeof line - 1;
+ memcpy(line, begin, n); line[n] = 0;
+ ht_text(s, (HT_WIDTH - w) / 2, y + row * font->height, w, font, ink, s->background, line);
+ }
+ if (mark && *rest && s->count > start) {
+ char *line = s->runs[s->count - 1].text, *p = line, *space = NULL;
+ int keep = (widths ? widths[count - 1] : width) / font->width - 2;
+ for (int i = 0; *p && i < keep; i++) {
+ if (*p == ' ') space = p;
+ const char *next = p; ht_utf8_next(&next); p = (char *)next;
+ }
+ if (*p && *p != ' ' && space) p = space;
+ while (p > line && p[-1] == ' ') p--;
+ strcpy(p, " +");
+ }
+ for (int i = start; i < s->count; i++) {
+ ht_run_t *r = &s->runs[i]; const char *p = r->text; int n = 0;
+ while (*p) { ht_utf8_next(&p); n++; }
+ r->w = n * font->width; r->x = (HT_WIDTH - r->w) / 2;
+ }
+}
+
+static void expression(char row[55], int y, int eye, const ht_tim_face_t *f)
+{
+ if (y == eye) {
+ const char *eyes = NULL;
+ char gaze[4] = " @ ";
+ if (f->pose.pressed || f->pose.look) {
+ memset(gaze, ' ', 3);
+ gaze[f->pose.look < 0 ? 0 : f->pose.look > 0 ? 2 : 1] = '@';
+ eyes = gaze;
+ } else if (f->pose.blink || f->mood == HT_TIM_ASLEEP) eyes = "---";
+ else if (f->mood == HT_TIM_ATTENTION) eyes = " O ";
+ else if (f->mood == HT_TIM_DONE || f->mood == HT_TIM_BOOPED) eyes = " ^ ";
+ else if (f->mood == HT_TIM_OFFLINE) eyes = " - ";
+ if (eyes) { memcpy(row + 19, eyes, 3); memcpy(row + 30, eyes, 3); }
+ }
+ if (f->unread) {
+ // The right tentacle stays raised while unread messages remain. It is
+ // part of the same ASCII portrait, registered to the bobbing head;
+ // no badge, extra run, independent timer or animated asset.
+ static const struct { uint8_t x; const char *ink; } arm[] = {
+ {46, ",;oo,"}, {45, ":#..#;"}, {45, ";# .:;"},
+ {45, ";#;"}, {45, ";#;"}, {44, " ;#;"},
+ {43, " ;##"}, {42, " .##;"}, {41, " .##;"},
+ {39, " .x##;"}, {36, " .x##%;."}, {33, " .x####xo."}
+ };
+ int pose_row = y - eye + 5;
+ if (pose_row >= 0 && pose_row < 12) {
+ memset(row + 42, ' ', 12);
+ memcpy(row + arm[pose_row].x, arm[pose_row].ink, strlen(arm[pose_row].ink));
+ }
+ }
+ if (f->mood == HT_TIM_LISTENING && (y == eye + 2 || y == eye + 3)) {
+ static const char *mouth[5][2] = {
+ {"###.###", "#######"}, {"##---##", "#######"}, {"##(o)##", "#######"},
+ {"#( o )#", "##(_)##"}, {"#( O )#", "#(___)#"}
+ };
+ unsigned level = f->pose.level > 4 ? 4 : f->pose.level;
+ memcpy(row + 23, mouth[level][y - eye - 2], 7);
+ }
+}
+
+static void recap_lines(ht_scene_t *s, int y, int width, int rows, bool centered, const int *widths,
+ uint16_t ink, const char *recap)
+{
+ // Every nonempty recap ends in the desktop arrow, including complete
+ // sentences. Reserve its cell before wrapping; cached host markers dedupe.
+ // Seven visible rows use a bounded UTF-8 prefix. Bound the prefix
+ // even when the source is longer than the device's stored recap buffer.
+ char marked[7 * HT_TEXT_BYTES + 3];
+ size_t used = 0;
+ const char *p = recap ? recap : "";
+ while (*p) {
+ const char *start = p;
+ ht_utf8_next(&p);
+ size_t bytes = (size_t)(p - start);
+ if (used + bytes + 3 > sizeof marked) break;
+ memcpy(marked + used, start, bytes);
+ used += bytes;
+ }
+ while (used && marked[used - 1] == ' ') used--;
+ marked[used] = 0;
+ if (used && !(used >= 2 && !strcmp(marked + used - 2, " +")))
+ strcpy(marked + used, " +");
+ int start = s->count;
+ lines(s, y, width, rows, &ht_mono_20, ink, marked, true, widths);
+ // The host's continuation marker and the display's own row-overflow marker
+ // both reserve " +". Replace only that final sign with the desktop action
+ // glyph; keeping the space and cell width preserves wrapping and centering.
+ for (int i = s->count - 1; i >= start; i--) {
+ ht_run_t *r = &s->runs[i];
+ size_t n = strlen(r->text);
+ if (!n) continue;
+ // Wrapping can leave the marker on a row of its own. Bring the last
+ // word with it when it fits, so the arrow stays attached to prose.
+ if (n == 1 && r->text[0] == '+' && i > start) {
+ ht_run_t *prev = &s->runs[i - 1];
+ char *word = strrchr(prev->text, ' ');
+ word = word ? word + 1 : prev->text;
+ const char *p = word;
+ int cells = 0;
+ while (*p) { ht_utf8_next(&p); cells++; }
+ if (cells && cells + 2 <= (widths ? widths[i - start] : width) / ht_mono_20.width &&
+ strlen(word) + 3 <= sizeof r->text) {
+ strcpy(r->text, word);
+ strcat(r->text, " +");
+ while (word > prev->text && word[-1] == ' ') word--;
+ *word = 0;
+ p = prev->text;
+ int kept = 0;
+ while (*p) { ht_utf8_next(&p); kept++; }
+ prev->w = kept * ht_mono_20.width;
+ prev->x = (HT_WIDTH - prev->w) / 2;
+ r->w = (cells + 2) * ht_mono_20.width;
+ r->x = (HT_WIDTH - r->w) / 2;
+ n = strlen(r->text);
+ }
+ }
+ if ((n >= 2 && !strcmp(r->text + n - 2, " +")) ||
+ (n == 1 && r->text[0] == '+')) {
+ r->text[n - 1] = 0;
+ r->w -= ht_mono_20.width;
+ ht_text(s, r->x + r->w, r->y, ht_open_20.width, &ht_open_20,
+ ink, s->background, "\xe2\x86\x97");
+ }
+ break;
+ }
+ if (centered) {
+ int bottom = y;
+ for (int i = start; i < s->count; i++)
+ if (s->runs[i].text[0]) bottom = s->runs[i].y + ht_mono_20.height;
+ // y describes the full five-row area. Center the actual prose inside it.
+ int shift = (rows * ht_mono_20.height - (bottom - y)) / 2;
+ for (int i = start; i < s->count; i++) s->runs[i].y += shift;
+ }
+}
+
+void ht_recap_lines(ht_scene_t *s, int y, uint16_t ink, const char *recap)
+{
+ recap_lines(s, y, 336, 3, false, NULL, ink, recap);
+}
+bool ht_octopus_short_recap(const char *recap)
+{
+ return recap && *recap && ht_text_rows(recap, &ht_mono_20, 324) <= 3;
+}
+
+static void recipient(ht_scene_t *s, const ht_tim_face_t *f, int y)
+{
+ // In reading mode the name labels the message directly underneath it.
+ // Long names wrap without changing the text size.
+ lines(s, y, 320, 2, &ht_mono_20, f->dim, f->recipient, false, NULL);
+}
+
+void ht_octopus_face(ht_scene_t *s, const ht_tim_face_t *f, uint8_t frame, uint16_t ink,
+ const char *recap)
+{
+ if (frame >= HT_OCTOPUS_FRAMES) frame = 0;
+ // The outcome owns the reading space after a turn. Artwork and its label
+ // move together above the recap; the status footer stays fixed.
+ bool result = recap && *recap;
+ bool brief = result && ht_octopus_short_recap(recap);
+ bool compact = f->focus || f->carrying;
+ const ht_font_t *font = result ? (brief ? &ht_octopus_font_6 : &ht_octopus_font_4) : compact ? &ht_octopus_font_8 : &ht_octopus_font_10;
+ int y = result ? (brief ? 78 : 72) : compact ? 113 : 98;
+ int x = (HT_WIDTH - HT_OCTOPUS_COLS * font->width) / 2;
+ if (f->mood == HT_TIM_OFFLINE || f->mood == HT_TIM_ASLEEP) ink = f->dim;
+ for (int i = 0; i < HT_OCTOPUS_ROWS; i++) {
+ char row[55]; memcpy(row, octopus_frames[frame][i], sizeof row);
+ expression(row, i, octopus_eyes[frame], f);
+ ht_text(s, x, y + i * font->height, HT_OCTOPUS_COLS * font->width, font, ink, s->background, row);
+ }
+ if (f->straight_title) recipient(s, f, ht_octopus_title_y(result, compact));
+ else ht_arc_title(s, f->dim, f->recipient);
+ // Keep slots stable through long titles and animation; damage stays local.
+ static const int reading_widths[] = {396, 396, 384, 372, 348, 324, 276};
+ static const int brief_widths[] = {372, 348, 324};
+ if (result) recap_lines(s, brief ? 252 : 194, brief ? 372 : 396,
+ brief ? 3 : 7, false, brief ? brief_widths : reading_widths, f->foreground, recap);
+ else lines(s, 337, 320, 1, &ht_mono_20, f->dim, compact ? f->detail : "", false, NULL);
+ if (!f->footer_action && !f->straight_title) ht_arc_status(s, f->ink, f->status);
+ else lines(s, f->footer_action ? 369 : 385, 276, 1, &ht_mono_20, f->ink, f->status, false, NULL);
+ lines(s, 417, 210, 1, &ht_mono_20, f->dim, f->hint, false, NULL);
+}
diff --git a/devices/harness-device/firmware/test/reference48/octopus_art.inc b/devices/harness-device/firmware/test/reference48/octopus_art.inc
new file mode 100644
index 000000000..42f224162
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/octopus_art.inc
@@ -0,0 +1,1834 @@
+// Generated by scripts/gen_octopus.py. Do not edit.
+// Adapted from ferrebarrat/brrtfetch, gifs/defaults/brrt.gif.
+// Exact approved gallery text frames; see prototype/habitat/CREATURE_GALLERY_02.md.
+static const char octopus_frames[63][27][55] = {
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@############%;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ;xoo, .;o%####x:%####o;#####xo: xxox. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. x:.:%x; ",
+ " o@#: .. ..,oxx#######%xx:., ,. x@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,:,. .%@@ ",
+ " .@@#x;;;;;;oo.o%#%oo%%#@%%%%;%#%;,;o;;;;;;o#@x: ",
+ " .,o@@%%@@;,:%#@@,o%##@@%###%,o##%o;@@#x@@%,.. ",
+ " ;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " ,x#@@%@@x,:. o##@; @@##. .:,x@@@@%@#%%;, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " ;@::, .:o, o@@. %@#. .oo: @@x ",
+ " xo; :#, .x@@. x@@,. .o% o;:o#; ",
+ " :@@;:o#@%: ,o@@%;:#@% ,:: ",
+ " ..x#@#x: .x#@#x:. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@##############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###x.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .oxxx,. ,;o%####%:%###%o;#####o;: ,xxx,. ",
+ " ,x#;. ;: :;o%####;::::x###%x;:. ;,.,%%o ",
+ " o@#, ...oox#######%oo:.. %@@ ",
+ " ;#@x:. .:::oo;;oooooooo;oo;,;,. .#@# ",
+ " .@@#o;;;;;;ox.o%#%oo##@@%##%;%#%;,;x;;;;;;o#@o, ",
+ " ..o@@%%@@;::%#@@.o%##@@####%,o@#%o;@@#x@@%,. ",
+ " .;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " o%#@##@@@x,,. o##@; @@##. .,,x@@@@%@#%%;, ",
+ " #@% o#@%: %@@#. .%x#:. ",
+ " @#::. o@@. %@#. :@#: ",
+ " ,xo, .xxo .x@@. x@@,. xxx ,x:;x%, ",
+ " :@# ,;@@%: ,o@@x: x@ ::: ",
+ " :%%#@#x, .x#@#%%o ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " oooooooooooo:. ",
+ " .;%@@@@###########%o. ",
+ " .:@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%xo,o#####%;, ",
+ " :;;;. :o%##x.%::######;,#.o####%;. :;; ",
+ " .xo;,,o: .,o###%%%%%#####%x%%%###x;. x;:ox: ",
+ " ;@#: .,;x%###%;ooooo;o####x;:, %@@ ",
+ " ;@#: .:;o####xxxxx%###xo;.. %@@ ",
+ " .@#; ....;;o%%%%%%%x;;,.... .,@o ",
+ " o@@x......,:::o%xooxxxxxxxo;x%o.;;:......;@x: ",
+ " .x@@#@@o;;;;%#@xox##@@%##%ox%#%:;;%@@#@@#. ",
+ " .,:::::%%%##@#o o##@@@@####.x@#@#%#;::;,,, ",
+ " ,o%@@#@@@@xo%o,. o###o,,@@##...o%oo@@@@#@@@%o: ",
+ " o@%;,.,,,,. o##@; @@##. ,,,,.,,,:@@x, ",
+ " x@,:o o@@:. :#@#. o@#. ",
+ " .:xo: o@@. %@#. ;o.,x@. ",
+ " x@@. #@#. .;o; ",
+ " oo: :#@%. o@@;, ,;x, ",
+ " %#x;;x%@x: .o@@%;:o%@, ",
+ " ,;oooo,. ,:oxoo; ",
+ " ",
+ },
+ {
+ " .. .. ",
+ " .,:@@@#########x;:. ",
+ " :#@@@@@############%:. ",
+ " .:o@@@##############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xo%########%oo%######o, ",
+ " :xxx, ,ox###o.@xo######[email protected]####%o,. oxx. ",
+ " .%#o. ,;x##x:::;######o:::x###%x: :..:#%; ",
+ " ,@@; ,;x%####%;#####xo#####xo: #@@ ",
+ " ,@#; .:;x%###%:::::o%###%o;, ##x ",
+ " @@; ,,,xx%########xx;,, ,x@o ",
+ " x@@:. :,,:;;;oooooooo;;;:,:, :x@:. ",
+ " :%@##@xxxo:ox##oo%%##%%%x;##%,.;xx###@@x. ",
+ " o;;ooooo##@@:ox#%@@%##%x:%@#%xooo;:o, ",
+ " .,x%##%###@%%@%,., o##@@##@###.;%o##x@###%##%%o, ",
+ " :%@o;ox:oooo. o##@; @@##. oooo;oo;o#@o. ",
+ " %@#,. o#@@: @@@#. .:@#o ",
+ " ,;;, o@@. %@#. .;..o@o ",
+ " o@@. %@#. ,ox%,. ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " %x, .,:#@x. :@@x;, .:@, ",
+ " :x#%#@@o, ;%@@%%%;. ",
+ " ..... ..... ",
+ },
+ {
+ " ;;;;;;;;;;;;,. ",
+ " :o%@@@#########%%x;. ",
+ " .,#@@@@@###########@@#x;. ",
+ " ,o%@@@###############@@#%x: ",
+ " .;x#######################%o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ,,, ;%####x,:x########x:,o######;, . ",
+ " .x#x:.. :o%##o.@;:######;:@.o####%; ,;#x: ",
+ " ,@@; .:o##%xxxx######%xxx%###x;. %@@ ",
+ " ,@#; .:;x%###x:xxxxx;;####%;;, %@@ ",
+ " ,@#: ,:ox####ooooo%###%o;,. .;@x. ",
+ " %@#, ....;;o%%%%%%%%;;:... ,o@x: ",
+ " x@%o;;;;;;,:;xxo;oooooooo;xxo.,:;;;;;;##x ",
+ " .,@%#@::::x%%#%oo##@@%##%;%%#xx;::x%x#o, ",
+ " ..oooooo;o##@@%##% o%#@@@####%.o#o@@##xooooooo;, ",
+ " o%#%%@#x@@@#,::, o###o::@@##. ::,;#@##x##%@@x, ",
+ " @#x o##@;. @@##. .:%@#,",
+ " ,:: o@@o, o#@#. .::@#:",
+ " o@@. %@#. ,:;: ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " ,, :#@o :%@o:. .: ",
+ " o%x,;x%@x, .,@@#x,:x@. ",
+ " :oxxo ,;ooo: ",
+ },
+ {
+ " .%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " .:@@@@@############@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " :x%###o.xxx######xxx.o#####x:. ",
+ " .,xx: :o%##o.o,:######;,o.o####%; ;o ",
+ " o@:. ,;%#####%x#####%x#####%o: .:@, ",
+ " x@;. .,;o%###%o;;;;;ox###%x;:. ,o@, ",
+ " ;@@x;. .::;%%%#%%%%%##%%o;:. .o#@. ",
+ " .x@#x,. ,.,,;;oxxxxxxxo;;:,.,. .:x@%; ",
+ " ,x@%xxxxxxx.:o%%ooxx%xxxxx;%%x..;xxxxxx%#@:. ",
+ " ::::::::::::###@oox##@@%##%oo%@##o::,,,::,:,. ",
+ " ox%#@@#@@@@@@@@@o:; o##@@@@####.,o#@@#@@@@#@@#@%oo. ",
+ " @x, . . .. o###; @@##. ... .. o#x@#:",
+ " :, o@@o, o#@#. .o##:",
+ " %@#. .:@#: ... ",
+ " #@# ,@@; ",
+ " #@# :@@; ",
+ " #@# ,@@; ",
+ " #@# ,@#; ",
+ " .,@#o .%@o, ",
+ " :x ;@;. :%#;.:o ",
+ " .x%xo ,#xoo ",
+ },
+ {
+ " ..###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " .:xx; :o%##x.;,:######;,;.o###%x; ;x. ",
+ " o@,. ,;%#####%o#####xx#####%o: :@, ",
+ " x@;. ..;ox###%x:::::ox###%o;:. ,o@: ",
+ " ;#@%;. ,::%%%########%%o::. .o@@ ",
+ " .o@@x:. ,,,:;;oxxxxxxxo;;:,.,. ,;%@%; ",
+ " .o@%xxxxxxx,;x%%oo%%%%%%%x;%#x,,;xxxxxxx%@:. ",
+ " .;::::::::::;##@@;ox#%@@%##%o;%@##o::::::::::, ",
+ " x%%%@@%@@@@@#@@@o:: o##@@@@####.,;#@@#@@@@%@@%@@%%x: ",
+ " @x. o#@@: @@##. .o@@:",
+ " ,. ;%@@;. ;#@#o, .:::.",
+ " #@@ ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " .,@%; .x@x: ",
+ " ,x..;@:. ,x@o.;o ",
+ " oxo; .%oo; ",
+ },
+ {
+ " .,###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###x.xxx######xo%.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%x; ",
+ " ,,: ,;%#####%o#####xx#####%o: . ",
+ " @x: .,;ox###%x:::::ox###%o;:. ,;## ",
+ " @#o. ,::%%%########%%o::. .:@#.",
+ " o#@%;, ,,,,;;oxxxxxxxo;;:,.,. ,o#@x, ",
+ " .;@@#x,,,,,,:;,;x#%oo%%%%%%%x;%#x,;;;,,,,,,:x@@#, ",
+ " .:;:,@##@@@%;;%#@;ox##@@%##%o;x##:;x@@@#@@%;.::. ",
+ " :#xo%x .,,,::o#@%: o##@@@@####.x@##xo,:,.,:;##xxx%, ",
+ " ,;, ;#@###@#@@#, :x#@x, #@@#;.,@x#@@@@#@@@#. ,ox. ",
+ " ;;;:o;o; .#@#; :x@#x; :;;;;:o;: ",
+ " ;@#; #@%:. ",
+ " ;@, %@# ",
+ " o@, %@# ",
+ " o@. %@# ",
+ " o@:. .%@% ",
+ " ,x@; ##% ",
+ " ;x%;. :x%x. ",
+ " ",
+ },
+ {
+ " oooooooooooo:. ",
+ " .;%@@@@###########%o. ",
+ " .:@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%x;,o#####%;, ",
+ " :o%##o.%::######;:#.o####%; ",
+ " .,o###%%%%%#####%x%%%###x;. ",
+ " .:;x%###%;ooooo;o####x;:, ",
+ " .:;o####xxxxx%###xo;,. ",
+ ",#o ,..,;;o%%%%%%%x;;:.... ;o,",
+ ".@x, .:::o%%ooxxxxxxxo;x%o.;:: #@:",
+ " %%#@%%%%%%%%xxx,x#@xox##@@%##%ox%#%,;%%%%%%%%%%%%%#x,",
+ " .;.;%xooxx, .%@#x o##@@@@###%.x@#x:.xxx;%xxx%x:. ",
+ " .. .:@#o.x#@@#;,,@@##%oo@#x: ,%%: ",
+ " ;#;. .o@%,:%@@@x ;#@@#x @@%;. ,;ox. ",
+ " :x@#%%%#x: x#@%;. .:#@@#x::@#%x@@% ",
+ " :@@; ,o@@x ",
+ " %@% ,@# ",
+ " %@% :@% ",
+ " .%%o. .,@%; ",
+ " ,oo, :xo. ",
+ " ",
+ " ",
+ },
+ {
+ " ::::::::::::,. ",
+ " ,;x@@@#########%xo: ",
+ " ..%@@@@@###########@@#o:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#@#####################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###o.@;:######;;@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:o%####x:%%%%%o;####%o;: ",
+ " ,;ox####;;;;;%###%x;,. ",
+ " ....oox#######%oo:.. ",
+ "o%; ,:,;:;xxo;oooooooo;xxo,;:::. oo,",
+ "x#x. :ooo%@@.o%#%oo##@@%##%;%#%o,x@#xoo .##:",
+ " ;%@@%#@@%%@#: .%#@#.o%##@@####%.x@#x:. ##x@@#%%##@%;.",
+ " .,,,:;;. ,;@%: o%#@@%oo@@##oox@#o: :::;:::: ",
+ " ;#:;x%#@@#, .%@@@%x:@#x. ",
+ " .,%@@@x: ,x@@@@o:,o. ",
+ " o.:@@x:, .,:o@@@o. ",
+ " ,;x@::@@;. x@#.:: ",
+ " ::::..:@%x; .:o#@: ,: ",
+ " oxx :%%;. ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " oooooooooooo:. ",
+ " .o%@@@@###########%o.. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x.;x%######%x;.o#####%;, ",
+ " :o%##o.%::######;,%.o####%;. ",
+ " .,o###%%%%%#####%x%%%###x;. ",
+ " .,;x%###%;ooooo;o####x;:, ",
+ " .:;o####xxxxx%###xo;,. ",
+ " ....;;o%%%%%%%x;;:.... ",
+ "... ;;;::o%%ooxxxxxxxo;x%o.;;;;. .. ",
+ "%#o .o%#%%##,x#@xox##@@%##%ox%#%:x@%#%%... %%:",
+ ":##%xo%@@@@xo. .%@#o o##@@@@###%.x@##x: oxo@@%;;::x@#,",
+ " ,;;::;:. :%@o:,%#@@#;,,@@##x;;@@#%. o::o;;oo. ",
+ " .,,ox#@@@o ;#@@%x.::;. ",
+ " :ox@@#o%: .:@@@@#%x:. ",
+ " %@#o#; ,:;@@@@x, ",
+ " ., :%o;, ,;o@o. ",
+ " , ::, ,:::. ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ,;o%####x:%####oo#####oo: ",
+ " :;o%####;::::x###%x;:. ",
+ " .,,oox#######%xo:,, ",
+ " %#xo,. .;::oo;;oooooooo;oo;,;,. .;ox@, ",
+ " oox@#%;;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o%@@@o. ",
+ " ,,o@@##@@;::%#@@,o%##@@####%,x##%o;@@@%@@@,,,, ",
+ " ,;;;%##@%; o##@#xx@@##.;%@##%;;;;;. ",
+ " x%@@@@%,:. o%@@:. @@##. .:,x@@@@@#%; ",
+ " @@x ,;;;..,@@@o o#@o, ::: ,@@x ",
+ " @%::,,@%:;x@@o, :#@%; o%% .@@x ",
+ " ;xx: #@@@@x o%#@@@# xx%#: ",
+ " ,:;:, .;;:, ::: ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######o;@.o####%o. ",
+ " ,;x##%;;;o######o;;;x###%o: ",
+ " ,;o%####%:#####o;#####xo: ",
+ " :;o%####;::::x###%x;:. ",
+ " :xoo: .,,oxx#######%xx:,, .;oxo ",
+ " ;@%o:. .:::;o;;oooooooo;o;;,:, .,o%@@ ",
+ " ,;@@@@@@@@#@#%.o%##oo%%#@%%%%;%#%;,;%#@##@@@@@x: ",
+ " ..,,,,:#;::x#@@,o%##@@%###x,o##%o;%o;,:,, . ",
+ " ;;;;;%##@%; o##@#%%@@##.;#@##%:;;;;;: ",
+ " :x#@@#@@%,:. o##@; @@##. .:,x@@@@#@@#o ",
+ " o@#, x@@:. x@@#. o#@:. ",
+ " o@;:, xooo. x@@, x@@;, xo;: o@#: ",
+ " .xx; @@%,,x@#;. .:%@#x:,o#@,.oxx%# ",
+ " :x@@@@o. ;%@@@@@:. .;;, ",
+ " .... ..,,.. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ::::::::::::,. ",
+ " ,;o@@@#########%xo: ",
+ " .x@@@@@###########@@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " .;x#@##################@##%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###o.@;:######;;@.o####%;. ",
+ " ,:o##%ooox######xooo%###%o, ",
+ " .;xxx; .:o%#######x,;#######%o;: %xx%, ",
+ " @@% xo ,;ox#####%;o#####%x;,. %::%@o ",
+ " @@#.,. ...oox#######%oo:.. ,.:#@o ",
+ " :%@@x;;;;;;::;ooo;oooooooo;ooo,;;;;;;;;%@@;, ",
+ " ..,##x@@#%.o%#%oo##@@%##%;%#%o,o@@@#%@o,. ",
+ " o;;;#@@#.o%##@@####%.o@##x;;. ",
+ " ,x%%####@%%@#x: o##@%oo@@##.:x@#%##%#%%%%%,,. ",
+ " .#@#;x;;xo, o##@; @@##. :xxxo;xo;@#o ",
+ " ,@o,. o#@%: x@@#. .#@%. ",
+ " .;x%% o@@. %@#. :: ,@@: ",
+ " .. oxx ,%@@. %@@,. xxo, .;x%;, ",
+ " #%: ,;@@%: ,o@@x: ,x@, ",
+ " ;%@x#@#x, .x%@@%@@x. ",
+ " .:o;, ",
+ " ",
+ },
+ {
+ " ",
+ " oooooooooooo:. ",
+ " .o%@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.;x%######%x;.o#####%;, ",
+ " ::: :o%##o.%::######;,%.o####%;.,;;. ",
+ " .o%%% .,o%##%%%%###%%#%%%%%###x;. ;o#%o ",
+ " .@@o. .,;x%######x.:#######x;:, .%@@ ",
+ " .@#; .:;o#####%x%#####xo;,. ;@@ ",
+ " .@#x:::::....;;o%%%%%%%x;;:...,::::o#@% ",
+ " ,;%@@@@#::o%%ooxxxxxxxo;x%o.:%@@@@%o, ",
+ " :%::::x%#@xox##@@%##%oo%##;:,,. . ",
+ " ..;oooooo##@@#xoo o##@@@@####.x@%@@##x;;;;;;,.. ",
+ " ,o##x%#%###%,... o###o,,@@##. ..,,,@@@@%#@@###;. ",
+ " #@o. o##@; @@##. ,;@%o ",
+ " ,;oo. o@@:. :#@#. ,. .o@x ",
+ " o@@. %@#. ,;x%x: ",
+ " o@@. #@#. ",
+ " o; :#@@. %@@:. : ",
+ " ##x:;x#@%: ,%@@x,..:@, ",
+ " ,;oooo,. :;o@##%;. ",
+ " ",
+ },
+ {
+ " ",
+ " ..,@@@#########o:,. ",
+ " ,%@@@@@############%:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#xo######xo#.o#####x,. ",
+ " :x% :o%##x,::;######;,;,o###%x; ;%:. ",
+ " .%#x: ,;x########%ox########xo: .:#%o ",
+ " .@@o .;ox######x.:######%o;,. .%@@ ",
+ " .@%;. ,::x%%########%%;::. .,x@# ",
+ " o@@xoooo:,,:;;;oooooooo;;:,,:;ooo%@@x: ",
+ " .;#@@%x,;x#%oo%%%%%%%x;%#%,,o#@@x:. ",
+ " ;;;;##@@:ox#%@@%##%x:%@##x;;. ",
+ " :oxx%%x%%%#%#@%:,, o##@@@@@###.;#x@#%#%%%x%%xx;, ",
+ " %#%%ox%;xx%x. o##@; @@##. .x%%x;x%o%#@#:. ",
+ " @#o o##@; @@##. ,:o@#,",
+ " o@@. %@#. .:,:x@; ",
+ " o@@. %@#. oo; ",
+ " o@@. %@#. ",
+ " ;: :#@@. %@#:. ",
+ " %%o:;x%@%;. .:@@%o. .:#. ",
+ " :ooxxo,. ;%@@%%%o. ",
+ " ..,,,. ",
+ },
+ {
+ " ,,,,,,,,,,,,.. ",
+ " ,:o@@@#########%x;, ",
+ " .o@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;#%; .;x###o.@o;######;;@.o####%o. .%x, ",
+ " o@#: ,;x##%;;;o######x;;;x###%o, o@@ ",
+ " o@%, ,;o%#######x,;########o;: %@ ",
+ " o@x, :;ox#####%;o#####%x;:. .%@ ",
+ " o@%;, ...oox#######%oo:.. .%@@ ",
+ " ,o@#x:::,,::;oo;;oooooooo;oo;,::,:;;;@#x ",
+ " o#@@@%::o%#%oo##@@%%#%;%#%;.:##@%xo, ",
+ " ,::, ,o%#@@,o%##@@####%,o##x;. ",
+ " o%%o#@#;::,o%#@@#o o##@%xx@@##. ,%@@##%%x##%oxxxo. ",
+ " %x, ,;@@@@@o:;:. o##@; o@@#. ;;o@@@#x;:%;;x@#; ",
+ " o#@%: o#@%: ,:;@; ",
+ " o@@. ,@#; .::, ",
+ " o@@. :@@; ",
+ " o@@. ,@@; ",
+ " x@@. ,@@; ",
+ " ox.,:;##x .%@x, ",
+ " ,:%#%::. :%@x;o: ",
+ " .,,. ",
+ },
+ {
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%x;,o#####%;, ",
+ " :x%##o.#::######;:#.o####%;. ,,, ",
+ " ,@%x .:o##%xxx%###%##%xxx%###x;. :x@o, ",
+ " @@o .:;x%######x.:#######%;:, :#@x ",
+ " @@o .:oo#####%x%#####xo;,. :#@o ",
+ " ;#@x. ....;;o%%%%%%%x;;:.... .:%@x, ",
+ " o#@%oooooo;,:;xxooxxxxxxxo;xxo.;;oo;;oo#@; ",
+ " .:@%%@@@x,x%##xox##@@%##%;x%#%,x@@@#%@o, ",
+ " .oo; ,;x@@#xx o##@@@@###%.x@##x: ,, ... ",
+ " o,x#%,,:x##@@;, o##@o::@@##x;o@#######@@#@#@@%:. ",
+ " . :%@@%o%, o##@; o#@#o, ,oxxoo:::; ..o@#,",
+ " ,,. o@@;. .;@@#. :x##,",
+ " o@@. %@% ",
+ " o@@. x@# ",
+ " o@@. x@#. ",
+ " ;%@@, .#@: ",
+ " ,%xoo%@#x. ##%: ",
+ " .oooo;. ,,,, ",
+ " ",
+ },
+ {
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@############x,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###o.ox%######%xo.o#####%:. ",
+ " :o%##o.x::######;,%.o####%;. ",
+ " %%o ,o%##%%%%##%x%##%%%###%x; :x%#: ",
+ " @#: .,;x%######x.:#######x;:, ,;#@; ",
+ " %@#x,. .:;;%#####%%#####x;;. .o%@#, ",
+ " :%@#o, ,..,;;oxxxxxxxx;;:,.,. ,;%@#o ",
+ " .:@@%xxxoooo;.:o%%ooxxxxxxxx;%%x.;oxooxxx#@@;. ",
+ " ;##x%@#;;x#@@@oox##@@%##%oo%##:x#@@%x@x; ",
+ " o%@@#xoo o##@@@@####.x@##x; .:oooooo;; ",
+ " .;%x#x.. o###;..@@@#%;:@%###x%#@#%@x#@#@o.",
+ " :%#o o##@; ;%@@%; :xxxxx:. .;##:",
+ " .:@@x o@@,. .,@@@%,. ,,..",
+ " o@#, o@@. ,o@@%: ",
+ " ;@%x; .;#@: ,@@% ",
+ " ,%@; ,;%@%; ",
+ " o; :x@@: o%#;,. ",
+ " ;ox%%%o ",
+ " ",
+ " ",
+ },
+ {
+ " ..,#@#%%%%%%%%%o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%x:. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.%xx######xo#.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x;. ",
+ " ,;x########%ox########%o: ",
+ " ..;ox######x.:######%o;:. oo.",
+ ";x; ,::%%%########%%o::. .@@:",
+ "x@o :,,:;;oxxxxxxxo;;:,,,. ,x@x,",
+ ";@#x:,,,x%%##xxx,;x##oo%%%%%%%x;%#%,:x####%#%%o#@@@, ",
+ " ,oxxoo%@xoxooox#@@@;ox##@@%##%o;x##;oxxxo;%xoxoo: ",
+ " :ox%%%@@#;:: o##@@@@####.x@##%o. ,o%xx%x%x;. ",
+ " .:@@#x%, o##@: %@@##:,%o%@@@@@%xo%ox%x@x.",
+ " :%@x:, o@@o. ,x@#x; ,:;::: .o##:",
+ " ,#%. x@@@ %@@#;:, ",
+ " ;#%:;. :%@@. ,;%#@@ ",
+ " ,,,,. o@@, .,%@ ",
+ " .:;#@o. ,x%#@. ",
+ " ;@@o, .,,,. ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ..,@@@#########o:,. ",
+ " ,%@@@@@############x:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#xo######xo#.o#####x,. ",
+ " :o%##x,;:;######;,;,o###%x: ",
+ " ,;x#####%o#####xx#####xo: ",
+ " .;ox###%x:::::o%###%o;,. ",
+ " ,::x%%########%%;:: ",
+ " :,,:;;;oooooooo;;::,:. :;.",
+ ";%o. ;oo%xxxxxxo,;x##oo%%##%%%x;##%,:ox###%@#%,.;xo@#:",
+ ";%%;.,;xoo;;;;;o##@@;ox#%@@%##%x:x##o;;oxo;xo;;:;;oxo,",
+ " .:%#####@@@@#%#:,, o##@@@@@###.x@@#####%%##%%#%o. ",
+ " @#;;, o#@o, %@@#. .o:;xxxo;xxo,xxx@o, ",
+ " ##o: ;%@@. %@#;, ,##; ",
+ " ... .#@# :@@x;,,. ",
+ " .#@% .o#@@@%;, ",
+ " .,:@@x ..,;%@, ",
+ " x%%#;. ., ",
+ " .,,. ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ..%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " ,;@@@@@@###########@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " :x%###o.xxx######xxx.o#####x:. ",
+ " :o%##x.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;;;;;ox###%x;:. ",
+ " ::;%%%#%%%%%##%%o::. ",
+ " ,,:: ,,,,;;oxxxxxxxx;;:,.,. .::: ",
+ " .####x%%x%xxx,;o%%oo%%%%x%xx;%%x.;ox%%%x%%%@@@% ",
+ " .:;::;:%x:xo;;##@@oox##@@%##%o;x##;:;%%xo%%o ",
+ " x%##@@@@#%%%###@o:: o##@@@@####.x@@###xxxxxxxxx: ",
+ " @o :xxo%x; o#@o, @@##. ;%#%%o#xx###%:. ",
+ " :, x@@. @@##. ,o@; ",
+ " .:#@x x@@:. :xx, ",
+ " ;@@; ,%@#o :;;o. ",
+ " ,x%%, :x#@@@#x. ",
+ " .@#x, ..,;. ",
+ " %%%x ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " :::::::::::;,. ",
+ " ,;x@@@#########%xo: ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;:@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:;x%###%:x%%%%;;####%o;: ",
+ " ,:ox####o;;;;%###%x;,. ",
+ " :,,, ....ooo##%##%%%oo:... .,,, ",
+ " .@@@@;:::::::::;xxo;oooooooo;xxo.;;:::::::o#@@% ",
+ " ,:::@@#%@o::xx%#%oo##@@%##%;%##x,,:@@@%@@#::,. ",
+ " :;;#@@#:::::%##@%x# o%#@@@####%.o@@##%::::::::,. ",
+ " @%:,;::%@@#@@%:;. o##@x;;@@##.:;;:%@@@@#@@#@@%o ",
+ " o: . .. o@@. @@##. .. ..;%@, ",
+ " ;#@o o@@#. ox%@, ",
+ " .:@#o %@@:. .,,. ... ",
+ " ;%@;. ,;x#%x;:o#@, ",
+ " .@#o, .o%@@##o. ",
+ " .@#%x ",
+ " ,,,. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##x.%::######;,x.o####%;. ",
+ " ,o%##%%%%%#####%x%%###%x; ",
+ " .,;x%###%;oo;oooo####x;:, ",
+ " .... .:;;####%%%%%%###xo;, ,xo;, ",
+ " o@#x: ,..,;;o%%%%%%%x;;:,.,. .,o@@. ",
+ " :#@#x;......,;,:o%%ooxxxxxxxx;%%x.;;:......,x#@@. ",
+ " ooox@@#@@#x;:x#@oox##@@%##%oo%##::o@@@#@@@xx: ",
+ " .:%%%x.,,;:,;o#@@o o##@@@@####.x@##%x:::,::: ",
+ " o@x;x@@#xx%%#@@o. o##@;..@@##. ,#o%@@@@#@@#o;: ",
+ " ;%x, .,%#x##%, o#@#; @@##. ,::::,;:,@@@x. ",
+ " x@@. ,#@#. ,;.;@@: ",
+ " ... #@@% %@@, :;;, ,%%%%: ",
+ " o@%:o#@x: :o@@x:,x#@; ",
+ " o@@@#%,. .;#@@@@o. ",
+ " .;:, ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ;xxx, ,;o%####x:%####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " x@#, .. .,,oox#######%oo:,,. .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%%%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@.o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, ",
+ " ;@%, o@@%: %@@#. ,#@x: ",
+ " o@::, .:x, o@@. %@#. .xx: . @@% ",
+ " .xx; ;@, .%@@. %@@,. .o% o;:x#; ",
+ " ;@@o:;@@%: ,o@@%;:#@# ,:: ",
+ " .x#@#x: .x#@#%;. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " oxxx, ,;o%####x:#####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. .,,oox#######%oo:,, ,. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%#%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, ",
+ " ;@%, o@@%: %@@#. ,#@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@% ",
+ " .xx; ;@, .%@@. %@@,. .o% o;;x#; ",
+ " ;@@;:o@@%: ,o@@%;:#@% ,:: ",
+ " .x#@#x:. .x#@#%:. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " oxxx, ,;o%####x:%####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:.. .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%#%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@#%%o, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@% ",
+ " oo; ;@, .%@@. %@@,. .o% o;;x%; ",
+ " ;@@;:o@@%: ,o@@%;:#@% ,:: ",
+ " .x#@#x:. .x#@#%:. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " :;;;. ,;x##%;;;o######x;;;x###%o, :;;. ",
+ " .,%o:,,o: ,;o%####x:%####o;#####oo: x:,o%;. ",
+ " o@#, :;o%####;::::x###%x;:. %@@ ",
+ " o@#, ...oox#######%oo:.. %@@ ",
+ " ,;@x:. .:::oo;;oooooooo;oo;,;,. .#%; ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o#@o ",
+ " .,o@@%%@@;::%#@@,o%##@@####%,x@#%o;@@@x@@%,.. ",
+ " ,;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " o##@##@@@x,,. o##@;. @@##. .:,x@@@@%@#%%;, ",
+ " #@% o#@%: %@@#. ,%@%; ",
+ " @#::. o@@. %@#. #@@. ",
+ " :xx, oxx .%@@. %@@,. xxx: ;;:o##; ",
+ " ##, ,;@@%: ,o@@%; ,x@. .::, ",
+ " ;%@x#@#x: .x#@#%%%: ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ;;;;;;;;;:;;,. ",
+ " ,;x@@@#########%%x:. ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " ,,,. :x###x.@;:######;:@.o####%;. .,, ",
+ " .oxo;o;. .:o##%ooox######xooo%###xo, ;;;xo, ",
+ " ;@#: . .:;x%###x:xxxxx;;####%o;: . %@# ",
+ " o@#, ,:ox####ooooo%###%x;,. %@@ ",
+ " .:@o, ....ooo#######%oo:... .##x ",
+ " .@@%; .,::;xxo;oooooooo;xxo.;:. .:%@o ",
+ " ;%@#%%##xxx,x%#%oo##@@%##%;%##x,;x###%#@#o,. ",
+ " .:x;oxo;;o#@@% o%#@@@####%.o@##x;xxo;%o: ",
+ " .;x%%%##%#%#@;, o##@x;;@@##.,;@#%#%#%%%#%%,.. ",
+ " ,#@%%o;x%xx, o##@;. @@##. oxxxo;xxo@@% ",
+ " ,@o, o@@o, o@@#. ,x@x, ",
+ " ,#xoo. o@@. %@#. ., .o@%, ",
+ " ,,, .,. o@@. %@#. ., .:o%%o ",
+ " %o. .;#@%. ;#@x:. ,;o. ",
+ " %%%;o%#@x: .:@@@o;x##, ",
+ " ,;oooo,. ..:ooo; ",
+ " ",
+ },
+ {
+ " ",
+ " xxxxxxxxxxxx:, ",
+ " .o#@@@@############o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :x#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%:. ",
+ " ,xx;. :o%##o.x::######;,x.o####%;. .xxo ",
+ " x@:..: ,;%##%%%%%#####%x%%###%x; .: :x@, ",
+ " x@o, .,;o%###%oo;;;;;o####x;:, :%@, ",
+ " ,@%;. .:;;%###%%%%%%###x;;. .%##. ",
+ " .x@#x,. ,..,;;oxxxxxxxx;;:,.,. .;#@o. ",
+ " ,x@%xooxxxx,:o%%ooxxxxxxxx;%%x.;oooooox%#@,. ",
+ " .@%%@#;::%##@oox##@@%##%oo%##:::#@#x@#o ",
+ " :o;;;oo%@@@x;; o##@@@@####.x@#@@#o;;;;;;;. ",
+ " .:#x%@@##@@;.,. o###;..@@##....,,:@@@@%@@%##%, ",
+ " .%@x, o##@;. @@##. :%@o, ",
+ " ;#@,,,, o@@,. ,#@#. . :@#; ",
+ " :o;;, o@@. %@#. .o;ox%, ",
+ " o@@. %@#. ::, ",
+ " :, ,%@@. ;#@%;. .;. ",
+ " #%;..:o@@%, .:@@@o,:o@, ",
+ " :%%%%%;, :o#%%x. ",
+ " ",
+ },
+ {
+ " ",
+ " .,:@@@#########x;:. ",
+ " :#@@@@@############%:. ",
+ " .:o@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%########%xx%######o, ",
+ " ,o%###x.@xo######[email protected]#####x,. ",
+ " ,;x##x,::;######o:;:x###%x: ",
+ " oxx: ,;x%####%;#####xo#####xo: ",
+ " @%, .;;x%###%:::::o%###%o;,. ::oo ",
+ " %##o,. ,,,xx%########xx;,,. ,:;@@. ",
+ " :x@%o, :,,:;;;oooooooo;;;:,:, ,%@@@; ",
+ " .x##%%%%%xo,,ox##oo%%##%%%x;##%,:;%xxxxx#@@#%;. ",
+ " ,::::;;x%##@@@:ox#%@@%##%x:%@####;;;;;;;;:. ",
+ " .,#@@#@@@#%#@,,,. o##@@##@###..,,@#x#@@@@@@@@%x. ",
+ " ,x#%o;, o##@; @@##. o%#x: ",
+ " @#: .x@@;. o@@#. ;@@:",
+ " %x:,:, %@@ ;@%: :;o%o,",
+ " ,::. #@@ :@@o, .,,. ",
+ " #@# ,@@x. ",
+ " #@# :#@%. ",
+ " .. .,@#o .;@@x:, ",
+ " ,;oo%@@x, o%%%, ",
+ " .,,,, ",
+ },
+ {
+ " ::::::::::::,. ",
+ " ,;x@@@#########%xo: ",
+ " ..%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#@#####################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;;@.o####%;. ",
+ " ,:o##%ooox######xooo%###%o, ",
+ " .:o%####x:%%%%%o;####%o;: ",
+ " ;;: ,;ox####;;;;;%###%x;,. ",
+ " @@o ...oox#######%oo:... ",
+ " ;%#o;: ,::. ::;xxo;oooooooo;oxo,:,,:,. .,x##% ",
+ " .:@o:,,,::::;oox%#%oo##@@%##%;%#%ooxx:::,,,::ooo ",
+ " ,x##%###%##@x#@#.o%##@@####%.o#x@##%#######%o,. ",
+ " ,o@xox;xxx::;o o##@%oo@@##. ;;:;ooxo;ox;%@#;, ",
+ " x##, x#@@; @@##. .,o@#:",
+ " @%. ;#@x o#@;, .;##:",
+ " :o%x, ,o@@o ,@@o, ,,,.",
+ " :#@o @@% ",
+ " :@@o o#@o. ",
+ " :#@; :%@o, ",
+ " :x@; ,#@%; ",
+ " .,o#x, o%%x. ",
+ " :o;: ... ",
+ },
+ {
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##o.x::######;,%.o####%;. ",
+ " .,o%##%%%%%#####%x%%###%x;. ",
+ " .,;x%###%;ooooo;o####x;:, ",
+ " .:;o####%xxxx%###xo;, ..,. ",
+ " @#%% ,..,;;oxxxx%%%x;;:,.,. ,;%@# ",
+ " @@#o;;, ,:o%%ooxxxxxxxx;%%x..,:oox%@%; ",
+ " ,,,,::,:;x##@@@oox##@@%##%oo%@###%:::::,,,,. ",
+ " ;%@@#@@@##@@:ooo o##@@@@####.:o:@#%#@@@@@@@#x;: ",
+ " ,o#@:.......... o%@@%;.,@@##x: ............x@@%;.",
+ " @#o ,:#@@o o#@#o, ,@@;",
+ " @%:. .;%@@;, .;@@@o. ,x%%:",
+ " :oo. .%@@@ ,x@@o, ",
+ " .#@%, ,@@#% ",
+ " #@%, .;@@% ",
+ " ,o%#%; @@% ",
+ " ,;, x%x ",
+ " ;%x. ",
+ " ",
+ },
+ {
+ " ..,###%%%%%%%%%o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%x: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.xxx######xx%.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x; ",
+ " ,;%#####%o#####xx#####%o: ",
+ " ..;ox###%x:::::ox###%o;:. ",
+ " xxo; ,::%%%########%%o::. ,ox%x ",
+ " .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@# ",
+ " ,%#xxx;.,;x##oo%%%%%%%x;%#x,,;oxx%#@o. ",
+ " :::;;;;;;;o#@@@;ox##@@%##%o;%@###o;;;;;;;;;, ",
+ " ,o%@@@%@@@@@@@@;:: o##@@@@####.,:x@@%@@@@#%@@###x. ",
+ " x#@,. .,#@@@o, #@@##; ,%@#,",
+ " @x. :o%@x:, :x@#x; .;@@:",
+ " ;xxo. .,%#@#. .#@@#:. .,,,.",
+ " ... ,o@@x: :x@@%; ",
+ " x@,. .,#@x. ",
+ " %@ ;@@; ",
+ " o#o;: .o@o ",
+ " .;;; o%#, ",
+ " ",
+ " ",
+ },
+ {
+ " .,#@#%%%%%%%%#o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@@#x:. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%%%##########%%%######o, ",
+ " ,o%###o.%xx######xo#.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x;. ",
+ " ,;%#####%o#####xx#####%o: ",
+ " ..;ox###%x:::::ox###%o;:. ",
+ " .@#%x ,::%%%########%%o:: :x%@# ",
+ " .@#o, :,,:;;oxxxxxxxo;;:,.:. .:%@# ",
+ " ,%@@#%%%.;x##oo%%%%%%%x;%#x.,;x#%#@@;. ",
+ " .:. ,:o%@@;ox##@@%##%o;x###o;xx:..,, ,:::. ",
+ " .:ooxxxxxxxxx%##@%:.o##@@@@####.x@@###%%%%@@#@@#%##; ",
+ " @@x:;x#xx%###%o%,.,#@@@o, %@@##; ;%%%xo .:##:",
+ " :x%x. :x#@x:, ,x@#%; .,,,.",
+ " ,,:%@@#. #@@#:, ",
+ " .;%#@@@x: ,o@@@#;. ",
+ " :@#;... ...,@@x ",
+ " :@%o .;;@% ",
+ " ... ;;;, ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " .%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " .:@@@@@@###########@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :x%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%###################o, ",
+ " :x%###o.oxx######xxx.o#####%:. ",
+ " :o%##o.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%x: ",
+ " . .,;o%###%o;;;;;ox####x;:, ",
+ " @#xo: .:;;%%%#%%%%%##%%o;:. ;x%@% ",
+ " .@#o,: ,.,,;;oxxxxxxxx;;:,.,. .:%@# ",
+ " :#@@xxxx,;o%%ooxx%%xxxx;%%x.;oxxx#@@o, ",
+ " .##x;:%#@oox##@@%##%oox##;:;#%o. ,,,, ",
+ " .;oooo; ;ox#@#; o##@@@@####.x@@###oooxxxx#@@@@%: ",
+ " @@x::x@@@#%@@@##,.,%#@@x: .@@@##;.. o###%x@;.....:##:",
+ " :;;;. xxo;xxo, :o%@%;, :%@#x; .:::.",
+ " .,,,o#@@,. ,@@@%,... ",
+ " .:@@@@@%: :x@@@@@;. ",
+ " :@%;,,. .,,,%@x ",
+ " :@%x. ,;@x ",
+ " ... .::, ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ;;;;;;;;;;;;,. ",
+ " .:o%@@@#########%%x;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@##############@@@#%x: ",
+ " .;x########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,:x########x:,x######;, ",
+ " :o###o.@;:######;:@.o####%;. ",
+ " .:o##%xxxx######%xxx%###x;. ",
+ " :::: .:;x%###x:xxxxx;;####%o:: :::::, ",
+ " ;%#;o# ,:ox####ooooo%###%o;,. %x::%%# ",
+ " x@%::x ....;;o%%%%%%%%o;:... o; o#@ ",
+ " :x@#x;;;;;::;xxo;oooooooo;xxo.;;;;;;ox#@x ",
+ " .::,. ,,o@@@#x.x%#%oo##@@%##%;%%#x,,:@@@@;:,.,:;:. ",
+ " ;@x#x, .:#@@% o%#@@@@###%.o@@##%::::::;#@x;x%, ",
+ " :xx:o@o;;:;ox#@o, o%@@@x;;@@##::;:@@@@@@#@@#o:..oo, ",
+ " .#xo;:::: .:#@@x. x@@#; ,,::.. ",
+ " ;;.@#%x :x@@x, ,#@#o ox#@;, ",
+ " .@####@@%. x@@@%%@@@o ",
+ " :oo;:. .:;ooo,;, ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " .,:@@@#########o;,. ",
+ " :#@@@@@############%:. ",
+ " .,o@@@##############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%########%xx%######o, ",
+ " ,o%###x.#xo######[email protected]#####x,. ",
+ " :ox##x,::;######o::,x###%x: ",
+ " ,;x%####%;#####xo#####xo; .,,,, ",
+ " .o%xx%o .;ox####%:::::o%###%o;,. ,#xx%:. ",
+ " :@@#: ;o ,,,xx%########xx;,, .x, .#@# ",
+ " ;@@%: .. :,,:;;;oooooooo;;;:,:, %@@ ",
+ " ,@%o;;;;;;;ox,;x##oo%%##%%%%;##%::;o::::::;%@#o ",
+ " ,o@@##@@x;;o%@@:ox#%@@%##%x:x##o;o@@@#@@@;:, ",
+ " .,,,x%%@@x. o##@@@#@###.o@@##%:::,:. ",
+ " :x#@@@#;o, o##@:. @@##. .o;%@@@@@#o, ",
+ " %@@:,,. o@@;. #@@#. .,,,;@@#; ",
+ " @@,,. :oo; :#@@ o@@:. ooo ,@@; ",
+ " :o%%: %@o..;@@x, .;#@%:,x#@.;ox@:. ",
+ " :x@@@@%. o#@@@@x :o; ",
+ " ,:,. .,,,. ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ::::::::::::,. ",
+ " ,:o@@@#########%xo, ",
+ " .x@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " :x#@##################@##%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;x########%;;x######o, ",
+ " :x###x.@o:######;;@.o####%;. ",
+ " .,,,. ,:x##%;;oo######xooox###%o, .,,: ",
+ " ;xo;;;: .;o%####%:%%%%%o;#####o;: %o;xo: ",
+ " ;@#: :, ,:ox####;;;;;x###%x;:. . %@@ ",
+ " o@#: ...oox#######%oo:.. %@@ ",
+ " ,x@%o, .,;:;ooo;oooooooo;ooo,;:. .,@@@ ",
+ " .#@@xoooooxxx.o%#%oo##@@%##%;%#%o,;xoooooox@@o. ",
+ " ;@@%%@#o::#@@@.o%##@@####%.o@##o;#@#x@@% ",
+ " .ooooo%##@%: o##@%oo@@##.:x@###ooo;oo, ",
+ " :%@@#%@@x.. o##@o. @@##. ..o@@@#%@@#x ",
+ " o@x, o@@%: x@@#. o%@;, ",
+ " o@;;, .%%o o@@, %@#. ,xx: . .;@%: ",
+ " .oo: :@#;..;#@@. o@@o,.,%@% .;ox%x. ",
+ " .:@###@#; ,o@@@#@x: ,,, ",
+ " ;xo:. :;o;. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@##############o:. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " :;;; ,;x##%;;;o######x;;;x###%o, ;;;, ",
+ " .;#;,,x, ,;o%#######x:o#xx#####o;: :x,,ooo ",
+ " o@%, :;ox#####%:o#####%x;:. .#@ ",
+ " o@#: ...oox#######%oo:.. x@@ ",
+ " ,:@%;. ..;::oo;;oooooooo;oo;,;:. .,@x, ",
+ " .#@@x;;;;;oox.o%#%oo##@@%%%%;%#%o,;x;;;;;;x@@; ",
+ " .o@@%%@@o::%#@@.o%##@@####%,x@#%o;@@#x@@%. ",
+ " .:;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :%#@@@#@@%,,. o##@;. @@##. .,,x@@@@%@#%%o, ",
+ " x@#, o#@%: %@@#. o#@o, ",
+ " x@::. .;x: o@@. %@#. ,xx: .@@o ",
+ " ,xo: :@,. ,%@@. %@@:. ,#% .x;;x#: ",
+ " :@@o;o@@%, .;@@#x;@@% ::: ",
+ " x###o, o%#%o, ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " oxxxxxxooooo:. ",
+ " .o%@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##x.%::######;,%.o####%;. ",
+ " .,o%##%%%%###%%#%%%%###%x;. ",
+ " .,,: .,;x%######x.:#######x;:, :oo,. ",
+ " @%; .:;o%####%x%#####xo;,. .,x@o ",
+ " @#: ,...;;o%%%%%%%x;;:.... .:#@o ",
+ " x#@%;, .:::o%%ooxxxxxxxo;x%x.;:: ,o%@#, ",
+ " .;x@@##%#@#xxo:%#@xox##@@%##%oo%##:;x###%#####x; ",
+ " ,;;::;;xox#@#o o##@@@@####.x@##%o;;;:oo; ",
+ " ::x#@#@@@@%x#:. o###;,,@@##..,@xx@@@@#@@@%:,. ",
+ " ,#@%:o:;oo;, o##@o. @@##. .oooo:;o;;@@x ",
+ " ,@;. : o@@:. ,#@#. .o@#, ",
+ " .x%xo. o@@. %@#. .; ,o@;. ",
+ " .,. ,,. x@@. #@#. .,,, ,x%x, ",
+ " #%, .,%@@x. :%@#;. ,;@. ",
+ " ;%@%#@@%;, .,%@@#x#@o. ",
+ " .,:::, .:;;:, ",
+ " ",
+ },
+ {
+ " ............. ",
+ " .,:@@@#########xo:, ",
+ " :@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@xo######[email protected]####%o,. ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ,;x%#######%;o########xo: ",
+ " :;o%#####x:;#####%%o:, ",
+ " ,,,xx%#######%xx;,,. ",
+ "xx; ....;,:;;;;oooooooo;;;:,:,.. %%:",
+ "o@%:,,:::::;oooo:ox##oo%%##%%%%;%#%;:;o#o;::::,,:::@@:",
+ " :x@@;::::::oxxx##@@,o%#%@@%##%x:x##xxox;;::::,;@@@;,.",
+ " .,:%#@%#@@@%%@x,:, o##@@##@@##.;%o##x@@####@##o:. ",
+ " ;%@@oox:oooo. o##@;. @@##. oooo;oo;o#@@;. ",
+ " @#: o#@@:. @@@#. ..,@#:",
+ " @%, :, o@@. %@#. ;..,@x,",
+ " :xo:. o@@. %@#. ,ox%:. ",
+ " o@@. %@#. ",
+ " ,x@@. %@#,. ",
+ " %x, .:o@@x :#@%;, .:@. ",
+ " ,o##@@@:. ;%@@##%;. ",
+ " ",
+ },
+ {
+ " ;ooooooooooo,. ",
+ " .;x%@@@#########%%%;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@##############@@@#%x: ",
+ " .;%########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,;x%######%x;,o######;, ",
+ " :o%##x.@;:######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " .:;x%######x.:#######%o:, ",
+ " ,:oo#####%xx#####%o;,. ",
+ " ....;;o%%%%%%%x;;:.... ",
+ ".,. :;;,:;xxooxxxxxxxo;xxo.,:;;. ,, ",
+ "x#o ,:;.:::%%##%oo##@@%##%;x%#xxo:,xx, .%%:",
+ ":xo:x%%xxxxxo@@@#%%% o##@@@@###%.o##@@##%xxxxxxxxo;#x,",
+ " ;%@#%#@x@@@@;::, o##@o::@@##. :;::o###x%#x@##@o, ",
+ " @%, o##@; x#@#. .,@@;",
+ " x%x:. o#@x. ,o@x: .:;@%,",
+ " ,,, %@@ ,@#; ,::, ",
+ " %@@ :@@; ",
+ " %@@ ,@@; ",
+ " ;@@, :@#; ",
+ " ..%@@; ,%@x, ",
+ " ;x::x@@o, ;#@o,;x. ",
+ " .;:, ,xoo; ",
+ },
+ {
+ " ..###%%%%%%%%%o:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%ox######xx%.o#####x:. ",
+ " :o%##x.o,:######;,o.o####x;. ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;;:::ox####o;:. ",
+ " ,::%%%########%%o::. ",
+ " :,,,;;oxxxxxxxo;;:,.,. ",
+ " ,. .oxo,;o#%oo%%%%%%%x;%#x.,;xx, .o%x ",
+ " :::::::::::;#@@@;ox##@@%##%o;%@##x::::::::::::, ",
+ " ,;x@@@@@#@@@#@@@o:: o##@@@@####.,;%@@@#@@@@@@#@@#x. ",
+ " @@% o#@x, @@@#:. ,x@%,",
+ " @#o x@@. :x@%: .o@@;",
+ " ... .#@# .@@x ... ",
+ " #@% @@% ",
+ " #@x @@% ",
+ " #@x @@% ",
+ " %@% @@% ",
+ " .,##o @@x ",
+ " ,..;@o, :#@;. ",
+ " :xx; ,xx: ",
+ },
+ {
+ " .,,@@@#########o;,. ",
+ " :#@@@@@############%:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#oo######xo#.o#####x,. ",
+ " :o%##x,:,;######;:;,o###%x: ",
+ " ,;x%####%o#####xx#####xo: ",
+ " .;ox####x;::::o%###%o;,. ",
+ " .,,, ,::xx%########%%;::. .,,. ",
+ " o@@%, :,,:;;;oooooooo;;::,:. ;%@@: ",
+ " .,;@@@#@@#%.;x##oo%%##%%%x;##%,:x@@@@#@@#... ",
+ " .;;;, ,::;;:,o%@@:ox#%@@%##%x:x##o;ooo;..,:,;;: ",
+ " %%%x@@%###%###%@@x, o##@@@@@###,x@@#%%%%%x@%%@####%o.",
+ " @x .o;;;ooo;x. :x@@o, x@@##; oxx%xxox, .;##:",
+ " ,. .#@#: ,o@@#x. ,,,.",
+ " ;#@: x%@@. ",
+ " ;@o. :@x: ",
+ " o@ :@@; ",
+ " o@,. ,@#; ",
+ " ;@@: :x@, ",
+ " ,o@; .o%o ",
+ " ;%%,. ",
+ " .,: ",
+ },
+ {
+ " ..###%%%%%%%%%o:. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%x;. ",
+ " ,;%#####%x#####xx#####%o: ",
+ " .,;ox###%x;::::ox####o;:. ",
+ " @#xo ,::%%%########%%o::. :x%@% ",
+ " .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@@ ",
+ " ,%@@%%%%,;x#%oo%%%%%%%x;%#x,;x%%%#@@o. ",
+ " .:::, .o%%xo;%@@;ox##@@%##%o;x##;ox%xo; .,::: ",
+ " xxx:@@#ooxxxxxx#@%: o##@@@@####.x@##%o ;ooxxx#@@##x: ",
+ " @x .##%x##%x#, ,x#@x, #@@##;:#x%@@@@@#o, .:##:",
+ " :. #@#; :x@@#x ,;;;;: .:::.",
+ " ,;#@: x#@@;, ",
+ " ##o .o@#o ",
+ " @# ;#@ ",
+ " @#, .:@@# ",
+ " x#@;. :##o. ",
+ " ,ox, ",
+ " ",
+ " ",
+ },
+ {
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o%@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;x####x,;x%######%x;,o#####%;, ",
+ " :o%##x.#::######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " :::;..:;x%###%:ooooo;o####%;:, .:::. ",
+ " @#%x: .:oo####xxxxx%###xo;,. :xx#o: ",
+ " @@x: ....;;o%%%%%%%x;;:.... ,;#@# ",
+ " o#@#;;;;::oxxooxxxxxxxo;xxo.;;;;;x#@x: ",
+ " .,,;: ..,@@#%,x##xoo##@@%##%;x%#%:x@@@#x,. ...., ",
+ " o#%o%@%;:, :;;#@#x o##@@@@###%.x@##x: ,:;x@@xo%x. ",
+ " ;x. ,:,%@@###%@;, %####o,:@@##x;o@###%%%##@#:,.,x%, ",
+ " ,xoo: #@@% o#@@%o .x%%%xx:. ",
+ " ..:x@x, .;@@@x;:. ",
+ " ,#@@@ .:##@@;. ",
+ " :@x;, ,o#@, ",
+ " ,@o;, ox#@. ",
+ " ::;; ::,, ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ............. ",
+ " .:;@@@#########xo;, ",
+ " ;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######[email protected]#####o, ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ,;o%####%:#####oo#####xo; ",
+ " ,x%x#, :;o%####:::::x###%%;:, #%x%;, ",
+ " .@@o #, .,,xxx#######%xx;,,. %;.o@# ",
+ " .@@%;:,..;::;o;;oooooooo;o;;,;,..:;o#@% ",
+ " ::, o%%@@@#.o%##oo####%%%%;%#%::x@@@@#x, ,:: ",
+ " :xx#%; ::::x#@@,o%##@@%###x,x##xo:::,, .;%%%x, ",
+ " :xo,;@@#x::x##@#o :x##@@%%@@##:o#@##%:::::x#@#:,x, ",
+ " .o;x@#x;:;. %#@@:. ;@@##:.;::;;@@@@x;: ",
+ " ;xxx.,;@@x ;@@x: x%%;..:. ",
+ " @@x::x@@, .,@@@;ox#@,o% ",
+ " o@@@@#x .;#@@#%.., ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " oooooooooooo:. ",
+ " .;%#@@@##########%%o. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o%@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;x####x.;x%######%x;,o#####%;, ",
+ " :o%##o.#::######;,#.o####%;. ",
+ " .,o##%xxx%%#####%xxx%###x;. ",
+ " .;;;; .:;x%###%;ooooo;o####x;:, :;;;o: ",
+ " ;#%;;# .:;o####xxxxx%###xo;,. xx,:%#@ ",
+ " x@x,,x ,...;;o%%%%%%%x;;,.... ;: o@@ ",
+ " ;#@xo;;;;;::;xxooxxxxxxxo;xxo.;;;;;;;x##;.,. ",
+ " xo;;xo%@@@@%,x#@xoo##@@%##%;x%#%:x@@@@@#:.:;xx ",
+ " .:x#o, .:;#@#x o%#@@@@###%.x@##x: ..:o@o:: ",
+ " ;@@#%x%###@;. o##@o,,@@##..;@###%xxx%@@%. ",
+ " .oxxo%x;, ;x@@, o@@#. :o;@@@@x: ",
+ " x%x:...#@@. ,x@#o, xxx; ,@x ",
+ " #@x::o@@x: .;@@#;:x@% :o@; ",
+ " ;%@#@@%. .;%@@@% xxo, ",
+ " .:;:, ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " .,,,...,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######o;@.o####%o, ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ;xxx, ,;o%####%:#####oo#####xo: xxxx. ",
+ " ,;#;, oo :;o%####:::::x###%x;:. %:.:#x: ",
+ " x@#, .. .,,,xxx#######%xx;,,. ,. %@@ ",
+ " ;@@o:. .:,:;o;;oooooooo;o;;,:,. .%@@ ",
+ " .@@#x;;;;;;oo.o%#%oo%%##%%%%;%#%;:;x;;::;;o#@%: ",
+ " ,:x@@##@@o::x#@@,o%##@@%###x,o##xo;@@@%@@#:,. ",
+ " :::::%##@#o o##@#%%@@##.;#@##%::::::: ",
+ " ,x#@@#@@%,:. o##@; @@##. .:,%@@@@#@@%x;, ",
+ " ;@#: o#@#: #@@#. ,#@x: ",
+ " o@::, ,;x, o@@. %@#. ,xx: . @@% ",
+ " .xx; ;@,. .x@@. %@@,. ,x% x;:o#; ",
+ " ;@@o:;#@%: ,o@@x;:#@# :;; ",
+ " .x#@@%:. .x#@#x:. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########%x;, ",
+ " .x@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;x########%;;x######o, ",
+ " :x###x.@o:######;;@.o####%;. ",
+ " ;oo;. ,;x##%;;;o######x;;;x###%o, :oo. ",
+ " .:%o:.,;. ,;o%####%:%%%%%o;#####o;: x:,;%o, ",
+ " o@#, ,;ox####;;;;;x###%x;:. %@@ ",
+ " o@#, ...oox#######%oo:... %@@ ",
+ " ..@%;. .;::oo;;oooooooo;oo;,;:. .:@%: ",
+ " %@@xooooooox.o%#%oo##@@%%#%;%#%o,;xoooooox@#; ",
+ " ;@@%%@#;::%#@@.o%##@@####%.o@#%o:@@#x@@x. ",
+ " .;;;;;;%##@%; o##@%ox@@##.:%@##%;;;;;;: ",
+ " o%#@##@@@x.,. o##@; @@##. .,.x@@@#%@#%%o: ",
+ " #@% o@@%, %@@#. ,%@%; ",
+ " @#;:. o@@. %@#. @@# ",
+ " :oo, oxx. .x@@. %@@,. ;oo: :o:x%x ",
+ " %@o .;@@#: ,o@@x: ,x@. .::. ",
+ " .;##@@#x: .x#@@@@@: ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@############o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.;o%######%xo.o#####%;. ",
+ " .xx; :o%##x.x::######;,x.o####%;. ,xxo, ",
+ " o@%,,; ,;%##%%%%%#####%x%%###%x; :: ,x#x ",
+ " x@%, .,;x%###%;o;oo;oo####x;:, o@@. ",
+ " ;#@;. .:;;%###%%%%%%###x;;, o#@. ",
+ " .@@%, ,..,;;oxxxxxxxx;;:,.,. ,x@x. ",
+ " ,#@%;;;;oo;:::o%%ooxxxxxxxo;%%x.;;:;;;;;x%@;, ",
+ " :@@%#@@%xo:x#@oox##@@%##%oo%##:;x@@@%@@%. ",
+ " oooo#@#o o##@@@@####.x@##xoo, ",
+ " ,,;%#####@#x#:. o###;..@@##..:@x%@###%##x,,. ",
+ " .%@#;x;;ooo: o##@o @@##. :oxoo;xoo@@; ",
+ " ,@o. ,. o@@,. ,#@#. ..%@: ",
+ " .xxoo;. o@@. %@#. :: ,#@: ",
+ " ,,, .x@@. %@@. .;x%o, ",
+ " o; .,#@#; :x@#o, .o. ",
+ " %#%;x%@#;. .,#@@#:;x@, ",
+ " ,o%%; .%%%x ",
+ " ",
+ },
+ {
+ " ............. ",
+ " .:;@@@#########xo:, ",
+ " ;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######[email protected]####%o,. ",
+ " .. ,;x##x:::o######o:::x###%o: .. ",
+ " o%%o, ,;o%####%:#####oo#####xo: .;ox: ",
+ " @@: :;o%####:::::x###%x;:, .## ",
+ " x@#o,. ,,,xxx#######%xx;,,. .;%@% ",
+ " ,x@%;. :::;o;;oooooooo;o;;,:, .:#@@; ",
+ " .x@@x::::::o%,ox##oo%%##%%%%;%#%::ox;:::::o@#;. ",
+ " :%@##@@o::x%@@,o%##@@%###x,x##x;;@@@%@@x. ",
+ " .,:::::x##@#o o##@#%%@@##.o#@##%::::::, ",
+ " .;o#@@@@@@@%:;. o##@; @@##. .;:%@@@@#@@%x;, ",
+ " :#@#,.. x@@%. #@@#. .. . ,@@##,. ",
+ " x@, ., o@@: ;#@;, %@o ",
+ " ,o%xo: ,o@@x :@@;. o:.;##. ",
+ " ,o#@x, .:@@#; ;oo, ",
+ " ;:;o@@%:. ,;%@#xo ",
+ " .##%:,. .;x%##, ",
+ " ,,,: .. .. ",
+ " ",
+ },
+ {
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@###############@@##%: ",
+ " ,o%########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,;x%######%x;,o#####%;, ",
+ " :x%##x.#::######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " ::: .:;x%###%:oxooo;o####%;:, .:::.",
+ " @x, .:oo####xxxxx%###%o;,. .,#@:",
+ " @@o, ,...;;o%%%%%%%x;;:..,. .:x@#:",
+ " ;#@#o, :;:::;xxooxxxxxxxo;xxo.;;;;. ;%@@o, ",
+ " .:#@#%%%%%%%##,x##xoo##@@%##%;x%#%:o##%%x%%%#@#x, ",
+ " :x%oo%x;:;#@#x o##@@@@###%.x@##x;x%x;%%o ",
+ " ,oxxxxx%##@o, o##@o::@@##.,o@###xxxxxxo. ",
+ " :%@#%##xx##%o ,%@@, %@@#. ;###%o#xx#@@%, ",
+ " ;#@;. .#@# o@@o, :;x@o, ",
+ " ##, ,, :x@@o ,@@#x, .: .;@x, ",
+ " :x%x;, .:x@@@#,. x%#@%o: ,;ox%o. ",
+ " .. ,x@@#;. .x@@#,. ... ",
+ " :@#o, ,:x@o ",
+ " :@x:, ,,:@o ",
+ " ;;: :;;. ",
+ " ",
+ },
+ {
+ " ..###%%%%%%%%%;:. ",
+ " ,x@@@@@############x,. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.xox######xox.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%%; ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;::::ox###%x;:. ",
+ " .:::%%%########%%o::. ",
+ "x%; ,,,,;;oxxxxxxxo;;:,.,. xx,",
+ "%@%;. ..oxx:;o%%oo%%%%%%%x;%%x.;oxx, .;#@;",
+ " x#####@@##@@xx%:%#@;ox##@@%##%o;x##.;%o@@#@@@####@#;.",
+ " .oooo;::;;.,o#@#; o##@@@@####.x@#xo, ;;:;;;oooo; ",
+ " .,;oxx#####@#%#: :x#@x, @@##,.,@x#@@##%@#%%%xo, ",
+ " ;%@@oxxx;;xxo;. ,;#@#; ,%@##; :oxo;;ooooo%@@o: ",
+ " @%:. ,o@@: :@@#x, ..;@# ",
+ " x%xo:. ,;x%@@o ,o@@@o;: ;oo#%; ",
+ " .,,. .:#@@@o:. .,o#@##;, ,,,, ",
+ " o@%, .o@# ",
+ " ;@%, .@# ",
+ " . .;;: ",
+ " ",
+ " ",
+ },
+ {
+ " .,###%%%%%%%%%o:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " :o%##x.;,:######;,;.o###%x;. ",
+ " ,;%#####%o#####xx#####%o: ",
+ " .,;ox###%x;::::ox###%o;:. ",
+ " .,::%%%########%%o::. ",
+ " :,,,;;oxxxxxxxo;;:,.,. ",
+ "ox: ...x%%:;x#%oo%%%%%%%x;%#x,:o%%,.. ox,",
+ "%#x,,,,::x#@@xx%:%@@;ox##@@%##%o;x##.;%o@@%:::,,,,,##:",
+ ":;;::::;;xx;:.,;%@#: o##@@@@####.x@#x: ::::;;:,,::;:.",
+ " ,x@%##%%x;,,x#@@o,,%@@@x, %@@##:,#@#%:,:;########:, ",
+ " @#o:;ooo#@@@@#o,:o%@@%: :x@#x; ;%@@@@@o;;ooooo@#,",
+ " @%o,. ..,::::%#@@x, .o@@@#:,::,,. .:o@#:",
+ " ,;;. :o@#@@@@x;: :;o@@@@#@%: :;;. ",
+ " %@x..... .....o#@ ",
+ " ;xx ;%@ ",
+ " . ... ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ..%%%xxxxxxxxx;,. ",
+ " ,x#@@@@############x,. ",
+ " .:@@@@@@###########@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%####################o, ",
+ " :x%###o.xxx######xxx.o#####%:. ",
+ " :o%##x.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%x: ",
+ " .,;o%###%o;;;;;ox####x;:. ",
+ " .:;;%%%#%%%%%##%%o;:. ",
+ " ,..,;;oxxxxxxxx;;:,.,. ",
+ " . .xxxx:;o%%ooxxxxxxxx;%%x.;o%x;, ,;:. ",
+ " x##:,;%%#@@@#%%,x#@oox##@@%##%oo%##,o#x@@#xx;,;%#@: ",
+ " ::::::ox;:::..:%@#; o##@@@@####.x@#x: ::;@x::;;;:. ",
+ " x##%#x,.....;x#@o,,%#@@x: .@@@#%;:@@#x.....,,;#%%@o:.",
+ " @#:.;%@@@#%@@#o::o%@@#; :%@#x; o#@@@@@@@#xo;:%@@:",
+ " .,::..,,:::::,,x#@@%:. ,x@@#%,,::::,,,. :oo,. ",
+ " x#@#@@@@%o: :ox@@@@#@#x ",
+ " ;o,.,,,. .,,,.,x@ ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " :::::::::::;,. ",
+ " ,;x@@@#########%xo: ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;:@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:ox%###x:x%x%%o;####%o;: ",
+ " ::, ,:ox####ooooo%###%x;,. ::, ",
+ " .@#; ....oox%%%%%%#%oo:... .%@@ ",
+ " .##%o::::;:;xxo;oooooooo;xxo,;;:::;x#@% ",
+ " :x@@@@#.o%#%oo##@@%##%;%##x,x@@@@@o, ",
+ " .,. ..%@@#.o%#@@@####%.x@##;. .. ... ",
+ " o@o. ,o@x: o##@x;;@@##.:x@#x; :x##, ",
+ " ;#x, . :x@, x@@, @@##. .##%o. . ;%#; ",
+ " ,;% :;: o#@%. ;%@:. :;;.:%,. ",
+ " x#% #@%..,o@@x :@@%:.,o#@,;#%: ",
+ " ;%@@@@@o, o#@@@@@o. ",
+ " .,;::, .,::,, ",
+ " ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " .,###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@@###########@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###x.%xx######xo%.o#####x:. ",
+ " :o%##x.;,:######;,;.o###%x;. ",
+ " ,;%#####%x#####%x#####%o; ",
+ " .,,,..,;ox###%x;::::ox###%o;:. .,, ",
+ " ;##xx, ,::%%%########%%o::. .xx#; ",
+ " %@#o.. :,,,;;oxxxxxxxo;;:,.,. ;x@o ",
+ " ;xo#@##,;x%%oo%%%%%%%x;%%x,;x#@@#xx. ",
+ " ;%%o. :;;;;%@@;ox##@@%##%o;x##;::;;, .xxx, ",
+ " ;#x, ;%#@%: o##@@@@####.x@###% .;%@, ",
+ " ,;:. ;%@x, o##@; @@##. ,%;%@x. .::. ",
+ " o@#, o#@@; @@##. ,:#@o. ",
+ " .;%,. ;oo. o@@, %@#.,oo;, .x%; ",
+ " ,x##: @#x .x@@. %@@,,;x@; xx%o ",
+ " @@%;@@#: ,x@@%x@@; ",
+ " ,%@@#;. ,#@@@, ",
+ " ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;ox######o, ",
+ " .;x###x.@o;######[email protected]####%o. ",
+ " ,;x##%;;;o######o;;;x###%o: ",
+ " ,;o%####%:#####oo#####xo: ",
+ " .;%o%: :;o%####;::::x###%x;:. .xxo:. ",
+ " @@x #: .,,xxx#######%xx:,,. %o:@%; ",
+ " @@x.o, .:::;o;;oooooooo;oo;,;,. o:,%@% ",
+ " ,o;: x#@%;;ox.o%##oo##@@%%%%;%#%;,;x;;x@@%; ;;: ",
+ " :%%:x; ,,,@@%:x#@@,o%##@@%###x,x##%o;@@x,,. %oox%. ",
+ " ;; ,o#@%; o##@#%%@@##.;#@##%: ,x;. ",
+ " ;%@@:. o##@; @@##. .:,x@@o: . ",
+ " ,#@#: .: o#@#: #@@#... :@@o ",
+ " ,@@, :x% o@@. %@#.;x; ,::%x ",
+ " ,@#;. x@%.x@@. %@@,x@@ oxxx: ",
+ " ,,,. x#x#@#: ,o@@### .,. ",
+ " .;@%:. .%#%. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .. ,;o%####x:%####o;#####oo: ... ",
+ " ,;#x%@, :;o%####;::::x###%x;:. x%o%x; ",
+ " x@%,:@, .,,oox#######%oo:,,. xx ,%@, ",
+ " .o@x:,o. .:::oo;;oooooooo;oo;,;,. ,, .x@:... ",
+ " :,xoo@@%o;;ox.o%#%oo##@@%%%%;%#%;,;x;;;x@#o %%%, ",
+ " ,, ,,ox@@x:%#@@.o%##@@####%,o##%o;@@#%,. .., ",
+ " .,;;x#@%; o##@%xx@@##.;%@##%;;:, ",
+ " :o#@@@@:. o##@; @@##. .:,x@@@##o,. ",
+ " ;@@%. .,, o#@%: %@@#.., :#@#o ",
+ " @@%.. :xxx o@@. %@#.;%o. .@@o ",
+ " ;xxx, #@x,,%@@. %@@,.:@%; .%xx#: ",
+ " :@@x@@%: ,o@@#%@;. ;:: ",
+ " .;#x:. .x##. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .;xxx, ,;o%####x:%####o;#####o;: xxxx. ",
+ " ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:,,. ,. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@%: ",
+ " .,o@@%#@@;::%#@@,o%##@@####%,o##%o;@@#x@@%,.. ",
+ " .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,,. o##@; @@##. .:,x@@@#%@#%%o, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@x ",
+ " .xo: ;@, .x@@. %@@,. ,x# x;;o#; ",
+ " ;@@o;o@@%: ,o@@x;:#@% ,:: ",
+ " .x#@#x: .x#@#x:. ",
+ " ",
+ " ",
+ },
+ {
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .;xxx, ,;o%####x:%####o;#####o;: xxxx. ",
+ " ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:,, .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%#@@o::%#@@,o%##@@####%,o##%o;@@#x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,,. o##@; @@##. .:,x@@@@%@#%%o, ",
+ " ;@%, o#@%, %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@x ",
+ " .xo: ;@, .%@@. %@@,. ,x# x;;x#; ",
+ " ;@@o;o@@%: ,o@@x;:#@# ,:: ",
+ " .x@@#x: .x#@#x:. ",
+ " ",
+ " ",
+ },
+};
+static const uint8_t octopus_eyes[] = {10,10,10,9,9,9,9,9,9,9,10,10,10,10,10,9,9,9,9,9,8,9,9,10,10,10,10,10,10,10,9,9,9,9,9,9,9,9,10,10,10,9,9,9,8,9,9,9,10,10,10,10,9,9,9,9,9,9,10,10,10,10,10};
+static const uint16_t octopus_ends[] = {100,170,270,330,430,500,600,670,770,830,930,1000,1100,1170,1270,1330,1430,1500,1600,1670,1770,1830,1930,2000,2100,2170,2270,2330,2430,2500,2600,2670,2770,2830,2930,3000,3100,3170,3270,3330,3430,3500,3600,3670,3770,3830,3930,4000,4100,4170,4270,4330,4430,4500,4600,4670,4770,4830,4930,5000,5100,5170,5210};
diff --git a/devices/harness-device/firmware/test/reference48/octopus_ref.c b/devices/harness-device/firmware/test/reference48/octopus_ref.c
new file mode 100644
index 000000000..608da8e40
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/octopus_ref.c
@@ -0,0 +1,2 @@
+#include "renames.h"
+#include "octopus.c.inc"
diff --git a/devices/harness-device/firmware/test/reference48/reference.h b/devices/harness-device/firmware/test/reference48/reference.h
new file mode 100644
index 000000000..5e4db9212
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/reference.h
@@ -0,0 +1,8 @@
+#pragma once
+#include "octopus.h"
+
+// Captured .48 renderer/art layout, compiled only into diagnostic programs.
+void ht48_octopus_face(ht_scene_t *scene, const ht_tim_face_t *face, uint8_t frame,
+ uint16_t ink, const char *recap);
+void ht48_damage(const ht_scene_t *before, const ht_scene_t *after, ht_damage_t *out);
+void ht48_raster(const ht_scene_t *scene, ht_rect_t region, uint16_t *out);
diff --git a/devices/harness-device/firmware/test/reference48/renames.h b/devices/harness-device/firmware/test/reference48/renames.h
new file mode 100644
index 000000000..41cfe8ed9
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/renames.h
@@ -0,0 +1,19 @@
+// Diagnostic namespace only; archived sources below are unmodified.
+#define ht_arc_cache_builds ht48_arc_cache_builds
+#define ht_arc_status ht48_arc_status
+#define ht_arc_title ht48_arc_title
+#define ht_can_display ht48_can_display
+#define ht_center ht48_center
+#define ht_damage ht48_damage
+#define ht_octopus_face ht48_octopus_face
+#define ht_octopus_motion_tick ht48_octopus_motion_tick
+#define ht_octopus_short_recap ht48_octopus_short_recap
+#define ht_raster ht48_raster
+#define ht_recap_lines ht48_recap_lines
+#define ht_rgb ht48_rgb
+#define ht_scene_clear ht48_scene_clear
+#define ht_take_line ht48_take_line
+#define ht_text ht48_text
+#define ht_text_rows ht48_text_rows
+#define ht_utf8_next ht48_utf8_next
+#define ht_wrap ht48_wrap
diff --git a/devices/harness-device/firmware/test/reference48/source-hashes.json b/devices/harness-device/firmware/test/reference48/source-hashes.json
new file mode 100644
index 000000000..5a5f86e6a
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/source-hashes.json
@@ -0,0 +1,17 @@
+{
+ "terminal.c.inc": {
+ "sha256": "a80ae27c0a5fa6199886e732157fd1c2710434f06eb2f6d1c02c1b516c2f21c0",
+ "bytes": 17512,
+ "snapshot": "/private/tmp/harness-atlas49/before/terminal.c"
+ },
+ "octopus.c.inc": {
+ "sha256": "cb5f6416d662ba20cdab1f5e952e9f6fe8bd284bd4cde060ab7d744f7e68c6bb",
+ "bytes": 11060,
+ "snapshot": "/private/tmp/harness-clip50/before/main/ui/habitat/octopus.c"
+ },
+ "octopus_art.inc": {
+ "sha256": "0c384833a16ef999344d82e99c8c543aa1f6784b9f07c722ad3f7155fa7b272f",
+ "bytes": 113878,
+ "snapshot": "/private/tmp/harness-clip50/before/main/ui/habitat/octopus_art.inc"
+ }
+}
diff --git a/devices/harness-device/firmware/test/reference48/terminal.c.inc b/devices/harness-device/firmware/test/reference48/terminal.c.inc
new file mode 100644
index 000000000..f3304b62a
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/terminal.c.inc
@@ -0,0 +1,429 @@
+#include "terminal.h"
+#include <string.h>
+#include "arc_geometry.inc"
+
+static int imin(int a, int b) { return a < b ? a : b; }
+static int imax(int a, int b) { return a > b ? a : b; }
+static uint16_t be16(uint16_t v) { return (uint16_t)((v << 8) | (v >> 8)); }
+static uint32_t punctuation_alias(uint32_t cp)
+{
+ // One cell in, one cell out. Keep the original UTF-8 in the scene/wire;
+ // reuse existing ASCII pixels for typographic punctuation outside Latin-1.
+ switch (cp) {
+ case 0x2010: case 0x2011: case 0x2012: case 0x2013: case 0x2014: case 0x2015:
+ case 0x2212: return '-';
+ case 0x2018: case 0x2019: case 0x201a: case 0x201b: return '\'';
+ case 0x201c: case 0x201d: case 0x201e: case 0x201f: return '"';
+ default: return cp;
+ }
+}
+static const ht_font_t *glyph_font(const ht_font_t *font, uint32_t cp)
+{
+ // Authored arrows in a recap use the same precomputed glyph as its marker.
+ // Identical cell metrics: no scaling, allocation, or extra text runs.
+ return cp == 0x2197 && font == &ht_mono_20 ? &ht_open_20 : font;
+}
+static uint32_t font_codepoint(const ht_font_t *font, uint32_t cp)
+{
+ // Space is always an empty cell, including compact Unicode-only atlases.
+ if (cp == ' ' || (cp >= font->first && cp <= font->last)) return cp;
+ font = glyph_font(font, cp);
+ cp = punctuation_alias(cp);
+ if (cp >= font->first && cp <= font->last) return cp;
+ return font->first <= '?' && font->last >= '?' ? '?' : ' ';
+}
+uint16_t ht_rgb(unsigned c)
+{
+ return (uint16_t)(((c >> 8) & 0xf800) | ((c >> 5) & 0x07e0) | ((c >> 3) & 0x1f));
+}
+uint32_t ht_utf8_next(const char **p)
+{
+ const unsigned char *s = (const unsigned char *)*p;
+ uint32_t c = *s++;
+ if (!c)
+ return 0;
+ if (c >= 0xc2 && c <= 0xf4) {
+ int n = c < 0xe0 ? 1 : c < 0xf0 ? 2 : 3;
+ uint32_t v = c & ((1u << (6 - n)) - 1);
+ for (int i = 0; i < n; i++) {
+ if ((s[i] & 0xc0) != 0x80) {
+ *p = (const char *)s;
+ return '?';
+ }
+ v = (v << 6) | (s[i] & 63);
+ }
+ s += n;
+ c = v;
+ } else if (c >= 128)
+ c = '?';
+ *p = (const char *)s;
+ return c;
+}
+void ht_scene_clear(ht_scene_t *s, uint16_t bg)
+{
+ s->count = 0;
+ s->background = bg;
+}
+bool ht_text(ht_scene_t *s, int x, int y, int w, const ht_font_t *font, uint16_t fg, uint16_t bg,
+ const char *text)
+{
+ if (s->count >= HT_RUNS || !font || w <= 0)
+ return false;
+ ht_run_t *r = &s->runs[s->count++];
+ memset(r, 0, sizeof(*r));
+ r->x = x;
+ r->y = y;
+ r->w = w;
+ r->font = font;
+ r->fg = fg;
+ r->bg = bg;
+ const char *p = text ? text : "";
+ size_t n = 0;
+ int cells = w / font->width;
+ while (*p && cells-- > 0) {
+ const char *start = p;
+ ht_utf8_next(&p);
+ size_t len = (size_t)(p - start);
+ if (n + len >= sizeof(r->text))
+ break;
+ memcpy(r->text + n, start, len);
+ n += len;
+ }
+ r->text[n] = 0;
+ return true;
+}
+void ht_center(ht_scene_t *s, int y, const ht_font_t *font, uint16_t fg, const char *text)
+{
+ const char *p = text;
+ int n = 0;
+ while (*p) {
+ ht_utf8_next(&p);
+ n++;
+ }
+ int w = imin(n * font->width, HT_WIDTH - 80);
+ ht_text(s, (HT_WIDTH - w) / 2, y, w, font, fg, s->background, text);
+}
+static void arc_text(ht_scene_t *s, uint16_t fg, const char *text, bool bottom)
+{
+ if (!text || !*text) return;
+ if (!ht_text(s, HT_ARC_X, HT_ARC_Y, HT_ARC_COLS * ht_mono_20.width,
+ &ht_mono_20, fg, s->background, text)) return;
+ ht_run_t *r = &s->runs[s->count - 1];
+ // A long name ends at a word boundary; the pane list retains its full name.
+ if (strlen(text ? text : "") > strlen(r->text)) {
+ char *last = strrchr(r->text, ' ');
+ if (last && last - r->text >= HT_ARC_COLS / 2) *last = 0;
+ }
+ r->arc = bottom ? 2 : 1;
+ r->y = bottom ? HT_HEIGHT - HT_ARC_Y - HT_ARC_HEIGHT : HT_ARC_Y;
+ r->w = HT_ARC_WIDTH;
+}
+void ht_arc_title(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, false); }
+void ht_arc_status(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, true); }
+const char *ht_take_line(const char **cursor, int cols)
+{
+ const char *p = *cursor, *start = p, *space = NULL, *end = p;
+ int n = 0;
+ while (*p && *p != '\n' && n < cols) {
+ if (*p == ' ')
+ space = p;
+ ht_utf8_next(&p);
+ n++;
+ end = p;
+ }
+ if (*p && *p != '\n' && space && space > start) {
+ end = space;
+ p = space + 1;
+ } else if (*p == '\n')
+ p++;
+ *cursor = p;
+ return end;
+}
+int ht_text_rows(const char *text, const ht_font_t *font, int width)
+{
+ if (!font || !font->width || width < font->width) return 0;
+ const char *p = text ? text : "";
+ int rows = 0;
+ while (*p) { ht_take_line(&p, width / font->width); rows++; }
+ return rows;
+}
+bool ht_can_display(const char *text, const ht_font_t *font, int width, int lines)
+{
+ if (!font || !font->width || width < font->width || lines < 1)
+ return false;
+ const char *p = text ? text : "";
+ while (*p) {
+ uint32_t cp = ht_utf8_next(&p);
+ const ht_font_t *glyph = glyph_font(font, cp);
+ if (cp < glyph->first || cp > glyph->last) cp = punctuation_alias(cp);
+ if (cp != '\n' && cp != ' ' && (cp < glyph->first || cp > glyph->last || (cp >= 127 && cp < 160)))
+ return false;
+ }
+ p = text ? text : "";
+ int rows = 0;
+ while (*p) {
+ if (++rows > lines)
+ return false;
+ ht_take_line(&p, width / font->width);
+ }
+ return true;
+}
+int ht_wrap(ht_scene_t *s, int x, int y, int w, int lines, int skip, const ht_font_t *f,
+ uint16_t fg, const char *text)
+{
+ if (!f || !f->width || w < f->width || lines <= 0)
+ return 0;
+ const char *p = text ? text : "";
+ int row = 0, shown = 0, cols = w / f->width;
+ while (*p && shown < lines) {
+ const char *start = p;
+ const char *end = ht_take_line(&p, cols);
+ if (row++ < skip)
+ continue;
+ char line[HT_TEXT_BYTES];
+ size_t len = (size_t)(end - start);
+ if (len >= sizeof(line))
+ len = sizeof(line) - 1;
+ memcpy(line, start, len);
+ line[len] = 0;
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, line);
+ shown++;
+ }
+ // Keep the slots after a wrapped block stable when its line count changes.
+ // Otherwise one extra prompt line makes every following button look moved.
+ while (shown < lines) {
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, "");
+ shown++;
+ }
+ return row;
+}
+static ht_rect_t bounds(const ht_run_t *r)
+{
+ if (r->arc) {
+ const char *p = r->text; int count = 0;
+ while (*p && count < HT_ARC_COLS) { ht_utf8_next(&p); count++; }
+ if (!count) return (ht_rect_t){0, 0, 0, 0};
+ int sn = arc_trig[count - 1][0], cs = arc_trig[count - 1][1];
+ // Tight, conservative ink bounds. The fixed cache remains 416x128, but
+ // a short name must not dirty that whole rectangle on every pane switch.
+ int half_w = ((13 * cs + 29 * sn) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sn) >> 15) + 2;
+ int left = 233 - (205 * sn >> 14) - half_w - 1;
+ int bottom = 233 - (205 * cs >> 14) + half_h + 1;
+ return (ht_rect_t){left, r->arc == 2 ? HT_HEIGHT - bottom : HT_ARC_Y,
+ 2 * (233 - left), bottom - HT_ARC_Y};
+ }
+ return (ht_rect_t){r->x, r->y, r->w, r->font->height};
+}
+static bool intersect(ht_rect_t a, ht_rect_t b)
+{
+ return a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
+}
+static ht_rect_t united(ht_rect_t a, ht_rect_t b)
+{
+ int x = imin(a.x, b.x), y = imin(a.y, b.y);
+ return (ht_rect_t){x, y, imax(a.x + a.w, b.x + b.w) - x, imax(a.y + a.h, b.y + b.h) - y};
+}
+static void damage_add(ht_damage_t *d, ht_rect_t r)
+{
+ int x = imax(0, r.x) & ~1, y = imax(0, r.y) & ~1, x2 = imin(HT_WIDTH, (r.x + r.w + 1) & ~1),
+ y2 = imin(HT_HEIGHT, (r.y + r.h + 1) & ~1);
+ r = (ht_rect_t){x, y, x2 - x, y2 - y};
+ if (r.w <= 0 || r.h <= 0)
+ return;
+ for (int i = 0; i < d->count; i++) {
+ ht_rect_t u = united(d->rect[i], r);
+ if (intersect(d->rect[i], r) || u.w * u.h <= d->rect[i].w * d->rect[i].h + r.w * r.h + 64) {
+ r = u;
+ d->rect[i] = d->rect[--d->count];
+ i = -1;
+ }
+ }
+ if (d->count == HT_DAMAGE_MAX) {
+ d->count = 1;
+ d->rect[0] = (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT};
+ return;
+ }
+ d->rect[d->count++] = r;
+}
+void ht_damage(const ht_scene_t *a, const ht_scene_t *b, ht_damage_t *d)
+{
+ memset(d, 0, sizeof(*d));
+ if (!a || a->background != b->background) {
+ damage_add(d, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT});
+ } else
+ for (int i = 0; i < imax(a->count, b->count); i++) {
+ if (i < a->count && i < b->count &&
+ memcmp(&a->runs[i], &b->runs[i], sizeof(ht_run_t)) == 0)
+ continue;
+ if (i < a->count && i < b->count) {
+ const ht_run_t *old = &a->runs[i], *next = &b->runs[i];
+ if (!old->arc && !next->arc && old->x == next->x && old->y == next->y && old->w == next->w &&
+ old->font == next->font && old->fg == next->fg && old->bg == next->bg) {
+ const char *p = old->text, *q = next->text;
+ int cell = 0, first = -1, last = -1;
+ while (*p || *q) {
+ uint32_t pc = *p ? ht_utf8_next(&p) : ' ';
+ uint32_t qc = *q ? ht_utf8_next(&q) : ' ';
+ pc = font_codepoint(old->font, pc);
+ qc = font_codepoint(old->font, qc);
+ if (pc != qc) {
+ if (first < 0)
+ first = cell;
+ last = cell;
+ }
+ cell++;
+ }
+ if (first >= 0)
+ damage_add(d, (ht_rect_t){next->x + first * next->font->width, next->y,
+ (last - first + 1) * next->font->width,
+ next->font->height});
+ continue;
+ }
+ }
+ if (i < a->count)
+ damage_add(d, bounds(&a->runs[i]));
+ if (i < b->count)
+ damage_add(d, bounds(&b->runs[i]));
+ }
+ for (int i = 0; i < d->count; i++)
+ d->pixels += (uint32_t)d->rect[i].w * d->rect[i].h;
+}
+static void fill(uint16_t *p, size_t n, uint16_t c)
+{
+ for (size_t i = 0; i < n; i++)
+ p[i] = c;
+}
+static uint16_t blend(uint16_t fg, uint16_t bg, unsigned alpha)
+{
+ unsigned r = (((fg >> 11) * alpha + (bg >> 11) * (3 - alpha)) + 1) / 3;
+ unsigned g = ((((fg >> 5) & 63) * alpha + ((bg >> 5) & 63) * (3 - alpha)) + 1) / 3;
+ unsigned b = (((fg & 31) * alpha + (bg & 31) * (3 - alpha)) + 1) / 3;
+ return be16((r << 11) | (g << 5) | b);
+}
+
+// The renderer owns two 13 KiB 2-bit masks plus bounded row-ink spans.
+// Upper/lower text have independent keys, so they never evict each other.
+// Scenes retain immutable text, allowing old scenes to rasterize correctly.
+typedef struct {
+ uint8_t mask[HT_ARC_WIDTH * HT_ARC_HEIGHT / 4];
+ uint16_t left[HT_ARC_HEIGHT], right[HT_ARC_HEIGHT];
+ char text[HT_TEXT_BYTES];
+ bool valid;
+} arc_cache_t;
+static arc_cache_t arc_caches[2];
+static uint32_t arc_builds;
+uint32_t ht_arc_cache_builds(void) { return arc_builds; }
+
+static unsigned glyph_alpha(const uint8_t *glyph, int x, int y)
+{
+ if (x < 0 || x >= 12 || y < 0 || y >= 28) return 0;
+ unsigned k = (unsigned)y * 12 + (unsigned)x;
+ return (glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3;
+}
+static void arc_prepare(const ht_run_t *r, arc_cache_t *cache)
+{
+ if (cache->valid && !strcmp(cache->text, r->text)) return;
+ memset(cache->mask, 0, sizeof cache->mask);
+ for (int y = 0; y < HT_ARC_HEIGHT; y++) { cache->left[y] = HT_ARC_WIDTH; cache->right[y] = 0; }
+ strcpy(cache->text, r->text);
+ cache->valid = true; arc_builds++;
+ uint32_t cp[HT_ARC_COLS];
+ int count = 0;
+ const char *p = r->text;
+ while (*p && count < HT_ARC_COLS) cp[count++] = ht_utf8_next(&p);
+ for (int i = 0; i < count; i++) {
+ uint32_t c = font_codepoint(&ht_mono_20, cp[i]);
+ if (c == ' ') continue;
+ const ht_font_t *f = glyph_font(&ht_mono_20, c);
+ const uint8_t *glyph = f->pixels + (c - f->first) * 84;
+ int step = 2 * i - (count - 1), absolute = step < 0 ? -step : step;
+ int sn = arc_trig[absolute][0] * (step < 0 ? -1 : 1), cs = arc_trig[absolute][1];
+ int cx = (233 - HT_ARC_X) * 256 + (205 * sn * 256 >> 14);
+ int cy = (233 - r->y) * 256 + (r->arc == 2 ? 1 : -1) * (205 * cs * 256 >> 14);
+ if (r->arc == 2) sn = -sn; // lower arc reads left-to-right with upright letters
+ int sin_abs = sn < 0 ? -sn : sn;
+ int half_w = ((13 * cs + 29 * sin_abs) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sin_abs) >> 15) + 2;
+ int x0 = imax(0, (cx >> 8) - half_w), x1 = imin(HT_ARC_WIDTH, (cx >> 8) + half_w + 1);
+ int y0 = imax(0, (cy >> 8) - half_h), y1 = imin(HT_ARC_HEIGHT, (cy >> 8) + half_h + 1);
+ for (int y = y0; y < y1; y++) for (int x = x0; x < x1; x++) {
+ int dx = x * 256 + 128 - cx, dy = y * 256 + 128 - cy;
+ int sx = ((dx * cs + dy * sn) >> 14) + 6 * 256 - 128;
+ int sy = ((-dx * sn + dy * cs) >> 14) + 14 * 256 - 128;
+ if (sx < -256 || sx >= 12 * 256 || sy < -256 || sy >= 28 * 256) continue;
+ int gx = sx >> 8, gy = sy >> 8;
+ unsigned fx = sx & 255, fy = sy & 255;
+ // Fixed-point bilinear coverage preserves the existing font's soft
+ // edges. This runs only on a title change, never per animation tick.
+ unsigned a = (glyph_alpha(glyph,gx,gy)*(256-fx)*(256-fy) +
+ glyph_alpha(glyph,gx+1,gy)*fx*(256-fy) +
+ glyph_alpha(glyph,gx,gy+1)*(256-fx)*fy +
+ glyph_alpha(glyph,gx+1,gy+1)*fx*fy + 32768) >> 16;
+ unsigned k = (unsigned)y * HT_ARC_WIDTH + (unsigned)x, shift = (3 - (k & 3)) * 2;
+ unsigned old = (cache->mask[k >> 2] >> shift) & 3;
+ if (a > old) {
+ cache->mask[k >> 2] = (uint8_t)((cache->mask[k >> 2] & ~(3u << shift)) | (a << shift));
+ if (x < cache->left[y]) cache->left[y] = x;
+ if (x + 1 > cache->right[y]) cache->right[y] = x + 1;
+ }
+ }
+ }
+}
+static void arc_raster(const ht_run_t *r, ht_rect_t clip, uint16_t *out)
+{
+ arc_cache_t *cache = &arc_caches[r->arc == 2];
+ arc_prepare(r, cache);
+ uint16_t palette[4] = {0, blend(r->fg,r->bg,1), blend(r->fg,r->bg,2), be16(r->fg)};
+ int x0 = imax(clip.x,r->x), x1 = imin(clip.x+clip.w,r->x+r->w);
+ int y0 = imax(clip.y,r->y), y1 = imin(clip.y+clip.h,r->y+HT_ARC_HEIGHT);
+ for (int y = y0; y < y1; y++) {
+ int left = imax(x0, r->x + cache->left[y-r->y]);
+ int right = imin(x1, r->x + cache->right[y-r->y]);
+ if (left >= right) continue;
+ unsigned k = (unsigned)(y-r->y)*HT_ARC_WIDTH + (unsigned)(left-r->x);
+ uint16_t *dst = out + (y-clip.y)*clip.w + left-clip.x;
+ for (int x = left; x < right; x++, k++, dst++) {
+ unsigned a = (cache->mask[k >> 2] >> ((3-(k&3))*2)) & 3;
+ if (a) *dst = palette[a];
+ }
+ }
+}
+void ht_raster(const ht_scene_t *s, ht_rect_t clip, uint16_t *out)
+{
+ fill(out, (size_t)clip.w * clip.h, be16(s->background));
+ for (int i = 0; i < s->count; i++) {
+ const ht_run_t *r = &s->runs[i];
+ const ht_font_t *f = r->font;
+ ht_rect_t box = bounds(r);
+ if (!intersect(box, clip))
+ continue;
+ if (r->arc) { arc_raster(r, clip, out); continue; }
+ int y1 = imax(clip.y, r->y), y2 = imin(clip.y + clip.h, r->y + f->height),
+ x1 = imax(clip.x, r->x), x2 = imin(clip.x + clip.w, r->x + r->w);
+ if (r->bg != s->background)
+ for (int y = y1; y < y2; y++)
+ fill(out + (y - clip.y) * clip.w + x1 - clip.x, (size_t)(x2 - x1), be16(r->bg));
+ uint16_t palette[4] = {be16(r->bg), blend(r->fg, r->bg, 1), blend(r->fg, r->bg, 2),
+ be16(r->fg)};
+ const char *p = r->text;
+ int gx = r->x;
+ while (*p && gx < x2) {
+ uint32_t c = ht_utf8_next(&p);
+ c = font_codepoint(f, c);
+ if (gx + f->width > x1 && c != ' ') {
+ const ht_font_t *face = glyph_font(f, c);
+ size_t stride = ((size_t)face->width * face->height + 3) / 4;
+ const uint8_t *glyph = face->pixels + (c - face->first) * stride;
+ int xa = imax(x1, gx), xb = imin(x2, gx + f->width);
+ for (int y = y1; y < y2; y++) {
+ uint16_t *dst = out + (y - clip.y) * clip.w + xa - clip.x;
+ size_t k = (size_t)(y - r->y) * f->width + xa - gx;
+ for (int x = xa; x < xb; x++, k++)
+ *dst++ = palette[(glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3];
+ }
+ }
+ gx += f->width;
+ }
+ }
+}
diff --git a/devices/harness-device/firmware/test/reference48/terminal_ref.c b/devices/harness-device/firmware/test/reference48/terminal_ref.c
new file mode 100644
index 000000000..f52781322
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference48/terminal_ref.c
@@ -0,0 +1,2 @@
+#include "renames.h"
+#include "terminal.c.inc"
diff --git a/devices/harness-device/firmware/test/reference79/README.md b/devices/harness-device/firmware/test/reference79/README.md
new file mode 100644
index 000000000..81fb0742d
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/README.md
@@ -0,0 +1,5 @@
+# Dense curved-cache reference
+
+Exact terminal.c from the tested habitat.79 source, before packed arc storage.
+Compiled only by native comparisons or an explicit diagnostic build. The production
+firmware never includes this copy. Font assets are shared, byte for byte.
diff --git a/devices/harness-device/firmware/test/reference79/reference.h b/devices/harness-device/firmware/test/reference79/reference.h
new file mode 100644
index 000000000..97bae56fd
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/reference.h
@@ -0,0 +1,4 @@
+#pragma once
+#include "terminal.h"
+void ht79_raster(const ht_scene_t *, ht_rect_t, uint16_t *);
+void ht79_damage(const ht_scene_t *, const ht_scene_t *, ht_damage_t *);
diff --git a/devices/harness-device/firmware/test/reference79/renames.h b/devices/harness-device/firmware/test/reference79/renames.h
new file mode 100644
index 000000000..5d7ca0f79
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/renames.h
@@ -0,0 +1,24 @@
+// Diagnostic namespace for the unmodified dense-cache renderer.
+#define ht_arc_cache_builds ht79_arc_cache_builds
+#define ht_arc_fast_sampling ht79_arc_fast_sampling
+#define ht_arc_status ht79_arc_status
+#define ht_arc_tight_bounds ht79_arc_tight_bounds
+#define ht_arc_title ht79_arc_title
+#define ht_ascii_text ht79_ascii_text
+#define ht_can_display ht79_can_display
+#define ht_center ht79_center
+#define ht_damage ht79_damage
+#define ht_damage_fast_ascii ht79_damage_fast_ascii
+#define ht_glyph_cache_builds ht79_glyph_cache_builds
+#define ht_glyph_cache_bytes ht79_glyph_cache_bytes
+#define ht_glyph_cache_enable ht79_glyph_cache_enable
+#define ht_raster ht79_raster
+#define ht_raster_fast_ascii ht79_raster_fast_ascii
+#define ht_rgb ht79_rgb
+#define ht_run_bounds ht79_run_bounds
+#define ht_scene_clear ht79_scene_clear
+#define ht_take_line ht79_take_line
+#define ht_text ht79_text
+#define ht_text_rows ht79_text_rows
+#define ht_utf8_next ht79_utf8_next
+#define ht_wrap ht79_wrap
diff --git a/devices/harness-device/firmware/test/reference79/source-hashes.json b/devices/harness-device/firmware/test/reference79/source-hashes.json
new file mode 100644
index 000000000..f83cbbde9
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/source-hashes.json
@@ -0,0 +1,3 @@
+{
+ "terminal.c.inc": "33e99c591f10a88237858947e7c400201360934909722e325a80e98941fadd6b"
+}
diff --git a/devices/harness-device/firmware/test/reference79/terminal.c.inc b/devices/harness-device/firmware/test/reference79/terminal.c.inc
new file mode 100644
index 000000000..bfcc4eec0
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/terminal.c.inc
@@ -0,0 +1,590 @@
+#include "terminal.h"
+#include <string.h>
+#include "arc_geometry.inc"
+
+static int imin(int a, int b) { return a < b ? a : b; }
+static int imax(int a, int b) { return a > b ? a : b; }
+static uint16_t be16(uint16_t v) { return (uint16_t)((v << 8) | (v >> 8)); }
+static uint32_t punctuation_alias(uint32_t cp)
+{
+ // One cell in, one cell out. Keep the original UTF-8 in the scene/wire;
+ // reuse existing ASCII pixels for typographic punctuation outside Latin-1.
+ switch (cp) {
+ case 0x2010: case 0x2011: case 0x2012: case 0x2013: case 0x2014: case 0x2015:
+ case 0x2212: return '-';
+ case 0x2018: case 0x2019: case 0x201a: case 0x201b: return '\'';
+ case 0x201c: case 0x201d: case 0x201e: case 0x201f: return '"';
+ default: return cp;
+ }
+}
+static const ht_font_t *glyph_font(const ht_font_t *font, uint32_t cp)
+{
+ // Authored arrows in a recap use the same precomputed glyph as its marker.
+ // Identical cell metrics: no scaling, allocation, or extra text runs.
+ return cp == 0x2197 && font == &ht_mono_20 ? &ht_open_20 : font;
+}
+static uint32_t font_codepoint(const ht_font_t *font, uint32_t cp)
+{
+ // Space is always an empty cell, including compact Unicode-only atlases.
+ if (cp == ' ' || (cp >= font->first && cp <= font->last)) return cp;
+ font = glyph_font(font, cp);
+ cp = punctuation_alias(cp);
+ if (cp >= font->first && cp <= font->last) return cp;
+ return font->first <= '?' && font->last >= '?' ? '?' : ' ';
+}
+uint16_t ht_rgb(unsigned c)
+{
+ return (uint16_t)(((c >> 8) & 0xf800) | ((c >> 5) & 0x07e0) | ((c >> 3) & 0x1f));
+}
+uint32_t ht_utf8_next(const char **p)
+{
+ const unsigned char *s = (const unsigned char *)*p;
+ uint32_t c = *s++;
+ if (!c)
+ return 0;
+ if (c >= 0xc2 && c <= 0xf4) {
+ int n = c < 0xe0 ? 1 : c < 0xf0 ? 2 : 3;
+ uint32_t v = c & ((1u << (6 - n)) - 1);
+ for (int i = 0; i < n; i++) {
+ if ((s[i] & 0xc0) != 0x80) {
+ *p = (const char *)s;
+ return '?';
+ }
+ v = (v << 6) | (s[i] & 63);
+ }
+ s += n;
+ c = v;
+ } else if (c >= 128)
+ c = '?';
+ *p = (const char *)s;
+ return c;
+}
+void ht_scene_clear(ht_scene_t *s, uint16_t bg)
+{
+ s->count = 0;
+ s->background = bg;
+}
+bool ht_text(ht_scene_t *s, int x, int y, int w, const ht_font_t *font, uint16_t fg, uint16_t bg,
+ const char *text)
+{
+ if (s->count >= HT_RUNS || !font || w <= 0)
+ return false;
+ ht_run_t *r = &s->runs[s->count++];
+ memset(r, 0, sizeof(*r));
+ r->x = x;
+ r->y = y;
+ r->w = w;
+ r->font = font;
+ r->fg = fg;
+ r->bg = bg;
+ const char *p = text ? text : "";
+ size_t n = 0;
+ int cells = w / font->width;
+ while (*p && cells-- > 0) {
+ const char *start = p;
+ ht_utf8_next(&p);
+ size_t len = (size_t)(p - start);
+ if (n + len >= sizeof(r->text))
+ break;
+ memcpy(r->text + n, start, len);
+ n += len;
+ }
+ r->text[n] = 0;
+ return true;
+}
+bool ht_ascii_text(ht_scene_t *s, int x, int y, int w, const ht_font_t *font,
+ uint16_t fg, uint16_t bg, const char *text, size_t cells)
+{
+ if (s->count >= HT_RUNS || !font || !font->width || w <= 0 || (!text && cells)) return false;
+ size_t n = (size_t)w / font->width;
+ if (n > cells) n = cells;
+ if (n >= HT_TEXT_BYTES) n = HT_TEXT_BYTES - 1;
+ ht_run_t *r = &s->runs[s->count++];
+ memset(r, 0, sizeof *r);
+ r->x = x; r->y = y; r->w = w; r->font = font; r->fg = fg; r->bg = bg;
+ if (n) memcpy(r->text, text, n);
+ return true;
+}
+void ht_center(ht_scene_t *s, int y, const ht_font_t *font, uint16_t fg, const char *text)
+{
+ const char *p = text;
+ int n = 0;
+ while (*p) {
+ ht_utf8_next(&p);
+ n++;
+ }
+ int w = imin(n * font->width, HT_WIDTH - 80);
+ ht_text(s, (HT_WIDTH - w) / 2, y, w, font, fg, s->background, text);
+}
+static void arc_text(ht_scene_t *s, uint16_t fg, const char *text, bool bottom)
+{
+ if (!text || !*text) return;
+ if (!ht_text(s, HT_ARC_X, HT_ARC_Y, HT_ARC_COLS * ht_mono_20.width,
+ &ht_mono_20, fg, s->background, text)) return;
+ ht_run_t *r = &s->runs[s->count - 1];
+ // A long name ends at a word boundary; the pane list retains its full name.
+ if (strlen(text ? text : "") > strlen(r->text)) {
+ char *last = strrchr(r->text, ' ');
+ if (last && last - r->text >= HT_ARC_COLS / 2) *last = 0;
+ }
+ r->arc = bottom ? 2 : 1;
+ r->y = bottom ? HT_HEIGHT - HT_ARC_Y - HT_ARC_HEIGHT : HT_ARC_Y;
+ r->w = HT_ARC_WIDTH;
+}
+void ht_arc_title(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, false); }
+void ht_arc_status(ht_scene_t *s, uint16_t fg, const char *text) { arc_text(s, fg, text, true); }
+const char *ht_take_line(const char **cursor, int cols)
+{
+ const char *p = *cursor, *start = p, *space = NULL, *end = p;
+ int n = 0;
+ while (*p && *p != '\n' && n < cols) {
+ if (*p == ' ')
+ space = p;
+ ht_utf8_next(&p);
+ n++;
+ end = p;
+ }
+ if (*p && *p != '\n' && space && space > start) {
+ end = space;
+ p = space + 1;
+ } else if (*p == '\n')
+ p++;
+ *cursor = p;
+ return end;
+}
+int ht_text_rows(const char *text, const ht_font_t *font, int width)
+{
+ if (!font || !font->width || width < font->width) return 0;
+ const char *p = text ? text : "";
+ int rows = 0;
+ while (*p) { ht_take_line(&p, width / font->width); rows++; }
+ return rows;
+}
+bool ht_can_display(const char *text, const ht_font_t *font, int width, int lines)
+{
+ if (!font || !font->width || width < font->width || lines < 1)
+ return false;
+ const char *p = text ? text : "";
+ while (*p) {
+ uint32_t cp = ht_utf8_next(&p);
+ const ht_font_t *glyph = glyph_font(font, cp);
+ if (cp < glyph->first || cp > glyph->last) cp = punctuation_alias(cp);
+ if (cp != '\n' && cp != ' ' && (cp < glyph->first || cp > glyph->last || (cp >= 127 && cp < 160)))
+ return false;
+ }
+ p = text ? text : "";
+ int rows = 0;
+ while (*p) {
+ if (++rows > lines)
+ return false;
+ ht_take_line(&p, width / font->width);
+ }
+ return true;
+}
+int ht_wrap(ht_scene_t *s, int x, int y, int w, int lines, int skip, const ht_font_t *f,
+ uint16_t fg, const char *text)
+{
+ if (!f || !f->width || w < f->width || lines <= 0)
+ return 0;
+ const char *p = text ? text : "";
+ int row = 0, shown = 0, cols = w / f->width;
+ while (*p && shown < lines) {
+ const char *start = p;
+ const char *end = ht_take_line(&p, cols);
+ if (row++ < skip)
+ continue;
+ char line[HT_TEXT_BYTES];
+ size_t len = (size_t)(end - start);
+ if (len >= sizeof(line))
+ len = sizeof(line) - 1;
+ memcpy(line, start, len);
+ line[len] = 0;
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, line);
+ shown++;
+ }
+ // Keep the slots after a wrapped block stable when its line count changes.
+ // Otherwise one extra prompt line makes every following button look moved.
+ while (shown < lines) {
+ ht_text(s, x, y + shown * f->height, w, f, fg, s->background, "");
+ shown++;
+ }
+ return row;
+}
+ht_rect_t ht_run_bounds(const ht_run_t *r)
+{
+ if (r->arc) {
+ const char *p = r->text; int count = 0;
+ while (*p && count < HT_ARC_COLS) { ht_utf8_next(&p); count++; }
+ if (!count) return (ht_rect_t){0, 0, 0, 0};
+ int sn = arc_trig[count - 1][0], cs = arc_trig[count - 1][1];
+ // Tight, conservative ink bounds. The fixed cache remains 416x128, but
+ // a short name must not dirty that whole rectangle on every pane switch.
+ int half_w = ((13 * cs + 29 * sn) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sn) >> 15) + 2;
+ int left = 233 - (205 * sn >> 14) - half_w - 1;
+ int bottom = 233 - (205 * cs >> 14) + half_h + 1;
+ return (ht_rect_t){left, r->arc == 2 ? HT_HEIGHT - bottom : HT_ARC_Y,
+ 2 * (233 - left), bottom - HT_ARC_Y};
+ }
+ return (ht_rect_t){r->x, r->y, r->w, r->font->height};
+}
+static bool intersect(ht_rect_t a, ht_rect_t b)
+{
+ return a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
+}
+static ht_rect_t united(ht_rect_t a, ht_rect_t b)
+{
+ int x = imin(a.x, b.x), y = imin(a.y, b.y);
+ return (ht_rect_t){x, y, imax(a.x + a.w, b.x + b.w) - x, imax(a.y + a.h, b.y + b.h) - y};
+}
+static void damage_add(ht_damage_t *d, ht_rect_t r)
+{
+ int x = imax(0, r.x) & ~1, y = imax(0, r.y) & ~1, x2 = imin(HT_WIDTH, (r.x + r.w + 1) & ~1),
+ y2 = imin(HT_HEIGHT, (r.y + r.h + 1) & ~1);
+ r = (ht_rect_t){x, y, x2 - x, y2 - y};
+ if (r.w <= 0 || r.h <= 0)
+ return;
+ for (int i = 0; i < d->count; i++) {
+ ht_rect_t u = united(d->rect[i], r);
+ if (intersect(d->rect[i], r) || u.w * u.h <= d->rect[i].w * d->rect[i].h + r.w * r.h + 64) {
+ r = u;
+ d->rect[i] = d->rect[--d->count];
+ i = -1;
+ }
+ }
+ if (d->count == HT_DAMAGE_MAX) {
+ d->count = 1;
+ d->rect[0] = (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT};
+ return;
+ }
+ d->rect[d->count++] = r;
+}
+#ifdef DEVICE_LAYOUT_BENCH
+static bool damage_fast_ascii = true, raster_fast_ascii = true;
+void ht_raster_fast_ascii(bool enabled) { raster_fast_ascii = enabled; }
+void ht_damage_fast_ascii(bool enabled) { damage_fast_ascii = enabled; }
+#endif
+void ht_damage(const ht_scene_t *a, const ht_scene_t *b, ht_damage_t *d)
+{
+ memset(d, 0, sizeof(*d));
+ if (!a || a->background != b->background) {
+ damage_add(d, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT});
+ } else
+ for (int i = 0; i < imax(a->count, b->count); i++) {
+ if (i < a->count && i < b->count &&
+ memcmp(&a->runs[i], &b->runs[i], sizeof(ht_run_t)) == 0)
+ continue;
+ if (i < a->count && i < b->count) {
+ const ht_run_t *old = &a->runs[i], *next = &b->runs[i];
+ if (!old->arc && !next->arc && old->x == next->x && old->y == next->y && old->w == next->w &&
+ old->font == next->font && old->fg == next->fg && old->bg == next->bg) {
+ const char *p = old->text, *q = next->text;
+ int cell = 0, first = -1, last = -1;
+ bool ascii = old->font->first == 32 && old->font->last >= 126;
+#ifdef DEVICE_LAYOUT_BENCH
+ ascii = ascii && damage_fast_ascii;
+#endif
+ while (*p || *q) {
+ uint32_t pc = (uint8_t)*p, qc = (uint8_t)*q;
+ if (ascii && (pc | qc) < 128) {
+ // Artwork is one printable byte per cell. Avoid
+ // decoding and alias lookup for every tentacle cell.
+ // Missing trailing cells still render as spaces.
+ if (pc) p++; else pc = ' ';
+ if (qc) q++; else qc = ' ';
+ if (pc < 32 || pc > old->font->last) pc = '?';
+ if (qc < 32 || qc > old->font->last) qc = '?';
+ } else {
+ pc = *p ? ht_utf8_next(&p) : ' ';
+ qc = *q ? ht_utf8_next(&q) : ' ';
+ pc = font_codepoint(old->font, pc);
+ qc = font_codepoint(old->font, qc);
+ }
+ if (pc != qc) {
+ if (first < 0)
+ first = cell;
+ last = cell;
+ }
+ cell++;
+ }
+ if (first >= 0)
+ damage_add(d, (ht_rect_t){next->x + first * next->font->width, next->y,
+ (last - first + 1) * next->font->width,
+ next->font->height});
+ continue;
+ }
+ }
+ if (i < a->count)
+ damage_add(d, ht_run_bounds(&a->runs[i]));
+ if (i < b->count)
+ damage_add(d, ht_run_bounds(&b->runs[i]));
+ }
+ for (int i = 0; i < d->count; i++)
+ d->pixels += (uint32_t)d->rect[i].w * d->rect[i].h;
+}
+static void fill(uint16_t *p, size_t n, uint16_t c)
+{
+ for (size_t i = 0; i < n; i++)
+ p[i] = c;
+}
+static uint16_t blend(uint16_t fg, uint16_t bg, unsigned alpha)
+{
+ unsigned r = (((fg >> 11) * alpha + (bg >> 11) * (3 - alpha)) + 1) / 3;
+ unsigned g = ((((fg >> 5) & 63) * alpha + ((bg >> 5) & 63) * (3 - alpha)) + 1) / 3;
+ unsigned b = (((fg & 31) * alpha + (bg & 31) * (3 - alpha)) + 1) / 3;
+ return be16((r << 11) | (g << 5) | b);
+}
+
+// The small ASCII artwork uses only a handful of characters. Expand each used
+// glyph once for its font/palette, then copy clipped rows directly into DMA
+// strips. Fixed capacity, renderer-owned: no allocation and no per-frame churn.
+// Ordinary text and Unicode fonts retain the general renderer below.
+enum { GLYPH_SLOTS = 24, GLYPH_PIXELS = 50, ASCII_COUNT = 95 };
+typedef struct {
+ uint16_t pixels[GLYPH_SLOTS][GLYPH_PIXELS];
+ uint8_t index[ASCII_COUNT], code[GLYPH_SLOTS], next;
+ const ht_font_t *font;
+ uint16_t fg, bg;
+} glyph_cache_t;
+static glyph_cache_t glyph_cache;
+static bool glyph_cache_enabled = true;
+static uint32_t glyph_builds;
+void ht_glyph_cache_enable(bool enabled) { glyph_cache_enabled = enabled; }
+uint32_t ht_glyph_cache_builds(void) { return glyph_builds; }
+size_t ht_glyph_cache_bytes(void) { return sizeof glyph_cache; }
+
+static bool glyph_cache_prepare(const ht_font_t *f, uint16_t fg, uint16_t bg)
+{
+ if (!glyph_cache_enabled || f->first != 32 || f->last != 126 ||
+ !f->width || f->width > 5 || !f->height || f->height > 10) return false;
+ if (glyph_cache.font != f || glyph_cache.fg != fg || glyph_cache.bg != bg) {
+ memset(glyph_cache.index, 0, sizeof glyph_cache.index);
+ memset(glyph_cache.code, 0, sizeof glyph_cache.code);
+ glyph_cache.next = 0;
+ glyph_cache.font = f; glyph_cache.fg = fg; glyph_cache.bg = bg;
+ }
+ return true;
+}
+static const uint16_t *glyph_cached(uint32_t c, const uint8_t *glyph,
+ const uint16_t palette[4])
+{
+ unsigned code = c - 32;
+ if (glyph_cache.index[code]) return glyph_cache.pixels[glyph_cache.index[code] - 1];
+ unsigned slot = glyph_cache.next;
+ glyph_cache.next = (slot + 1) % GLYPH_SLOTS;
+ if (glyph_cache.code[slot]) glyph_cache.index[glyph_cache.code[slot] - 1] = 0;
+ glyph_cache.index[code] = slot + 1;
+ glyph_cache.code[slot] = code + 1;
+ unsigned pixels = glyph_cache.font->width * glyph_cache.font->height;
+ for (unsigned k = 0; k < pixels; k++)
+ glyph_cache.pixels[slot][k] = palette[(glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3];
+ glyph_builds++;
+ return glyph_cache.pixels[slot];
+}
+
+// The renderer owns two 13 KiB 2-bit masks plus bounded row-ink spans.
+// Upper/lower text have independent keys, so they never evict each other.
+// Scenes retain immutable text, allowing old scenes to rasterize correctly.
+typedef struct {
+ uint8_t mask[HT_ARC_WIDTH * HT_ARC_HEIGHT / 4];
+ uint16_t left[HT_ARC_HEIGHT], right[HT_ARC_HEIGHT];
+ char text[HT_TEXT_BYTES];
+ bool valid;
+} arc_cache_t;
+static arc_cache_t arc_caches[2];
+static uint32_t arc_builds;
+uint32_t ht_arc_cache_builds(void) { return arc_builds; }
+#ifdef DEVICE_LAYOUT_BENCH
+static bool arc_fast = true, arc_tight = true;
+void ht_arc_tight_bounds(bool enabled)
+{
+ arc_tight = enabled;
+ arc_caches[0].valid = arc_caches[1].valid = false;
+}
+void ht_arc_fast_sampling(bool enabled)
+{
+ arc_fast = enabled;
+ arc_caches[0].valid = arc_caches[1].valid = false;
+}
+static unsigned glyph_alpha_reference(const uint8_t *glyph, int x, int y)
+{
+ if (x < 0 || x >= 12 || y < 0 || y >= 28) return 0;
+ unsigned k = (unsigned)y * 12 + (unsigned)x;
+ return (glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3;
+}
+#endif
+
+static void glyph_coverage(const uint8_t *glyph, uint8_t padded[14 * 30])
+{
+ // One glyph plus a transparent one-pixel border. Bilinear sampling below
+ // then needs four byte loads instead of four checked packed-bit lookups.
+ // This 420-byte scratch lives only while a changed curved label is built.
+ memset(padded, 0, 14 * 30);
+ for (unsigned y = 0; y < 28; y++) for (unsigned x = 0; x < 12; x++) {
+ unsigned k = y * 12 + x;
+ padded[(y + 1) * 14 + x + 1] = (glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3;
+ }
+}
+static void arc_prepare(const ht_run_t *r, arc_cache_t *cache)
+{
+ if (cache->valid && !strcmp(cache->text, r->text)) return;
+ memset(cache->mask, 0, sizeof cache->mask);
+ for (int y = 0; y < HT_ARC_HEIGHT; y++) { cache->left[y] = HT_ARC_WIDTH; cache->right[y] = 0; }
+ strcpy(cache->text, r->text);
+ cache->valid = true; arc_builds++;
+ uint32_t cp[HT_ARC_COLS];
+ int count = 0;
+ const char *p = r->text;
+ while (*p && count < HT_ARC_COLS) cp[count++] = ht_utf8_next(&p);
+ uint8_t coverage[14 * 30];
+ for (int i = 0; i < count; i++) {
+ uint32_t c = font_codepoint(&ht_mono_20, cp[i]);
+ if (c == ' ') continue;
+ const ht_font_t *f = glyph_font(&ht_mono_20, c);
+ const uint8_t *glyph = f->pixels + (c - f->first) * 84;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (arc_fast)
+#endif
+ glyph_coverage(glyph, coverage);
+ int step = 2 * i - (count - 1), absolute = step < 0 ? -step : step;
+ int sn = arc_trig[absolute][0] * (step < 0 ? -1 : 1), cs = arc_trig[absolute][1];
+ int cx = (233 - HT_ARC_X) * 256 + (205 * sn * 256 >> 14);
+ int cy = (233 - r->y) * 256 + (r->arc == 2 ? 1 : -1) * (205 * cs * 256 >> 14);
+ if (r->arc == 2) sn = -sn; // lower arc reads left-to-right with upright letters
+ int sin_abs = sn < 0 ? -sn : sn;
+ int half_w = ((13 * cs + 29 * sin_abs) >> 15) + 2;
+ int half_h = ((29 * cs + 13 * sin_abs) >> 15) + 2;
+ int box_x = cx, box_y = cy;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (arc_tight)
+#endif
+ {
+ const uint8_t *ink = f == &ht_open_20 ? ht_open_20_ink[0] : ht_mono_20_ink[c - f->first];
+ // Source pixels outside this box are transparent. Include a full
+ // bilinear halo and two destination pixels for fixed-point rounding.
+ int ox = (ink[0] + ink[2]) * 128 - (6 * 256 - 128);
+ int oy = (ink[1] + ink[3]) * 128 - (14 * 256 - 128);
+ box_x += (ox * cs - oy * sn) >> 14;
+ box_y += (ox * sn + oy * cs) >> 14;
+ int w = ink[2] - ink[0] + 2, h = ink[3] - ink[1] + 2;
+ half_w = ((w * cs + h * sin_abs) >> 15) + 2;
+ half_h = ((h * cs + w * sin_abs) >> 15) + 2;
+ }
+ int x0 = imax(0, (box_x >> 8) - half_w), x1 = imin(HT_ARC_WIDTH, (box_x >> 8) + half_w + 1);
+ int y0 = imax(0, (box_y >> 8) - half_h), y1 = imin(HT_ARC_HEIGHT, (box_y >> 8) + half_h + 1);
+ for (int y = y0; y < y1; y++) for (int x = x0; x < x1; x++) {
+ int dx = x * 256 + 128 - cx, dy = y * 256 + 128 - cy;
+ int sx = ((dx * cs + dy * sn) >> 14) + 6 * 256 - 128;
+ int sy = ((-dx * sn + dy * cs) >> 14) + 14 * 256 - 128;
+ if (sx < -256 || sx >= 12 * 256 || sy < -256 || sy >= 28 * 256) continue;
+ int gx = sx >> 8, gy = sy >> 8;
+ unsigned fx = sx & 255, fy = sy & 255;
+ // Fixed-point bilinear coverage preserves the existing font's soft
+ // edges. This runs only on a title change, never per animation tick.
+ unsigned a;
+#ifdef DEVICE_LAYOUT_BENCH
+ if (!arc_fast) {
+ a = (glyph_alpha_reference(glyph,gx,gy)*(256-fx)*(256-fy) +
+ glyph_alpha_reference(glyph,gx+1,gy)*fx*(256-fy) +
+ glyph_alpha_reference(glyph,gx,gy+1)*(256-fx)*fy +
+ glyph_alpha_reference(glyph,gx+1,gy+1)*fx*fy + 32768) >> 16;
+ } else
+#endif
+ {
+ const uint8_t *alpha = coverage + (gy + 1) * 14 + gx + 1;
+ unsigned upper = alpha[0]*(256-fx) + alpha[1]*fx;
+ unsigned lower = alpha[14]*(256-fx) + alpha[15]*fx;
+ a = (upper*(256-fy) + lower*fy + 32768) >> 16;
+ }
+ unsigned k = (unsigned)y * HT_ARC_WIDTH + (unsigned)x, shift = (3 - (k & 3)) * 2;
+ unsigned old = (cache->mask[k >> 2] >> shift) & 3;
+ if (a > old) {
+ cache->mask[k >> 2] = (uint8_t)((cache->mask[k >> 2] & ~(3u << shift)) | (a << shift));
+ if (x < cache->left[y]) cache->left[y] = x;
+ if (x + 1 > cache->right[y]) cache->right[y] = x + 1;
+ }
+ }
+ }
+}
+static void arc_raster(const ht_run_t *r, ht_rect_t clip, uint16_t *out)
+{
+ arc_cache_t *cache = &arc_caches[r->arc == 2];
+ arc_prepare(r, cache);
+ uint16_t palette[4] = {0, blend(r->fg,r->bg,1), blend(r->fg,r->bg,2), be16(r->fg)};
+ int x0 = imax(clip.x,r->x), x1 = imin(clip.x+clip.w,r->x+r->w);
+ int y0 = imax(clip.y,r->y), y1 = imin(clip.y+clip.h,r->y+HT_ARC_HEIGHT);
+ for (int y = y0; y < y1; y++) {
+ int left = imax(x0, r->x + cache->left[y-r->y]);
+ int right = imin(x1, r->x + cache->right[y-r->y]);
+ if (left >= right) continue;
+ unsigned k = (unsigned)(y-r->y)*HT_ARC_WIDTH + (unsigned)(left-r->x);
+ uint16_t *dst = out + (y-clip.y)*clip.w + left-clip.x;
+ for (int x = left; x < right; x++, k++, dst++) {
+ unsigned a = (cache->mask[k >> 2] >> ((3-(k&3))*2)) & 3;
+ if (a) *dst = palette[a];
+ }
+ }
+}
+void ht_raster(const ht_scene_t *s, ht_rect_t clip, uint16_t *out)
+{
+ fill(out, (size_t)clip.w * clip.h, be16(s->background));
+ for (int i = 0; i < s->count; i++) {
+ const ht_run_t *r = &s->runs[i];
+ const ht_font_t *f = r->font;
+ ht_rect_t box = ht_run_bounds(r);
+ if (!intersect(box, clip))
+ continue;
+ if (r->arc) { arc_raster(r, clip, out); continue; }
+ int y1 = imax(clip.y, r->y), y2 = imin(clip.y + clip.h, r->y + f->height),
+ x1 = imax(clip.x, r->x), x2 = imin(clip.x + clip.w, r->x + r->w);
+ if (r->bg != s->background)
+ for (int y = y1; y < y2; y++)
+ fill(out + (y - clip.y) * clip.w + x1 - clip.x, (size_t)(x2 - x1), be16(r->bg));
+ uint16_t palette[4] = {be16(r->bg), blend(r->fg, r->bg, 1), blend(r->fg, r->bg, 2),
+ be16(r->fg)};
+ bool cached = glyph_cache_prepare(f, r->fg, r->bg);
+ bool ascii = f->first == 32 && f->last >= 126;
+#ifdef DEVICE_LAYOUT_BENCH
+ ascii = ascii && raster_fast_ascii;
+#endif
+ const char *p = r->text;
+ int gx = r->x;
+ while (*p && gx < x2) {
+ uint32_t c = (uint8_t)*p;
+ if (ascii && c < 128) {
+ p++;
+ if (c < 32 || c > f->last) c = '?';
+ } else {
+ c = ht_utf8_next(&p);
+ c = font_codepoint(f, c);
+ }
+ if (gx + f->width > x1 && c != ' ') {
+ const ht_font_t *face = glyph_font(f, c);
+ size_t stride = ((size_t)face->width * face->height + 3) / 4;
+ const uint8_t *glyph = face->pixels + (c - face->first) * stride;
+ int xa = imax(x1, gx), xb = imin(x2, gx + f->width);
+ const uint16_t *colored = cached ? glyph_cached(c, glyph, palette) : NULL;
+ for (int y = y1; y < y2; y++) {
+ uint16_t *dst = out + (y - clip.y) * clip.w + xa - clip.x;
+ size_t k = (size_t)(y - r->y) * f->width + xa - gx;
+ if (colored) {
+ // At most five pixels. A general memcpy call costs more
+ // than these aligned 16-bit loads/stores on the ESP32.
+ const uint16_t *src = colored + k;
+ switch (xb - xa) {
+ case 5: dst[4] = src[4]; /* fall through */
+ case 4: dst[3] = src[3]; /* fall through */
+ case 3: dst[2] = src[2]; /* fall through */
+ case 2: dst[1] = src[1]; /* fall through */
+ case 1: dst[0] = src[0];
+ }
+ continue;
+ }
+ for (int x = xa; x < xb; x++, k++)
+ *dst++ = palette[(glyph[k >> 2] >> ((3 - (k & 3)) * 2)) & 3];
+ }
+ }
+ gx += f->width;
+ }
+ }
+}
diff --git a/devices/harness-device/firmware/test/reference79/terminal_ref.c b/devices/harness-device/firmware/test/reference79/terminal_ref.c
new file mode 100644
index 000000000..f52781322
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference79/terminal_ref.c
@@ -0,0 +1,2 @@
+#include "renames.h"
+#include "terminal.c.inc"
diff --git a/devices/harness-device/firmware/test/reference91/README.md b/devices/harness-device/firmware/test/reference91/README.md
new file mode 100644
index 000000000..09cfce2b7
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference91/README.md
@@ -0,0 +1,5 @@
+# Original cable transport reference
+
+Exact firmware `cable_frame.c` used by habitat.91 before the overnight CRC and
+buffer-copy experiment. Its hash is recorded alongside it. This is test and
+diagnostic code only; normal images do not link it.
diff --git a/devices/harness-device/firmware/test/reference91/cable_frame.c.inc b/devices/harness-device/firmware/test/reference91/cable_frame.c.inc
new file mode 100644
index 000000000..044b4d7b1
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference91/cable_frame.c.inc
@@ -0,0 +1,164 @@
+#include "cable_frame.h"
+
+#include <string.h>
+
+uint16_t cable_crc16(const uint8_t *data, size_t len)
+{
+ uint16_t crc = 0xFFFF;
+ for (size_t i = 0; i < len; i++) {
+ crc ^= (uint16_t)data[i] << 8;
+ for (int bit = 0; bit < 8; bit++) {
+ crc = (crc & 0x8000) ? (uint16_t)((crc << 1) ^ 0x1021) : (uint16_t)(crc << 1);
+ }
+ }
+ return crc;
+}
+
+int cable_frame_encode(uint8_t type, const uint8_t *payload, size_t payload_len,
+ uint8_t *out, size_t out_cap)
+{
+ if (payload_len > CABLE_MAX_PAYLOAD) return -1;
+ const size_t total = CABLE_HEADER_BYTES + payload_len + CABLE_CRC_BYTES;
+ if (out_cap < total) return -1;
+
+ out[0] = CABLE_MAGIC_0;
+ out[1] = CABLE_MAGIC_1;
+ out[2] = CABLE_FRAME_VERSION;
+ out[3] = type;
+ out[4] = (uint8_t)(payload_len & 0xFF);
+ out[5] = (uint8_t)((payload_len >> 8) & 0xFF);
+ if (payload_len > 0) memcpy(out + CABLE_HEADER_BYTES, payload, payload_len);
+
+ // Covers ver..payload. The magic is a marker, not data — including a constant would add nothing to
+ // detect.
+ const uint16_t crc = cable_crc16(out + 2, CABLE_HEADER_BYTES - 2 + payload_len);
+ out[total - 2] = (uint8_t)(crc & 0xFF);
+ out[total - 1] = (uint8_t)((crc >> 8) & 0xFF);
+ return (int)total;
+}
+
+void cable_decoder_init(cable_decoder_t *d)
+{
+ d->len = 0;
+ d->corrupt_frames = 0;
+ d->discarded_bytes = 0;
+}
+
+void cable_decoder_reset(cable_decoder_t *d)
+{
+ // Only the partial frame goes. The counters deliberately survive: they exist to show a TREND — a few
+ // discarded bytes at every boot is the bootloader and is expected, a steady trickle means the two
+ // sides disagree about the format or the cable is bad. Zeroing them on every reconnect would erase
+ // exactly the history that tells those apart, on precisely the link worth measuring.
+ d->len = 0;
+}
+
+// Take `count` bytes off the front, keeping the rest. Says nothing about why.
+static void consume(cable_decoder_t *d, size_t count)
+{
+ if (count == 0) return;
+ if (count >= d->len) {
+ d->len = 0;
+ return;
+ }
+ memmove(d->buf, d->buf + count, d->len - count);
+ d->len -= count;
+}
+
+// Consume bytes that turned out not to be a frame, and say so.
+//
+// Split from consume() rather than counting inside it: the bytes of a frame that decoded fine are also
+// consumed, and counting those as discarded would make the health number read as "this link is full of
+// noise" on a link that is working perfectly.
+static void discard(cable_decoder_t *d, size_t count)
+{
+ const size_t dropped = count < d->len ? count : d->len;
+ consume(d, count);
+ d->discarded_bytes += (uint32_t)dropped;
+}
+
+// Offset of the next complete magic, or -1.
+//
+// Stops one short of the end on purpose: a final lone byte cannot be judged yet, and the caller keeps it
+// in case the next read completes the pair.
+static int index_of_magic(const cable_decoder_t *d)
+{
+ for (size_t i = 0; i + 1 < d->len; i++) {
+ if (d->buf[i] == CABLE_MAGIC_0 && d->buf[i + 1] == CABLE_MAGIC_1) return (int)i;
+ }
+ return -1;
+}
+
+// Try to take one frame off the front.
+//
+// Returns true when a frame was emitted (so the caller should try again), false when more bytes are
+// needed. Noise is consumed internally rather than reported, so the caller never has to tell "wait" from
+// "that was rubbish".
+static bool take_front(cable_decoder_t *d, cable_frame_cb cb, void *ctx)
+{
+ for (;;) {
+ const bool head_is_magic =
+ d->len >= 2 && d->buf[0] == CABLE_MAGIC_0 && d->buf[1] == CABLE_MAGIC_1;
+
+ if (!head_is_magic) {
+ const int at = index_of_magic(d);
+ if (at < 0) {
+ // Keep a trailing A5: the 5A may simply not have arrived yet.
+ const size_t keep = (d->len > 0 && d->buf[d->len - 1] == CABLE_MAGIC_0) ? 1 : 0;
+ discard(d, d->len - keep);
+ return false;
+ }
+ discard(d, (size_t)at);
+ continue;
+ }
+
+ if (d->len < CABLE_HEADER_BYTES) return false;
+
+ const size_t payload_len = (size_t)d->buf[4] | ((size_t)d->buf[5] << 8);
+
+ // A length this large cannot be real, so those two bytes were noise rather than a header. Step
+ // over one byte and keep hunting; waiting for 64 KB that is never coming would stall the link.
+ if (payload_len > CABLE_MAX_PAYLOAD) {
+ discard(d, 1);
+ continue;
+ }
+
+ const size_t total = CABLE_HEADER_BYTES + payload_len + CABLE_CRC_BYTES;
+ if (d->len < total) return false;
+
+ const uint16_t expected = (uint16_t)d->buf[total - 2] | ((uint16_t)d->buf[total - 1] << 8);
+ const uint16_t actual = cable_crc16(d->buf + 2, CABLE_HEADER_BYTES - 2 + payload_len);
+
+ if (actual != expected) {
+ // Drop ONE byte, not the whole frame: the magic may have been a coincidence inside noise, and
+ // a genuine frame can begin one byte further in. Dropping the lot would swallow it.
+ d->corrupt_frames++;
+ discard(d, 1);
+ continue;
+ }
+
+ if (cb) cb(d->buf[2], d->buf[3], d->buf + CABLE_HEADER_BYTES, payload_len, ctx);
+ consume(d, total);
+ return true;
+ }
+}
+
+void cable_decoder_feed(cable_decoder_t *d, const uint8_t *data, size_t n,
+ cable_frame_cb cb, void *ctx)
+{
+ for (size_t i = 0; i < n; i++) {
+ // Full and still no frame means the head was never a real one. Making room by dropping the oldest
+ // byte keeps the link alive; refusing the new byte instead would wedge it permanently.
+ if (d->len == sizeof(d->buf)) discard(d, 1);
+
+ d->buf[d->len++] = data[i];
+
+ // Only worth attempting once a header could be complete. This also keeps the magic scan
+ // amortised: it runs on resync, not per byte.
+ if (d->len >= CABLE_HEADER_BYTES) {
+ while (take_front(d, cb, ctx)) {
+ // keep going: one read can complete several frames
+ }
+ }
+ }
+}
diff --git a/devices/harness-device/firmware/test/reference91/cable_frame_ref.c b/devices/harness-device/firmware/test/reference91/cable_frame_ref.c
new file mode 100644
index 000000000..40c3001af
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference91/cable_frame_ref.c
@@ -0,0 +1,6 @@
+#define cable_crc16 reference_crc16
+#define cable_frame_encode reference_frame_encode
+#define cable_decoder_init reference_decoder_init
+#define cable_decoder_reset reference_decoder_reset
+#define cable_decoder_feed reference_decoder_feed
+#include "cable_frame.c.inc"
diff --git a/devices/harness-device/firmware/test/reference91/source-hashes.json b/devices/harness-device/firmware/test/reference91/source-hashes.json
new file mode 100644
index 000000000..f0d198455
--- /dev/null
+++ b/devices/harness-device/firmware/test/reference91/source-hashes.json
@@ -0,0 +1,3 @@
+{
+ "cable_frame.c.inc": "f0ecdaf7d6711a645f50d5476509ad8e7463aa835508920c074942e0702ed17c"
+}
diff --git a/devices/harness-device/firmware/test/run.sh b/devices/harness-device/firmware/test/run.sh
old mode 100755
new mode 100644
index ef44fa96b..9b11b9e81
--- a/devices/harness-device/firmware/test/run.sh
+++ b/devices/harness-device/firmware/test/run.sh
@@ -19,6 +19,11 @@ python3 "$here/../scripts/gen_cable_vectors.py" --check
cc -std=c11 -Wall -Wextra -Werror -O1 \
-o "$out/test_cable_frame" "$here/test_cable_frame.c" "$here/../main/cable_frame.c"
"$out/test_cable_frame" "$here/vectors/cable_frame.txt"
+python3 "$here/test_cable_transport.py"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_cable_json_guard" "$here/test_cable_json_guard.c" "$here/../main/cable_json_guard.c"
+"$out/test_cable_json_guard"
cc -std=c11 -Wall -Wextra -Werror -O1 \
-o "$out/test_cable_machines" "$here/test_cable_machines.c" "$here/../main/cable_machines.c"
@@ -36,3 +41,167 @@ cc -std=c11 -Wall -Wextra -Werror -O1 \
cc -std=c11 -Wall -Wextra -Werror -O1 \
-o "$out/test_board" "$here/test_board.c" "$here/../main/board/board_table.c"
"$out/test_board"
+python3 "$here/test_board_i2c.py"
+
+# New direct compositor: fuzz partial redraws against a fresh frame under UB/bounds sanitizers.
+# SANITIZERS=address,undefined also enables ASan on hosts with a compatible ASan runtime.
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_terminal" "$here/test_terminal.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_terminal"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_arc_pixels" "$here/test_arc_pixels.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_arc_pixels"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -I "$here/../main/ui/habitat" -o "$out/test_arc_storage" "$here/test_arc_storage.c" \
+ "$here/reference79/terminal_ref.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_arc_storage"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" -DDEVICE_LAYOUT_BENCH=1 \
+ -o "$out/test_arc_bounds" "$here/test_arc_bounds.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_arc_bounds"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_voice_buffer" "$here/test_voice_buffer.c" "$here/../main/voice_buffer.c"
+"$out/test_voice_buffer"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" -pthread \
+ -o "$out/test_voice_buffer_threads" "$here/test_voice_buffer_threads.c" "$here/../main/voice_buffer.c"
+"$out/test_voice_buffer_threads"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_scroll" "$here/test_scroll.c" "$here/../main/ui/habitat/scroll.c" -lm
+"$out/test_scroll"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_gestures" "$here/test_gestures.c" "$here/../main/ui/habitat/gestures.c"
+"$out/test_gestures"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_workspace" "$here/test_workspace.c" "$here/../main/ui/habitat/workspace.c"
+"$out/test_workspace"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_tim" "$here/test_tim.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_tim"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_octopus" "$here/test_octopus.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_octopus"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -I "$here/../main/ui/habitat" -I "$here" -o "$out/test_renderer_reference" \
+ "$here/test_renderer_reference.c" "$here/reference48/terminal_ref.c" "$here/reference48/octopus_ref.c" \
+ "$here/../main/ui/habitat/octopus.c" "$here/../main/ui/habitat/ascii_clip.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_renderer_reference"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" -DDEVICE_LAYOUT_BENCH=1 \
+ -o "$out/test_ascii_scene" "$here/test_ascii_scene.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_ascii_scene"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_glyph_cache" "$here/test_glyph_cache.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_glyph_cache"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -DDEVICE_LAYOUT_BENCH=1 -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_raster_ascii" "$here/test_raster_ascii.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_raster_ascii"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -DDEVICE_LAYOUT_BENCH=1 -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_damage_delta" "$here/test_damage_delta.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_damage_delta"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -DDEVICE_LAYOUT_BENCH=1 -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_damage_bands" "$here/test_damage_bands.c" "$here/../main/ui/habitat/octopus.c" \
+ "$here/../main/ui/habitat/octopus_font.c" "$here/../main/ui/habitat/ascii_clip.c" "$here/../main/ui/habitat/tim.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_damage_bands"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -DDEVICE_LAYOUT_BENCH=1 -o "$out/test_ascii_clip" "$here/test_ascii_clip.c" "$here/../main/ui/habitat/ascii_clip.c"
+"$out/test_ascii_clip"
+python3 "$here/test_octopus_art.py"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_creature_gallery" "$here/test_creature_gallery.c" \
+ "$here/../main/ui/habitat/creature_gallery.c" "$here/../main/ui/habitat/creature_font.c" \
+ "$here/../main/ui/habitat/terminal.c" "$here/../main/ui/habitat/fonts.c"
+"$out/test_creature_gallery"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_selection" "$here/test_selection.c" "$here/../main/ui/habitat/selection.c"
+"$out/test_selection"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_carry" "$here/test_carry.c" "$here/../main/ui/habitat/carry.c"
+"$out/test_carry"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_visit" "$here/test_visit.c" "$here/../main/ui/habitat/visit.c"
+"$out/test_visit"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_form" "$here/test_form.c" "$here/../main/ui/habitat/form.c"
+"$out/test_form"
+
+cc -std=c11 -Wall -Wextra -Werror -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -o "$out/test_draft" "$here/test_draft.c" "$here/../main/ui/habitat/draft.c"
+"$out/test_draft"
+
+python3 "$here/test_search_ui.py"
+python3 "$here/test_draft_ui.py"
+python3 "$here/test_question_ui.py"
+python3 "$here/test_voice_ui.py"
+python3 "$here/test_touch_ui.py"
+python3 "$here/test_brightness_ui.py"
+python3 "$here/test_touch_driver.py"
+python3 "$here/test_render_guard.py"
+python3 "$here/test_display_power.py"
+python3 "$here/test_machine_ui.py"
+python3 "$here/test_reload_threads.py"
+python3 "$here/test_agent_snapshot.py"
+python3 "$here/test_cable_session.py"
+python3 "$here/test_cable_idle.py"
+python3 "$here/test_fw_update.py"
+python3 "$here/test_cable_logging.py"
+python3 "$here/test_audio_notify.py"
+python3 "$here/test_audio_init.py"
+python3 "$here/test_audio_stream.py"
+python3 "$here/test_audio_threads.py"
+
+# These exercise the exact cJSON version linked into the board, when its SDK is
+# available. The rest of the suite remains independent of ESP-IDF.
+if [[ -n "${IDF_PATH:-}" ]]; then
+ python3 "$here/test_cable_crc.py"
+ cc -std=c11 -Wall -Wextra -Werror -Wno-deprecated-declarations -O1 -g -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -I "$here/../main" -I "$IDF_PATH/components/json/cJSON" \
+ -o "$out/test_cable_features" "$here/test_cable_features.c" \
+ "$here/../main/cable_features.c" "$IDF_PATH/components/json/cJSON/cJSON.c"
+ "$out/test_cable_features"
+ cc -std=c11 -Wall -Wextra -Werror -Wno-deprecated-declarations -O1 -g -pthread -fsanitize="${SANITIZERS:-undefined,bounds}" \
+ -I "$here/../main" -I "$IDF_PATH/components/json/cJSON" \
+ -o "$out/test_cable_scroll" "$here/test_cable_scroll.c" \
+ "$here/../main/cable_scroll.c" "$IDF_PATH/components/json/cJSON/cJSON.c"
+ "$out/test_cable_scroll"
+ python3 "$here/test_cable_json_parse.py"
+ python3 "$here/test_cable_identity.py"
+ python3 "$here/test_cable_models.py"
+ python3 "$here/test_cable_outbound.py"
+fi
diff --git a/devices/harness-device/firmware/test/test_agent_snapshot.py b/devices/harness-device/firmware/test/test_agent_snapshot.py
new file mode 100644
index 000000000..3126d4ea4
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_agent_snapshot.py
@@ -0,0 +1,77 @@
+"""Exercise the production streamed roster reader; incomplete streams must not reach the UI."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import defines, typedef
+
+main = Path(__file__).resolve().parent / '../main'
+source = (main / 'cable_client.c').read_text()
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#define ESP_LOGI(...) ((void)0)
+#define portMAX_DELAY 0
+'''
+code += defines('ID_MAX','CABLE_NAME_MAX') + typedef('cable_agent_t',source) + typedef('project_t') + typedef('cable_agent_snapshot_t')
+code += r'''
+typedef struct { int valueint; const char *tab; bool number; } cJSON;
+static cable_agent_t rows[4], *s_agents=rows;
+static int s_agents_lock=1, held, reloads, s_agent_count, s_agents_total;
+static bool s_agents_building,s_has_window;
+static char s_agents_tab[ID_MAX];
+static uint32_t s_agents_generation;
+static void xSemaphoreTake(int lock,int wait) { (void)wait; assert(lock && !held); held++; }
+static void xSemaphoreGive(int lock) { assert(lock && held==1); held--; }
+static const cJSON *cJSON_GetObjectItemCaseSensitive(const cJSON *p,const char *key) { assert(!strcmp(key,"total")); return p; }
+static bool cJSON_IsNumber(const cJSON *p) { return p && p->number; }
+static const char *str_of(const cJSON *p,const char *key) { assert(!strcmp(key,"tab")); return p->tab; }
+static void ui_request_agent_reload(void) { assert(!held); reloads++; }
+'''
+for name in ['cable_client_agent_generation', 'cable_client_list_agents_snapshot', 'handle_agents_begin', 'handle_agents_end']:
+ code += function(name)
+code += r'''
+int main(void) {
+ project_t out[4]={0}; cable_agent_snapshot_t snapshot={0};
+ handle_agents_begin(); strcpy(rows[0].id,"old-pane"); strcpy(rows[0].name,"Old"); s_agent_count=1;
+ cJSON first={.valueint=70,.tab="old-tab",.number=true}; handle_agents_end(&first);
+ assert(reloads==1 && !held && cable_client_agent_generation()==1);
+ assert(cable_client_list_agents_snapshot(out,4,&snapshot)==1);
+ assert(!strcmp(out[0].id,"old-pane") && !strcmp(snapshot.tab,"old-tab"));
+ assert(snapshot.generation==1 && snapshot.total==70 && snapshot.window);
+ handle_agents_begin(); strcpy(rows[0].id,"new-pane"); strcpy(rows[0].name,"New"); s_agent_count=1;
+ assert(cable_client_list_agents_snapshot(out,4,&snapshot)==-1 && !held);
+ assert(!strcmp(out[0].id,"old-pane")); // No half-built rows overwrite the display's copy.
+ assert(!snapshot.generation && !snapshot.tab[0]);
+ cJSON next={.valueint=71,.tab="new-tab",.number=true}; handle_agents_end(&next);
+ assert(cable_client_list_agents_snapshot(out,4,&snapshot)==1);
+ assert(!strcmp(out[0].id,"new-pane") && !strcmp(snapshot.tab,"new-tab"));
+ assert(snapshot.generation==2 && snapshot.total==71);
+ handle_agents_begin(); next.tab="empty-tab"; handle_agents_end(&next);
+ assert(cable_client_list_agents_snapshot(out,4,&snapshot)==0);
+ assert(!strcmp(snapshot.tab,"empty-tab") && snapshot.window && snapshot.generation==3);
+ handle_agents_begin(); next.tab=""; handle_agents_end(&next);
+ assert(cable_client_list_agents_snapshot(out,4,&snapshot)==0);
+ assert(!snapshot.window && !snapshot.tab[0] && snapshot.generation==4);
+ s_agents_generation=UINT32_MAX; handle_agents_begin(); handle_agents_end(&next);
+ assert(cable_client_agent_generation()==0 && !held);
+ puts("agent snapshot: production reader rejects partial streams; exact roster/tab/count/generation, empty tabs and wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-agent-snapshot-') as path:
+ out = Path(path)
+ (out / 'snapshot.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ str(out / 'snapshot.c'), '-o', str(out / 'snapshot')], check=True)
+ subprocess.run([str(out / 'snapshot')], check=True)
diff --git a/devices/harness-device/firmware/test/test_arc_bounds.c b/devices/harness-device/firmware/test/test_arc_bounds.c
new file mode 100644
index 000000000..7bd63dec7
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_arc_bounds.c
@@ -0,0 +1,53 @@
+// Every supported curved glyph at every rotation, plus arbitrary mixed labels.
+#include "../main/ui/habitat/terminal.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t original[HT_ARC_WIDTH * HT_ARC_HEIGHT + 1];
+static uint16_t tight[HT_ARC_WIDTH * HT_ARC_HEIGHT + 1];
+static uint32_t seed = 0x517ca;
+static unsigned next(void) { seed = seed * 1664525u + 1013904223u; return seed; }
+static size_t encode(char *p, unsigned cp)
+{
+ if (cp < 128) { p[0]=(char)cp; return 1; }
+ if (cp < 2048) { p[0]=(char)(0xc0|(cp>>6));p[1]=(char)(0x80|(cp&63));return 2; }
+ p[0]=(char)(0xe0|(cp>>12));p[1]=(char)(0x80|((cp>>6)&63));p[2]=(char)(0x80|(cp&63));return 3;
+}
+static void compare(const char *text, int edge)
+{
+ ht_scene_t scene;
+ ht_scene_clear(&scene,ht_rgb(next()&0xffffff));
+ if(edge) ht_arc_status(&scene,ht_rgb(next()&0xffffff),text);
+ else ht_arc_title(&scene,ht_rgb(next()&0xffffff),text);
+ ht_rect_t rect={HT_ARC_X,edge ? HT_HEIGHT-HT_ARC_Y-HT_ARC_HEIGHT : HT_ARC_Y,
+ HT_ARC_WIDTH,HT_ARC_HEIGHT};
+ const size_t pixels=(size_t)rect.w*rect.h;
+ original[pixels]=tight[pixels]=0x7ced;
+ ht_arc_tight_bounds(false);ht_raster(&scene,rect,original);
+ ht_arc_tight_bounds(true);ht_raster(&scene,rect,tight);
+ assert(original[pixels]==0x7ced&&tight[pixels]==0x7ced);
+ assert(!memcmp(original,tight,pixels*sizeof *tight));
+}
+int main(void)
+{
+ // The 31- and 32-cell labels cover all 32 rotation-table entries in both
+ // directions. Every Latin-1 glyph and the authored arrow occupies each one.
+ for(unsigned glyph=32;glyph<=256;glyph++) {
+ unsigned cp=glyph==256 ? 0x2197 : glyph;
+ for(int length=31;length<=32;length++) for(int edge=0;edge<2;edge++) {
+ char text[HT_TEXT_BYTES];size_t n=0;
+ for(int i=0;i<length;i++)n+=encode(text+n,cp);
+ text[n]=0;compare(text,edge);
+ }
+ }
+ for(int trial=0;trial<2000;trial++) {
+ char text[HT_TEXT_BYTES];size_t n=0;unsigned length=1+next()%HT_ARC_COLS;
+ for(unsigned i=0;i<length;i++) {
+ unsigned cp=32+next()%226;
+ n+=encode(text+n,cp==256 ? 0x2197 : cp==257 ? 0x2014 : cp);
+ }
+ text[n]=0;compare(text,trial&1);
+ }
+ puts("arc bounds: 225 glyphs at every upper/lower rotation + 2000 mixed labels match original pixels PASS");
+}
diff --git a/devices/harness-device/firmware/test/test_arc_pixels.c b/devices/harness-device/firmware/test/test_arc_pixels.c
new file mode 100644
index 000000000..1622dbe86
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_arc_pixels.c
@@ -0,0 +1,37 @@
+// Golden pixels from the original fixed-point curved renderer. Optimizations
+// must preserve every coverage/color value at all 32 supported text lengths.
+#include "../main/ui/habitat/terminal.h"
+#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+#ifndef HT_UPDATE_ARC_GOLDEN
+static const uint64_t expected[] = {
+#include "arc_pixels.inc"
+};
+#endif
+static uint16_t pixels[HT_WIDTH * HT_HEIGHT];
+int main(void)
+{
+ for (int edge=0;edge<2;edge++) for (int length=1;length<=HT_ARC_COLS;length++) {
+ char text[HT_ARC_COLS+1];
+ for (int i=0;i<length;i++) text[i]=32+(i*17+length*7)%95;
+ text[length]=0;
+ ht_scene_t scene; ht_scene_clear(&scene,ht_rgb(0x183c25));
+ if(edge) ht_arc_status(&scene,ht_rgb(0xc8a9f0),text);
+ else ht_arc_title(&scene,ht_rgb(0xc8a9f0),text);
+ ht_raster(&scene,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},pixels);
+ uint64_t hash=UINT64_C(14695981039346656037);
+ for (unsigned i=0;i<sizeof pixels/sizeof pixels[0];i++) {
+ hash^=pixels[i]; hash*=UINT64_C(1099511628211);
+ }
+#ifdef HT_UPDATE_ARC_GOLDEN
+ printf("UINT64_C(0x%016" PRIx64 "),\n",hash);
+#else
+ assert(hash==expected[edge*HT_ARC_COLS+length-1]);
+#endif
+ }
+#ifndef HT_UPDATE_ARC_GOLDEN
+ puts("arc pixels: all 64 original upper/lower angle/color hashes preserved");
+#endif
+}
diff --git a/devices/harness-device/firmware/test/test_arc_storage.c b/devices/harness-device/firmware/test/test_arc_storage.c
new file mode 100644
index 000000000..db2b1dc75
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_arc_storage.c
@@ -0,0 +1,75 @@
+// Exercise the actual packed cache, its hard capacity bound, and exact pixels
+// against the independently archived dense-cache renderer from habitat.79.
+#include "../main/ui/habitat/terminal.c"
+#include "reference79/reference.h"
+#include <assert.h>
+#include <stdio.h>
+
+static uint16_t dense[HT_ARC_WIDTH * HT_ARC_HEIGHT + 2];
+static uint16_t packed[HT_ARC_WIDTH * HT_ARC_HEIGHT + 2];
+static uint32_t seed = 0x80cace;
+static unsigned next(void) { seed = seed * 1664525u + 1013904223u; return seed; }
+static size_t encode(char *p, unsigned cp)
+{
+ if (cp < 128) { p[0]=(char)cp; return 1; }
+ if (cp < 2048) { p[0]=(char)(0xc0|(cp>>6));p[1]=(char)(0x80|(cp&63));return 2; }
+ p[0]=(char)(0xe0|(cp>>12));p[1]=(char)(0x80|((cp>>6)&63));p[2]=(char)(0x80|(cp&63));return 3;
+}
+static void compare(const char *text, int edge, bool partial)
+{
+ ht_scene_t scene;
+ ht_scene_clear(&scene,ht_rgb(next()&0xffffff));
+ ht_text(&scene,25,edge ? 345 : 20,416,&ht_mono_20,ht_rgb(0xabcdef),scene.background,
+ "Underlying text stays under gaps");
+ if(edge) ht_arc_status(&scene,ht_rgb(next()&0xffffff),text);
+ else ht_arc_title(&scene,ht_rgb(next()&0xffffff),text);
+ ht_rect_t rect={HT_ARC_X,edge ? HT_HEIGHT-HT_ARC_Y-HT_ARC_HEIGHT : HT_ARC_Y,
+ HT_ARC_WIDTH,HT_ARC_HEIGHT};
+ if(partial) {
+ int dx=next()%300,dy=next()%96;
+ rect.x+=dx;rect.y+=dy;rect.w=1+next()%(HT_ARC_WIDTH-dx);rect.h=1+next()%(HT_ARC_HEIGHT-dy);
+ }
+ const size_t pixels=(size_t)rect.w*rect.h;
+ dense[0]=packed[0]=0x61ac;dense[pixels+1]=packed[pixels+1]=0x8ace;
+ ht79_raster(&scene,rect,dense+1);ht_raster(&scene,rect,packed+1);
+ assert(dense[0]==0x61ac&&packed[0]==0x61ac);
+ assert(dense[pixels+1]==0x8ace&&packed[pixels+1]==0x8ace);
+ assert(!memcmp(dense+1,packed+1,pixels*sizeof *packed));
+}
+int main(void)
+{
+ unsigned peak=0;
+ for(int count=1;count<=HT_ARC_COLS;count++) for(int edge=0;edge<2;edge++) {
+ arc_cache_t cache={0};
+ ht_run_t run={.arc=edge+1,.y=edge ? HT_HEIGHT-HT_ARC_Y-HT_ARC_HEIGHT : HT_ARC_Y};
+ assert(arc_pack_geometry(&run,&cache,count));
+ if(cache.mask_bytes>peak) peak=cache.mask_bytes;
+ for(int y=0;y<HT_ARC_HEIGHT;y++) for(int h=0;h<2;h++) {
+ arc_span_t span=cache.spans[y][h];
+ assert(span.first<=ARC_HALF&&span.last<=ARC_HALF);
+ if(span.first<span.last) assert(span.offset+(span.last-span.first+3)/4<=cache.mask_bytes);
+ }
+ char text[HT_ARC_COLS+1];memset(text,'W',count);text[count]=0;
+ compare(text,edge,false);
+ memset(text,' ',count);compare(text,edge,false);
+ }
+ assert(peak==3968);
+ assert(sizeof arc_caches==11528);
+ for(unsigned glyph=32;glyph<=256;glyph++) {
+ unsigned cp=glyph==256 ? 0x2197 : glyph;
+ for(int length=31;length<=32;length++) for(int edge=0;edge<2;edge++) {
+ char text[HT_TEXT_BYTES];size_t n=0;
+ for(int i=0;i<length;i++) n+=encode(text+n,cp);
+ text[n]=0;compare(text,edge,false);
+ }
+ }
+ for(int trial=0;trial<4000;trial++) {
+ char text[HT_TEXT_BYTES];size_t n=0;unsigned length=1+next()%HT_ARC_COLS;
+ for(unsigned i=0;i<length;i++) {
+ unsigned cp=32+next()%226;
+ n+=encode(text+n,cp==256 ? 0x2197 : cp==257 ? 0x2014 : cp);
+ }
+ text[n]=0;compare(text,trial&1,trial%3!=0);
+ }
+ printf("Packed arcs: all 64 geometries <=%u/4096B; 225 glyphs at every angle, 4000 mixed/clipped labels match dense pixels; caches=%zuB PASS\n",peak,sizeof arc_caches);
+}
diff --git a/devices/harness-device/firmware/test/test_ascii_clip.c b/devices/harness-device/firmware/test/test_ascii_clip.c
new file mode 100644
index 000000000..dda4a48b6
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_ascii_clip.c
@@ -0,0 +1,108 @@
+#define _DEFAULT_SOURCE 1
+#include "../main/ui/habitat/ascii_clip.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+static uint32_t seed = 0x61547230;
+static unsigned next(void) { seed ^= seed << 13; seed ^= seed >> 17; seed ^= seed << 5; return seed; }
+// The byte immediately after every test buffer is an inaccessible page.
+// These checks remain useful when a host cannot initialize AddressSanitizer.
+static void *guarded(size_t size)
+{
+ size_t page = (size_t)sysconf(_SC_PAGESIZE);
+ assert(size && size <= page);
+ char *p = mmap(NULL, page * 2, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+ assert(p != MAP_FAILED && !mprotect(p + page, page, PROT_NONE));
+ return p + page - size;
+}
+static void release(void *buffer)
+{
+ size_t page = (size_t)sysconf(_SC_PAGESIZE);
+ void *base = (void *)((uintptr_t)buffer & ~(uintptr_t)(page - 1));
+ assert(!munmap(base, page * 2));
+}
+static bool reference(const ht_ascii_clip_t *c, unsigned frame, unsigned row, char *out, size_t cap)
+{
+ if (cap) out[0] = 0;
+ if (!cap || !c->cols || cap <= c->cols || !c->symbols || c->symbols > 16 ||
+ frame >= c->frames || row >= c->rows) return false;
+ unsigned key = c->frame_rows[frame * c->rows + row];
+ if (key >= c->unique_rows) return false;
+ unsigned a = c->row_offsets[key], b = c->row_offsets[key + 1];
+ if (a > b || b > c->data_bytes) return false;
+ unsigned n = 0;
+ for (unsigned i = a; i < b; i++) {
+ unsigned symbol = c->data[i] % 16;
+ if (symbol >= c->symbols || (unsigned char)c->alphabet[symbol] < 32 ||
+ (unsigned char)c->alphabet[symbol] > 126) return false;
+ n += c->data[i] / 16 + 1;
+ }
+ if (n != c->cols) return false;
+ n = 0;
+ for (unsigned i = a; i < b; i++) for (unsigned j = 0; j <= c->data[i] / 16; j++)
+ out[n++] = c->alphabet[c->data[i] % 16];
+ out[n] = 0;
+ return true;
+}
+int main(void)
+{
+ char *alphabet = guarded(16), *out = guarded(65);
+ uint8_t *data = guarded(128);
+ uint16_t *offsets = guarded(33 * sizeof *offsets), *keys = guarded(64 * sizeof *keys);
+ ht_ascii_clip_t clip = {.cols=54,.rows=1,.symbols=2,.frames=1,.unique_rows=1,
+ .data_bytes=4,.alphabet=alphabet,.frame_rows=keys,.row_offsets=offsets,.data=data};
+ memcpy(alphabet, " #", 2); keys[0] = 0; offsets[0] = 0; offsets[1] = 4;
+ data[0]=0xf0; data[1]=0xf1; data[2]=0xf0; data[3]=0x51;
+ assert(ht_ascii_clip_row(&clip,0,0,out+10,55)); // exact capacity ending at guard
+ assert(strlen(out+10)==54);
+ assert(!memcmp(out+10," ################ ######",54));
+ assert(!ht_ascii_clip_row(&clip,0,0,out+11,54)); // no room for terminator
+ assert(!ht_ascii_clip_row(&clip,UINT32_MAX,0,out,65));
+ assert(!ht_ascii_clip_row(&clip,0,UINT32_MAX,out,65));
+ assert(!ht_ascii_clip_row(&clip,0,0,NULL,0));
+ assert(!ht_ascii_clip_row(NULL,0,0,out,65));
+ // Authored rows have many one-cell strokes plus longer transparent runs.
+ // Exercise successful writes, ending exactly at the inaccessible page.
+ for (unsigned trial=0;trial<50000;trial++) {
+ clip.cols=1+next()%64; clip.rows=clip.frames=clip.unique_rows=1;
+ clip.symbols=1+next()%16; offsets[0]=keys[0]=0;
+ for (unsigned i=0;i<16;i++) alphabet[i]=32+next()%95;
+ unsigned cells=0, runs=0;
+ while(cells<clip.cols) {
+ unsigned n=1+next()%16;
+ if(n>clip.cols-cells)n=clip.cols-cells;
+ data[runs++]=(uint8_t)(((n-1)<<4) | (next()%clip.symbols));
+ cells+=n;
+ }
+ offsets[1]=clip.data_bytes=runs;
+ char expected[65]; size_t cap=clip.cols+1;
+ assert(reference(&clip,0,0,expected,cap));
+ for(int mode=0;mode<2;mode++) {
+ ht_ascii_clip_short_runs(mode!=0);
+ assert(ht_ascii_clip_row(&clip,0,0,out+65-cap,cap));
+ assert(!memcmp(out+65-cap,expected,cap));
+ }
+ }
+ ht_ascii_clip_short_runs(true);
+ for (unsigned trial=0;trial<100000;trial++) {
+ clip.cols=next()%65; clip.rows=next()%9; clip.frames=next()%9;
+ clip.symbols=next()%18; clip.unique_rows=next()%33; clip.data_bytes=next()%129;
+ for (unsigned i=0;i<16;i++) alphabet[i]=next();
+ for (unsigned i=0;i<128;i++) data[i]=next();
+ for (unsigned i=0;i<33;i++) offsets[i]=next()%180;
+ for (unsigned i=0;i<64;i++) keys[i]=next()%40;
+ unsigned frame=next()%10,row=next()%10,cap=next()%66;
+ char expected[65];
+ bool valid=reference(&clip,frame,row,expected,cap);
+ bool actual=ht_ascii_clip_row(&clip,frame,row,out+65-cap,cap);
+ assert(actual==valid);
+ if(valid) assert(!strcmp(out+65-cap,expected));
+ else if(cap) assert(!out[65-cap]);
+ }
+ release(alphabet);release(out);release(data);release(offsets);release(keys);
+ puts("ASCII clip: exact-capacity guards, 50000 valid rows in both decode modes + 100000 malformed metadata/run cases pass");
+}
diff --git a/devices/harness-device/firmware/test/test_ascii_scene.c b/devices/harness-device/firmware/test/test_ascii_scene.c
new file mode 100644
index 000000000..494fa79a8
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_ascii_scene.c
@@ -0,0 +1,49 @@
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+static ht_scene_t a,b;
+static uint32_t seed=0x741bc;
+static unsigned next(void) {seed=seed*1664525u+1013904223u;return seed;}
+static void identical(void) {
+ assert(a.count==b.count&&a.background==b.background);
+ assert(!memcmp(a.runs,b.runs,a.count*sizeof *a.runs));
+}
+int main(void) {
+ const ht_font_t *fonts[]={&ht_octopus_font_2,&ht_octopus_font_4,&ht_octopus_font_6,
+ &ht_octopus_font_8,&ht_octopus_font_10,&ht_mono_20};
+ size_t page=(size_t)sysconf(_SC_PAGESIZE);
+ char *map=mmap(NULL,page*3,PROT_NONE,MAP_PRIVATE|MAP_ANON,-1,0);
+ assert(map!=MAP_FAILED&&!mprotect(map+page,page,PROT_READ|PROT_WRITE));
+ for(unsigned trial=0;trial<10000;trial++) {
+ unsigned n=next()%256;char reference[257];char *asset=map+2*page-n;
+ for(unsigned i=0;i<n;i++)reference[i]=asset[i]=(char)(32+next()%95);
+ reference[n]=0;
+ const ht_font_t *font=fonts[next()%6];int w=1+next()%700;
+ int x=(int)(next()%600)-70,y=(int)(next()%600)-70;
+ uint16_t fg=(uint16_t)next(),bg=(uint16_t)next();
+ ht_scene_clear(&a,bg);ht_scene_clear(&b,bg);
+ assert(ht_text(&a,x,y,w,font,fg,bg,reference));
+ // No terminator is readable after the asset: exactly n bytes are enough.
+ assert(ht_ascii_text(&b,x,y,w,font,fg,bg,asset,n));identical();
+ }
+ assert(!munmap(map,page*3));
+ ht_scene_clear(&b,0);
+ assert(!ht_ascii_text(&b,0,0,40,NULL,0,0,"x",1));
+ ht_font_t invalid=ht_mono_20;invalid.width=0;
+ assert(!ht_ascii_text(&b,0,0,40,&invalid,0,0,"x",1));
+ assert(!ht_ascii_text(&b,0,0,40,&ht_mono_20,0,0,NULL,1));
+ for(int i=0;i<HT_RUNS;i++)assert(ht_ascii_text(&b,0,0,40,&ht_mono_20,0,0,NULL,0));
+ assert(!ht_ascii_text(&b,0,0,40,&ht_mono_20,0,0,"x",1));
+ for(unsigned frame=0;frame<HT_OCTOPUS_FRAMES;frame++) for(unsigned mood=0;mood<=HT_TIM_LISTENING;mood++)
+ for(unsigned size=0;size<5;size++) {
+ ht_tim_face_t face={.mood=(ht_tim_mood_t)mood,.dim=0x8410,.unread=frame%2,
+ .pose={.look=(int)(frame%5)-2,.blink=frame%3==0,.pressed=frame%4==0,.level=frame%5}};
+ ht_scene_clear(&a,0);ht_scene_clear(&b,0);
+ ht_octopus_fast_scene(false);ht_octopus_portrait(&a,&face,frame,0xfedc,fonts[size],80);
+ ht_octopus_fast_scene(true);ht_octopus_portrait(&b,&face,frame,0xfedc,fonts[size],80);identical();
+ }
+ puts("ASCII scene: 10000 exact-length guarded assets + 2520 full portrait scenes match UTF-8 construction byte for byte PASS");
+}
diff --git a/devices/harness-device/firmware/test/test_audio_init.py b/devices/harness-device/firmware/test/test_audio_init.py
new file mode 100644
index 000000000..d2e142b85
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_audio_init.py
@@ -0,0 +1,135 @@
+"""Fail every codec initialization step; retries must not leak or double-free."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = (main / 'audio_capture.c').read_text()
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include <assert.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "audio_capture.h"
+#define DEVICE_HABITAT 1
+#define ESP_OK 0
+#define pdPASS 1
+#define ESP_LOGI(...) ((void)0)
+static void log_ignore(const char *fmt,...) { (void)fmt; }
+#define ESP_LOGW(tag,...) log_ignore(__VA_ARGS__)
+#define ESP_LOGE(tag,...) log_ignore(__VA_ARGS__)
+#define I2S_NUM_0 0
+#define I2C_NUM_0 0
+#define I2S_ROLE_MASTER 0
+#define I2S_CHANNEL_DEFAULT_CONFIG(a,b) ((i2s_chan_config_t){0})
+#define I2S_STD_CLK_DEFAULT_CONFIG(a) 0
+#define I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(a,b) 0
+#define BSP_I2S_MCLK 0
+#define BSP_I2S_BCLK 1
+#define BSP_I2S_WS 2
+#define BSP_I2S_DOUT 3
+#define BSP_I2S_DIN 4
+#define BSP_PA_IO 5
+#define ES7210_CODEC_DEFAULT_ADDR 0
+#define ES8311_CODEC_DEFAULT_ADDR 1
+#define ESP_CODEC_DEV_WORK_MODE_DAC 1
+#define ESP_CODEC_DEV_TYPE_IN 1
+#define ESP_CODEC_DEV_TYPE_OUT 2
+typedef struct resource { int kind; bool enabled; struct resource *dependency; } resource;
+typedef struct { int dma_frame_num,dma_desc_num; } i2s_chan_config_t;
+typedef struct { int clk_cfg,slot_cfg; struct { int mclk,bclk,ws,dout,din;struct{bool mclk_inv,bclk_inv,ws_inv;}invert_flags;}gpio_cfg; } i2s_std_config_t;
+typedef struct { bool (*on_recv_q_ovf)(void *,void *,void *); } i2s_event_callbacks_t;
+typedef struct { int port; resource *rx_handle,*tx_handle; } audio_codec_i2s_cfg_t;
+typedef struct { int port,addr; void *bus_handle; } audio_codec_i2c_cfg_t;
+typedef struct { resource *ctrl_if; } es7210_codec_cfg_t;
+typedef struct { resource *ctrl_if,*gpio_if; int codec_mode,pa_pin;bool use_mclk; } es8311_codec_cfg_t;
+typedef struct { int dev_type;resource *codec_if,*data_if; } esp_codec_dev_cfg_t;
+static resource *s_codec_lock,*s_tx,*s_rx,*s_data_if,*s_ctrl_if,*s_es7210,*s_mic;
+static resource *s_spk_ctrl,*s_gpio_if,*s_es8311,*s_spk,*s_beep_task;
+static atomic_bool s_muted;
+static unsigned operation, fail_at,live;
+static bool fail(void) { return ++operation==fail_at; }
+static resource *acquire(int kind,resource *dependency) {
+ resource *p=calloc(1,sizeof *p);assert(p);p->kind=kind;p->dependency=dependency;live++;return p;
+}
+static void release(resource *p) { assert(p&&live);if(p->dependency)assert(p->dependency->kind);p->kind=0;live--;free(p); }
+static resource *xSemaphoreCreateMutex(void) { return fail()?NULL:acquire(1,NULL); }
+static void vSemaphoreDelete(resource *p) { release(p); }
+static int i2s_new_channel(const i2s_chan_config_t *cfg,resource **tx,resource **rx) {
+ assert(cfg->dma_desc_num==12&&cfg->dma_frame_num==160);
+ if(fail())return 1;*tx=acquire(2,NULL);
+ if(fail())return 1;*rx=acquire(2,NULL);return ESP_OK;
+}
+static int i2s_channel_init_std_mode(resource *p,const i2s_std_config_t *cfg) { (void)cfg;assert(p);return fail(); }
+static int i2s_channel_register_event_callback(resource *p,const i2s_event_callbacks_t *cb,void *ctx) { (void)ctx;assert(p&&cb->on_recv_q_ovf);return fail(); }
+static int i2s_channel_enable(resource *p) { assert(p);if(fail())return 1;p->enabled=true;return 0; }
+static int i2s_channel_disable(resource *p) { assert(p);p->enabled=false;return 0; }
+static void i2s_del_channel(resource *p) { assert(!p->enabled);release(p); }
+static resource *audio_codec_new_i2s_data(const audio_codec_i2s_cfg_t *c) { assert(c->tx_handle&&c->rx_handle);return fail()?NULL:acquire(3,c->rx_handle); }
+static resource *audio_codec_new_i2c_ctrl(const audio_codec_i2c_cfg_t *c) { (void)c;return fail()?NULL:acquire(4,NULL); }
+static resource *audio_codec_new_gpio(void) { return fail()?NULL:acquire(5,NULL); }
+static resource *es7210_codec_new(const es7210_codec_cfg_t *c) { assert(c->ctrl_if);return fail()?NULL:acquire(6,c->ctrl_if); }
+static resource *es8311_codec_new(const es8311_codec_cfg_t *c) { assert(c->ctrl_if&&c->gpio_if);return fail()?NULL:acquire(6,c->ctrl_if); }
+static resource *esp_codec_dev_new(const esp_codec_dev_cfg_t *c) { assert(c->codec_if&&c->data_if);return fail()?NULL:acquire(7,c->codec_if); }
+static void esp_codec_dev_delete(resource *p) { release(p); }
+static void audio_codec_delete_codec_if(resource *p) { release(p); }
+static void audio_codec_delete_ctrl_if(resource *p) { release(p); }
+static void audio_codec_delete_gpio_if(resource *p) { release(p); }
+static void audio_codec_delete_data_if(resource *p) { release(p); }
+static void *board_i2c_get(void) { return (void *)1; }
+static bool config_load_muted(void) { return true; }
+static void config_save_muted(bool on) { assert(on); }
+bool audio_notify_is_muted(void) { return atomic_load(&s_muted); }
+static bool rx_overrun(void *a,void *b,void *c) { (void)a;(void)b;(void)c;return false; }
+static void beep_task(void *arg) { (void)arg; }
+static int xTaskCreate(void (*fn)(void *),const char *name,int stack,void *arg,int priority,resource **task) {
+ (void)name;(void)arg;(void)priority;assert(fn==beep_task&&stack==4096);
+ if(fail())return 0;*task=acquire(8,NULL);return pdPASS;
+}
+'''
+for name in ['capture_init_failed', 'audio_capture_init', 'notify_init_failed', 'audio_notify_init']:
+ code += function(name)
+code += r'''
+static void assert_mic_empty(void) {
+ assert(!s_codec_lock&&!s_tx&&!s_rx&&!s_data_if&&!s_ctrl_if&&!s_es7210&&!s_mic&&!live);
+}
+int main(void) {
+ assert(audio_capture_init());unsigned steps=operation;assert(live==7);
+ unsigned before=operation;assert(audio_capture_init()&&operation==before);
+ capture_init_failed("test cleanup");assert_mic_empty();
+ for(unsigned step=1;step<=steps;step++) {
+ operation=0;fail_at=step;assert(!audio_capture_init());assert_mic_empty();
+ operation=fail_at=0;assert(audio_capture_init());capture_init_failed("retry cleanup");assert_mic_empty();
+ }
+ operation=fail_at=0;assert(audio_capture_init());unsigned mic_live=live;
+ operation=0;audio_notify_init();unsigned speaker_steps=operation;assert(s_beep_task&&live==mic_live+5);
+ before=operation;audio_notify_init();assert(operation==before);
+ release(s_beep_task);s_beep_task=NULL;notify_init_failed("test cleanup");assert(live==mic_live);
+ for(unsigned step=1;step<=speaker_steps;step++) {
+ operation=0;fail_at=step;audio_notify_init();
+ assert(!s_spk_ctrl&&!s_gpio_if&&!s_es8311&&!s_spk&&!s_beep_task&&live==mic_live);
+ operation=fail_at=0;audio_notify_init();assert(s_beep_task);
+ release(s_beep_task);s_beep_task=NULL;notify_init_failed("retry cleanup");assert(live==mic_live);
+ }
+ capture_init_failed("final cleanup");assert_mic_empty();
+ printf("Audio init: %u microphone + %u speaker failure points, partial channel allocation and retries, no leaked resources PASS (offline)\n",steps,speaker_steps);
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-audio-init-') as folder:
+ out = Path(folder)
+ (out / 'init.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(main), str(out / 'init.c'), '-o', str(out / 'init')], check=True)
+ subprocess.run([str(out / 'init')], check=True)
diff --git a/devices/harness-device/firmware/test/test_audio_notify.py b/devices/harness-device/firmware/test/test_audio_notify.py
new file mode 100644
index 000000000..08452f50b
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_audio_notify.py
@@ -0,0 +1,113 @@
+"""Offline waveform equivalence and mute/mic preemption; no physical audio."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = (main / 'audio_capture.c').read_text()
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include <assert.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include "audio_capture.h"
+#define ESP_OK 0
+#define ESP_CODEC_DEV_OK 0
+#define pdTRUE 1
+#define ESP_LOGI(...) ((void)0)
+#define ESP_LOGW(...) ((void)0)
+typedef struct { int sample_rate,channel,bits_per_sample; } esp_codec_dev_sample_info_t;
+static int s_spk=1,s_codec_lock=1,s_beep_task=1,held,opens,closes,writes,notifications;
+static atomic_bool s_capture_requested;
+static bool muted,open_fail,write_fail,mute_on_lock,reenter;
+static int stop_after,mute_after;
+static int16_t received[10000];
+static size_t received_count;
+static int64_t clock_us;
+bool audio_notify_is_muted(void) { return muted; }
+static bool xSemaphoreTake(int lock,int ticks) {
+ assert(lock==1&&ticks==0);if(held)return false;held=1;if(mute_on_lock)muted=true;return true;
+}
+static void xSemaphoreGive(int lock) { assert(lock==1&&held);held=0; }
+static int esp_codec_dev_open(int dev,const esp_codec_dev_sample_info_t *fs) {
+ assert(dev==1&&held&&fs->sample_rate==AUDIO_SAMPLE_RATE);opens++;return open_fail;
+}
+static void esp_codec_dev_set_out_vol(int dev,int v) { assert(dev==1&&v==100&&held); }
+static void esp_codec_dev_close(int dev) { assert(dev==1&&held);closes++; }
+static int esp_codec_dev_write(int dev,void *p,int bytes) {
+ assert(dev==1&&held&&bytes>0&&bytes<=AUDIO_SAMPLE_RATE*2/50);writes++;
+ if(write_fail)return 1;
+ assert(received_count+(size_t)bytes/2<10000);
+ memcpy(received+received_count,p,(size_t)bytes);received_count+=(size_t)bytes/2;
+ if(stop_after&&writes==stop_after)atomic_store(&s_capture_requested,true);
+ if(mute_after&&writes==mute_after)muted=true;
+ return 0;
+}
+static void xTaskNotifyGive(int task) { assert(task==1);notifications++; }
+static int64_t esp_timer_get_time(void) {
+ int64_t sampled=clock_us;
+ if(reenter){reenter=false;clock_us+=1000;audio_notify_done();}
+ return sampled;
+}
+'''
+for line in source.splitlines():
+ if re.match(r'#define (BEEP_|GAP_|TONE_)', line) or line.startswith('static int16_t s_tone['):
+ code += line + '\n'
+for name in ['render_tone', 'play_beep', 'audio_notify_done']:
+ code += function(name)
+code += r'''
+static void reset(void) {
+ muted=open_fail=write_fail=mute_on_lock=false;atomic_store(&s_capture_requested,false);
+ held=opens=closes=writes=stop_after=mute_after=0;received_count=0;
+}
+int main(void) {
+ int16_t original[TONE_SAMPLES];int at=0;
+ // The old full-waveform construction, retained as the reference.
+ const int half=AUDIO_SAMPLE_RATE/2000/2;
+ for(int b=0;b<BEEP_COUNT;b++) {
+ for(int n=0;n<BEEP_SAMPLES;n++)original[at++]=((n/(half>0?half:1))&1)?6000:-6000;
+ if(b<BEEP_COUNT-1)for(int n=0;n<GAP_SAMPLES;n++)original[at++]=0;
+ }
+ assert(at==TONE_SAMPLES&&sizeof s_tone==640);
+ reset();play_beep();assert(!held&&opens==1&&closes==1&&received_count==TONE_SAMPLES);
+ assert(!memcmp(original,received,sizeof original));
+ reset();muted=true;play_beep();assert(!opens&&!writes);
+ reset();atomic_store(&s_capture_requested,true);play_beep();assert(!opens&&!writes);
+ reset();mute_on_lock=true;play_beep();assert(!held&&!opens&&!writes);
+ reset();held=1;play_beep();assert(!opens&&!writes);held=0;
+ for(int n=1;n<18;n++) {
+ reset();stop_after=n;play_beep();assert(writes==n&&!held&&closes==1);
+ assert(!memcmp(original,received,received_count*sizeof *received));
+ reset();mute_after=n;play_beep();assert(writes==n&&!held&&closes==1);
+ }
+ reset();open_fail=true;play_beep();assert(!held&&opens==1&&!closes&&!writes);
+ reset();write_fail=true;play_beep();assert(!held&&opens==1&&closes==1&&writes==1);
+ reset();clock_us=1000000;audio_notify_done();assert(notifications==1);
+ clock_us=1999000;audio_notify_done();assert(notifications==1);
+ clock_us=2000000;audio_notify_done();assert(notifications==2);
+ clock_us=3000000;reenter=true;audio_notify_done();assert(notifications==3);
+ clock_us=(int64_t)(UINT32_MAX-500u)*1000;audio_notify_done();assert(notifications==4);
+ clock_us=((INT64_C(1)<<32)+498)*1000;audio_notify_done();assert(notifications==4);
+ clock_us+=1000;audio_notify_done();assert(notifications==5);
+ muted=true;clock_us+=1000000;audio_notify_done();assert(notifications==5);
+ puts("Notification: exact 5760-sample waveform with 640B buffer; mute/mic/error release, concurrent debounce and wrap PASS (offline)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-notify-') as folder:
+ out = Path(folder)
+ (out / 'notify.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(main), str(out / 'notify.c'), '-o', str(out / 'notify')], check=True)
+ subprocess.run([str(out / 'notify')], check=True)
diff --git a/devices/harness-device/firmware/test/test_audio_stream.py b/devices/harness-device/firmware/test/test_audio_stream.py
new file mode 100644
index 000000000..1fe373e11
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_audio_stream.py
@@ -0,0 +1,129 @@
+"""Exercise actual capture/sender loops against an offline synthetic byte sink."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('AUDIO_STREAM_SOURCE', main / 'audio_client_habitat.c')).read_text()
+
+def function(name):
+ match = re.search(r'^static void ' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include "voice_buffer.h"
+#include <assert.h>
+#include <stdarg.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <string.h>
+#define CAPTURE_SAMPLES 160
+#define BUFFER_BYTES 32768
+#define AUDIO_SAMPLE_RATE 16000
+#define CABLE_VOICE_CHUNK 1024
+#define CFG_VLANG_MAX 16
+#define pdTRUE 1
+#define portMAX_DELAY (-1)
+#define pdMS_TO_TICKS(ms) (ms)
+static const char *TAG="offline-test";
+static void log_noop(const char *tag,const char *format,...) {(void)tag;(void)format;}
+#define ESP_LOGI(...) log_noop(__VA_ARGS__)
+#define ESP_LOGE(...) log_noop(__VA_ARGS__)
+typedef void *TaskHandle_t;
+static int capture_token, sender_token;
+static TaskHandle_t capture_task=&capture_token,sender_task=&sender_token;
+static voice_buffer_t buffer;
+static atomic_bool active, recording, stop_requested, abort_requested, capture_done, heard;
+static atomic_uint input_level;
+static char agent[]="target-agent";
+enum { VOICE_CMD_NONE,VOICE_CMD_GOAL,VOICE_CMD_LOOP };
+static int command;
+static uint32_t produced,high_water,read_max_us;
+enum { HEALTHY, BEGIN_FAIL, START_FAIL, READ_FAIL, READ_RECOVER, TX_FAIL, OVERFLOW, DMA_LOSS, MODES };
+static int mode,role;
+static unsigned capture_waits,sender_waits,reads,raw_bytes,sent_bytes,pcm_calls;
+static unsigned starts,stops,begins,ends,aborts,notifications,overruns;
+static uint64_t clock_us;
+static jmp_buf captured,finished;
+static void capture(void *unused);
+static int64_t esp_timer_get_time(void) {return (int64_t)(clock_us+=100);}
+static unsigned uxTaskGetStackHighWaterMark(TaskHandle_t task) {(void)task;return 4096;}
+static int ulTaskNotifyTake(int clear,int wait) {
+ assert(clear==pdTRUE&&wait==portMAX_DELAY);
+ if(role==1) {if(capture_waits++)longjmp(captured,1);}
+ else {if(sender_waits++){assert(!active);longjmp(finished,1);}}
+ return 1;
+}
+static void xTaskNotifyGive(TaskHandle_t task) {
+ notifications++;
+ if(task==sender_task)return;
+ assert(task==capture_task&&role==2);role=1;
+ if(!setjmp(captured))capture(NULL);
+ role=2;
+}
+static void vTaskDelay(unsigned ticks) {clock_us+=ticks*1000;}
+static bool audio_capture_start(void) {starts++;return mode!=START_FAIL;}
+static int audio_capture_read(uint8_t *out,int capacity) {
+ assert(capacity==CAPTURE_SAMPLES*2);reads++;
+ if(mode==READ_FAIL||(mode==READ_RECOVER&&reads<=2))return -1;
+ for(int i=0;i<capacity;i++)out[i]=(uint8_t)(raw_bytes+i);
+ raw_bytes+=(unsigned)capacity;
+ if(mode==DMA_LOSS&&reads==3)overruns++;
+ if(mode!=OVERFLOW&&raw_bytes==64*CAPTURE_SAMPLES*2)atomic_store(&stop_requested,true);
+ return capacity;
+}
+static unsigned audio_capture_overruns(void) {return overruns;}
+static void audio_capture_stop(void) {stops++;}
+static void config_load_voicelang(char *out,size_t n) {snprintf(out,n,"en");}
+static bool audio_stream_begin(const char *id,const char *cmd,const char *lang,int rate) {
+ assert(id&&!strcmp(id,"target-agent")&&!strcmp(cmd,"")&&!strcmp(lang,"en")&&rate==16000);
+ begins++;return mode!=BEGIN_FAIL;
+}
+static bool audio_stream_pcm(const uint8_t *bytes,size_t n) {
+ assert(begins==1&&mode!=BEGIN_FAIL&&n&&n<=CABLE_VOICE_CHUNK);pcm_calls++;
+ for(size_t i=0;i<n;i++)assert(bytes[i]==(uint8_t)(sent_bytes+i));
+ if(mode==TX_FAIL&&pcm_calls==3)return false;
+ sent_bytes+=(unsigned)n;return true;
+}
+static void audio_stream_end(void) {
+ assert(capture_done&&!abort_requested&&sent_bytes==produced);ends++;
+}
+static void audio_stream_abort(const char *why) {assert(why&&capture_done);aborts++;}
+'''
+code += function('capture') + function('send_audio')
+code += r'''
+int main(void) {
+ static uint8_t guarded[BUFFER_BYTES+16];
+ for(unsigned round=0;round<100;round++)for(mode=0;mode<MODES;mode++) {
+ memset(guarded,0xa5,sizeof guarded);voice_buffer_init(&buffer,guarded+8,BUFFER_BYTES);
+ if(round&1) {atomic_store(&buffer.head,UINT32_MAX-255);atomic_store(&buffer.tail,UINT32_MAX-255);}
+ active=recording=true;stop_requested=abort_requested=capture_done=heard=false;
+ input_level=produced=high_water=read_max_us=0;
+ capture_waits=sender_waits=reads=raw_bytes=sent_bytes=pcm_calls=0;
+ starts=stops=begins=ends=aborts=notifications=overruns=0;clock_us=0;role=2;
+ if(!setjmp(finished))send_audio(NULL);
+ assert(!active&&!recording&&capture_done&&input_level==0&&begins==1&&starts==1);
+ assert(stops==(unsigned)(mode!=START_FAIL));
+ assert(high_water<=BUFFER_BYTES);
+ if(mode==HEALTHY||mode==READ_RECOVER) {
+ assert(ends==1&&!aborts&&sent_bytes==20480&&!voice_buffer_used(&buffer));
+ } else {
+ assert(!ends&&aborts==1);
+ if(mode!=TX_FAIL)assert(!pcm_calls);
+ }
+ for(int i=0;i<8;i++)assert(guarded[i]==0xa5&&guarded[BUFFER_BYTES+8+i]==0xa5);
+ }
+ puts("Audio workers: 800 offline sessions; exact PCM order, failed begin/start, read retry/failure, USB failure, ring overflow, DMA loss and 32-bit wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-audio-stream-') as folder:
+ out = Path(folder)
+ (out / 'stream.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(main), str(out / 'stream.c'), str(main / 'voice_buffer.c'),
+ '-o', str(out / 'stream')], check=True)
+ subprocess.run([str(out / 'stream')], check=True, timeout=30)
diff --git a/devices/harness-device/firmware/test/test_audio_threads.py b/devices/harness-device/firmware/test/test_audio_threads.py
new file mode 100644
index 000000000..868ad362f
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_audio_threads.py
@@ -0,0 +1,186 @@
+"""Real capture/sender threads and public start/stop/metadata calls, offline.
+
+The audio is generated bytes in host RAM, never a microphone or network stream.
+SANITIZERS=thread also checks cross-task ownership with ThreadSanitizer.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import defines
+
+main=Path(__file__).resolve().parent/'../main'
+source=re.sub(r'^#include .*\n','',(main/'audio_client_habitat.c').read_text(),flags=re.M)
+code=defines('ID_MAX')+r'''
+#include "audio_client.h"
+#include "voice_buffer.h"
+#include <assert.h>
+#include <pthread.h>
+#include <sched.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#define CFG_VLANG_MAX 16
+#define AUDIO_SAMPLE_RATE 16000
+#define CABLE_VOICE_CHUNK 1024
+#define pdTRUE 1
+#define pdPASS 1
+#define portMAX_DELAY (-1)
+#define pdMS_TO_TICKS(ms) (ms)
+#define portMUX_TYPE pthread_mutex_t
+#define portMUX_INITIALIZER_UNLOCKED PTHREAD_MUTEX_INITIALIZER
+#define portENTER_CRITICAL(p) assert(!pthread_mutex_lock(p))
+#define portEXIT_CRITICAL(p) assert(!pthread_mutex_unlock(p))
+typedef int BaseType_t;
+typedef struct task {
+ pthread_t thread;
+ pthread_mutex_t lock;
+ pthread_cond_t wake;
+ unsigned pending;
+ bool quit;
+ void (*function)(void *);
+} task_t;
+typedef task_t *TaskHandle_t;
+static _Thread_local task_t *self;
+static void log_noop(const char *tag,const char *fmt,...) { (void)tag;(void)fmt; }
+#define ESP_LOGI(...) log_noop(__VA_ARGS__)
+#define ESP_LOGE(...) log_noop(__VA_ARGS__)
+static int64_t esp_timer_get_time(void) {
+ struct timespec t;assert(!clock_gettime(CLOCK_MONOTONIC,&t));
+ return (int64_t)t.tv_sec*1000000+t.tv_nsec/1000;
+}
+static uint32_t esp_random(void) { static atomic_uint counter;return atomic_fetch_add(&counter,1)+1; }
+static void vTaskDelay(unsigned ms) {
+ (void)ms;struct timespec t={0,10000};nanosleep(&t,NULL);
+}
+static int ulTaskNotifyTake(int clear,int ticks) {
+ assert(self&&clear==pdTRUE);assert(!pthread_mutex_lock(&self->lock));
+ while(!self->pending&&!self->quit) {
+ if(ticks==portMAX_DELAY) assert(!pthread_cond_wait(&self->wake,&self->lock));
+ else {
+ struct timespec until;clock_gettime(CLOCK_REALTIME,&until);
+ until.tv_nsec+=1000000;if(until.tv_nsec>=1000000000){until.tv_nsec-=1000000000;until.tv_sec++;}
+ int result=pthread_cond_timedwait(&self->wake,&self->lock,&until);
+ assert(!result||result==ETIMEDOUT);if(result==ETIMEDOUT)break;
+ }
+ }
+ unsigned value=self->pending;self->pending=0;bool quit=self->quit;
+ assert(!pthread_mutex_unlock(&self->lock));if(quit)pthread_exit(NULL);return (int)value;
+}
+static void xTaskNotifyGive(TaskHandle_t task) {
+ assert(task);assert(!pthread_mutex_lock(&task->lock));task->pending++;
+ assert(!pthread_cond_signal(&task->wake));assert(!pthread_mutex_unlock(&task->lock));
+}
+static unsigned uxTaskGetStackHighWaterMark(TaskHandle_t task) {(void)task;return 4096;}
+static void *run_task(void *arg) { self=arg;self->function(NULL);return NULL; }
+static BaseType_t xTaskCreatePinnedToCore(void (*f)(void *),const char *name,unsigned stack,void *arg,
+ unsigned priority,TaskHandle_t *out,int core) {
+ (void)name;(void)stack;(void)arg;(void)priority;(void)core;
+ task_t *task=calloc(1,sizeof *task);assert(task);
+ assert(!pthread_mutex_init(&task->lock,NULL));assert(!pthread_cond_init(&task->wake,NULL));
+ task->function=f;*out=task;assert(!pthread_create(&task->thread,NULL,run_task,task));return pdPASS;
+}
+static void vTaskDelete(TaskHandle_t task) {
+ pthread_mutex_lock(&task->lock);task->quit=true;pthread_cond_signal(&task->wake);pthread_mutex_unlock(&task->lock);
+ assert(!pthread_join(task->thread,NULL));pthread_cond_destroy(&task->wake);pthread_mutex_destroy(&task->lock);free(task);
+}
+static void *ram_psram_alloc(size_t bytes,const char *owner) {(void)owner;return calloc(1,bytes);}
+static void config_load_voicelang(char *out,size_t n) {snprintf(out,n,"en");}
+enum { HEALTHY, BEGIN_FAIL, START_FAIL, READ_FAIL, READ_RECOVER, TX_FAIL, OVERFLOW, DMA_LOSS,
+ EXPLICIT_STOP, EXPLICIT_ABORT, MODES };
+static unsigned mode,session_number,raw_bytes,reads,sent_bytes,pcm_calls,starts,stops,begins,ends,aborts;
+static atomic_uint overruns;
+static atomic_bool start_gate,first_read;
+static char expected_agent[ID_MAX];
+static bool audio_capture_start(void);
+static int audio_capture_read(uint8_t *,int);
+static void audio_capture_stop(void);
+static unsigned audio_capture_overruns(void) {return atomic_load(&overruns);}
+static bool audio_stream_begin(const char *,const char *,const char *,int);
+static bool audio_stream_pcm(const uint8_t *,size_t);
+static void audio_stream_end(void);
+static void audio_stream_abort(const char *);
+'''
+code+=source
+code+=r'''
+static uint8_t value(unsigned at) {return (uint8_t)((at*29u)^(session_number*17u));}
+static bool audio_capture_start(void) {
+ starts++;while(!atomic_load(&start_gate))sched_yield();return mode!=START_FAIL;
+}
+static int audio_capture_read(uint8_t *out,int capacity) {
+ assert(capacity==CAPTURE_SAMPLES*2);reads++;
+ if(mode==READ_FAIL||(mode==READ_RECOVER&&reads<=2))return -1;
+ // Pace synthetic hardware behind the sender except in the dedicated overflow
+ // case. This keeps scheduler load from impersonating a broken USB link.
+ while(mode!=OVERFLOW&&voice_buffer_used(&buffer)>BUFFER_BYTES-(unsigned)capacity) {
+ if(atomic_load(&stop_requested)||atomic_load(&abort_requested))return 0;
+ sched_yield();
+ }
+ for(int i=0;i<capacity;i++)out[i]=value(raw_bytes+(unsigned)i);
+ raw_bytes+=(unsigned)capacity;atomic_store(&first_read,true);
+ if(mode==DMA_LOSS&&reads==3)atomic_store(&overruns,1);
+ if(mode!=OVERFLOW&&mode!=EXPLICIT_STOP&&mode!=EXPLICIT_ABORT&&raw_bytes==64*CAPTURE_SAMPLES*2)
+ atomic_store(&stop_requested,true);
+ sched_yield();return capacity;
+}
+static void audio_capture_stop(void) {stops++;}
+static bool audio_stream_begin(const char *id,const char *cmd,const char *lang,int rate) {
+ assert(id&&!strcmp(id,expected_agent)&&!strcmp(cmd,"")&&!strcmp(lang,"en")&&rate==16000);begins++;
+ if(mode==OVERFLOW)while(!atomic_load(&abort_requested))sched_yield();
+ return mode!=BEGIN_FAIL;
+}
+static bool audio_stream_pcm(const uint8_t *bytes,size_t n) {
+ assert(begins==1&&n&&n<=CABLE_VOICE_CHUNK);pcm_calls++;
+ for(size_t i=0;i<n;i++)assert(bytes[i]==value(sent_bytes+(unsigned)i));
+ if(mode==TX_FAIL&&pcm_calls==3)return false;
+ sent_bytes+=(unsigned)n;sched_yield();return true;
+}
+static void audio_stream_end(void) {
+ assert(atomic_load(&capture_done)&&!atomic_load(&abort_requested)&&sent_bytes==produced);ends++;
+}
+static void audio_stream_abort(const char *why) {assert(why&&atomic_load(&capture_done));aborts++;}
+static void wait_finished(void) {
+ int64_t limit=esp_timer_get_time()+5000000;
+ while(audio_client_active()) {assert(esp_timer_get_time()<limit);sched_yield();}
+}
+int main(void) {
+ audio_client_init();assert(storage&&capture_task&&sender_task);
+ audio_client_init(); // Idempotent; no extra workers or ring.
+ for(unsigned round=0;round<100;round++)for(mode=0;mode<MODES;mode++) {
+ assert(!audio_client_active());session_number++;
+ raw_bytes=reads=sent_bytes=pcm_calls=starts=stops=begins=ends=aborts=0;
+ atomic_store(&overruns,0);atomic_store(&start_gate,false);atomic_store(&first_read,false);
+ snprintf(expected_agent,sizeof expected_agent,"offline-agent-%u",session_number);
+ audio_client_start_cable(expected_agent,VOICE_CMD_NONE);assert(audio_client_active());
+ // A second start while recording cannot redirect this utterance.
+ audio_client_start_cable("wrong-agent",VOICE_CMD_GOAL);
+ char current[24];audio_client_copy_upload_id(current,sizeof current);
+ assert(audio_client_upload_matches(current)&&!audio_client_upload_matches("old-upload"));
+ assert(audio_client_recording());
+ atomic_store(&start_gate,true);
+ if(mode==EXPLICIT_STOP||mode==EXPLICIT_ABORT) {
+ while(!atomic_load(&first_read))sched_yield();
+ if(mode==EXPLICIT_STOP)audio_client_stop();else audio_client_abort();
+ }
+ wait_finished();
+ assert(!audio_client_recording()&&atomic_load(&capture_done)&&audio_client_input_level()==0);
+ assert(begins==1&&starts==1&&stops==(unsigned)(mode!=START_FAIL));
+ assert(high_water<=BUFFER_BYTES);
+ if(mode==HEALTHY||mode==READ_RECOVER||mode==EXPLICIT_STOP) {
+ assert(ends==1&&!aborts&&sent_bytes==produced&&!voice_buffer_used(&buffer));
+ } else assert(!ends&&aborts==1);
+ }
+ vTaskDelete(capture_task);vTaskDelete(sender_task);free(storage);
+ puts("Audio threads: 1000 concurrent offline sessions; exact PCM, pinned targets, explicit stop/abort, start/read/USB/overflow failures and immediate restart PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-audio-threads-') as d:
+ out=Path(d);(out/'threads.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g','-pthread',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),'-I',str(main),
+ str(out/'threads.c'),str(main/'voice_buffer.c'),'-o',str(out/'threads')],check=True)
+ subprocess.run([str(out/'threads')],check=True,timeout=120)
diff --git a/devices/harness-device/firmware/test/test_board_i2c.py b/devices/harness-device/firmware/test/test_board_i2c.py
new file mode 100644
index 000000000..c5bb886e1
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_board_i2c.py
@@ -0,0 +1,96 @@
+"""Run the actual shared-bus initializer with concurrent retries and SDK failures."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('I2C_SOURCE', main / 'board/board_i2c.c')).read_text()
+# Only SDK types and scheduling are replaced. The complete production C body is retained.
+source = re.sub(r'^#include .*$', '', source, flags=re.M)
+code = r'''
+#include <assert.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+typedef void *i2c_master_bus_handle_t;
+typedef struct {
+ int i2c_port,sda_io_num,scl_io_num,clk_source,glitch_ignore_cnt;
+ struct { bool enable_internal_pullup; } flags;
+} i2c_master_bus_config_t;
+#define I2C_NUM_0 0
+#define BSP_I2C_PORT I2C_NUM_0
+#define BSP_I2C_SDA 15
+#define BSP_I2C_SCL 14
+#define I2C_CLK_SRC_DEFAULT 0
+#define ESP_OK 0
+#define ESP_LOGE(tag, ...) ((void)(tag))
+#define pdMS_TO_TICKS(ms) (ms)
+static atomic_uint calls;
+static atomic_bool release_first,first_done,second_started;
+static int scenario,token;
+static int64_t esp_timer_get_time(void) {
+ struct timespec ts;assert(clock_gettime(CLOCK_MONOTONIC,&ts)==0);
+ return (int64_t)ts.tv_sec*1000000+ts.tv_nsec/1000;
+}
+static void vTaskDelay(unsigned ms) {
+ struct timespec wait={.tv_sec=ms/1000,.tv_nsec=(long)(ms%1000)*1000000};
+ nanosleep(&wait,NULL);
+}
+static int i2c_new_master_bus(const i2c_master_bus_config_t *cfg,i2c_master_bus_handle_t *out) {
+ assert(cfg->i2c_port==0&&cfg->sda_io_num==15&&cfg->scl_io_num==14);
+ unsigned n=atomic_fetch_add(&calls,1)+1;
+ if(n==1) {
+ while(!atomic_load(&release_first))vTaskDelay(1);
+ if(scenario==1)return -1; // failed initial allocation, before any handle exists
+ } else if(scenario==0) {
+ // The other core acquired this hardware port. Its failing retry must not
+ // erase the winner's published handle (the previous code did exactly that).
+ while(!atomic_load(&first_done))vTaskDelay(1);
+ return -1;
+ }
+ *out=&token;return ESP_OK;
+}
+'''+source+r'''
+static void *first(void *unused) {
+ (void)unused;void *result=board_i2c_get();atomic_store(&first_done,true);return result;
+}
+static void *second(void *unused) {
+ (void)unused;atomic_store(&second_started,true);return board_i2c_get();
+}
+int main(int argc,char **argv) {
+ assert(argc==2);scenario=atoi(argv[1]);pthread_t a,b;void *ra,*rb;
+ assert(!pthread_create(&a,NULL,first,NULL));
+ while(!atomic_load(&calls))vTaskDelay(1);
+ assert(!pthread_create(&b,NULL,second,NULL));
+ while(!atomic_load(&second_started))vTaskDelay(1);
+ if(scenario==2) {
+ int64_t start=esp_timer_get_time();assert(!pthread_join(b,&rb));
+ int64_t elapsed=esp_timer_get_time()-start;
+ assert(!rb&&elapsed<1500000&&atomic_load(&calls)==1);
+ atomic_store(&release_first,true);assert(!pthread_join(a,&ra));
+ assert(ra==&token&&board_i2c_get()==&token);
+ } else {
+ vTaskDelay(20);atomic_store(&release_first,true);
+ assert(!pthread_join(a,&ra)&&!pthread_join(b,&rb));
+ assert(ra==(scenario==1?NULL:&token)&&rb==&token);
+ unsigned count=atomic_load(&calls);assert(count==(scenario==1?2u:1u));
+ for(unsigned i=0;i<200000;i++)assert(board_i2c_get()==&token);
+ assert(atomic_load(&calls)==count);
+ }
+ printf("Shared I2C scenario %d: concurrent initialization, failure retry, bounded wait, stable cached handle PASS\n",scenario);
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-i2c-') as folder:
+ out=Path(folder);(out/'test.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-Wno-unused-function',
+ '-Wno-deprecated-declarations','-O1','-g','-pthread',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ str(out/'test.c'),'-o',str(out/'test')],check=True)
+ for scenario in range(3):
+ subprocess.run([str(out/'test'),str(scenario)],check=True,timeout=5)
diff --git a/devices/harness-device/firmware/test/test_brightness_ui.py b/devices/harness-device/firmware/test/test_brightness_ui.py
new file mode 100644
index 000000000..6cc43a0a6
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_brightness_ui.py
@@ -0,0 +1,94 @@
+"""Exercise production brightness loading, controls, and persistence conversions."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+here = Path(__file__).resolve().parent
+source = Path(os.environ.get('UI_SOURCE', here / '../main/ui/habitat/ui_habitat.c')).read_text()
+
+def function(name, text=source):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', text, re.M | re.S)
+ assert match, name
+ return match.group(0)
+
+def brightness_case(name):
+ match = re.search(r' case A_BRIGHT:.*?\bbreak;', function(name), re.S)
+ assert match, name
+ return match.group(0)
+
+load = re.search(r' s\.brightness = [^;]*config_load_brightness\(\)[^;]*;', function('ui_init')).group(0)
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include "theme.h"
+static struct { int brightness; } s;
+typedef struct { int kind, value; } action_t;
+enum { A_BRIGHT };
+static action_t pending;
+static uint8_t saved;
+static uint8_t config_load_brightness(void) { return saved; }
+static void config_save_brightness(uint8_t value) { saved=value; }
+static void display_lock(void) {}
+static void display_unlock(void) {}
+static void change(void) {}
+static bool queue(action_t a) { pending=a; return true; }
+'''
+code += function('ui_set_brightness') + '\n'
+code += function('ht_rgb', (here / '../main/ui/habitat/terminal.c').read_text()) + '\n'
+code += function('color') + '\n'
+code += 'static void load_saved(void) {\n' + load + '\n}\n'
+code += 'static void tap_brightness(void) { action_t a={.kind=A_BRIGHT}; switch(a.kind) {\n' + brightness_case('dispatch') + '\n} }\n'
+code += 'static void persist(void) { action_t a=pending; switch(a.kind) {\n' + brightness_case('worker') + '\n} }\n'
+code += r'''
+int main(void) {
+ // The factory byte 0x99 is 60%. Two presses used to produce 85%, then
+ // 110%, whose persisted byte wrapped back to a nearly dark display.
+ saved=0x99; load_saved(); assert(s.brightness==60);
+ tap_brightness(); tap_brightness();
+ if (s.brightness>100) {
+ fprintf(stderr,"Brightness escaped its range: %d%%\n",s.brightness);
+ return 1;
+ }
+ int previous=-1;
+ for(int level=0;level<=255;level++) {
+ saved=(uint8_t)level; load_saved();
+ int loaded=s.brightness;
+ ui_set_brightness((uint8_t)level);
+ assert(s.brightness==loaded && loaded>=previous && loaded<=100);
+ previous=loaded;
+ for(int step=0;step<8;step++) {
+ int before=s.brightness;
+ tap_brightness();
+ int chosen=s.brightness;
+ assert(chosen>=25 && chosen<=100 && chosen%25==0);
+ assert(before==100 ? chosen==25 : chosen>before);
+ assert(pending.value==chosen);
+ persist(); load_saved();
+ assert(s.brightness==chosen); // Reboot cannot change the selected step.
+ ui_set_brightness(saved); assert(s.brightness==chosen);
+ }
+ }
+ for(int percent=0;percent<=100;percent++) {
+ s.brightness=percent;
+ uint16_t canvas=color(HT_THEME_CANVAS);
+ unsigned r=canvas>>11, g=(canvas>>5)&63, b=canvas&31;
+ r=(r<<3)|(r>>2); g=(g<<2)|(g>>4); b=(b<<3)|(b>>2);
+ assert(r==g && g==b && r<=24);
+ if(percent==25)assert(r==8);
+ if(percent==60)assert(r==16);
+ if(percent==100)assert(r==24 && color(HT_THEME_TEXT)==ht_rgb(HT_THEME_TEXT));
+ }
+ puts("Brightness: 256 stored levels, 2048 control/save/reload cycles; bounded, monotonic, exact presets and neutral canvas at all 101 percentages PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-brightness-') as directory:
+ out=Path(directory)
+ (out/'test.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ '-I',str(here / '../main/ui/habitat'),str(out/'test.c'),'-o',str(out/'test')],check=True)
+ subprocess.run([str(out/'test')],check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_crc.py b/devices/harness-device/firmware/test/test_cable_crc.py
new file mode 100644
index 000000000..cbe6b8f4e
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_crc.py
@@ -0,0 +1,85 @@
+"""Verify the CRC candidates against the wire implementation and Espressif source.
+
+The native SDK function is Espressif's software implementation of the ROM API;
+the physical diagnostic checks the actual ROM entry point separately.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+here = Path(__file__).resolve().parent
+idf = Path(os.environ['IDF_PATH'])
+source = (here / '../main/ui/habitat/transport_bench.c').read_text()
+
+
+def function(name):
+ match = re.search(r'^static uint16_t ' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match[0] + '\n'
+
+
+code = r'''
+#include "cable_frame.h"
+#include "esp_rom_crc.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+''' + function('crc_nibble') + function('crc_rom') + r'''
+static uint32_t rng = 0x71829345;
+static uint32_t random_word(void) {
+ rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5; return rng;
+}
+static unsigned checks;
+static void check(const uint8_t *p, size_t len) {
+ uint16_t old = cable_crc16(p, len);
+ assert(crc_nibble(p, len) == old);
+ assert(crc_rom(p, len) == old);
+ checks++;
+}
+int main(void) {
+ assert(crc_rom((const uint8_t *)"123456789", 9) == 0x29b1);
+ assert(crc_nibble((const uint8_t *)"123456789", 9) == 0x29b1);
+ check(NULL, 0);
+ uint8_t pair[2];
+ for (unsigned value = 0; value < 256; value++) {
+ pair[0] = value; check(pair, 1);
+ }
+ for (unsigned value = 0; value < 65536; value++) {
+ pair[0] = value >> 8; pair[1] = value; check(pair, 2);
+ }
+ size_t page = (size_t)sysconf(_SC_PAGESIZE);
+ size_t size = ((CABLE_MAX_PAYLOAD + 4 + page - 1) / page) * page;
+ uint8_t *guard = mmap(NULL, size + page, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+ assert(guard != MAP_FAILED);
+ assert(mprotect(guard + size, page, PROT_NONE) == 0);
+ for (size_t i = 0; i < size; i++) guard[i] = (uint8_t)random_word();
+ for (size_t len = 0; len <= CABLE_MAX_PAYLOAD + 4; len++)
+ check(guard + size - len, len);
+ for (unsigned i = 0; i < 10000; i++) {
+ size_t len = random_word() % 513;
+ for (size_t j = 0; j < len; j++) guard[size - len + j] = (uint8_t)random_word();
+ check(guard + size - len, len);
+ }
+ assert(munmap(guard, size + page) == 0);
+ printf("CRC: PASS (%u comparisons; all one/two-byte inputs, every legal frame length, guarded reads, SDK ROM semantics)\n", checks);
+}
+'''
+
+with tempfile.TemporaryDirectory(prefix='harness-crc-') as directory:
+ root = Path(directory)
+ (root / 'test.c').write_text(code)
+ # Compile the SDK's software fallback, rather than duplicating its algorithm.
+ (root / 'esp_rom_caps.h').write_text('#define ESP_ROM_HAS_CRC_BE 0\n#define ESP_ROM_HAS_CRC_LE 0\n')
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(root), '-I', str(here / '../main'),
+ '-I', str(idf / 'components/esp_rom/include'),
+ str(root / 'test.c'), str(here / '../main/cable_frame.c'),
+ str(idf / 'components/esp_rom/patches/esp_rom_crc.c'),
+ '-o', str(root / 'test')], check=True)
+ subprocess.run([str(root / 'test')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_features.c b/devices/harness-device/firmware/test/test_cable_features.c
new file mode 100644
index 000000000..30d647e53
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_features.c
@@ -0,0 +1,51 @@
+#include "cable_features.h"
+#include "cJSON.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static unsigned allocations;
+static void *allocate(size_t bytes) { allocations++; return malloc(bytes); }
+static void check(const char *json, uint32_t expected)
+{
+ cJSON *welcome = cJSON_Parse(json);
+ assert(welcome);
+ unsigned before = allocations;
+ assert(cable_features_parse(welcome) == expected);
+ assert(allocations == before);
+ cJSON_Delete(welcome);
+}
+int main(void)
+{
+ cJSON_Hooks hooks = {.malloc_fn=allocate, .free_fn=free};
+ cJSON_InitHooks(&hooks);
+ assert(!cable_features_parse(NULL));
+ check("{}", 0);
+ check("{\"features\":null}", 0);
+ check("{\"features\":true}", 0);
+ check("{\"features\":\"form\"}", 0);
+ check("{\"features\":[]}", 0);
+ check("{\"features\":[\"form\",\"form\",\"future\"]}", CABLE_FEATURE_FORM);
+ check("{\"features\":[\"Form\",\"FORM\",\"form.2\"]}", 0);
+ check("{\"features\":[\"form\",null]}", 0);
+ check("{\"features\":[\"form\",{}]}", 0);
+ check("{\"features\":[\"form\",[\"visit\"]]}", 0);
+ check("{\"features\":[\"agents.refresh\"]}", CABLE_FEATURE_AGENTS_REFRESH);
+ static const char *names[] = {"form", "selection", "visit", "voice.draft", "question.review", "agents.refresh"};
+ for (unsigned mask=0; mask<64; mask++) {
+ cJSON *root=cJSON_CreateObject(), *array=cJSON_AddArrayToObject(root,"features");
+ assert(root && array);
+ for (unsigned i=0;i<6;i++) if (mask & (1u<<i))
+ assert(cJSON_AddItemToArray(array,cJSON_CreateString(names[i])));
+ assert(cable_features_parse(root)==mask);
+ cJSON_Delete(root);
+ }
+ cJSON *root=cJSON_CreateObject(), *array=cJSON_AddArrayToObject(root,"features");
+ assert(root && array);
+ for (int i=0;i<16;i++) assert(cJSON_AddItemToArray(array,cJSON_CreateString("form")));
+ assert(cable_features_parse(root)==CABLE_FEATURE_FORM);
+ assert(cJSON_AddItemToArray(array,cJSON_CreateString("form")));
+ assert(cable_features_parse(root)==0);
+ cJSON_Delete(root);
+ puts("host features: PASS (legacy default, 64 combinations, unknown/type/size bounds, no allocations)");
+}
diff --git a/devices/harness-device/firmware/test/test_cable_identity.py b/devices/harness-device/firmware/test/test_cable_identity.py
new file mode 100644
index 000000000..2fc1e6bee
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_identity.py
@@ -0,0 +1,131 @@
+"""Actual roster/catalog handlers with exact production capacities and cJSON.
+
+An overlong opaque identifier must be rejected, never turned into another target.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import MAIN, typedef
+
+source = Path(os.environ.get('CABLE_SOURCE', MAIN/'cable_client.c')).read_text()
+json_dir = Path(os.environ['IDF_PATH'])/'components/json/cJSON'
+
+
+def function(name):
+ match = re.search(r'^[^\n]*\b'+name+r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match[0]+'\n'
+
+
+code = r'''
+#include <limits.h>
+enum { native_name_max = NAME_MAX };
+#include "cable_client.h"
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+_Static_assert(NAME_MAX == native_name_max, "protocol header must not redefine POSIX NAME_MAX");
+_Static_assert(CABLE_NAME_MAX == 40, "wire name capacity must be independent of system headers");
+_Static_assert(sizeof(((project_t *)0)->name) == 40, "UI names retain protocol capacity");
+'''
+code += typedef('cable_agent_t',source)
+code += r'''
+_Static_assert(sizeof(((cable_agent_t *)0)->name) == 40, "roster names retain protocol capacity");
+_Static_assert(sizeof(((cable_agent_t *)0)->machine) == 40, "machine names retain protocol capacity");
+#define portMAX_DELAY 0
+static struct { uint64_t before; cable_agent_t rows[CABLE_MAX_AGENTS]; uint64_t after; } storage;
+static cable_agent_t *s_agents=storage.rows;
+static int s_agents_lock=1,s_agent_count,held;
+static bool s_agents_building=true;
+static int s_models_sem=2,s_models_n,s_models_max;
+static bool s_models_replied;
+static char s_models_agent[ID_MAX]="agent";
+static uint32_t s_models_request=5;
+static model_item_t models[4],*s_models_out=models;
+static unsigned swarm_calls,notice_calls,sem_gives;
+static int swarm_count,notice_count;
+static cable_swarm_t swarms[SWARMS_MAX];
+static cable_notif_t notices[8];
+static char selected[ID_MAX];
+static void xSemaphoreTake(int lock,int delay) { (void)delay;assert(lock==1&&!held);held=1; }
+static void xSemaphoreGive(int lock) { if(lock==1){assert(held);held=0;}else{assert(lock==2);sem_gives++;} }
+static void ui_swarms_replace(const cable_swarm_t *rows,int n,const char *id) {
+ assert(!held&&n>=0&&n<=SWARMS_MAX);swarm_calls++;swarm_count=n;
+ memcpy(swarms,rows,(size_t)n*sizeof *rows);snprintf(selected,sizeof selected,"%s",id?id:"");
+}
+static int tile_count;
+static void ui_tiles_replace(const cable_tile_t *rows,int n,const char *id) {
+ assert(n>=0&&n<=SWARM_TILES_MAX&&!strcmp(selected,id?id:""));tile_count=n;
+ for(int i=0;i<n;i++)assert(rows[i].x1>=0&&rows[i].x2<=1000&&rows[i].x1<rows[i].x2&&
+ rows[i].y1>=0&&rows[i].y2<=1000&&rows[i].y1<rows[i].y2);
+}
+static void ui_notif_replace(const cable_notif_t *rows,int n) {
+ assert(!held&&n>=0&&n<=8);notice_calls++;notice_count=n;memcpy(notices,rows,(size_t)n*sizeof *rows);
+}
+'''
+for name in ['str_of','bool_of','handle_agent','handle_swarms','handle_notifications','handle_models']:
+ code += function(name)
+code += r'''
+static cJSON *object(const char *key,const char *value) {
+ cJSON *p=cJSON_CreateObject();assert(p&&cJSON_AddStringToObject(p,key,value));return p;
+}
+static void add(cJSON *items,const char *key,const char *value) { assert(cJSON_AddItemToArray(items,object(key,value))); }
+static void bounds(void) { assert(!held&&storage.before==0xaabbccdd&&storage.after==0x11223344); }
+int main(void) {
+ storage.before=0xaabbccdd;storage.after=0x11223344;
+ char exact[ID_MAX],longer[ID_MAX+1];memset(exact,'a',sizeof exact-1);exact[sizeof exact-1]=0;
+ snprintf(longer,sizeof longer,"%sx",exact);
+ cJSON *p=object("id",exact);handle_agent(p);cJSON_Delete(p);
+ assert(s_agent_count==1&&!strcmp(s_agents[0].id,exact));bounds();
+ p=object("id",longer);handle_agent(p);cJSON_Delete(p);
+ assert(s_agent_count==1); // formerly a second row aliased the exact ID above
+ p=object("id",exact);handle_agent(p);cJSON_Delete(p);assert(s_agent_count==1);
+ p=object("id","normal");assert(cJSON_AddStringToObject(p,"machineId",longer));
+ assert(cJSON_AddStringToObject(p,"model","a-model-name-beyond-the-old-field-capacity"));
+ handle_agent(p);cJSON_Delete(p);assert(s_agent_count==2);
+ assert(!s_agents[1].machine_id[0]&&!s_agents[1].model[0]);bounds();
+ for(int i=0;i<CABLE_MAX_AGENTS*2;i++) {
+ char id[24];snprintf(id,sizeof id,"row-%d",i);p=object("id",id);handle_agent(p);cJSON_Delete(p);
+ }
+ assert(s_agent_count==CABLE_MAX_AGENTS);bounds();
+ for(int kind=0;kind<2;kind++) {
+ const char *key=kind?"agentId":"id";
+ p=object("selected",longer);cJSON *items=cJSON_AddArrayToObject(p,"items");assert(items);
+ add(items,key,longer);add(items,key,exact);add(items,key,exact);add(items,key,"");add(items,key,"second");
+ if(kind) { handle_notifications(p);assert(notice_count==2&&!strcmp(notices[0].agent_id,exact)); }
+ else { handle_swarms(p);assert(swarm_count==2&&!strcmp(swarms[0].id,exact)&&!selected[0]); }
+ cJSON_Delete(p);bounds();
+ unsigned calls=kind?notice_calls:swarm_calls;
+ p=cJSON_CreateObject();assert(p);
+ if(kind)handle_notifications(p);else handle_swarms(p);
+ assert((kind?notice_calls:swarm_calls)==calls); // missing list cannot clear current state
+ assert(cJSON_AddItemToObject(p,"items",cJSON_CreateObject()));
+ if(kind)handle_notifications(p);else handle_swarms(p);
+ assert((kind?notice_calls:swarm_calls)==calls);
+ assert(cJSON_ReplaceItemInObjectCaseSensitive(p,"items",cJSON_CreateArray()));
+ if(kind){handle_notifications(p);assert(notice_count==0);}else{handle_swarms(p);assert(swarm_count==0);}
+ cJSON_Delete(p);
+ }
+ p=cJSON_Parse("{\"selected\":\"tab\",\"items\":[],\"tiles\":[{\"x1\":0,\"y1\":0,\"x2\":1000,\"y2\":1000},{\"x1\":-1,\"y1\":0,\"x2\":1000,\"y2\":1000},{\"x1\":0,\"y1\":0,\"x2\":1e300,\"y2\":1000},{\"x1\":0,\"y1\":0,\"x2\":10,\"y2\":1e999}]}");
+ assert(p);handle_swarms(p);cJSON_Delete(p);assert(tile_count==1);
+ char profile[sizeof models[0].id],bad_profile[sizeof models[0].id+1];
+ memset(profile,'p',sizeof profile-1);profile[sizeof profile-1]=0;
+ snprintf(bad_profile,sizeof bad_profile,"%sx",profile);
+ p=object("agentId","agent");cJSON *items=cJSON_AddArrayToObject(p,"items");assert(items);
+ add(items,"id",bad_profile);add(items,"id",profile);add(items,"id","second");
+ s_models_max=4;handle_models(p);cJSON_Delete(p);
+ assert(s_models_replied&&sem_gives==1&&s_models_n==2&&!strcmp(models[0].id,profile));bounds();
+ printf("Protocol identities: exact %u-byte targets / %zu-byte profiles, overlong/duplicate rejection, malformed lists preserve state, fixed row bounds PASS\n",ID_MAX-1,sizeof profile-1);
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-identities-') as folder:
+ out=Path(folder);(out/'test.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-Wno-deprecated-declarations','-O1','-g',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),'-I',str(json_dir),'-I',str(MAIN),
+ str(out/'test.c'),str(json_dir/'cJSON.c'),'-o',str(out/'test')],check=True)
+ subprocess.run([str(out/'test')],check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_idle.py b/devices/harness-device/firmware/test/test_cable_idle.py
new file mode 100644
index 000000000..c088b2904
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_idle.py
@@ -0,0 +1,115 @@
+"""Replay interrupted USB reads through the production reader and real decoder."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('CABLE_LINK_SOURCE', main / 'cable_link.c')).read_text()
+reader = re.search(r'static void reader_task\(void \*arg\)\n\{.*?^\}', source, re.M | re.S).group(0)
+defines = '\n'.join(re.findall(r'^#define (?:READ_CHUNK|READ_WAIT_MS|FRAME_IDLE_US) .+$', source, re.M))
+code = r'''
+#include "cable_link.h"
+#include <assert.h>
+#include <setjmp.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#define pdMS_TO_TICKS(x) (x)
+''' + defines + r'''
+typedef struct { const uint8_t *bytes; size_t len; int64_t at; } read_t;
+static read_t reads[80];
+static unsigned read_count, read_at, frames, ticks;
+static int64_t now;
+static jmp_buf done;
+static cable_decoder_t s_decoder;
+static cable_frame_cb s_cb;
+static cable_tick_cb s_tick;
+static void *s_ctx;
+static uint8_t payload[CABLE_MAX_PAYLOAD], frame[CABLE_MAX_FRAME], hello[CABLE_MAX_FRAME];
+static size_t expected_size;
+static const uint8_t *expected;
+static int64_t esp_timer_get_time(void) { return now; }
+static int usb_serial_jtag_read_bytes(uint8_t *out, size_t cap, int wait) {
+ assert(cap == READ_CHUNK && wait == READ_WAIT_MS);
+ if (read_at == read_count) longjmp(done, 1);
+ const read_t r = reads[read_at++];
+ assert(r.len <= cap); now = r.at;
+ if (r.len) memcpy(out, r.bytes, r.len);
+ return (int)r.len;
+}
+static void tick(void *ctx) { assert(!ctx); ticks++; }
+static void collect(uint8_t version, uint8_t type, const uint8_t *p, size_t n, void *ctx) {
+ assert(!ctx && version == CABLE_FRAME_VERSION && type == CABLE_TYPE_JSON);
+ assert(n == expected_size && !memcmp(p, expected, n)); frames++;
+}
+''' + reader + r'''
+static void add(const uint8_t *p, size_t len, int64_t *at, int64_t interval) {
+ while (len) {
+ size_t n = len > READ_CHUNK ? READ_CHUNK : len;
+ assert(read_count < sizeof(reads)/sizeof(reads[0]));
+ reads[read_count++] = (read_t){p,n,*at}; *at += interval; p += n; len -= n;
+ }
+}
+static void reset(void) {
+ read_count = read_at = frames = ticks = 0; now = 0;
+ cable_decoder_init(&s_decoder);
+ s_decoder.corrupt_frames = 7; s_decoder.discarded_bytes = 11;
+ s_cb = collect; s_tick = tick; s_ctx = NULL;
+}
+static void run(void) {
+ if (!setjmp(done)) reader_task(NULL);
+ assert(ticks == read_count && frames == 1 && !s_decoder.len);
+ assert(s_decoder.corrupt_frames == 7 && s_decoder.discarded_bytes == 11);
+}
+int main(void) {
+ // The old incomplete frame claims the maximum legal length. A later short
+ // welcome fits inside that missing payload, so magic/CRC alone cannot rescue it.
+ for (size_t i=0; i<sizeof(payload); i++) payload[i]=(uint8_t)(i*71+9);
+ int frame_n = cable_frame_encode(CABLE_TYPE_JSON,payload,sizeof(payload),frame,sizeof(frame));
+ static const uint8_t greeting[] = "{\"t\":\"welcome\"}";
+ int hello_n = cable_frame_encode(CABLE_TYPE_JSON,greeting,sizeof(greeting)-1,hello,sizeof(hello));
+ assert(frame_n > 0 && hello_n > 0);
+ unsigned checks=0;
+ reset(); int64_t first_at=0;
+ expected=greeting; expected_size=sizeof(greeting)-1;
+ add(frame,CABLE_HEADER_BYTES,&first_at,1000);
+ first_at+=15000000;
+ add(hello,(size_t)hello_n,&first_at,1000);
+ run(); checks++;
+ for (int cut=1; cut<frame_n; cut++) for (int idle=0; idle<2; idle++) {
+ reset(); int64_t at=0;
+ expected=greeting; expected_size=sizeof(greeting)-1;
+ add(frame,(size_t)cut,&at,1000);
+ at += 15000000;
+ if (idle) reads[read_count++]=(read_t){NULL,0,at++};
+ add(hello,(size_t)hello_n,&at,1000);
+ run(); checks++;
+ }
+ // A valid frame may take longer than the timeout in total. Only the gap
+ // between reads matters; every fragment just below 15 seconds stays intact.
+ for (int cut=1; cut<frame_n; cut++) {
+ reset(); int64_t at=(INT64_C(1)<<32)-20;
+ expected=payload; expected_size=sizeof(payload);
+ add(frame,(size_t)cut,&at,14999999);
+ add(frame+cut,(size_t)(frame_n-cut),&at,14999999);
+ run(); checks++;
+ }
+ // Idle before the first welcome and repeated empty reads are ordinary.
+ reset(); int64_t at=90000000;
+ reads[read_count++]=(read_t){NULL,0,0};
+ reads[read_count++]=(read_t){NULL,0,at};
+ expected=greeting; expected_size=sizeof(greeting)-1;
+ add(hello,(size_t)hello_n,&at,1000);run();checks++;
+ printf("cable idle: PASS (%u production-reader traces; every interrupted-frame cut, idle/read-gap recovery, slow valid fragments, 64-bit clock and retained counters)\n",checks);
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-idle-') as d:
+ root = Path(d)
+ (root / 'idle.c').write_text(code)
+ subprocess.run(['cc', '-std=gnu11', '-Wall', '-Wextra', '-Werror', '-Wno-unused-function', '-O1',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(main), str(root / 'idle.c'), str(main / 'cable_frame.c'),
+ '-o', str(root / 'idle')], check=True)
+ subprocess.run([str(root / 'idle')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_json_guard.c b/devices/harness-device/firmware/test/test_cable_json_guard.c
new file mode 100644
index 000000000..915ad6199
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_json_guard.c
@@ -0,0 +1,62 @@
+#include "../main/cable_json_guard.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+static bool valid(const char *s) { return cable_json_guard((const uint8_t *)s, strlen(s)); }
+int main(void)
+{
+ assert(valid("{}") && valid(" \n{\"t\":\"ping\"}\r\t "));
+ assert(valid("{\"p\":{\"items\":[{\"name\":\"braces [ } and \\\" quotes\"}]}}"));
+ assert(!valid("") && !valid("[]") && !valid("null"));
+ assert(!valid("{}{}") && !valid("{}garbage") && !valid("{]"));
+ assert(!valid("{\"p\": [}") && !valid("{\"p\":\"unterminated}"));
+ assert(!valid("{\"p\":\"literal\nnewline\"}"));
+ const uint8_t nul[] = {'{','}',0,'{','}'};
+ assert(!cable_json_guard(nul, sizeof nul));
+ char nested[CABLE_JSON_MAX + 1];
+ for (unsigned depth = 1; depth < 1000; depth++) {
+ size_t n = 0; nested[n++] = '{'; nested[n++] = '"'; nested[n++] = 'a';
+ nested[n++] = '"'; nested[n++] = ':';
+ for (unsigned j = 1; j < depth; j++) nested[n++] = '[';
+ nested[n++] = '0';
+ for (unsigned j = 1; j < depth; j++) nested[n++] = ']';
+ nested[n++] = '}';
+ assert(cable_json_guard((const uint8_t *)nested, n) == (depth <= CABLE_JSON_DEPTH));
+ }
+ memset(nested, ' ', sizeof nested); nested[0] = '{'; nested[1] = '}';
+ assert(cable_json_guard((const uint8_t *)nested, CABLE_JSON_MAX - 1));
+ assert(!cable_json_guard((const uint8_t *)nested, CABLE_JSON_MAX));
+ assert(!cable_json_guard(NULL, 1));
+
+ for (unsigned values=CABLE_JSON_TOKENS-3; values<=CABLE_JSON_TOKENS-2; values++) {
+ size_t n=(size_t)snprintf(nested,sizeof nested,"{\"a\":[");
+ for(unsigned i=0;i<values;i++) n+=(size_t)snprintf(nested+n,sizeof nested-n,"%s0",i ? "," : "");
+ n+=(size_t)snprintf(nested+n,sizeof nested-n,"]}");
+ assert(cable_json_guard((const uint8_t *)nested,n)==(values+3<=CABLE_JSON_TOKENS));
+ }
+
+ // The received frame ends immediately before an inaccessible page. A missing
+ // terminator or truncated escape must never cause a read into the next frame.
+ size_t page = (size_t)sysconf(_SC_PAGESIZE);
+ size_t window = (CABLE_JSON_MAX + page - 1) / page * page;
+ uint8_t *map = mmap(NULL, window + 2 * page, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ assert(map != MAP_FAILED && !mprotect(map + page, window, PROT_READ | PROT_WRITE));
+ uint32_t seed = 0x3246524d;
+ static const char alphabet[] = "{}[]\\\" :,01x\n\t";
+ for (unsigned trial = 0; trial < 100000; trial++) {
+ seed = seed * 1664525u + 1013904223u;
+ size_t n = seed % CABLE_JSON_MAX;
+ uint8_t *p = map + page + window - n;
+ for (size_t j = 0; j < n; j++) {
+ seed = seed * 1664525u + 1013904223u;
+ p[j] = (uint8_t)alphabet[seed % (sizeof alphabet - 1)];
+ }
+ if (n > 1 && trial % 2) { p[0] = '{'; p[n - 1] = '}'; }
+ (void)cable_json_guard(p, n);
+ }
+ assert(!munmap(map, window + 2 * page));
+ puts("JSON guard: exact depth/size limits, escapes, NUL/trailing data, 100000 guarded frames PASS");
+}
diff --git a/devices/harness-device/firmware/test/test_cable_json_parse.py b/devices/harness-device/firmware/test/test_cable_json_parse.py
new file mode 100644
index 000000000..9f3c50c73
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_json_parse.py
@@ -0,0 +1,154 @@
+"""Exercise the actual USB callback against ESP-IDF's real cJSON, including OOM.
+
+Set IDF_PATH to the ESP-IDF checkout used to build the firmware. This is separate
+from the dependency-free native suite so that suite still runs without an SDK.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+json_dir = Path(os.environ['IDF_PATH']) / 'components/json/cJSON'
+source = (main / 'cable_client.c').read_text()
+match = re.search(r'^static void on_frame\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+assert match
+code = r'''
+#include "cJSON.h"
+#include "cable_json_guard.h"
+#include <assert.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <sys/mman.h>
+#include <unistd.h>
+static int64_t s_last_rx_us, clock_us = 123;
+static uint32_t s_bad,s_unknown;
+static unsigned handled, alloc_calls, live, fail_at, fw_slices;
+static int last_number;
+static size_t allocated_bytes, peak_bytes;
+typedef union { max_align_t alignment; size_t bytes; } allocation_header;
+static void *allocate(size_t n) {
+ if (++alloc_calls == fail_at) return NULL;
+ allocation_header *p = malloc(sizeof *p + n);
+ if (!p) return NULL;
+ p->bytes=n;live++;allocated_bytes+=n;
+ if(allocated_bytes>peak_bytes)peak_bytes=allocated_bytes;
+ return p+1;
+}
+static void deallocate(void *p) {
+ if(p) { allocation_header *h=(allocation_header *)p-1; assert(live && allocated_bytes>=h->bytes);
+ live--;allocated_bytes-=h->bytes;free(h); }
+}
+static int64_t esp_timer_get_time(void) { return clock_us; }
+static void fw_update_slice(const uint8_t *p,size_t n) { (void)p; (void)n; fw_slices++; }
+static void handle_message(const cJSON *root) {
+ assert(cJSON_IsObject(root)); handled++;
+ const cJSON *v = cJSON_GetObjectItemCaseSensitive(root,"n");
+ if (v) last_number = v->valueint;
+}
+'''
+code += match.group(0)
+code += r'''
+static void send_text(const char *s,bool accepted) {
+ unsigned before = handled;
+ on_frame(1,CABLE_TYPE_JSON,(const uint8_t *)s,strlen(s),NULL);
+ assert(handled == before + accepted && live == 0 && allocated_bytes==0);
+}
+int main(void) {
+ cJSON_Hooks hooks = {.malloc_fn = allocate,.free_fn = deallocate}; cJSON_InitHooks(&hooks);
+ send_text("{\"t\":\"ping\"}",true); assert(s_last_rx_us == clock_us);
+ send_text(" \r\n{\"t\":\"welcome\",\"p\":{\"machine\":{\"id\":\"host\",\"name\":\"M2\"}}} \t",true);
+ send_text("{\"t\":\"question\",\"p\":{\"questions\":[{\"options\":[{\"label\":\"Start\"}]}]}}",true);
+ send_text("{\"n\":1e999}",true); assert(last_number == INT_MAX);
+ send_text("{\"n\":-1e999}",true); assert(last_number == INT_MIN);
+ send_text("{\"n\":2.5}",true); assert(last_number == 2);
+ send_text("{\"text\":\"\\\\ \\\" {} [] \\u263a\"}",true);
+ int64_t last = s_last_rx_us; clock_us += 1000;
+ send_text("{}{}",false); send_text("{}garbage",false); send_text("{}\v",false);
+ send_text("{bad}",false); send_text("{\"t\":]}",false); send_text("[]",false);
+ send_text("{\"t\":\"bad\nstring\"}",false);
+ const uint8_t nul[] = {'{','}',0,'x'};
+ unsigned before = handled;
+ on_frame(1,CABLE_TYPE_JSON,nul,sizeof nul,NULL);
+ assert(handled == before && last == s_last_rx_us);
+ // A rejected depth never enters cJSON or allocates.
+ char deep[2048]; size_t n=0; deep[n++]='{'; deep[n++]='"'; deep[n++]='a'; deep[n++]='"';deep[n++]=':';
+ for(int j=0;j<900;j++)deep[n++]='[';
+ deep[n++]='0';for(int j=0;j<900;j++)deep[n++]=']';deep[n++]='}';deep[n]=0;
+ unsigned allocated=alloc_calls;send_text(deep,false);assert(allocated==alloc_calls);
+ const char *message="{\"t\":\"swarms\",\"items\":[{\"id\":\"a\",\"name\":\"long name\",\"panes\":2},{\"id\":\"b\"}]}";
+ allocated=alloc_calls;send_text(message,true);unsigned count=alloc_calls-allocated;
+ // Every individual allocation failure must free its already-built subtree.
+ for(unsigned j=1;j<=count;j++) { fail_at=alloc_calls+j;send_text(message,false); }
+ fail_at=0;send_text(message,true);
+ // Eight perfectly ordinary unread cards exceed the old 2 KiB JSON copy.
+ char batch[CABLE_JSON_MAX+1], summary[181], name[40], machine[33];
+ memset(summary,'s',180);summary[180]=0;memset(name,'n',39);name[39]=0;
+ memset(machine,'m',32);machine[32]=0;
+ n=(size_t)snprintf(batch,sizeof batch,"{\"t\":\"notif.replace\",\"items\":[");
+ for(int i=0;i<8;i++)n+=(size_t)snprintf(batch+n,sizeof batch-n,
+ "%s{\"agentId\":\"12345678-1234-1234-1234-%012d\",\"name\":\"%s\",\"machine\":\"%s\",\"summary\":\"%s\",\"question\":false}",
+ i ? "," : "",i,name,machine,summary);
+ n+=(size_t)snprintf(batch+n,sizeof batch-n,"]}");
+ assert(n>2048 && n<CABLE_JSON_MAX);send_text(batch,true);
+ allocated=alloc_calls;send_text(batch,true);count=alloc_calls-allocated;
+ for(unsigned j=1;j<=count;j++){fail_at=alloc_calls+j;send_text(batch,false);}
+ fail_at=0;
+ // The exact wire maximum is valid; one extra byte is refused before allocation.
+ n=(size_t)snprintf(batch,sizeof batch,"{\"text\":\"");
+ while(n<CABLE_MAX_PAYLOAD-2) { batch[n++]='a'; }
+ batch[n++]='"';batch[n++]='}';batch[n]=0;
+ assert(n==CABLE_MAX_PAYLOAD);send_text(batch,true);
+ batch[n++]=' ';batch[n]=0;allocated=alloc_calls;send_text(batch,false);assert(allocated==alloc_calls);
+ for(unsigned values=CABLE_JSON_TOKENS-3;values<=CABLE_JSON_TOKENS-2;values++) {
+ n=(size_t)snprintf(batch,sizeof batch,"{\"a\":[");
+ for(unsigned i=0;i<values;i++)n+=(size_t)snprintf(batch+n,sizeof batch-n,"%s0",i ? "," : "");
+ n+=(size_t)snprintf(batch+n,sizeof batch-n,"]}");
+ allocated=alloc_calls;send_text(batch,values+3<=CABLE_JSON_TOKENS);
+ if(values+3>CABLE_JSON_TOKENS)assert(allocated==alloc_calls);
+ }
+ assert(peak_bytes<=CABLE_JSON_MAX+CABLE_JSON_TOKENS*sizeof(cJSON));
+ printf("USB JSON bounded peak: %zu bytes (host cJSON nodes are %zu bytes)\n",peak_bytes,sizeof(cJSON));
+ size_t page=(size_t)sysconf(_SC_PAGESIZE);
+ uint8_t *map=mmap(NULL,3*page,PROT_NONE,MAP_PRIVATE|MAP_ANON,-1,0);
+ assert(map!=MAP_FAILED&&!mprotect(map+page,page,PROT_READ|PROT_WRITE));
+ const char *samples[]={"{}","{\"t\":\"ping\"}","{\"p\":[1,2,3]}","{\"x\":\"\\u","{\"x\":1e","{\"x\":true","{\"p\":{}}"};
+ for(unsigned j=0;j<sizeof samples/sizeof *samples;j++) {
+ for(size_t len=0;len<=strlen(samples[j]);len++) {
+ uint8_t *p=map+2*page-len;memcpy(p,samples[j],len);
+ on_frame(1,CABLE_TYPE_JSON,p,len,NULL);assert(!live);
+ }
+ }
+ uint32_t seed=0x12347;static const char alphabet[]="{}[]\\\" :,01truefx\n\t";
+ for(unsigned j=0;j<100000;j++) {
+ seed=seed*1664525u+1013904223u;size_t len=seed%512;
+ uint8_t *p=map+2*page-len;
+ for(size_t k=0;k<len;k++){seed=seed*1664525u+1013904223u;p[k]=alphabet[seed%(sizeof alphabet-1)];}
+ if(len>1){p[0]='{';p[len-1]='}';}
+ on_frame(1,CABLE_TYPE_JSON,p,len,NULL);assert(!live);
+ }
+ assert(!munmap(map,3*page));
+ on_frame(1,9,NULL,0,NULL);assert(s_unknown==1);
+ on_frame(1,CABLE_TYPE_FW,NULL,0,NULL);assert(fw_slices==1);
+ puts("USB JSON: real cJSON, guarded/truncated frames, 100000 mutations, every allocation failure PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-json-') as folder:
+ out = Path(folder)
+ (out / 'parse.c').write_text(code)
+ flags = ['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds')]
+ # Apple's SDK deprecates sprintf; this warning is in unmodified cJSON, not
+ # the firmware callback. Keep strict diagnostics on our own sources.
+ subprocess.run(flags + ['-Wno-deprecated-declarations', '-c', str(json_dir / 'cJSON.c'),
+ '-o', str(out / 'cJSON.o')], check=True)
+ subprocess.run(flags + [
+ '-I', str(main), '-I', str(json_dir), str(out / 'parse.c'),
+ str(main / 'cable_json_guard.c'), str(out / 'cJSON.o'), '-lm',
+ '-o', str(out / 'parse')], check=True)
+ subprocess.run([str(out / 'parse')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_logging.py b/devices/harness-device/firmware/test/test_cable_logging.py
new file mode 100644
index 000000000..9bab858c5
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_logging.py
@@ -0,0 +1,108 @@
+"""Exercise production log framing while the USB writer is busy or re-enters."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = (main / 'cable_link.c').read_text()
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include "cable_frame.h"
+#include <assert.h>
+#include <stdatomic.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#define LOG_WRITE_WAIT_MS 5
+#define LOG_LINE_MAX 512
+#define pdTRUE 1
+#define pdMS_TO_TICKS(ms) (ms)
+typedef int TickType_t;
+typedef int (*vprintf_like_t)(const char *,va_list);
+static bool isr, lock_busy, recurse, stalled;
+static atomic_bool s_running, s_log_framing;
+static atomic_uint s_dropped_logs;
+static int owner, s_tx_lock=1, taken, plain_calls, framed, installed;
+static uint8_t s_tx_frame[CABLE_MAX_FRAME], wire[8192];
+static size_t wire_bytes;
+static char saved[LOG_LINE_MAX];
+static vprintf_like_t hook;
+static int plain(const char *fmt,va_list args) { (void)fmt; (void)args;plain_calls++;return 1; }
+static _Atomic(vprintf_like_t) s_prev_vprintf=plain;
+static bool xPortInIsrContext(void) { return isr; }
+static int xTaskGetCurrentTaskHandle(void) { return 9; }
+static int xSemaphoreGetMutexHolder(int lock) { assert(lock==1);return owner; }
+static bool xSemaphoreTake(int lock,int wait) {
+ assert(lock==1&&wait==5&&owner!=9);taken++;
+ if(lock_busy)return false;
+ assert(!owner);owner=9;return true;
+}
+static void xSemaphoreGive(int lock) { assert(lock==1&&owner==9);owner=0; }
+static int log_vprintf(const char *fmt,va_list args);
+static int log_line(const char *fmt,...) {
+ va_list args;va_start(args,fmt);int n=log_vprintf(fmt,args);va_end(args);return n;
+}
+static int usb_serial_jtag_write_bytes(const void *p,size_t len,int wait) {
+ assert(owner==9&&wait==5);
+ if(recurse){recurse=false;assert(log_line("recursive driver log")==0);}
+ if(stalled)return 0;
+ assert(wire_bytes+len<=sizeof wire);memcpy(wire+wire_bytes,p,len);wire_bytes+=len;return (int)len;
+}
+static void last_words_add(const char *p,size_t n) { assert(n<sizeof saved);memcpy(saved,p,n);saved[n]=0; }
+static vprintf_like_t esp_log_set_vprintf(vprintf_like_t next) {
+ vprintf_like_t old=hook;hook=next;installed++;return old;
+}
+'''
+code += function('send_locked') + function('log_vprintf') + function('cable_link_set_log_framing')
+code += r'''
+static void received(uint8_t version,uint8_t type,const uint8_t *p,size_t n,void *ctx) {
+ (void)ctx;assert(version==CABLE_FRAME_VERSION&&type==CABLE_TYPE_LOG);
+ if(framed==0){assert(n==7&&!memcmp(p,"hello 7",n));}
+ else if(framed==1){assert(n==5&&!memcmp(p,"outer",n));}
+ else {assert(n==511);for(size_t i=0;i<n;i++)assert(p[i]=='x');}
+ framed++;
+}
+int main(void) {
+ hook=plain;s_running=true;
+ cable_link_set_log_framing(true);assert(hook==log_vprintf&&installed==1);
+ cable_link_set_log_framing(true);assert(installed==1);
+ assert(log_line("hello %d\r\n",7)==9&&!strcmp(saved,"hello 7"));
+ assert(!plain_calls&&!atomic_load(&s_dropped_logs)&&!owner);
+ lock_busy=true;owner=8;assert(!log_line("congested"));assert(!plain_calls);
+ lock_busy=false;owner=9;int before=taken;assert(!log_line("already owns tx"));
+ assert(taken==before);owner=0;
+ isr=true;assert(!log_line("ISR"));assert(taken==before);isr=false;
+ recurse=true;assert(log_line("outer")==5);assert(atomic_load(&s_dropped_logs)==3);
+ stalled=true;before=(int)wire_bytes;assert(log_line("not draining")==12);
+ assert((int)wire_bytes==before&&!plain_calls&&!strcmp(saved,"not draining"));stalled=false;
+ assert(atomic_load(&s_dropped_logs)==4);
+ char long_line[2048];memset(long_line,'x',sizeof long_line-1);long_line[sizeof long_line-1]=0;
+ assert(log_line("%s",long_line)==2047&&strlen(saved)==511);
+ cable_decoder_t decoder;cable_decoder_init(&decoder);
+ cable_decoder_feed(&decoder,wire,wire_bytes,received,NULL);
+ assert(framed==3&&!decoder.corrupt_frames&&!decoder.discarded_bytes);
+ cable_link_set_log_framing(false);assert(hook==plain&&installed==2);
+ // A previously captured hook may still execute after removal on another core.
+ assert(log_line("late callback")==1&&plain_calls==1);
+ cable_link_set_log_framing(false);assert(installed==2);
+ cable_link_set_log_framing(true);assert(hook==log_vprintf&&installed==3);
+ puts("USB logging: bounded contention, same-task recursion, ISR, late hook, truncation; exact framed bytes PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-log-') as folder:
+ out = Path(folder)
+ (out / 'log.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(main), str(out / 'log.c'), str(main / 'cable_frame.c'),
+ '-o', str(out / 'log')], check=True)
+ subprocess.run([str(out / 'log')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_models.py b/devices/harness-device/firmware/test/test_cable_models.py
new file mode 100644
index 000000000..245fb6ae2
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_models.py
@@ -0,0 +1,210 @@
+"""Model-list timeout/reader ownership, with real cJSON and deterministic threads.
+
+Requires IDF_PATH. No USB, microphone, app commands or real four-second sleeps.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import defines, typedef
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('CABLE_MODELS_SOURCE', main / 'cable_client.c')).read_text()
+json_dir = Path(os.environ['IDF_PATH']) / 'components/json/cJSON'
+
+def function(name, optional=False):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ if optional and not match:
+ return ''
+ assert match, name
+ return match.group(0) + '\n'
+
+code = defines('ID_MAX') + typedef('model_item_t') + r'''
+#include "cJSON.h"
+#include <assert.h>
+#include <pthread.h>
+#include <stdarg.h>
+#include <stdatomic.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define MODELS_WAIT_MS 4000
+#define portMAX_DELAY (-1)
+#define pdTRUE 1
+#define pdMS_TO_TICKS(ms) (ms)
+#define ESP_LOGW(...) ((void)0)
+typedef struct { pthread_mutex_t mutex; bool binary; unsigned count; } semaphore_t;
+static semaphore_t data_lock = {.mutex=PTHREAD_MUTEX_INITIALIZER};
+static semaphore_t reply_sem = {.mutex=PTHREAD_MUTEX_INITIALIZER,.binary=true};
+static semaphore_t *s_agents_lock=&data_lock, *s_models_sem=&reply_sem;
+static model_item_t *s_models_out;
+static int s_models_max, s_models_n;
+static char s_models_agent[ID_MAX];
+static uint32_t s_models_request;
+static bool s_models_replied;
+enum { NORMAL, NO_REPLY, SEND_FAIL, RACE, REPLY_FILTER };
+static int mode;
+static cJSON *response;
+static unsigned sends;
+static atomic_uint allocations, live, fail_at;
+static pthread_mutex_t control=PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t progress=PTHREAD_COND_INITIALIZER;
+static bool reader_paused, allow_reader, cleanup_waiting, request_finished;
+static _Thread_local bool request_thread, timed_out, reader_thread;
+static pthread_t reader;
+static void *allocate(size_t n) {
+ if (atomic_fetch_add(&allocations,1)+1==atomic_load(&fail_at)) return NULL;
+ void *p=malloc(n); if(p)atomic_fetch_add(&live,1);return p;
+}
+static void deallocate(void *p) { if(p){assert(atomic_fetch_sub(&live,1)>0);free(p);} }
+static int xSemaphoreTake(semaphore_t *s,int wait) {
+ if(!s->binary) {
+ if(request_thread&&timed_out) {
+ pthread_mutex_lock(&control);cleanup_waiting=true;
+ pthread_cond_broadcast(&progress);pthread_mutex_unlock(&control);
+ }
+ assert(!pthread_mutex_lock(&s->mutex));return pdTRUE;
+ }
+ if(mode==RACE&&wait==MODELS_WAIT_MS) {
+ pthread_mutex_lock(&control);
+ while(!reader_paused)pthread_cond_wait(&progress,&control);
+ timed_out=true;pthread_mutex_unlock(&control);return 0;
+ }
+ assert(!pthread_mutex_lock(&s->mutex));
+ bool got=s->count!=0;if(got)s->count--;
+ assert(!pthread_mutex_unlock(&s->mutex));return got;
+}
+static void xSemaphoreGive(semaphore_t *s) {
+ if(s->binary) {pthread_mutex_lock(&s->mutex);s->count=1;}
+ assert(!pthread_mutex_unlock(&s->mutex));
+}
+static int paused_snprintf(char *out,size_t n,const char *format,...) {
+ va_list args;va_start(args,format);int result=vsnprintf(out,n,format,args);va_end(args);
+ if(reader_thread) {
+ pthread_mutex_lock(&control);
+ if(!reader_paused) {
+ reader_paused=true;pthread_cond_broadcast(&progress);
+ while(!allow_reader)pthread_cond_wait(&progress,&control);
+ }
+ pthread_mutex_unlock(&control);
+ }
+ return result;
+}
+#define snprintf paused_snprintf
+static void handle_models(const cJSON *p);
+static void *deliver(void *arg) {(void)arg;reader_thread=true;handle_models(response);return NULL;}
+static bool send_json(cJSON *root) {
+ assert(root);sends++;
+ const cJSON *id=cJSON_GetObjectItemCaseSensitive(root,"agentId");
+ assert(cJSON_IsString(id)&&!strcmp(id->valuestring,"target-agent"));
+ cJSON_Delete(root);
+ if(mode==REPLY_FILTER) {
+ const char *wrong[]={
+ "{\"agentId\":\"old-agent\",\"items\":[{\"id\":\"wrong\"}]}",
+ "{\"items\":[{\"id\":\"missing target\"}]}",
+ "{\"agentId\":\"target-agent\",\"request\":0,\"items\":[{\"id\":\"stale\"}]}",
+ "{\"agentId\":\"target-agent\",\"request\":\"invalid\",\"items\":[]}",
+ "{\"agentId\":\"target-agent\",\"items\":{\"id\":\"not an array\"}}"
+ };
+ for(unsigned i=0;i<sizeof wrong/sizeof *wrong;i++) {
+ cJSON *late=cJSON_Parse(wrong[i]);assert(late);handle_models(late);cJSON_Delete(late);
+ assert(!reply_sem.count && !s_models_replied && s_models_out[0].id[0]==0x5a);
+ }
+ cJSON *answer=cJSON_Duplicate(response,true);assert(answer);
+ assert(cJSON_AddNumberToObject(answer,"request",s_models_request));
+ handle_models(answer);cJSON_Delete(answer);
+ assert(s_models_replied && reply_sem.count==1 && !strcmp(s_models_out[0].id,"first"));
+ cJSON *duplicate=cJSON_Parse("{\"agentId\":\"target-agent\",\"items\":[{\"id\":\"duplicate\"}]}");
+ handle_models(duplicate);cJSON_Delete(duplicate);
+ assert(!strcmp(s_models_out[0].id,"first"));
+ }
+ if(mode==SEND_FAIL)return false;
+ if(mode==NORMAL)handle_models(response);
+ if(mode==RACE)assert(!pthread_create(&reader,NULL,deliver,NULL));
+ return true;
+}
+'''
+code += function('msg') + function('msg_check', optional=True) + function('msg_string', optional=True) + function('msg_number', optional=True)
+code += function('handle_models') + function('cable_client_models_list')
+code += r'''
+static struct { uint64_t before;model_item_t rows[2];uint64_t after; } output;
+static int request_result;
+static void *request(void *arg) {
+ (void)arg;request_thread=true;
+ request_result=cable_client_models_list("target-agent","models","selected",output.rows,2);
+ pthread_mutex_lock(&control);request_finished=true;
+ pthread_cond_broadcast(&progress);pthread_mutex_unlock(&control);return NULL;
+}
+static void reset_output(void) {
+ assert(!s_models_out);memset(&output,0x5a,sizeof output);
+ output.before=UINT64_C(0xaabb11223344ccdd);output.after=UINT64_C(0xfeed44885500ffee);
+}
+static void canaries(void) {
+ assert(output.before==UINT64_C(0xaabb11223344ccdd));
+ assert(output.after==UINT64_C(0xfeed44885500ffee));
+}
+int main(void) {
+ (void)s_models_agent;(void)s_models_request;(void)s_models_replied;(void)msg_number;
+ assert(s_agents_lock);
+ cJSON_Hooks hooks={.malloc_fn=allocate,.free_fn=deallocate};cJSON_InitHooks(&hooks);
+ response=cJSON_Parse("{\"agentId\":\"target-agent\",\"items\":[{\"id\":\"first\"},{\"id\":\"abcdefghijklmnopqrstuvwxyz0123456789\"},{\"id\":\"overflow\"}]}");
+ assert(response);unsigned retained=atomic_load(&live);
+ mode=REPLY_FILTER;reset_output();
+ assert(cable_client_models_list("target-agent",NULL,NULL,output.rows,2)==2);canaries();
+ assert(!s_models_out && atomic_load(&live)==retained);
+ s_models_request=INT32_MAX;reset_output();
+ assert(cable_client_models_list("target-agent",NULL,NULL,output.rows,2)==2);
+ assert(s_models_request==1);mode=NORMAL;
+ reset_output();unsigned start=atomic_load(&allocations);
+ assert(cable_client_models_list("target-agent","models","selected",output.rows,2)==2);
+ unsigned count=atomic_load(&allocations)-start;
+ assert(!s_models_out&&!strcmp(output.rows[0].id,"first"));
+ assert(!strcmp(output.rows[1].id,"abcdefghijklmnopqrstuvwxyz0123456789"));canaries();
+ assert(atomic_load(&live)==retained);
+ // Every request allocation can fail. No borrowed pointer or partial send survives.
+ for(unsigned i=1;i<=count;i++) {
+ reset_output();unsigned before_sends=sends;
+ atomic_store(&fail_at,atomic_load(&allocations)+i);
+ assert(cable_client_models_list("target-agent","models","selected",output.rows,2)==-1);
+ assert(!s_models_out&&sends==before_sends&&atomic_load(&live)==retained);
+ handle_models(response);assert(output.rows[0].id[0]==0x5a);canaries();
+ }
+ atomic_store(&fail_at,0);
+ for(int m=NO_REPLY;m<=SEND_FAIL;m++) {
+ mode=m;reset_output();
+ assert(cable_client_models_list("target-agent",NULL,NULL,output.rows,2)==-1);
+ assert(!s_models_out);handle_models(response);
+ assert(output.rows[0].id[0]==0x5a);canaries();
+ }
+ // A timeout cannot return while the reader still owns the output buffer.
+ mode=RACE;reset_output();pthread_t caller;
+ assert(!pthread_create(&caller,NULL,request,NULL));
+ pthread_mutex_lock(&control);
+ while(!cleanup_waiting&&!request_finished)pthread_cond_wait(&progress,&control);
+ assert(cleanup_waiting&&reader_paused&&!request_finished);
+ allow_reader=true;pthread_cond_broadcast(&progress);pthread_mutex_unlock(&control);
+ assert(!pthread_join(caller,NULL)&&!pthread_join(reader,NULL));
+ assert(request_result==-1&&!s_models_out);canaries();
+ // Concurrent callers cannot replace another request's output pointer.
+ mode=NORMAL;model_item_t second[2];s_models_out=output.rows;s_models_max=2;
+ unsigned before_sends=sends;
+ assert(cable_client_models_list("target-agent",NULL,NULL,second,2)==-1);
+ assert(s_models_out==output.rows&&sends==before_sends);s_models_out=NULL;
+ reset_output();handle_models(response);assert(output.rows[0].id[0]==0x5a);
+ cJSON_Delete(response);assert(!atomic_load(&live));
+ puts("Model replies: target/request matching, duplicate/type rejection, serial wrap, every allocation failure, timeout/copy overlap and concurrent callers PASS (offline)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-models-') as folder:
+ out = Path(folder)
+ (out / 'models.c').write_text(code)
+ flags = ['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds')]
+ subprocess.run(flags + ['-Wno-deprecated-declarations', '-c', str(json_dir / 'cJSON.c'),
+ '-o', str(out / 'cJSON.o')], check=True)
+ subprocess.run(flags + ['-I', str(json_dir), str(out / 'models.c'), str(out / 'cJSON.o'),
+ '-lm', '-pthread', '-o', str(out / 'models')], check=True)
+ subprocess.run([str(out / 'models')], check=True, timeout=30)
diff --git a/devices/harness-device/firmware/test/test_cable_outbound.py b/devices/harness-device/firmware/test/test_cable_outbound.py
new file mode 100644
index 000000000..d93761644
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_outbound.py
@@ -0,0 +1,175 @@
+"""A failed allocation must never send a partial command. Requires IDF_PATH."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('CABLE_OUTBOUND_SOURCE', main / 'cable_client.c')).read_text()
+json_dir = Path(os.environ['IDF_PATH']) / 'components/json/cJSON'
+
+def function(name, optional=False):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ if not match:
+ match = re.search(r'^[^\n]*\b' + name + r'\([^\n]*\) \{[^\n]*\}$', source, re.M)
+ if optional and not match:
+ return ''
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include "cJSON.h"
+#include "cable_scroll.h"
+#include "cable_features.h"
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <stdatomic.h>
+#define CABLE_TYPE_JSON 1
+#define ESP_LOGI(...) ((void)0)
+typedef enum { CABLE_SCROLL_DOWN,CABLE_SCROLL_MOVE,CABLE_SCROLL_UP } cable_scroll_phase_t;
+static unsigned allocations, live, fail_at, sends;
+static char wire[8192];
+static size_t wire_size;
+static cJSON *answers;
+static bool review=true, fail_send;
+static atomic_uint s_features;
+static void *allocate(size_t n) {
+ if(++allocations==fail_at)return NULL;
+ void *p=malloc(n);if(p)live++;return p;
+}
+static void deallocate(void *p) {if(p){assert(live);live--;free(p);}}
+static bool cable_link_send(uint8_t type,const uint8_t *bytes,size_t n) {
+ assert(type==CABLE_TYPE_JSON&&n<sizeof wire);
+ sends++;memcpy(wire,bytes,n);wire[n]=0;wire_size=n;return !fail_send;
+}
+static void audio_client_copy_upload_id(char *out,size_t n) {snprintf(out,n,"upload-1234");}
+static void audio_client_copy_carry(char *out,size_t n) {snprintf(out,n,"carry-1234");}
+static void audio_client_copy_form(char *out,size_t n,unsigned *revision) {
+ snprintf(out,n,"form-1234");*revision=5;
+}
+static void audio_client_copy_draft(char *out,size_t n,unsigned *revision,bool *append) {
+ snprintf(out,n,"draft-1234");*revision=6;*append=true;
+}
+static void audio_client_copy_question(char *out,size_t n,unsigned *index) {
+ snprintf(out,n,"question-1234");*index=2;
+}
+static void audio_client_copy_search(char *out,size_t n,unsigned *revision) {
+ snprintf(out,n,"search-1234");*revision=7;
+}
+static void audio_client_copy_selection(char *out,size_t n,unsigned *revision) {
+ snprintf(out,n,"selection-1234");*revision=8;
+}
+static bool audio_client_review_requested(void) {return review;}
+'''
+for name in ['cable_client_supports', 'send_json', 'msg']:
+ code += function(name)
+for name in ['msg_check', 'msg_string', 'msg_number', 'msg_bool', 'msg_array', 'msg_item']:
+ code += function(name, optional=True)
+for name in ['select_machine', 'select_swarm', 'send_turn', 'stop_turn', 'send_focus', 'send_open',
+ 'send_scroll', 'answer', 'question_read', 'answer_reviewed', 'agent_update',
+ 'voice_begin', 'carry', 'form', 'visit', 'select_text', 'draft', 'voice_end',
+ 'voice_abort', 'voice_cancel', 'voice_confirm', 'fw_error', 'fw_progress']:
+ code += function('cable_client_' + name)
+code += function('cable_client_request_agents')
+code += r'''
+enum { CASES=25 };
+static void run(unsigned which) {
+ static const uint8_t choices[]={1,2,4,8};
+ static const char drafts[4][48]={"Keep the quoted \"text\".","", "Line 1\nLine 2", "é ↗"};
+ switch(which) {
+ case 0:cable_client_voice_begin("target-agent","goal","en",16000);break;
+ case 1:cable_client_select_machine("machine-1234");break;
+ case 2:cable_client_select_swarm("workspace-1234");break;
+ case 3:cable_client_send_turn("target-agent","A quote: \"yes\". A slash: \\.\nA second line.");break;
+ case 4:cable_client_stop_turn("target-agent");break;
+ case 5:cable_client_send_focus("target-agent");break;
+ case 6:cable_client_send_open("target-agent","question");break;
+ case 7:cable_client_send_scroll(CABLE_SCROLL_UP,-200,1000);break;
+ case 8:cable_client_answer("target-agent","request-1234",answers);break;
+ case 9:cable_client_question_read("target-agent","request-1234");break;
+ case 10:cable_client_answer_reviewed("target-agent","request-1234","token-1234",choices,drafts,4);break;
+ case 11:cable_client_agent_update("target-agent","model-1234","high");break;
+ case 12:cable_client_carry("carry-1234","target-agent","selection-1234",23,4,false);break;
+ case 13:cable_client_form("find-1234",25,"state",4,-1);break;
+ case 14:cable_client_visit("visit-1234",26,"begin","target-agent");break;
+ case 15:cable_client_select_text("target-agent","selection-1234",27,5,"extend",-1,true);break;
+ case 16:cable_client_draft("draft-1234","move",28,6,2);break;
+ case 17:cable_client_voice_end();break;
+ case 18:cable_client_voice_abort("cable interrupted");break;
+ case 19:cable_client_voice_cancel("upload-1234");break;
+ case 20:cable_client_voice_confirm("route-1234","target-agent");break;
+ case 21:cable_client_fw_error("bounded error text");break;
+ case 22:cable_client_fw_progress(UINT32_MAX);break;
+ case 23:cable_client_carry("carry-1234",NULL,NULL,0,0,true);break;
+ case 24:cable_client_voice_begin(NULL,NULL,NULL,16000);break;
+ default:assert(false);
+ }
+}
+int main(void) {
+ cJSON_Hooks hooks={.malloc_fn=allocate,.free_fn=deallocate};cJSON_InitHooks(&hooks);
+ answers=cJSON_Parse("{\"question\":[\"one\",\"two\"]}");assert(answers);
+ unsigned retained=live, failures=0;
+ for(unsigned which=0;which<CASES;which++) {
+ sends=0;unsigned first=allocations;run(which);
+ assert(sends==1&&live==retained);unsigned count=allocations-first;
+ char expected[8192];size_t expected_size=wire_size;memcpy(expected,wire,wire_size+1);
+ for(unsigned i=1;i<=count;i++) {
+ sends=0;fail_at=allocations+i;run(which);failures++;
+ // Either the whole original command or nothing. Never silently lose
+ // the destination, transcript, choice, revision or correlation ID.
+ assert(sends<=1&&live==retained);
+ assert(!sends||(wire_size==expected_size&&!memcmp(wire,expected,wire_size)));
+ }
+ fail_at=0;
+ if(which==0) {
+ cJSON *begin=cJSON_Parse(expected);assert(begin);
+ const cJSON *id=cJSON_GetObjectItemCaseSensitive(begin,"agentId");
+ assert(cJSON_IsString(id)&&!strcmp(id->valuestring,"target-agent"));cJSON_Delete(begin);
+ }
+ }
+ sends=0;cable_client_send_scroll((cable_scroll_phase_t)-1,0,0);
+ cable_client_send_scroll((cable_scroll_phase_t)3,0,0);
+ cable_client_send_scroll((cable_scroll_phase_t)INT_MIN,0,0);
+ cable_client_send_scroll((cable_scroll_phase_t)INT_MAX,0,0);assert(!sends);
+ fail_send=true;assert(!send_json(msg("ping")));assert(live==retained);
+ fail_send=false;
+ // The shipping bridge has agents.list but ignores agents.refresh. Core tab
+ // navigation must work without an optional feature announcement. Check the
+ // actual serialized request, its failure return and every allocation site.
+ for(unsigned mask=0;mask<64;mask++) {
+ atomic_store(&s_features,mask);sends=0;
+ unsigned first=allocations;
+ assert(cable_client_request_agents() && sends==1 && live==retained);
+ unsigned count=allocations-first;
+ const char *expected=(mask&CABLE_FEATURE_AGENTS_REFRESH)
+ ? "{\"t\":\"agents.refresh\"}" : "{\"t\":\"agents.list\"}";
+ assert(!strcmp(wire,expected));
+ for(unsigned i=1;i<=count;i++) {
+ sends=0;fail_at=allocations+i;
+ assert(!cable_client_request_agents() && !sends && live==retained);
+ }
+ fail_at=0;fail_send=true;
+ assert(!cable_client_request_agents() && live==retained);
+ fail_send=false;
+ }
+ puts("Roster request: legacy/modern capability selection, 64 feature combinations, allocation and send failures PASS");
+ cJSON_Delete(answers);assert(!live);
+ printf("Outbound JSON: %u allocation failures across %u real commands; whole messages only, no leaks, invalid scroll enums rejected PASS (offline)\n",failures,CASES);
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-outbound-') as folder:
+ out = Path(folder)
+ (out / 'outbound.c').write_text(code)
+ flags = ['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds')]
+ subprocess.run(flags + ['-Wno-deprecated-declarations', '-c', str(json_dir / 'cJSON.c'),
+ '-o', str(out / 'cJSON.o')], check=True)
+ subprocess.run(flags + ['-I', str(json_dir), '-I', str(main), str(out / 'outbound.c'), str(main / 'cable_scroll.c'), str(out / 'cJSON.o'),
+ '-lm', '-o', str(out / 'outbound')], check=True)
+ subprocess.run([str(out / 'outbound')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_scroll.c b/devices/harness-device/firmware/test/test_cable_scroll.c
new file mode 100644
index 000000000..288d51312
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_scroll.c
@@ -0,0 +1,73 @@
+#include "cable_scroll.h"
+#include "cJSON.h"
+#include <assert.h>
+#include <limits.h>
+#include <pthread.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static unsigned allocations, live;
+static void *allocate(size_t n) { void *p=malloc(n); allocations++; if(p)live++; return p; }
+static void release(void *p) { if(p) { assert(live);live--;free(p); } }
+static char *original(int phase,int dy,int v) {
+ static const char *names[]={"down","move","up"};
+ cJSON *root=cJSON_CreateObject();assert(root);
+ assert(cJSON_AddStringToObject(root,"t","scroll"));
+ assert(cJSON_AddStringToObject(root,"phase",names[phase]));
+ assert(cJSON_AddNumberToObject(root,"dy",dy));
+ if(phase==2)assert(cJSON_AddNumberToObject(root,"v",v));
+ char *out=cJSON_PrintUnformatted(root);cJSON_Delete(root);assert(out);return out;
+}
+static uint32_t rng=0x914819;
+static int random_int(void) {
+ rng^=rng<<13;rng^=rng>>17;rng^=rng<<5;
+ int32_t result;memcpy(&result,&rng,sizeof result);return result;
+}
+static void compare(int phase,int dy,int v) {
+ char *expected=original(phase,dy,v),out[CABLE_SCROLL_JSON_MAX];
+ unsigned count=allocations;
+ size_t n=cable_scroll_encode(out,sizeof out,phase,dy,v);
+ assert(n==strlen(expected)&&!strcmp(out,expected)&&allocations==count);
+ cJSON_free(expected);assert(!live);
+}
+static void *concurrent(void *arg) {
+ unsigned id=(unsigned)(uintptr_t)arg;
+ char first[CABLE_SCROLL_JSON_MAX],next[CABLE_SCROLL_JSON_MAX];
+ size_t n=cable_scroll_encode(first,sizeof first,id%3,(int)id-5,INT_MIN+(int)id);
+ for(unsigned i=0;i<20000;i++) {
+ assert(cable_scroll_encode(next,sizeof next,id%3,(int)id-5,INT_MIN+(int)id)==n);
+ assert(!strcmp(first,next));
+ }
+ return NULL;
+}
+int main(void) {
+ cJSON_Hooks hooks={.malloc_fn=allocate,.free_fn=release};cJSON_InitHooks(&hooks);
+ const int edges[]={INT_MIN,INT_MIN+1,-6000,-1,0,1,6000,INT_MAX-1,INT_MAX};
+ for(int p=0;p<3;p++)for(unsigned i=0;i<sizeof edges/sizeof *edges;i++)
+ for(unsigned j=0;j<sizeof edges/sizeof *edges;j++)compare(p,edges[i],edges[j]);
+ for(unsigned i=0;i<50000;i++)compare(i%3,random_int(),random_int());
+ unsigned baseline_calls[3];
+ for(int p=0;p<3;p++) {
+ unsigned before=allocations;char *s=original(p,0,0);cJSON_free(s);
+ baseline_calls[p]=allocations-before;
+ for(size_t cap=0;cap<=CABLE_SCROLL_JSON_MAX;cap++) {
+ unsigned char guard[CABLE_SCROLL_JSON_MAX+2];memset(guard,0xa7,sizeof guard);
+ char *out=(char*)guard+1;
+ size_t n=cable_scroll_encode(out,cap,p,INT_MIN,INT_MAX);
+ assert(guard[0]==0xa7&&guard[cap+1]==0xa7);
+ for(size_t i=cap+1;i<sizeof guard;i++)assert(guard[i]==0xa7);
+ if(n)assert(n<cap&&out[n]==0);else if(cap)assert(out[0]==0);
+ }
+ }
+ assert(!cable_scroll_encode(NULL,0,0,0,0)&&!cable_scroll_encode(NULL,96,0,0,0));
+ char out[CABLE_SCROLL_JSON_MAX];
+ for(int p=3;p<100;p++){strcpy(out,"before");assert(!cable_scroll_encode(out,sizeof out,p,1,2)&&!out[0]);}
+ assert(!cable_scroll_encode(out,sizeof out,INT_MIN,1,2));
+ cJSON_InitHooks(NULL);pthread_t threads[8];
+ for(uintptr_t i=0;i<8;i++)assert(!pthread_create(&threads[i],NULL,concurrent,(void*)i));
+ for(unsigned i=0;i<8;i++)assert(!pthread_join(threads[i],NULL));
+ printf("Scroll JSON: 50243 exact original messages, every capacity/32-bit edge, 160000 concurrent encodes; allocations %u/%u/%u -> 0 PASS\n",
+ baseline_calls[0],baseline_calls[1],baseline_calls[2]);
+}
diff --git a/devices/harness-device/firmware/test/test_cable_session.py b/devices/harness-device/firmware/test/test_cable_session.py
new file mode 100644
index 000000000..42906d43b
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_session.py
@@ -0,0 +1,174 @@
+"""Run the real connection loops with an adversarial task-start/read schedule."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+client = (main / 'cable_client.c').read_text()
+link = (main / 'cable_link.c').read_text()
+
+def function(source, name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+# Single-writer ownership is part of the contract, not a timing hope.
+assert 'session_down(' not in function(client, 'session_task')
+assert 's_last_rx_us' not in function(client, 'session_task')
+assert 'static int64_t' in client and 'static atomic_bool' in client
+
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdatomic.h>
+#include <setjmp.h>
+#define READ_CHUNK 256
+#define READ_WAIT_MS 100
+#define FRAME_IDLE_US INT64_C(15000000)
+#define SILENCE_MS 15000
+#define READER_STACK 6144
+#define USJ_TX_BUF 2048
+#define USJ_RX_BUF 32768
+#define CABLE_FRAME_VERSION 1
+#define CABLE_MAX_FRAME 8204
+#define CABLE_MAX_AGENTS 4
+#define CABLE_PROTO_VERSION 3
+#define ESP_LOGI(...) ((void)0)
+#define ESP_LOGE(...) ((void)0)
+#define ESP_OK 0
+#define pdPASS 1
+#define pdMS_TO_TICKS(ms) (ms)
+typedef int esp_err_t;
+typedef void (*cable_frame_cb)(uint8_t,uint8_t,const uint8_t *,size_t,void *);
+typedef void (*cable_tick_cb)(void *);
+typedef struct { int tx_buffer_size,rx_buffer_size; } usb_serial_jtag_driver_config_t;
+static bool connected, driver, fail_driver, fail_reader, new_task_ready, s_started;
+typedef void *TaskHandle_t;
+static TaskHandle_t hello_handle;
+static unsigned attempts, fail_at, live, hellos, notifications;
+static atomic_bool s_session, s_running;
+static void *s_tx_lock, *s_agents_lock, *s_models_sem;
+static int s_machines;
+static int64_t now, s_last_rx_us;
+static unsigned read_index, ticks, down_count, frames;
+static int owner;
+static jmp_buf loop_done;
+static cable_frame_cb s_cb;
+static cable_tick_cb s_tick;
+static void *s_ctx;
+typedef struct {size_t len;} decoder_t;
+static decoder_t s_decoder;
+typedef int cable_agent_t;
+static cable_agent_t *s_agents;
+static int64_t esp_timer_get_time(void) { return now; }
+static void fw_update_tick(void) {}
+static void ui_set_connected(bool value) { connected = value; }
+static void session_down(const char *why) {
+ (void)why; assert(owner == 1); down_count++; s_session = false; connected = false;
+}
+'''
+code += function(client, 'session_tick')
+code += r'''
+static void on_frame(uint8_t version,uint8_t type,const uint8_t *p,size_t n,void *ctx) {
+ (void)version; (void)type; (void)p; (void)n; assert(ctx == NULL && owner == 1);
+ frames++; s_last_rx_us = now; s_session = true; connected = true;
+}
+static void cable_decoder_init(decoder_t *d) { d->len = 0; }
+static void cable_decoder_reset(decoder_t *d) { d->len = 0; }
+static void cable_decoder_feed(decoder_t *d,const uint8_t *p,size_t n,cable_frame_cb cb,void *ctx) {
+ (void)d; assert(n == 1); cb(1,1,p,n,ctx);
+}
+static void counted_tick(void *ctx) { ticks++; session_tick(ctx); }
+static int usb_serial_jtag_read_bytes(uint8_t *p,size_t n,int timeout) {
+ assert(n == READ_CHUNK && timeout == 100 && owner == 1);
+ switch (read_index++) {
+ case 0: now = (INT64_C(1) << 32) - 1; p[0] = 0; return 1;
+ case 1: now += 100; return 0; // 32-bit low word rolled over, still connected.
+ case 2: assert(s_session); now += INT64_C(15000001); return -1;
+ case 3: assert(!s_session && down_count == 1); p[0] = 0; return 1;
+ default: assert(s_session && down_count == 1); longjmp(loop_done,1);
+ }
+}
+static bool allocation(void) { return ++attempts != fail_at; }
+static void *tracked_calloc(size_t n,size_t size) {
+ if(!allocation())return NULL;
+ void *p=calloc(n,size);assert(p);live++;return p;
+}
+static void tracked_free(void *p) { if(p){assert(live);live--;free(p);} }
+static void *xSemaphoreCreateMutex(void) { return tracked_calloc(1,1); }
+static void *xSemaphoreCreateBinary(void) { return tracked_calloc(1,1); }
+static void vSemaphoreDelete(void *lock) { assert(lock);tracked_free(lock); }
+static int usb_serial_jtag_driver_install(const usb_serial_jtag_driver_config_t *cfg) {
+ assert(cfg->rx_buffer_size == USJ_RX_BUF);
+ driver = allocation() && !fail_driver; return !driver;
+}
+static void usb_serial_jtag_driver_uninstall(void) { driver = false; }
+static void cable_machines_init(int *m) { *m = 1; }
+static void session_task(void *arg) { (void)arg; }
+static void reader_task(void *arg);
+static int xTaskCreate(void (*task)(void *),const char *name,int stack,void *arg,int priority,void *handle) {
+ (void)name; (void)stack; (void)arg; (void)priority;
+ if(!allocation())return 0;
+ if (task != reader_task) {
+ assert(task == session_task && handle && !hellos);
+ hello_handle=(void *)2;*(TaskHandle_t *)handle=hello_handle;hellos++;return pdPASS;
+ }
+ if (fail_reader) return 0;
+ assert(driver && s_running && s_tick && !connected && s_last_rx_us == now);
+ // A welcome can arrive on the new reader before xTaskCreate returns.
+ owner = 1; s_cb(1,1,NULL,0,s_ctx); owner = 0; new_task_ready = true;
+ return pdPASS;
+}
+static void vTaskDelete(TaskHandle_t task) { assert(task==hello_handle&&hellos);hellos--;hello_handle=NULL; }
+static void xTaskNotifyGive(TaskHandle_t task) {
+ assert(task==hello_handle&&hellos&&s_running&&driver&&new_task_ready);notifications++;
+}
+#define calloc tracked_calloc
+#define free tracked_free
+'''
+code += function(link, 'reader_task')
+code += function(link, 'cable_link_start')
+code += function(client, 'cable_client_start')
+code += r'''
+int main(void) {
+ // Array, both metadata locks, handshake task, transmit lock, driver, reader.
+ // Every startup failure must release all resources and allow a clean retry.
+ for(unsigned failure=1;failure<=7;failure++) {
+ attempts=0;fail_at=failure;
+ assert(!cable_client_start());
+ assert(!s_agents&&!s_agents_lock&&!s_models_sem&&!s_tx_lock&&!s_started);
+ assert(!s_running&&!driver&&!hellos&&!live&&!notifications);
+ }
+ attempts=fail_at=0;
+ now = 91; assert(cable_client_start());
+ assert(new_task_ready && s_running && connected && s_session && notifications==1);
+ unsigned calls=attempts;assert(cable_client_start());assert(calls==attempts&&notifications==1);
+ s_tick = counted_tick; owner = 1;
+ if (!setjmp(loop_done)) reader_task(NULL);
+ assert(ticks == 4 && frames == 3 && down_count == 1);
+ owner = 0; s_running = false; connected = false;
+ vSemaphoreDelete(s_tx_lock);s_tx_lock=NULL;usb_serial_jtag_driver_uninstall();
+ fail_driver = true; assert(!cable_link_start(on_frame,session_tick,NULL));
+ assert(!s_running && !driver && !s_tx_lock);
+ fail_driver = false; fail_reader = true;
+ assert(!cable_link_start(on_frame,session_tick,NULL));
+ assert(!s_running && !driver && !s_tx_lock);
+ free(s_agents);
+ vSemaphoreDelete(s_agents_lock);vSemaphoreDelete(s_models_sem);vTaskDelete(hello_handle);
+ assert(!live&&!hellos);
+ puts("USB session: seven startup failures/retries, idempotence, early welcome, idle/error reads, timeout/reconnect and 64-bit wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-cable-session-') as folder:
+ out = Path(folder)
+ (out / 'session.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ str(out / 'session.c'), '-o', str(out / 'session')], check=True)
+ subprocess.run([str(out / 'session')], check=True)
diff --git a/devices/harness-device/firmware/test/test_cable_transport.c b/devices/harness-device/firmware/test/test_cable_transport.c
new file mode 100644
index 000000000..a6f3501dd
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_transport.c
@@ -0,0 +1,113 @@
+// Original byte-at-a-time parser versus the production parser, including exact
+// emitted bytes, incomplete tails and resynchronization counters after each read.
+#include "cable_frame.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+void reference_decoder_init(cable_decoder_t *d);
+void reference_decoder_reset(cable_decoder_t *d);
+void reference_decoder_feed(cable_decoder_t *d, const uint8_t *data, size_t n,
+ cable_frame_cb cb, void *ctx);
+int reference_frame_encode(uint8_t type, const uint8_t *payload, size_t len,
+ uint8_t *out, size_t capacity);
+
+enum { STREAM_BYTES = 32768, MAX_RECORDS = STREAM_BYTES / 8 };
+typedef struct { size_t length; uint8_t version, type; } record_t;
+typedef struct {
+ record_t records[MAX_RECORDS];
+ uint8_t bytes[STREAM_BYTES];
+ size_t count, used;
+} collected_t;
+static collected_t actual, expected;
+static cable_decoder_t fast, old;
+static uint8_t stream[STREAM_BYTES], payload[CABLE_MAX_PAYLOAD];
+static uint8_t a[CABLE_MAX_FRAME + 16], b[CABLE_MAX_FRAME + 16];
+static uint32_t rng = 0xd00e5193;
+static uint32_t random_word(void)
+{
+ rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5; return rng;
+}
+static void collect(uint8_t version, uint8_t type, const uint8_t *p, size_t n, void *ctx)
+{
+ collected_t *c = ctx;
+ assert(c->count < MAX_RECORDS && n <= sizeof c->bytes - c->used);
+ c->records[c->count++] = (record_t){.length=n, .version=version, .type=type};
+ memcpy(c->bytes + c->used, p, n); c->used += n;
+}
+static void equal(void)
+{
+ assert(fast.len <= sizeof fast.buf && fast.len == old.len);
+ assert(fast.corrupt_frames == old.corrupt_frames);
+ assert(fast.discarded_bytes == old.discarded_bytes);
+ assert(!memcmp(fast.buf, old.buf, fast.len));
+ assert(actual.count == expected.count && actual.used == expected.used);
+ for (size_t i = 0; i < actual.count; i++) {
+ assert(actual.records[i].length == expected.records[i].length);
+ assert(actual.records[i].version == expected.records[i].version);
+ assert(actual.records[i].type == expected.records[i].type);
+ }
+ assert(!memcmp(actual.bytes, expected.bytes, actual.used));
+}
+static void replay(size_t size, unsigned split, bool reset)
+{
+ actual.count = actual.used = expected.count = expected.used = 0;
+ cable_decoder_init(&fast); reference_decoder_init(&old);
+ for (size_t at = 0; at < size;) {
+ size_t n = split == 0 ? size : split == 1 ? 1 : 1 + random_word() % 257;
+ if (n > size - at) n = size - at;
+ reference_decoder_feed(&old, stream + at, n, collect, &expected);
+ cable_decoder_feed(&fast, stream + at, n, collect, &actual);
+ equal();
+ cable_decoder_feed(&fast, NULL, 0, collect, &actual);
+ reference_decoder_feed(&old, NULL, 0, collect, &expected);
+ equal();
+ at += n;
+ if (reset && at > size / 2) {
+ cable_decoder_reset(&fast); reference_decoder_reset(&old); equal(); reset = false;
+ }
+ }
+}
+int main(void)
+{
+ for (size_t i = 0; i < sizeof payload; i++) payload[i] = (uint8_t)random_word();
+ unsigned encodes = 0, streams = 0;
+ for (size_t len = 0; len <= CABLE_MAX_PAYLOAD + 1; len++) {
+ uint8_t type = (uint8_t)random_word();
+ memset(a, 0xcd, sizeof a); memset(b, 0xcd, sizeof b);
+ int an = cable_frame_encode(type, payload, len, a + 8, CABLE_MAX_FRAME);
+ int bn = reference_frame_encode(type, payload, len, b + 8, CABLE_MAX_FRAME);
+ assert(an == bn && !memcmp(a, b, sizeof a)); encodes++;
+ if (an > 0) {
+ memcpy(stream, a + 8, (size_t)an);
+ replay((size_t)an, len % 3, false); streams++;
+ // Refusal must leave every destination byte untouched.
+ memset(a, 0xcd, sizeof a);
+ assert(cable_frame_encode(type, payload, len, a + 8, (size_t)an - 1) == -1);
+ for (size_t i = 0; i < sizeof a; i++) assert(a[i] == 0xcd);
+ }
+ }
+ for (unsigned test = 0; test < 12000; test++) {
+ size_t size = random_word() % 128;
+ for (size_t i = 0; i < size; i++) stream[i] = (uint8_t)random_word();
+ unsigned count = 1 + random_word() % 4;
+ for (unsigned frame = 0; frame < count; frame++) {
+ size_t len = test % 97 == 0 ? CABLE_MAX_PAYLOAD : random_word() % 1025;
+ if (CABLE_HEADER_BYTES + len + CABLE_CRC_BYTES > sizeof stream - size) break;
+ for (size_t i = 0; i < len; i++) payload[i] = (uint8_t)random_word();
+ int n = reference_frame_encode((uint8_t)random_word(), payload, len,
+ stream + size, sizeof stream - size);
+ assert(n > 0);
+ if ((test + frame) % 3 == 0)
+ stream[size + random_word() % (unsigned)n] ^= (uint8_t)(1u << (random_word() % 8));
+ size += (size_t)n;
+ }
+ if (test % 5 == 0 && size > 1) size -= 1 + random_word() % (size / 2);
+ replay(size, test % 3, test % 7 == 0); streams++;
+ }
+ // Dense false headers, oversized lengths and embedded valid frame starts.
+ for (size_t i = 0; i < sizeof stream; i++)
+ stream[i] = (const uint8_t[]){0xa5, 0x48, 1, 3, 0xff, 0xff}[i % 6];
+ for (unsigned split = 0; split < 3; split++) { replay(sizeof stream, split, false); streams++; }
+ printf("transport: PASS (%u exact encodes, %u streams; bulk/byte/random splits, noise, CRC errors, reset and incomplete-tail equivalence)\n", encodes, streams);
+}
diff --git a/devices/harness-device/firmware/test/test_cable_transport.py b/devices/harness-device/firmware/test/test_cable_transport.py
new file mode 100644
index 000000000..0a8741813
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_cable_transport.py
@@ -0,0 +1,25 @@
+"""Run exact wire/parser comparisons with both native and ESP-ROM code paths."""
+from pathlib import Path
+import os
+import subprocess
+import tempfile
+
+here = Path(__file__).resolve().parent
+idf = Path(os.environ['IDF_PATH']) if os.environ.get('IDF_PATH') else None
+with tempfile.TemporaryDirectory(prefix='harness-transport-') as directory:
+ root = Path(directory)
+ flags = ['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(here / '../main')]
+ for mode in ('native', 'rom') if idf else ('native',):
+ sources = [str(here / 'test_cable_transport.c'), str(here / '../main/cable_frame.c'),
+ str(here / 'reference91/cable_frame_ref.c')]
+ extra = []
+ if mode == 'rom':
+ (root / 'esp_rom_caps.h').write_text('#define ESP_ROM_HAS_CRC_BE 0\n#define ESP_ROM_HAS_CRC_LE 0\n')
+ extra = ['-DESP_PLATFORM', '-I', str(root), '-I', str(idf / 'components/esp_rom/include')]
+ sources += [str(idf / 'components/esp_rom/patches/esp_rom_crc.c')]
+ exe = root / mode
+ subprocess.run(flags + extra + sources + ['-o', str(exe)], check=True)
+ print(mode + ' path:', flush=True)
+ subprocess.run([str(exe)], check=True)
diff --git a/devices/harness-device/firmware/test/test_carry.c b/devices/harness-device/firmware/test/test_carry.c
new file mode 100644
index 000000000..bf8ab20fd
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_carry.c
@@ -0,0 +1,39 @@
+#include "../main/ui/habitat/carry.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+static int prepares,cancels;
+static bool busy;
+static bool emit(const ht_carry_command_t *c,void *ctx)
+{
+ (void)ctx;
+ if (busy) return false;
+ if (c->cancel) cancels++;
+ else { prepares++; assert(!strcmp(c->agent,"source") && !strcmp(c->selection,"pick-1") && c->revision==3); }
+ return true;
+}
+static void open_carry(ht_carry_t *c,uint32_t now)
+{ ht_carry_open(c,"carry-1","source","pick-1",3,now,emit,NULL); }
+int main(void)
+{
+ ht_carry_t c={0}; open_carry(&c,100);
+ assert(c.pending && !c.active && prepares==1);
+ uint32_t request=c.request;
+ assert(!ht_carry_reply(&c,"old",request,true,"Source","passage",2,300000,NULL,200));
+ assert(!ht_carry_reply(&c,c.id,request,true,"Source","passage",17,300000,NULL,200));
+ assert(!ht_carry_reply(&c,c.id,request,true,"Source","passage",2,300001,NULL,200));
+ assert(ht_carry_reply(&c,c.id,request,true,"Source","passage",2,300000,NULL,200));
+ assert(c.active && !c.pending && c.rows==2 && !strcmp(c.source,"Source"));
+ assert(!ht_carry_reply(&c,c.id,request,true,"Changed","wrong",1,1000,NULL,210));
+ assert(!ht_carry_tick(&c,300199)); assert(ht_carry_tick(&c,300200));
+ assert(!c.active && c.error[0] && !c.id[0] && cancels==1);
+ ht_carry_close(&c); assert(!c.error[0]);
+ open_carry(&c,UINT32_MAX-1000); request=c.request;
+ assert(!ht_carry_tick(&c,2498)); assert(ht_carry_tick(&c,2499));
+ assert(!c.pending && c.error[0]);
+ assert(!ht_carry_reply(&c,"carry-1",request,true,"Source","late",1,1000,NULL,2500));
+ open_carry(&c,5000); request=c.request; ht_carry_close(&c);
+ assert(!ht_carry_reply(&c,"carry-1",request,true,"Source","late",1,1000,NULL,5001));
+ busy=true; open_carry(&c,6000); assert(!c.pending && !c.active && c.error[0]);
+ printf("carry: frozen identity, bounded TTL, expiry, cancellation, congestion, duplicate/stale replies and wrap passed; state=%zu bytes\n",sizeof c);
+}
diff --git a/devices/harness-device/firmware/test/test_creature_gallery.c b/devices/harness-device/firmware/test/test_creature_gallery.c
new file mode 100644
index 000000000..cb978a137
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_creature_gallery.c
@@ -0,0 +1,113 @@
+#include "../main/ui/habitat/creature_gallery.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+
+static void stroke(ht_gallery_t *g, int x, int y, uint32_t now)
+{
+ ht_gallery_touch(g,true,233,233,now);
+ ht_gallery_touch(g,true,x,y,now+60);
+ ht_gallery_touch(g,false,0,0,now+90); // unreliable UP coordinates, as on hardware
+}
+static void render_file(const ht_scene_t *s, const char *dir, unsigned creature, unsigned mood, unsigned frame)
+{
+ char path[512];
+ snprintf(path,sizeof(path),"%s/%02u-%u-%02u.ppm",dir,creature,mood,frame);
+ FILE *f=fopen(path,"wb"); assert(f);
+ fprintf(f,"P6\n466 466\n255\n");
+ uint16_t line[466];
+ for(int y=0;y<466;y++) {
+ ht_raster(s,(ht_rect_t){0,y,466,1},line);
+ for(int x=0;x<466;x++) {
+ uint16_t p=(uint16_t)((line[x]>>8)|(line[x]<<8));
+ unsigned char rgb[]={(unsigned char)(((p>>11)&31)*255/31),
+ (unsigned char)(((p>>5)&63)*255/63),(unsigned char)((p&31)*255/31)};
+ fwrite(rgb,1,3,f);
+ }
+ }
+ fclose(f);
+}
+int main(int argc, char **argv)
+{
+ ht_gallery_t g; ht_gallery_init(&g,100);
+ assert(g.creature==HT_GALLERY_START);
+ g.creature=0; // Preserve original gesture/reaction traces independently of boot selection.
+ stroke(&g,100,237,1000); assert(g.creature==1 && g.mood==0 && !g.booped);
+ stroke(&g,366,236,2000); assert(g.creature==0);
+ stroke(&g,366,236,3000); assert(g.creature==HT_CREATURES-1); // wrapping
+ g.creature=9;
+ stroke(&g,240,100,4000); assert(g.mood==1 && g.creature==9);
+ stroke(&g,236,366,5000); assert(g.mood==0);
+ stroke(&g,236,366,6000); assert(g.mood==3);
+ stroke(&g,300,300,7000); assert(g.creature==9 && g.mood==3 && !g.booped); // ambiguous diagonal
+ ht_gallery_touch(&g,true,233,233,8000);
+ ht_gallery_touch(&g,true,260,234,8010);
+ ht_gallery_touch(&g,true,233,233,8030);
+ ht_gallery_touch(&g,false,233,233,8050);
+ assert(!g.booped); // returning to the start after a drag is not a tap
+ ht_gallery_touch(&g,true,233,233,9000);
+ ht_gallery_cancel(&g);
+ // Production driver suppresses the rest of the damaged contact. A duplicate
+ // release is harmless; cancellation must not wait for one to arrive.
+ ht_gallery_touch(&g,false,100,233,9100);
+ assert(g.creature==9 && !g.booped && !g.down);
+ ht_gallery_touch(&g,true,233,233,10000);
+ ht_gallery_touch(&g,false,0,0,10040);
+ assert(g.booped);
+ ht_gallery_tick(&g,11641); assert(!g.booped);
+ // Uptime wrap must not strand an animation or a contact.
+ ht_gallery_init(&g,UINT32_MAX-100);
+ g.creature=0;
+ ht_gallery_touch(&g,true,233,233,UINT32_MAX-20);
+ ht_gallery_touch(&g,false,0,0,15); assert(g.booped);
+ ht_gallery_tick(&g,1700); assert(!g.booped);
+
+ uint64_t total=0; unsigned frames=0,max_pixels=0;
+ for(unsigned c=0;c<HT_CREATURES;c++) for(unsigned m=0;m<HT_CREATURE_MOODS;m++) {
+ ht_gallery_init(&g,0);g.creature=c;g.mood=m;
+ ht_scene_t prior,scene; unsigned changes=0;
+ for(unsigned frame=0;frame<320;frame++) {
+ ht_gallery_render(&g,&scene,frame*125);
+ assert(scene.count<=HT_RUNS);
+ for(unsigned i=0;i<scene.count;i++) {
+ const ht_run_t *r=&scene.runs[i];
+ assert(r->x>=0 && r->y>=0 && r->x+r->w<=466 && r->y+r->font->height<=466);
+ const char *p=r->text;
+ unsigned cells=0;
+ while(*p) {
+ uint32_t cp=ht_utf8_next(&p); cells++;
+ assert(cp==' ' || (cp>=r->font->first && cp<=r->font->last));
+ }
+ assert(cells*r->font->width <= (unsigned)r->w);
+ }
+ if(frame) {
+ ht_damage_t d;ht_damage(&prior,&scene,&d);
+ if(d.count) changes++;
+ total+=d.pixels;frames++;
+ if(d.pixels>max_pixels) max_pixels=d.pixels;
+ }
+ if(argc==2 && (frame==0 || (m==2 && frame<12))) render_file(&scene,argv[1],c,m,frame);
+ prior=scene;
+ }
+ assert(changes>=3); // Every creature in every mood is visibly animated.
+ }
+ // Stored-clip input cannot call voice; a tap simply restarts its animation.
+ ht_gallery_init(&g,100);
+ ht_gallery_touch(&g,true,233,233,1000);
+ ht_gallery_touch(&g,false,0,0,1040);
+ assert(g.entered==1040 && !g.booped);
+ ht_scene_t scene;
+ assert(ht_gallery_take(&g,&scene,1040));
+ uint32_t wake=ht_gallery_wake(&g,1040);
+ assert(wake>0 && wake<2000);
+ ht_gallery_tick(&g,1040+wake);
+ assert(ht_gallery_take(&g,&scene,1040+wake));
+ // Last -> first clip and mood changes must not select a null asset.
+ g.creature=HT_CREATURES-1;
+ stroke(&g,100,233,2000); assert(g.creature==0);
+ printf("gallery: %d creatures x 4 modes x 320 frames; supported glyphs, bounded scenes, gestures and timer wrap pass\n",HT_CREATURES);
+ printf("gallery damage: %u samples, mean=%" PRIu64 " px, max=%u px (full=217156)\n",frames,total/frames,max_pixels);
+ return 0;
+}
diff --git a/devices/harness-device/firmware/test/test_damage_bands.c b/devices/harness-device/firmware/test/test_damage_bands.c
new file mode 100644
index 000000000..959fb70d9
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_damage_bands.c
@@ -0,0 +1,66 @@
+// Smaller transfer regions must still produce exactly the fully rendered frame.
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t frame[HT_WIDTH*HT_HEIGHT], full[HT_WIDTH*HT_HEIGHT];
+static uint16_t scratch[HT_WIDTH*HT_HEIGHT+2];
+static uint32_t seed=0xdaba84;
+static unsigned next(void) { seed=seed*1664525u+1013904223u;return seed; }
+static unsigned improved;
+static void transition(const ht_scene_t *a,const ht_scene_t *b)
+{
+ ht_damage_t old,d;
+ ht_damage_banded(false);ht_damage(a,b,&old);
+ ht_damage_banded(true);ht_damage(a,b,&d);
+ if(d.pixels!=old.pixels || d.count!=old.count) {
+ assert(d.pixels+d.count*256u+64<old.pixels+old.count*256u);improved++;
+ }
+ assert(d.count<=HT_DAMAGE_MAX);
+ uint32_t area=0;
+ for(int i=0;i<d.count;i++) {
+ ht_rect_t r=d.rect[i];
+ assert(r.x>=0&&r.y>=0&&r.w>0&&r.h>0&&r.x+r.w<=HT_WIDTH&&r.y+r.h<=HT_HEIGHT);
+ assert(!((r.x|r.y|r.w|r.h)&1));
+ unsigned count=r.w*r.h;area+=count;
+ scratch[0]=0x8411;scratch[count+1]=0x8412;ht_raster(b,r,scratch+1);
+ assert(scratch[0]==0x8411&&scratch[count+1]==0x8412);
+ for(int y=0;y<r.h;y++)memcpy(frame+(r.y+y)*HT_WIDTH+r.x,scratch+1+y*r.w,r.w*sizeof *frame);
+ }
+ assert(area==d.pixels);
+ ht_raster(b,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},full);
+ assert(!memcmp(frame,full,sizeof frame));
+}
+int main(void)
+{
+ ht_scene_t a,b;ht_scene_clear(&a,ht_rgb(0x080c08));transition(NULL,&a);
+ const char *recaps[]={NULL,"Fixed. All checks passed.",
+ "The update is installed. Voice input now sends to the selected agent. The result stays in the center."};
+ for(int i=0;i<768;i++) {
+ ht_tim_face_t f={.recipient=i%2?"Deploy latest firmware":"hn",.status=i%3?"Inbox 2 / Working":"Coalescing",
+ .mood=i%8,.foreground=0xffff,.dim=0x7777,.ink=0xafe0,.straight_title=i%7==0,
+ .pose={.look=i%3-1,.blink=i%11==0,.level=i%5}};
+ ht_scene_clear(&b,a.background);ht_octopus_face(&b,&f,i%HT_OCTOPUS_FRAMES,ht_rgb(0xc8a9f0),recaps[i%3]);
+ transition(&a,&b);a=b;
+ }
+ static const char *labels[]={"","A longer line","x","abc 123", "↗", "café — ready"};
+ for(int trial=0;trial<2000;trial++) {
+ ht_scene_clear(&b,trial%37?a.background:(uint16_t)next());
+ unsigned rows=next()%HT_RUNS;
+ for(unsigned row=0;row<rows;row++) {
+ const ht_font_t *font=next()%2?&ht_mono_16:&ht_mono_20;
+ int x=(int)(next()%550)-40,y=(int)(next()%545)-40,w=1+next()%400;
+ ht_text(&b,x,y,w,font,next(),next()%4?b.background:(uint16_t)next(),labels[next()%6]);
+ }
+ if(trial%5==0)ht_arc_title(&b,0xffff,"A curved title");
+ transition(&a,&b);a=b;
+ }
+ // Forty isolated thin rows force the 24-region budget to coalesce safely.
+ ht_scene_clear(&b,a.background);
+ for(int i=0;i<40;i++)ht_text(&b,(i*31)%360,i*10,60,&ht_octopus_font_2,0xffff,b.background,".:::::::.");
+ transition(&a,&b);a=b;
+ ht_scene_clear(&b,a.background);transition(&a,&b);
+ assert(improved>500);
+ printf("Damage bands: 768 real layout/pose transitions + 2000 overlapping/clipped scenes, region-budget pressure and guarded partial redraws match full frames; %u smaller updates PASS\n",improved);
+}
diff --git a/devices/harness-device/firmware/test/test_damage_delta.c b/devices/harness-device/firmware/test/test_damage_delta.c
new file mode 100644
index 000000000..36c4b0d20
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_damage_delta.c
@@ -0,0 +1,74 @@
+// The ASCII shortcut must produce exactly the original damage rectangles,
+// including UTF-8 aliases, malformed bytes and missing trailing space cells.
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint32_t rng = 0x61ad349b;
+static unsigned next(void) { rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5; return rng; }
+static void compare(const ht_scene_t *a, const ht_scene_t *b)
+{
+ ht_damage_t reference, fast;
+ ht_damage_fast_ascii(false); ht_damage(a, b, &reference);
+ ht_damage_fast_ascii(true); ht_damage(a, b, &fast);
+ assert(!memcmp(&reference, &fast, sizeof fast));
+}
+static void random_text(char *out, size_t capacity)
+{
+ static const char *tokens[] = {" "," ",".","@",":","x","o","*","!","A","z",
+ "—","“","é","↗","█","🐙","\1","\x7f","\xff","\xc2","\xe2\x80","\xf0\x9f"};
+ size_t used = 0;
+ unsigned count = next() % 60;
+ for (unsigned i = 0; i < count; i++) {
+ const char *token = tokens[next() % (sizeof tokens / sizeof tokens[0])];
+ size_t n = strlen(token);
+ if (used + n >= capacity) break;
+ memcpy(out + used, token, n); used += n;
+ }
+ out[used] = 0;
+}
+int main(void)
+{
+ static const uint8_t block_pixels[] = {255,255,255,255};
+ const ht_font_t blocks = {0x2588,0x2588,4,4,block_pixels};
+ const ht_font_t *fonts[] = {&ht_mono_16, &ht_mono_20, &ht_mono_24, &ht_mono_28,
+ &ht_octopus_font_2, &ht_octopus_font_4, &ht_octopus_font_6, &ht_octopus_font_8,
+ &ht_octopus_font_10, &ht_open_20, &blocks};
+ ht_scene_t a, b;
+ for (unsigned trial = 0; trial < 100000; trial++) {
+ uint16_t bg = next();
+ ht_scene_clear(&a, bg); ht_scene_clear(&b, bg);
+ for (unsigned row = 0, count = 1 + next() % 8; row < count; row++) {
+ char before[128], after[128];
+ random_text(before, sizeof before); random_text(after, sizeof after);
+ const ht_font_t *font = fonts[next() % (sizeof fonts / sizeof fonts[0])];
+ int x = (int)(next() % 160) - 40, y = (int)(next() % 460) - 20;
+ int width = 1 + next() % 400;
+ uint16_t fg = next();
+ ht_text(&a, x, y, width, font, fg, bg, before);
+ ht_text(&b, x, y, width, font, fg, bg, after);
+ if (next() % 10 == 0) b.runs[row].x++;
+ if (next() % 10 == 0) b.runs[row].fg++;
+ if (next() % 5 == 0) b.runs[row] = a.runs[row];
+ }
+ compare(&a, &b); compare(&b, &a);
+ compare(NULL, &b); compare(&a, &a);
+ }
+ ht_tim_face_t face = {.recipient = "Firmware", .status = "Coalescing",
+ .mood = HT_TIM_WORKING, .foreground = 0xffff, .dim = 0x7777, .ink = 0xafe0};
+ for (int layout = 0; layout < 4; layout++) {
+ face.focus = layout == 1;
+ const char *recap = layout == 2 ? "Fixed. All checks pass." : layout == 3 ?
+ "The update is installed. Voice input now sends to the selected agent. The result stays in the center." : NULL;
+ ht_scene_clear(&a, 0);
+ for (int frame = 0; frame < HT_OCTOPUS_FRAMES; frame++) {
+ face.pose = (ht_tim_pose_t){.blink = frame % 7 == 0, .level = frame % 5};
+ face.mood = frame % 8; face.unread = frame % 3 == 0;
+ ht_scene_clear(&b, 0);
+ ht_octopus_face(&b, &face, frame, ht_rgb(0xc8a9f0), recap);
+ compare(&a, &b); a = b;
+ }
+ }
+ puts("ASCII damage: 400000 original/fast comparisons + 252 creature transitions; exact rectangles, Unicode aliases and malformed bytes PASS");
+}
diff --git a/devices/harness-device/firmware/test/test_display_power.py b/devices/harness-device/firmware/test/test_display_power.py
new file mode 100644
index 000000000..26e1e61cd
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_display_power.py
@@ -0,0 +1,136 @@
+"""Run the production render loop with deterministic cross-task power interleavings."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+root = Path(__file__).resolve().parent.parent
+path = Path(os.environ.get('DISPLAY_SOURCE', root / 'main/ui/habitat/display_habitat.c'))
+source = path.read_text()
+
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;\n]*\) \{[^\n]*\}', source, re.M)
+ if not match:
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+
+code = r'''
+#include "terminal.h"
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdatomic.h>
+#include <stdio.h>
+#include <string.h>
+#include <setjmp.h>
+static atomic_bool asleep, force_frame;
+static atomic_uint last_activity;
+static ht_scene_t scenes[2];
+static bool painted;
+static void (*power_cb)(bool);
+static uint32_t clock_ms;
+static unsigned frames, ticks, waits, locks, sleeps, wakes, full_frames, notifications;
+static unsigned stop_after;
+static int mode;
+static bool panel_on = true;
+static int panel, render_guard;
+static jmp_buf finished;
+enum { RENDER_MODEL, RENDER_POWER, RENDER_DAMAGE, RENDER_RASTER, RENDER_DMA,
+ RENDER_SUBMIT, RENDER_HEALTH, RENDER_WAIT };
+typedef struct { void (*callback)(void *); const char *name; } esp_timer_create_args_t;
+#define pdTRUE 1
+#define pdMS_TO_TICKS(n) (n)
+#define ESP_ERROR_CHECK(expr) assert((expr) == 0)
+static int esp_task_wdt_add(void *p) { (void)p; return 0; }
+static int esp_task_wdt_reset(void) { return 0; }
+static int esp_timer_create(const esp_timer_create_args_t *a, int *out) {
+ assert(a->callback && a->name); *out=1; return 0;
+}
+static int esp_timer_start_periodic(int timer, int us) { assert(timer && us==1000000); return 0; }
+static void render_watch(void *arg) { (void)arg; }
+static void render_progress(unsigned stage) { assert(stage<=RENDER_WAIT); }
+static uint32_t now_ms(void) { return clock_ms; }
+static void heartbeat(void) {}
+static void habitat_render_notify(void) { notifications++; }
+static void display_wake(void);
+static void display_sleep(void);
+static void display_bump_activity(void);
+static bool display_is_asleep(void) { return atomic_load(&asleep); }
+static void power(bool on) { if(on) wakes++; else sleeps++; }
+static void display_lock(void) {
+ locks++;
+ // Touch wins the model lock while the renderer is waiting to auto-sleep.
+ if (mode==2 && locks==2) display_bump_activity();
+}
+static void display_unlock(void) {}
+static void habitat_tick(void) { ticks++; }
+static bool habitat_scene_take(ht_scene_t *out) { (void)out; return false; }
+static uint32_t habitat_next_wake_ms(void) { return 1000; }
+static int esp_lcd_panel_disp_on_off(int p, bool on) {
+ (void)p; panel_on=on;
+ // Power input arrives after the renderer sampled asleep, during panel OFF.
+ if (!on && mode==1) display_wake();
+ return 0;
+}
+void ht_damage(const ht_scene_t *before, const ht_scene_t *after, ht_damage_t *out) {
+ assert(after); memset(out,0,sizeof *out);
+ if (!before) { out->count=1; out->pixels=HT_WIDTH*HT_HEIGHT; full_frames++; }
+}
+static uint32_t paint(const ht_scene_t *scene, const ht_damage_t *damage) {
+ assert(scene && panel_on && damage->count); frames++; return 0;
+}
+static unsigned ulTaskNotifyTake(int clear, uint32_t timeout) {
+ assert(clear && timeout<=1000);
+ if (++waits==stop_after) longjmp(finished,1);
+ // Normal idle wake follows a quiet/asleep iteration, with no fresh model.
+ if (mode==3 && waits==1) display_wake();
+ return 0;
+}
+'''
+for name in ['elapsed_since', 'display_bump_activity', 'display_sleep', 'display_wake', 'render_task']:
+ code += function(name)
+code += r'''
+static void run(int which, uint32_t now, uint32_t activity, bool sleep, unsigned loops) {
+ mode=which; clock_ms=now; atomic_store(&last_activity,activity);
+ atomic_store(&asleep,sleep); atomic_store(&force_frame,false);
+ memset(scenes,0,sizeof scenes); painted=true; panel_on=true; power_cb=power;
+ frames=ticks=waits=locks=sleeps=wakes=full_frames=notifications=0;
+ stop_after=loops;
+ if (!setjmp(finished)) render_task(NULL);
+ assert(waits==loops);
+}
+int main(void) {
+ // A wake between power sampling and force-frame consumption must survive.
+ run(1,1000,1000,true,2);
+ assert(!display_is_asleep() && panel_on && wakes==1);
+ assert(frames==1 && full_frames==1);
+ // The idle decision must re-check activity once it owns the model lock.
+ run(2,300001,0,false,1);
+ assert(!display_is_asleep() && !sleeps);
+ // Still/quiet screens repaint on wake even when the scene never changes.
+ run(3,1000,1000,true,2);
+ assert(frames==1 && full_frames==1 && panel_on);
+ // Normal idle expiry, the boundary, and the 32-bit uptime wrap.
+ run(0,300001,0,false,1); assert(display_is_asleep() && sleeps==1);
+ run(0,300000,0,false,1); assert(!display_is_asleep() && !sleeps);
+ run(0,100,UINT32_MAX-100,false,1); assert(!display_is_asleep() && !sleeps);
+ run(0,299900,UINT32_MAX-100,false,1); assert(display_is_asleep() && sleeps==1);
+ // Repeated requests are idempotent; no extra callbacks/notifications.
+ unsigned n=notifications, s=sleeps, w=wakes;
+ display_sleep(); assert(notifications==n && sleeps==s);
+ display_wake(); display_wake(); assert(notifications==n+1 && wakes==w+1);
+ puts("Display power: production render-loop wake/repaint and touch/idle races, quiet wake, boundaries and wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-display-power-') as folder:
+ folder = Path(folder)
+ (folder / 'power.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(root / 'main/ui/habitat'), str(folder / 'power.c'),
+ '-o', str(folder / 'power')], check=True)
+ subprocess.run([str(folder / 'power')], check=True)
diff --git a/devices/harness-device/firmware/test/test_draft.c b/devices/harness-device/firmware/test/test_draft.c
new file mode 100644
index 000000000..176cd8865
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_draft.c
@@ -0,0 +1,45 @@
+#include "../main/ui/habitat/draft.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+static bool congested;
+static int commands;
+static ht_draft_command_t sent;
+static bool emit(const ht_draft_command_t *c,void *ctx) { (void)ctx;if(congested)return false;sent=*c;commands++;return true; }
+int main(void)
+{
+ ht_draft_t draft={0};
+ ht_draft_page_t page={.id="one",.revision=1,.active=true,.can_send=true,.position=1,.total=2,.text="Hello"};
+ ht_draft_open(&draft,&page,emit,NULL);
+ assert(!ht_draft_command(&draft,HT_DRAFT_SEND,0,0,100));
+ assert(!ht_draft_command(&draft,HT_DRAFT_UNDO,1,0,100));
+ congested=true;assert(!ht_draft_command(&draft,HT_DRAFT_SEND,1,0,100));assert(!draft.pending);congested=false;
+ assert(ht_draft_command(&draft,HT_DRAFT_MOVE,1,1,100));assert(draft.pending && commands==1);
+ assert(!ht_draft_command(&draft,HT_DRAFT_SEND,1,0,200));
+ assert(!ht_draft_reply(&draft,"other",sent.request,true,&page));
+ assert(!ht_draft_reply(&draft,"one",sent.request+1,true,&page));
+ assert(!ht_draft_tick(&draft,5099));assert(ht_draft_tick(&draft,5100));assert(draft.failed && !draft.pending);
+ assert(!ht_draft_command(&draft,HT_DRAFT_SEND,1,0,5200));
+ assert(!ht_draft_reply(&draft,"one",sent.request,true,&page)); // Timed-out receipt cannot release a newer contact.
+ assert(ht_draft_command(&draft,HT_DRAFT_STATE,1,0,5300));
+ page.revision=2;page.position=2;
+ assert(ht_draft_reply(&draft,"one",sent.request,true,&page));assert(!draft.failed && draft.page.revision==2);
+ page.can_send=false;ht_draft_open(&draft,&page,emit,NULL);
+ assert(!ht_draft_command(&draft,HT_DRAFT_SEND,2,0,5400));
+ page.can_send=true;ht_draft_open(&draft,&page,emit,NULL);
+ assert(ht_draft_command(&draft,HT_DRAFT_SEND,2,0,5400));
+ page.locked=true;strcpy(page.error,"Could not confirm");
+ assert(ht_draft_reply(&draft,"one",sent.request,false,&page));
+ assert(!ht_draft_command(&draft,HT_DRAFT_SEND,2,0,5500));
+ assert(ht_draft_command(&draft,HT_DRAFT_STATE,2,0,5600));page.active=false;
+ assert(ht_draft_reply(&draft,"one",sent.request,true,&page));assert(!draft.page.active);
+ unsigned old=sent.request;
+ page.active=true;page.locked=false;page.error[0]=0;ht_draft_open(&draft,&page,emit,NULL);
+ assert(ht_draft_command(&draft,HT_DRAFT_DISCARD,2,0,5700));assert(sent.request>old);
+ page.active=false;assert(ht_draft_reply(&draft,"one",sent.request,false,&page));assert(!draft.page.active);
+ // Deadline arithmetic remains valid when the millisecond counter wraps.
+ page.active=true;ht_draft_open(&draft,&page,emit,NULL);
+ assert(ht_draft_command(&draft,HT_DRAFT_STATE,2,0,UINT32_MAX-100));
+ assert(!ht_draft_tick(&draft,2000));assert(ht_draft_tick(&draft,4900));
+ printf("draft: PASS (revision/receipt ownership, transport refusal, timeout, recovery, at-most-once send and wraparound); state=%zu bytes\n",sizeof draft);
+}
diff --git a/devices/harness-device/firmware/test/test_draft_ui.py b/devices/harness-device/firmware/test/test_draft_ui.py
new file mode 100644
index 000000000..811128db9
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_draft_ui.py
@@ -0,0 +1,96 @@
+"""Exercise production draft packet validators and callbacks with decoded JSON trees."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+native = Path(__file__).resolve().parent / '../main/ui/habitat'
+source = (native/'ui_habitat.c').read_text()
+def function(name):
+ m=re.search(r'^[^\n]*\b'+name+r'\([^;]*?\)\n\{.*?^\}',source,re.M|re.S)
+ assert m,name
+ return m.group(0)+'\n'
+code=r'''
+#include "terminal.h"
+#include "draft.h"
+#include "carry.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+enum {HOME,DRAFT,DRAFT_OPTIONS,VOICE,MESSAGE};
+typedef struct cJSON {const char *string,*valuestring;int type,valueint;double valuedouble;struct cJSON *child,*next;} cJSON;
+enum {STRING=1,TRUE=2,NUMBER=3};
+static bool cJSON_IsString(const cJSON *v){return v && v->type==STRING;}
+static bool cJSON_IsNumber(const cJSON *v){return v && v->type==NUMBER;}
+static bool cJSON_IsTrue(const cJSON *v){return v && v->type==TRUE;}
+static const cJSON *cJSON_GetObjectItemCaseSensitive(const cJSON *v,const char *key){
+ for(const cJSON *p=v?v->child:NULL;p;p=p->next)if(p->string && !strcmp(p->string,key))return p;return NULL;
+}
+static cJSON object(cJSON *children,int n){for(int i=0;i<n;i++)children[i].next=i+1<n?&children[i+1]:NULL;return(cJSON){.child=children};}
+static ht_draft_t draft;
+static ht_carry_t carry;
+static struct {bool voice_open,voice_waiting,voice_review;int voice_return,view,offset;uint32_t voice_draft_revision;char title[80],message[256];} s;
+static int gesture,changes;
+static uint32_t ms(void){return 1000;}
+static void change(void){changes++;}
+static void input_cancel(void){}
+static void display_lock(void){}
+static void display_unlock(void){}
+static void voice_close(void){s.voice_open=s.voice_waiting=s.voice_review=false;}
+static void view(int v){s.view=v;s.offset=0;}
+static void ht_gesture_guard(int *g,uint32_t t){(void)g;(void)t;}
+static bool draft_emit(const ht_draft_command_t *c,void *ctx){(void)c;(void)ctx;return true;}
+#define COPY(dst,src) snprintf(dst,sizeof(dst),"%s",src)
+'''
+for name in ['copy','question_rows','draft_page','ui_voice_draft','ui_draft_state']:
+ code+=function(name)
+code+=r'''
+#define S(key,v) {.string=key,.type=STRING,.valuestring=v}
+#define N(key,v) {.string=key,.type=NUMBER,.valueint=v,.valuedouble=v}
+#define B(key) {.string=key,.type=TRUE}
+int main(void){
+ cJSON fields[]={S("id","draft-one"),N("revision",1),B("active"),S("text","Keep the API."),S("agentId","a"),
+ N("position",1),N("total",1),S("name","Original recipient"),B("canSend"),B("ok"),S("requestId","draft-1"),B("sent"),S("carryId","quote")};
+ cJSON p=object(fields,sizeof fields/sizeof *fields);
+ ht_draft_page_t page={0};assert(draft_page(&p,&page));assert(page.active && page.can_send && page.revision==1);
+ fields[1].valuedouble=1.5;assert(!draft_page(&p,&page));fields[1].valuedouble=1;
+ fields[5].valueint=fields[5].valuedouble=0;assert(!draft_page(&p,&page));fields[5].valueint=fields[5].valuedouble=1;
+ char oversized[500];memset(oversized,'x',sizeof oversized-1);oversized[sizeof oversized-1]=0;
+ fields[3].valuestring=oversized;assert(!draft_page(&p,&page));fields[3].valuestring="Unicode emoji \xf0\x9f\x90\x88";
+ assert(draft_page(&p,&page) && !page.can_send);fields[3].valuestring="Keep the API.";
+ s.voice_open=s.voice_waiting=true;s.voice_return=HOME;
+ ui_voice_draft(&p);assert(!draft.page.active); // Normal tap-to-send cannot consume a draft reply.
+ s.voice_review=true;ui_voice_draft(&p);
+ assert(draft.page.active && !s.voice_open && s.view==DRAFT && !strcmp(draft.page.name,"Original recipient"));
+ // An edit reply must match both the retained draft and the recording's revision.
+ s.voice_open=s.voice_waiting=s.voice_review=true;s.voice_return=DRAFT;s.voice_draft_revision=1;
+ fields[0].valuestring="wrong";fields[1].valueint=fields[1].valuedouble=2;ui_voice_draft(&p);assert(s.voice_open);
+ fields[0].valuestring="draft-one";fields[3].valuestring="New exact words.";ui_voice_draft(&p);
+ assert(!s.voice_open && draft.page.revision==2 && !strcmp(draft.page.text,"New exact words."));
+ assert(ht_draft_command(&draft,HT_DRAFT_SEND,2,0,1000));
+ char request[32];snprintf(request,sizeof request,"draft-%lu",(unsigned long)draft.request);fields[10].valuestring=request;
+ fields[2].type=0;carry.active=true;strcpy(carry.id,"different");ui_draft_state(&p);
+ assert(!draft.page.active && s.view==HOME && carry.active); // Only the accepted carry is cleared.
+ fields[2].type=TRUE;assert(draft_page(&p,&page));ht_draft_open(&draft,&page,draft_emit,NULL);
+ strcpy(carry.id,"quote");assert(ht_draft_command(&draft,HT_DRAFT_SEND,2,0,1000));
+ snprintf(request,sizeof request,"draft-%lu",(unsigned long)draft.request);fields[2].type=0;ui_draft_state(&p);
+ assert(!draft.page.active && !carry.active);
+ fields[2].type=TRUE;assert(draft_page(&p,&page));ht_draft_open(&draft,&page,draft_emit,NULL);
+ s.view=DRAFT;assert(ht_draft_command(&draft,HT_DRAFT_MOVE,2,1,1000));
+ fields[10].valuestring="draft-0";ui_draft_state(&p);assert(draft.pending);
+ fields[10].valuestring="draft-1junk";ui_draft_state(&p);assert(draft.pending);
+ snprintf(request,sizeof request,"draft-%lu",(unsigned long)draft.request);fields[10].valuestring=request;
+ fields[0].valuestring="different";ui_draft_state(&p);assert(draft.pending);
+ fields[0].valuestring="draft-one";fields[1].valueint=fields[1].valuedouble=3;ui_draft_state(&p);
+ assert(!draft.pending && draft.page.revision==3 && changes>0);
+ puts("draft UI: PASS (production validators/callbacks; bounded text, edit revision, voice ownership, receipt correlation and carry ownership)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-draft-ui-') as d:
+ root=Path(d);(root/'test.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g','-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ '-I',str(native),str(root/'test.c'),str(native/'draft.c'),str(native/'carry.c'),str(native/'terminal.c'),str(native/'fonts.c'),'-o',str(root/'test')],check=True)
+ subprocess.run([str(root/'test')],check=True)
diff --git a/devices/harness-device/firmware/test/test_form.c b/devices/harness-device/firmware/test/test_form.c
new file mode 100644
index 000000000..c887c17b5
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_form.c
@@ -0,0 +1,74 @@
+#include "../main/ui/habitat/form.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static ht_form_command_t last;
+static int sent;
+static bool blocked;
+static bool emit(const ht_form_command_t *c, void *ctx) {
+ (void)ctx;
+ if (blocked) return false;
+ last = *c; sent++; return true;
+}
+static ht_form_page_t page = {.active=true,.enabled=true,.revision=1,.total=4,.position=4,
+ .title="New Harness",.label="New Harness",.action="start"};
+int main(void) {
+ ht_form_t s = {0};
+ assert(ht_form_open(&s,"form-one",100,emit,NULL));
+ assert(s.pending && last.op==HT_FORM_OPEN);
+ assert(!ht_form_command(&s,HT_FORM_ACTIVATE,0,0,101));
+ assert(!ht_form_reply(&s,"wrong",s.request,true,&page,102));
+ assert(!ht_form_reply(&s,"form-one",s.request+1,true,&page,102));
+ assert(ht_form_reply(&s,"form-one",s.request,true,&page,102));
+ assert(!ht_form_command(&s,HT_FORM_ACTIVATE,0,0,103));
+ assert(ht_form_command(&s,HT_FORM_ACTIVATE,1,0,103));
+ assert(last.op==HT_FORM_ACTIVATE);
+ assert(!ht_form_command(&s,HT_FORM_ACTIVATE,1,0,104));
+ page.busy=true; page.enabled=false; page.revision=2;
+ assert(ht_form_reply(&s,"form-one",s.request,true,&page,104));
+ assert(!ht_form_command(&s,HT_FORM_ACTIVATE,2,0,105));
+ int n=sent; ht_form_move(&s,200,106); assert(n==sent && !s.queued);
+ ht_form_tick(&s,405); assert(s.pending && last.op==HT_FORM_STATE);
+ page.busy=false; page.enabled=true; page.revision=3;
+ ht_form_reply(&s,"form-one",s.request,true,&page,406);
+ ht_form_move(&s,125,407); assert(last.op==HT_FORM_MOVE && last.delta==2);
+ for (int i=0;i<100;i++) ht_form_move(&s,460,407+i);
+ assert(s.queued==8); page.revision++;
+ ht_form_reply(&s,"form-one",s.request,true,&page,510);
+ assert(last.op==HT_FORM_MOVE && last.delta==8 && !s.queued);
+ page.revision++;
+ ht_form_reply(&s,"form-one",s.request,true,&page,511);
+ blocked=true; n=sent; ht_form_move(&s,80,512);
+ assert(s.queued && !s.pending && sent==n);
+ blocked=false; ht_form_tick(&s,513); assert(s.pending && last.op==HT_FORM_MOVE);
+ assert(ht_form_tick(&s,4014) && s.failed && !s.pending && !s.queued);
+ // Timeout does not retry the launch/move; only a new explicit read/open.
+ n=sent; ht_form_tick(&s,8000); assert(sent==n);
+ assert(ht_form_command(&s,HT_FORM_OPEN,s.page.revision,0,8001));
+ page.revision++;
+ ht_form_reply(&s,"form-one",s.request,false,&page,8002);
+ assert(!s.failed && !s.queued); // stale-choice reply presents the new choice
+ uint32_t old=s.request; ht_form_reset(&s);
+ assert(ht_form_open(&s,"form-two",UINT32_MAX-100,emit,NULL));
+ assert(s.request>old && !ht_form_tick(&s,1500));
+ assert(ht_form_tick(&s,3499));
+ assert(!ht_form_reply(&s,"form-two",s.request,true,&page,3500));
+ assert(ht_form_command(&s,HT_FORM_OPEN,0,0,3501));
+ page.active=false;
+ assert(ht_form_reply(&s,"form-two",s.request,true,&page,3502) && !s.id[0]);
+ // Back is a local escape from an opening Finder, even with a lost reply
+ // or a full cable queue. Neither the open reply nor close reply revives it.
+ page.active=true;
+ assert(ht_form_open(&s,"find-opening",4000,emit,NULL));
+ old=s.request;
+ assert(ht_form_dismiss(&s));
+ assert(last.op==HT_FORM_CLOSE && !s.id[0] && !s.pending);
+ assert(!ht_form_reply(&s,"find-opening",old,true,&page,4010));
+ assert(!ht_form_reply(&s,"find-opening",last.request,true,&page,4011));
+ assert(ht_form_open(&s,"find-again",4020,emit,NULL));
+ assert(s.request>old);
+ blocked=true; assert(!ht_form_dismiss(&s));
+ assert(!s.id[0] && !s.pending && !s.failed);
+ printf("form: stale/duplicate activation, busy, bounded drag, backpressure, timeout, wraparound passed; state=%zu bytes\n",sizeof s);
+}
diff --git a/devices/harness-device/firmware/test/test_fw_update.py b/devices/harness-device/firmware/test/test_fw_update.py
new file mode 100644
index 000000000..f01655df1
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_fw_update.py
@@ -0,0 +1,202 @@
+"""Exercise the production OTA state machine with bounded, faulting fake flash.
+
+No USB, partitions, boot settings or actual device hardware are accessed. The
+crypto stub checks byte coverage/order; SHA-256 itself belongs to the SDK.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+main = Path(__file__).resolve().parent / '../main'
+source = Path(os.environ.get('FW_UPDATE_SOURCE', str(main / 'fw_update.c'))).read_text()
+source = re.sub(r'^#include .*\n', '', source, flags=re.M)
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <limits.h>
+typedef int esp_err_t;
+typedef unsigned esp_ota_handle_t;
+typedef int esp_ota_img_states_t;
+typedef struct { uint32_t size; const char *label; } esp_partition_t;
+typedef struct { char version[32]; } esp_app_desc_t;
+typedef struct { uint32_t hash; size_t bytes; } mbedtls_sha256_context;
+enum { ESP_OK=0, ESP_OTA_IMG_PENDING_VERIFY=1 };
+#define pdMS_TO_TICKS(ms) (ms)
+static const esp_partition_t slot={8192,"inactive"}, running={8192,"running"};
+static uint8_t flash[8192], image[8192];
+static int fault, hash_fault, image_state;
+static bool voice, missing_slot, handle_live, corrupt_read, confirmed_log;
+static unsigned erases, writes, reads, aborts, accepts, progress, errors, done, reboots, boots, ui_closed, marks;
+static uint32_t write_offset, ack;
+static int64_t clock_us;
+static char offered_version[32], error_text[96], hash_hex[65];
+static void log_message(const char *tag,const char *fmt,...) {
+ (void)tag; if(strstr(fmt,"image confirmed")) confirmed_log=true;
+}
+#define ESP_LOGI(...) log_message(__VA_ARGS__)
+#define ESP_LOGW(...) log_message(__VA_ARGS__)
+#define ESP_LOGE(...) log_message(__VA_ARGS__)
+static const char *esp_err_to_name(int err) { (void)err; return "fake error"; }
+static int64_t esp_timer_get_time(void) { return clock_us; }
+static bool audio_client_active(void) { return voice; }
+static const esp_partition_t *esp_ota_get_running_partition(void) { return &running; }
+static int esp_ota_get_state_partition(const esp_partition_t *p,int *state) {
+ assert(p==&running); *state=image_state; return fault==8;
+}
+static int esp_ota_mark_app_valid_cancel_rollback(void) { marks++; return fault==9; }
+static const esp_app_desc_t *esp_app_get_description(void) {
+ static const esp_app_desc_t desc={"current"}; return &desc;
+}
+static const esp_partition_t *esp_ota_get_next_update_partition(const void *p) {
+ assert(!p); return missing_slot ? NULL : &slot;
+}
+static int esp_ota_begin(const esp_partition_t *p,int size,esp_ota_handle_t *h) {
+ assert(p==&slot && size>0 && size<=8192 && !handle_live);
+ erases++; if(fault==1)return 1;
+ memset(flash,0xff,sizeof flash); handle_live=true; *h=17; write_offset=0;
+ return fault==10; // SDK failure after a partial handle was exposed.
+}
+static int esp_ota_abort(esp_ota_handle_t h) { assert(h==17 && handle_live); handle_live=false; aborts++; return 0; }
+static int esp_ota_write(esp_ota_handle_t h,const void *data,size_t n) {
+ assert(h==17 && handle_live && n<=sizeof flash-write_offset);
+ writes++; if(fault==2)return 1;
+ memcpy(flash+write_offset,data,n); write_offset+=(uint32_t)n; return 0;
+}
+static int esp_ota_end(esp_ota_handle_t h) { assert(h==17 && handle_live); handle_live=false; return fault==3; }
+static int esp_partition_read(const esp_partition_t *p,uint32_t offset,void *out,size_t n) {
+ assert(p==&slot && offset==reads*1024u && n<=1024 && n<=sizeof flash-offset);
+ reads++; if(fault==4)return 1;
+ memcpy(out,flash+offset,n); if(corrupt_read && n)((uint8_t *)out)[0]^=1; return 0;
+}
+static int esp_ota_get_partition_description(const esp_partition_t *p,esp_app_desc_t *desc) {
+ assert(p==&slot); snprintf(desc->version,sizeof desc->version,"%s",fault==6 ? "wrong-image" : offered_version);
+ return fault==5;
+}
+static int esp_ota_set_boot_partition(const esp_partition_t *p) { assert(p==&slot); if(fault==7)return 1; boots++;return 0; }
+static void esp_restart(void) { reboots++; }
+static void vTaskDelay(unsigned ticks) { assert(ticks==400); }
+static void ui_show_projects(void) { ui_closed++; }
+static void ui_ota_boot_show(const char *v) { snprintf(offered_version,sizeof offered_version,"%s",v); }
+static void ui_ota_boot_pct(int pct) { assert(pct>=0 && pct<=100); }
+static void ui_show_ota_restarting(void) {}
+static void cable_client_fw_error(const char *s) { errors++; snprintf(error_text,sizeof error_text,"%s",s); }
+static void cable_client_fw_accept(void) { accepts++; }
+static void cable_client_fw_progress(uint32_t written) { assert(written>=ack && written<=sizeof flash); progress++;ack=written; }
+static void cable_client_fw_done(void) { done++; }
+static void mbedtls_sha256_init(mbedtls_sha256_context *ctx) { *ctx=(mbedtls_sha256_context){2166136261u,0}; }
+static void mbedtls_sha256_free(mbedtls_sha256_context *ctx) { (void)ctx; }
+static int mbedtls_sha256_starts(mbedtls_sha256_context *ctx,int mode) { (void)ctx;assert(!mode);return hash_fault==1; }
+static int mbedtls_sha256_update(mbedtls_sha256_context *ctx,const uint8_t *p,size_t n) {
+ if(hash_fault==2)return 1;
+ for(size_t i=0;i<n;i++)ctx->hash=(ctx->hash^p[i])*16777619u;
+ ctx->bytes+=n;return 0;
+}
+static int mbedtls_sha256_finish(mbedtls_sha256_context *ctx,uint8_t *digest) {
+ if(hash_fault==3)return 1;
+ for(unsigned i=0;i<32;i++)digest[i]=(uint8_t)((ctx->hash>>(8*(i%4)))^(ctx->bytes+i));
+ return 0;
+}
+'''
+code += source
+if "void fw_update_tick(" not in source:
+ code += "static void fw_update_tick(void) {}\n"
+code += r'''
+static void reset(void) {
+ assert(!s_active && !handle_live);
+ reset_state(); fault=hash_fault=image_state=0;
+ voice=missing_slot=corrupt_read=confirmed_log=false;
+ erases=writes=reads=aborts=accepts=progress=errors=done=reboots=boots=ui_closed=marks=0;
+ ack=write_offset=0; clock_us=123456;
+ error_text[0]=0;
+}
+static void hash_image(size_t n) {
+ mbedtls_sha256_context ctx;mbedtls_sha256_init(&ctx);
+ assert(!mbedtls_sha256_update(&ctx,image,n));uint8_t digest[32];
+ assert(!mbedtls_sha256_finish(&ctx,digest));
+ for(unsigned i=0;i<32;i++)snprintf(hash_hex+i*2,3,"%02x",digest[i]);
+}
+static void begin(size_t n) { hash_image(n);assert(fw_update_offer("test.64",(int)n,hash_hex));assert(s_active && handle_live && accepts==1); }
+int main(void) {
+ (void)esp_timer_get_time; (void)esp_ota_get_partition_description;
+ for(unsigned i=0;i<sizeof image;i++)image[i]=(uint8_t)(i*31+i/7);
+ if(getenv("OTA_ONLY_OVERFLOW")) {
+ reset();begin(1500);fw_update_slice(image,100);fw_update_slice(image,SIZE_MAX);
+ assert(!s_active && !handle_live && errors==1 && writes==1);
+ puts("OTA oversized slice refused before flash write");return 0;
+ }
+ reset(); hash_image(1500);
+ assert(!fw_update_offer(NULL,1500,hash_hex));
+ assert(!fw_update_offer("",1500,hash_hex));
+ assert(!fw_update_offer("01234567890123456789012345678901",1500,hash_hex));
+ assert(!fw_update_offer("valid",0,hash_hex));
+ assert(!fw_update_offer("valid",INT_MAX,hash_hex));
+ assert(!fw_update_offer("valid",1500,NULL));
+ assert(!fw_update_offer("valid",1500,"abc"));
+ char invalid[65];memset(invalid,'x',64);invalid[64]=0;
+ assert(!fw_update_offer("valid",1500,invalid) && !erases);
+ voice=true;assert(!fw_update_offer("valid",1500,hash_hex) && !erases);voice=false;
+ missing_slot=true;assert(!fw_update_offer("valid",1500,hash_hex) && !erases);missing_slot=false;
+ for(int f=1;f<=10;f+=9) {
+ reset();hash_image(1500);fault=f;
+ assert(!fw_update_offer("valid",1500,hash_hex));
+ assert(!fw_update_active() && !handle_live && !accepts && !reboots && ui_closed==1);
+ }
+ reset();begin(1500);assert(!fw_update_offer("second",1500,hash_hex) && erases==1);
+ fw_update_slice(NULL,100);fw_update_slice(image,0);assert(!writes);
+ fw_update_slice(image,100);assert(writes==1 && ack==100);
+ fw_update_slice(image,SIZE_MAX);assert(!s_active && aborts==1 && errors==1 && writes==1 && !boots);
+ fw_update_slice(image,100);assert(writes==1);fw_update_abort("already gone");assert(aborts==1);
+ reset();begin(1500);fw_update_slice(image,100);fw_update_abort("unplugged");
+ assert(!s_active && aborts==1 && !errors && !boots);
+ reset();begin(1500);clock_us+=14999999;fw_update_tick();assert(s_active);
+ clock_us++;fw_update_tick();assert(!s_active && errors==1 && aborts==1 && !boots);
+ fw_update_tick();assert(errors==1);
+ reset();clock_us=(INT64_C(1)<<32)-100;begin(1500);clock_us+=14999999;fw_update_slice(image,100);
+ clock_us+=14999999;fw_update_tick();assert(s_active);clock_us++;fw_update_tick();assert(!s_active);
+ for(int f=2;f<=7;f++) {
+ reset();begin(1500);fault=f;fw_update_slice(image,1500);
+ assert(!s_active && !handle_live && errors==1 && !boots && !done && !reboots);
+ assert(aborts==(f==2));
+ }
+ for(int f=1;f<=3;f++) {
+ reset();begin(1500);hash_fault=f;fw_update_slice(image,1500);
+ assert(!s_active && !handle_live && errors==1 && !boots);
+ }
+ reset();begin(1500);corrupt_read=true;fw_update_slice(image,1500);assert(errors==1 && !boots && !s_active);
+ // Valid image, uppercase manifest hash, exact read-back and version match.
+ reset();hash_image(1500);for(unsigned i=0;i<64;i++)if(hash_hex[i]>='a' && hash_hex[i]<='f')hash_hex[i]+='A'-'a';
+ assert(fw_update_offer("test.64",1500,hash_hex));
+ fw_update_slice(image,100);fw_update_slice(image+100,1024);fw_update_slice(image+1124,376);
+ assert(done==1 && reboots==1 && boots==1 && !errors && !s_active && !handle_live && reads==2 && ack==1500 && progress==3);
+ // Flash writes and read-back can cross every chunk boundary without exceeding buffers.
+ for(unsigned n=1;n<=8192;n+=17) {
+ reset();begin(n);
+ for(unsigned offset=0;offset<n;) {
+ unsigned chunk=1+((offset*37+n)%1511);if(chunk>n-offset)chunk=n-offset;
+ fw_update_slice(image+offset,chunk);offset+=chunk;
+ }
+ assert(done==1 && reboots==1 && boots==1 && !errors && !s_active && !handle_live);
+ assert(reads==(n+1023)/1024);
+ }
+ reset();fw_mark_valid();assert(!marks && !confirmed_log);
+ image_state=ESP_OTA_IMG_PENDING_VERIFY;fault=8;fw_mark_valid();assert(!marks);
+ fault=9;fw_mark_valid();assert(marks==1 && !confirmed_log);
+ fault=0;fw_mark_valid();assert(marks==2 && confirmed_log);
+ puts("OTA: malformed offers, overflow, stalled transfers, disconnect, 10 SDK failure paths, hash/version checks and 482 chunked images PASS (fake flash)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-ota-') as d:
+ out = Path(d)
+ (out / 'ota.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize='+os.environ.get('SANITIZERS', 'undefined,bounds'),
+ str(out/'ota.c'), '-o', str(out/'ota')], check=True)
+ subprocess.run([str(out/'ota')], check=True)
diff --git a/devices/harness-device/firmware/test/test_gestures.c b/devices/harness-device/firmware/test/test_gestures.c
new file mode 100644
index 000000000..5378f2e03
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_gestures.c
@@ -0,0 +1,44 @@
+#include "../main/ui/habitat/gestures.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+static ht_gesture_t g;
+static ht_touch_result_t tap(uint32_t t, int x, int y) {
+ ht_gesture_begin(&g,x,y,t,0);
+ ht_gesture_move(&g,x+2,y-2);
+ return ht_gesture_end(&g,x,y,t+75);
+}
+static void clear(void) { memset(&g,0,sizeof(g)); }
+static uint32_t seed=1267;
+static unsigned next(void) { seed=seed*1664525u+1013904223u; return seed; }
+int main(void) {
+ clear(); ht_gesture_begin(&g,233,233,1000,0);
+ assert(g.live); // DOWN only starts classification, never an action.
+ assert(ht_gesture_end(&g,233,233,1075)==HT_TOUCH_TAP);
+ ht_gesture_guard(&g,1075); ht_gesture_cancel(&g);
+ assert(tap(1200,233,233)==HT_TOUCH_NONE);
+ assert(tap(1400,233,233)==HT_TOUCH_NONE); // old double/triple habit is one voice intent
+ assert(tap(1600,233,233)==HT_TOUCH_TAP);
+ clear(); ht_gesture_begin(&g,230,230,1000,0);
+ assert(ht_gesture_end(&g,230,230,1330)==HT_TOUCH_TAP); // deliberate slower tap
+ ht_gesture_begin(&g,230,230,2000,0);
+ assert(ht_gesture_end(&g,230,230,2700)==HT_TOUCH_HOLD);
+ ht_gesture_begin(&g,230,230,3000,0);
+ assert(ht_gesture_end(&g,230,230,10000)==HT_TOUCH_NONE); // resting finger
+ ht_gesture_begin(&g,230,230,11000,0);
+ assert(ht_gesture_end(&g,230,230,11024)==HT_TOUCH_NONE); // sensor pulse
+ clear(); assert(tap(UINT32_MAX-150,233,233)==HT_TOUCH_TAP);
+ ht_gesture_guard(&g,UINT32_MAX-75);
+ assert(tap(30,233,233)==HT_TOUCH_NONE);
+ assert(tap(500,233,233)==HT_TOUCH_TAP);
+ for(int i=0;i<20000;i++) {
+ clear(); ht_gesture_begin(&g,233,233,1000,0);
+ int dx=(int)(next()%401)-200,dy=(int)(next()%401)-200;
+ if(dx*dx+dy*dy<144) dx=25;
+ ht_gesture_move(&g,233+dx,233+dy);
+ if(i%3==0) ht_gesture_cancel(&g);
+ assert(ht_gesture_end(&g,233,233,1080)==HT_TOUCH_NONE);
+ assert(tap(1200,233,233)==HT_TOUCH_TAP);
+ }
+ puts("gestures: PASS (single release, slow tap, voice guard, holds, wrap + 20,000 drag/cancel traces)");
+}
diff --git a/devices/harness-device/firmware/test/test_glyph_cache.c b/devices/harness-device/firmware/test/test_glyph_cache.c
new file mode 100644
index 000000000..987ff7ae7
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_glyph_cache.c
@@ -0,0 +1,60 @@
+// Cached small-glyph rendering must be pixel-identical to the original path,
+// including clipping inside a cell, eviction, font/palette changes and fallback.
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t cached[HT_WIDTH * HT_HEIGHT + 2], original[HT_WIDTH * HT_HEIGHT + 2];
+static uint32_t seed = 0x4593082;
+static unsigned next(void) { seed ^= seed << 13; seed ^= seed >> 17; seed ^= seed << 5; return seed; }
+static void compare(const ht_scene_t *scene, ht_rect_t clip)
+{
+ size_t end = (size_t)clip.w * clip.h + 1;
+ cached[0] = original[0] = 0xabcd; cached[end] = original[end] = 0xdcba;
+ ht_glyph_cache_enable(false); ht_raster(scene, clip, original + 1);
+ ht_glyph_cache_enable(true); ht_raster(scene, clip, cached + 1);
+ assert(!memcmp(cached, original, (end + 1) * sizeof *cached));
+ assert(cached[0] == 0xabcd && cached[end] == 0xdcba);
+}
+int main(void)
+{
+ const ht_font_t *fonts[] = {&ht_octopus_font_2, &ht_octopus_font_4,
+ &ht_octopus_font_6, &ht_octopus_font_8, &ht_octopus_font_10, &ht_mono_20};
+ char alphabet[128];
+ for (int i = 0; i < 95; i++) alphabet[i] = i + 32;
+ memcpy(alphabet + 95, "\xe2\x80\x94\xe2\x80\x9c\xf0\x9f\x90\x99", 11);
+ ht_scene_t scene;
+ for (unsigned i = 0; i < 6000; i++) {
+ ht_scene_clear(&scene, next());
+ for (unsigned row = 0, count = 1 + next() % 12; row < count; row++) {
+ const ht_font_t *font = fonts[next() % 6];
+ ht_text(&scene, (int)(next() % 120) - 40, (int)(next() % 130) - 25,
+ 1 + next() % 465, font, next(), next() % 2 ? scene.background : next(),
+ alphabet + next() % 95);
+ }
+ ht_rect_t clip = {next() % 80, next() % 110, 1 + next() % 380, 1 + next() % 40};
+ compare(&scene, clip);
+ }
+ ht_tim_face_t face = {.recipient = "Firmware", .status = "Coalescing",
+ .mood = HT_TIM_WORKING, .foreground = 0xffff, .dim = 0x7777, .ink = 0xafe0};
+ for (int layout = 0; layout < 4; layout++) {
+ face.focus = layout == 1;
+ const char *recap = layout == 2 ? "Fixed. All checks pass." : layout == 3 ?
+ "The update is installed. Voice input now sends to the selected agent. The result stays in the center." : NULL;
+ for (int frame = 0; frame < HT_OCTOPUS_FRAMES; frame++) {
+ face.pose = (ht_tim_pose_t){.blink = frame % 7 == 0, .level = frame % 5};
+ face.mood = (frame % 8);
+ face.unread = frame % 3 == 0;
+ ht_scene_clear(&scene, ht_rgb(0x080c08));
+ ht_octopus_face(&scene, &face, frame, ht_rgb(0xc8a9f0), recap);
+ compare(&scene, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT});
+ uint32_t builds = ht_glyph_cache_builds();
+ for (int y = 0; y < HT_HEIGHT; y += 24)
+ compare(&scene, (ht_rect_t){0, y, HT_WIDTH, y + 24 > HT_HEIGHT ? HT_HEIGHT - y : 24});
+ assert(ht_glyph_cache_builds() == builds); // full-to-strip reuse, no palette churn
+ }
+ }
+ assert(ht_glyph_cache_bytes() <= 2600);
+ puts("glyph cache: 6000 clipped mixed scenes + 252 complete poses match the original renderer; guards and warm reuse pass");
+}
diff --git a/devices/harness-device/firmware/test/test_layout_bench.py b/devices/harness-device/firmware/test/test_layout_bench.py
new file mode 100644
index 000000000..8cc4bec27
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_layout_bench.py
@@ -0,0 +1,83 @@
+"""Validate diagnostic workloads/exit paths before flashing the display benchmark."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+native = Path(__file__).resolve().parent / '../main/ui/habitat'
+source = re.sub(r'^#include .*\n', '', (native/'layout_bench.c').read_text(), flags=re.M)
+code = r'''
+#include "octopus.h"
+#include "ascii_clip.h"
+#include "reference48/reference.h"
+#include "reference79/reference.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <limits.h>
+#define RTC_NOINIT_ATTR
+#define MALLOC_CAP_INTERNAL 1
+#define MALLOC_CAP_SPIRAM 2
+#define pdMS_TO_TICKS(ms) (ms)
+typedef struct { unsigned presses,read_failures; } touch_stats_t;
+typedef struct { const char *version; } esp_app_desc_t;
+static unsigned blocks,ends,cancels,skips,paints,queries,cancel_at=UINT_MAX;
+static int64_t clock_us;
+static uint16_t scratch[HT_WIDTH*24];
+static ht_scene_t a,b;
+static void log_message(const char *tag,const char *fmt,...) {
+ (void)tag;
+ blocks+=!strncmp(fmt,"BLOCK",5);ends+=!strncmp(fmt,"END",3);
+ cancels+=!strncmp(fmt,"CANCEL",6);skips+=!strncmp(fmt,"already attempted",17);
+}
+#define ESP_LOGI(...) log_message(__VA_ARGS__)
+#define ESP_LOGW(...) log_message(__VA_ARGS__)
+static int64_t esp_timer_get_time(void) { return ++clock_us; }
+static const esp_app_desc_t *esp_app_get_description(void) { static const esp_app_desc_t d={"test.65"};return &d; }
+static void esp_task_wdt_reset(void) {}
+static void vTaskDelay(unsigned ms) { clock_us+=ms*1000; }
+static bool cable_client_is_connected(void) { return true; }
+static bool heap_caps_check_integrity_all(bool noisy) { (void)noisy;return true; }
+static size_t heap_caps_get_free_size(int cap) { (void)cap;return 100000; }
+static size_t heap_caps_get_largest_free_block(int cap) { (void)cap;return 50000; }
+static unsigned uxTaskGetStackHighWaterMark(void *task) { (void)task;return 2000; }
+static void touch_stats(touch_stats_t *t) { *t=(touch_stats_t){0}; }
+static uint32_t touch_activity_generation(void) { return ++queries>=cancel_at; }
+void cable_scroll_benchmark(void) {}
+static uint32_t fake_paint(const ht_scene_t *scene,const ht_damage_t *damage) {
+ assert(scene->count<=HT_RUNS && damage->count && damage->count<=HT_DAMAGE_MAX);
+ for(int i=0;i<damage->count;i++) {
+ ht_rect_t r=damage->rect[i];
+ assert(r.x>=0 && r.y>=0 && r.w>0 && r.h>0 && r.x+r.w<=HT_WIDTH && r.y+r.h<=HT_HEIGHT);
+ }
+ paints++;return 1;
+}
+'''
+code += source
+code += r'''
+int main(void) {
+ ht_layout_benchmark(scratch,&a,&b,fake_paint);
+ assert(blocks==120 && ends==1 && !cancels && paints==2460);
+ ht_layout_benchmark(scratch,&a,&b,fake_paint);
+ assert(skips==1 && blocks==120);
+ attempted[0]=attempted[1]=0;queries=0;cancel_at=99;
+ ht_layout_benchmark(scratch,&a,&b,fake_paint);
+ assert(cancels==1 && ends==1 && a.count==0 && b.count==0);
+ puts("Layout benchmark: 4800 nonzero-damage workloads, 2460 bounded panel calls, one-shot reset guard and physical-input cancellation PASS (offline)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-layout-bench-') as d:
+ out=Path(d);(out/'bench.c').write_text(code)
+ for baseline in [48,79,82]:
+ defines=[f'-DDEVICE_LAYOUT_BASELINE{baseline}=1'] if baseline!=48 else []
+ sources=[f'reference{baseline}/terminal_ref.c'] if baseline!=82 else []
+ if baseline==48: sources+=['reference48/octopus_ref.c']
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g','-DDEVICE_LAYOUT_BENCH=1',*defines,
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),'-I',str(native),'-I',str(Path(__file__).resolve().parent),
+ str(out/'bench.c'),*[str(native/f) for f in ['octopus.c','ascii_clip.c','octopus_font.c','tim.c','terminal.c','fonts.c']],
+ *[str(Path(__file__).resolve().parent/f) for f in sources],
+ '-o',str(out/'bench')],check=True)
+ subprocess.run([str(out/'bench')],check=True)
diff --git a/devices/harness-device/firmware/test/test_machine_ui.py b/devices/harness-device/firmware/test/test_machine_ui.py
new file mode 100644
index 000000000..d3e9f065f
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_machine_ui.py
@@ -0,0 +1,100 @@
+"""Production machine-selection callbacks: late replies, bounds, and clock wrap."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+root = Path(__file__).resolve().parent.parent
+source = Path(os.environ.get('UI_SOURCE', root/'main/ui/habitat/ui_habitat.c')).read_text()
+
+
+def function(name):
+ m = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert m, name
+ return m.group(0) + '\n'
+
+
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+#define CABLE_MAX_MACHINES 8
+typedef struct { char id[64],name[96],state[16]; bool local; } cable_machine_t;
+static struct {
+ cable_machine_t machines[CABLE_MAX_MACHINES]; int machine_count;
+ char selected_machine[64],pending_machine[64],title[80],message[256];
+ uint32_t machine_deadline;
+} s;
+static uint32_t now;
+static int lock_depth,errors,changes,viewed;
+enum { MESSAGE=4 };
+static uint32_t ms(void) { return now; }
+static void display_lock(void) { lock_depth++; }
+static void display_unlock(void) { assert(lock_depth>0);lock_depth--; }
+static void change(void) { assert(lock_depth>0);changes++; }
+static void view(int value) { assert(lock_depth>0);viewed=value; }
+static void ui_show_error(const char *title,const char *message) {
+ errors++;snprintf(s.title,sizeof s.title,"%s",title);
+ snprintf(s.message,sizeof s.message,"%s",message?message:"");
+}
+'''
+code += function('copy') + '#define COPY(dst,src) copy(dst,sizeof(dst),src)\n'
+for name in ['ui_machines_replace', 'ui_machines_replace_one', 'ui_machine_selected_ack',
+ 'ui_machine_select_error', 'ui_tick_machine_select']:
+ code += function(name)
+code += r'''
+static void request(const char *id,uint32_t at) {
+ COPY(s.pending_machine,id);s.machine_deadline=at+6000;now=at;
+}
+int main(void) {
+ COPY(s.selected_machine,"origin");request("new",1000);
+ ui_machine_select_error("old","OFFLINE","Old request failed");
+ assert(!strcmp(s.pending_machine,"new") && !errors);
+ // Acknowledgements are authoritative about actual host selection, but an
+ // older acknowledgement must not clear the newer outstanding request.
+ ui_machine_selected_ack("old");
+ assert(!strcmp(s.selected_machine,"old") && !strcmp(s.pending_machine,"new"));
+ ui_machine_selected_ack("new");
+ assert(!strcmp(s.selected_machine,"new") && !s.pending_machine[0]);
+ ui_machine_select_error("old","OFFLINE","Too late");assert(!errors);
+ request("newer",2000);
+ ui_machine_select_error("newer","OFFLINE","Native host error");
+ assert(!s.pending_machine[0] && errors==1 && !strcmp(s.message,"Native host error"));
+ // Corrupt/absent identifiers cannot acknowledge a pending request.
+ request("waiting",3000);char huge[100];memset(huge,'x',sizeof huge);huge[99]=0;
+ ui_machine_selected_ack(NULL);ui_machine_selected_ack("");ui_machine_selected_ack(huge);
+ assert(!strcmp(s.pending_machine,"waiting") && !strcmp(s.selected_machine,"new"));
+ ui_machine_select_error(NULL,"ERR","Missing target");assert(errors==1);
+ // The six-second timeout remains six seconds across the millisecond wrap.
+ request("remote",UINT32_MAX-3000);ui_tick_machine_select();assert(s.pending_machine[0]);
+ now=UINT32_MAX;ui_tick_machine_select();assert(s.pending_machine[0]);
+ now=2998;ui_tick_machine_select();assert(s.pending_machine[0]);
+ now=2999;ui_tick_machine_select();assert(!s.pending_machine[0] && viewed==MESSAGE);
+ int before=changes;now++;ui_tick_machine_select();assert(changes==before);
+ request("remote",10000);now=15999;ui_tick_machine_select();assert(s.pending_machine[0]);
+ now=16000;ui_tick_machine_select();assert(!s.pending_machine[0]);
+ // Snapshot capacities are bounded before copying, including empty input.
+ cable_machine_t rows[CABLE_MAX_MACHINES];memset(rows,0,sizeof rows);
+ for(int i=0;i<CABLE_MAX_MACHINES;i++)snprintf(rows[i].id,sizeof rows[i].id,"m%d",i);
+ ui_machines_replace(rows,INT_MAX,"m2",NULL);assert(s.machine_count==CABLE_MAX_MACHINES);
+ assert(!memcmp(rows,s.machines,sizeof rows));
+ ui_machines_replace(rows,-1,NULL,NULL);assert(s.machine_count==0 && !s.selected_machine[0]);
+ ui_machines_replace(NULL,2,NULL,NULL);assert(!s.machine_count);
+ ui_machines_replace_one(NULL,NULL);
+ ui_machines_replace(rows,2,"m1",NULL);COPY(rows[1].name,"Renamed");
+ ui_machines_replace_one(&rows[1],"m1");assert(!strcmp(s.machines[1].name,"Renamed"));
+ assert(!lock_depth);
+ puts("Machine UI: stale replies, authoritative selection, malformed IDs, bounded snapshots and timeout wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-machine-ui-') as folder:
+ folder = Path(folder)
+ (folder/'machine.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),str(folder/'machine.c'),
+ '-o',str(folder/'machine')],check=True)
+ subprocess.run([str(folder/'machine')],check=True)
diff --git a/devices/harness-device/firmware/test/test_octopus.c b/devices/harness-device/firmware/test/test_octopus.c
new file mode 100644
index 000000000..3ebe630ae
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_octopus.c
@@ -0,0 +1,276 @@
+// Exercise the actual animation clock and incremental renderer, including the
+// mic path and transitions to/from secondary screens. No hardware/network use.
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t full[HT_WIDTH * HT_HEIGHT], incremental[HT_WIDTH * HT_HEIGHT];
+static uint16_t scratch[HT_WIDTH * HT_HEIGHT];
+static unsigned redraws;
+static const char *recap;
+static void transition(const ht_scene_t *before, const ht_scene_t *after)
+{
+ redraws++;
+ ht_damage_t d; ht_damage(before, after, &d);
+ for (int i = 0; i < d.count; i++) {
+ ht_rect_t r = d.rect[i];
+ assert(r.x >= 0 && r.y >= 0 && r.x + r.w <= HT_WIDTH && r.y + r.h <= HT_HEIGHT);
+ assert(!((r.x | r.y | r.w | r.h) & 1));
+ ht_raster(after, r, scratch);
+ for (int y = 0; y < r.h; y++)
+ memcpy(incremental + (r.y+y)*HT_WIDTH+r.x, scratch+y*r.w, (size_t)r.w*2);
+ }
+ ht_raster(after, (ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT}, full);
+ assert(!memcmp(incremental, full, sizeof full));
+}
+
+static bool tick(ht_octopus_motion_t *m, uint32_t now, ht_tim_mood_t mood,
+ bool quiet, bool visible, bool down, unsigned level)
+{
+ bool changed = ht_octopus_motion_tick(m, now, mood, quiet, visible, down, 330, level, now / 100);
+ assert(m->next_ms >= 1 && m->next_ms <= 1000);
+ assert(m->frame < HT_OCTOPUS_FRAMES);
+ return changed;
+}
+
+static void clock_checks(void)
+{
+ ht_octopus_motion_t m = {0}; bool seen[HT_OCTOPUS_FRAMES] = {0};
+ for (uint32_t t = 0; t <= HT_OCTOPUS_DURATION; t++) {
+ tick(&m, t, HT_TIM_WORKING, false, true, false, 0); seen[m.frame] = true;
+ }
+ for (int i = 0; i < HT_OCTOPUS_FRAMES; i++) assert(seen[i]);
+ assert(m.frame == 0 && m.phase == 0);
+ memset(&m, 0, sizeof m);
+ for (uint32_t t = 0; t <= HT_OCTOPUS_DURATION * 2; t++) tick(&m, t, HT_TIM_CONTENT, false, true, false, 0);
+ assert(m.frame == 0 && m.phase == 0);
+ memset(&m, 0, sizeof m);
+ tick(&m, UINT32_MAX - 49, HT_TIM_WORKING, false, true, false, 0);
+ tick(&m, 50, HT_TIM_WORKING, false, true, false, 0);
+ assert(m.phase == 100 && m.frame == 1);
+ tick(&m, 80, HT_TIM_WORKING, false, true, true, 0);
+ uint16_t held = m.phase;
+ tick(&m, 3000, HT_TIM_WORKING, false, true, true, 0);
+ assert(m.phase == held && m.reaction.pose.pressed && m.reaction.pose.look == 2);
+ tick(&m, 4000, HT_TIM_WORKING, false, true, false, 0);
+ assert(m.phase == held); // no catch-up jump when the finger lifts
+ tick(&m, 4100, HT_TIM_LISTENING, false, true, false, 4);
+ assert(m.reaction.pose.level == 4);
+ uint8_t frame = m.frame;
+ for (uint32_t t = 4101; t < 4225; t++) {
+ tick(&m, t, HT_TIM_LISTENING, false, true, false, 0);
+ assert(m.reaction.pose.level == 4 && m.frame == frame);
+ }
+ tick(&m, 4225, HT_TIM_LISTENING, false, true, false, 0);
+ assert(!m.reaction.pose.level && m.frame == frame);
+ for (int state = 0; state < 4; state++) {
+ ht_tim_mood_t mood = state == 2 ? HT_TIM_ASLEEP : state == 3 ? HT_TIM_OFFLINE : HT_TIM_WORKING;
+ tick(&m, 5000, mood, state == 0, state != 1, false, 0);
+ uint16_t phase = m.phase;
+ for (uint32_t t = 5001; t < 7000; t++) {
+ assert(!tick(&m, t, mood, state == 0, state != 1, false, 0));
+ assert(m.phase == phase && m.next_ms == 1000);
+ }
+ }
+}
+
+static ht_tim_face_t face = {.recipient = "Parser helper", .status = "3 working", .hint = "tap to talk",
+ .detail = "Running firmware checks", .foreground = 0xffff, .dim = 0x7777, .ink = 0xafe0,
+ .roomy_reading = true};
+static void scene(ht_scene_t *s, const ht_octopus_motion_t *m)
+{
+ ht_scene_clear(s, ht_rgb(0x080c08));
+ face.mood = m->reaction.mood; face.pose = m->reaction.pose;
+ ht_octopus_face(s, &face, m->frame, ht_rgb(0xc8a9f0), recap);
+ assert(s->count <= HT_RUNS - 2); // room for footer and explicit Discard
+ for (int i = 0; i < s->count; i++) {
+ const ht_run_t *r = &s->runs[i];
+ assert(r->x >= 0 && r->y >= 0 && r->x + r->w <= HT_WIDTH && r->y + r->font->height <= HT_HEIGHT);
+ assert(ht_can_display(r->text, r->font, r->w ? r->w : r->font->width, 1));
+ if (recap && r->font == &ht_octopus_font_4)
+ assert(r->y >= 92 && r->y + r->font->height <= 200);
+ if (recap && r->font == &ht_octopus_font_6)
+ assert(r->y >= 96 && r->y + r->font->height <= 258);
+ if (recap && r->font == &ht_mono_20 && r->text[0] && !r->arc && r->y >= 190 && r->y < 400)
+ assert(r->y >= 224 && r->y + r->font->height <= 392);
+ }
+}
+
+static void redraw_checks(void)
+{
+ ht_scene_t a = {0}, b = {0}; ht_octopus_motion_t m = {0};
+ scene(&a, &m); transition(NULL, &a);
+ for (int layout = 0; layout < 5; layout++) {
+ face.focus = layout == 1; face.straight_title = layout == 3; face.unread = layout == 4;
+ recap = layout == 2 ? "Fixed the parser. All checks pass, with a much longer explanation available in the terminal." : NULL;
+ for (int mood = HT_TIM_CONTENT; mood <= HT_TIM_LISTENING; mood++) {
+ m.reaction.mood = mood;
+ for (int frame = 0; frame < HT_OCTOPUS_FRAMES; frame++) {
+ m.frame = frame; m.reaction.pose = (ht_tim_pose_t){.blink = frame % 13 == 0, .level = frame % 5};
+ scene(&b, &m); transition(&a, &b); a = b;
+ }
+ }
+ }
+ recap = NULL;
+ face.unread = false;
+ face.focus = false; face.recipient = "A very long recipient name that must end in a plus";
+ scene(&b, &m); transition(&a, &b); a = b;
+ face.recipient = "hn"; face.status = "[ 1 needs you ]";
+ scene(&b, &m); transition(&a, &b); a = b;
+ ht_scene_clear(&b, a.background); ht_center(&b, 145, &ht_mono_20, 0xffff, "find");
+ transition(&a, &b); a = b; scene(&b, &m); transition(&a, &b);
+}
+
+static void text_checks(void)
+{
+ const char *examples[]={
+ "It isn't external.",
+ "Yes. The fix is installed.",
+ "We use ... for omitted text.",
+ "The device kept this complete sentence within sixty letters.",
+ "Fixed the parser. All tests pass. Voice input now sends to the selected agent.",
+ "A much longer completion from an older host must still fit three rows without overlapping the footer.",
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ "The desktop sorts by last activity only (newest first +",
+ "caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9 caf\xc3\xa9"
+ };
+ for (unsigned n=0;n<sizeof examples/sizeof examples[0];n++) {
+ ht_scene_t s; ht_scene_clear(&s,0);
+ ht_octopus_face(&s,&face,0,0xffff,examples[n]);
+ char shown[512]=""; const ht_run_t *last=NULL,*arrow=NULL;
+ for (int i=0;i<s.count;i++) {
+ const ht_run_t *r=&s.runs[i];
+ if (r->font==&ht_open_20) { assert(!arrow); arrow=r; continue; }
+ if (r->arc || r->font!=&ht_mono_20 || r->y<194 || r->y>390 || !r->text[0]) continue;
+ if (shown[0]) strcat(shown," ");
+ strcat(shown,r->text); last=r;
+ assert(r->w<=408 && ht_can_display(r->text,r->font,r->w,1));
+ }
+ assert(last);
+ assert(arrow && !strcmp(arrow->text,"\xe2\x86\x97"));
+ assert(last->text[strlen(last->text)-1]==' ');
+ assert(arrow->x==last->x+last->w && arrow->y==last->y);
+ assert(arrow->x+arrow->w<=431);
+ assert(!strchr(shown,'+'));
+ shown[strlen(shown)-1]=0; // The space before the consistently present arrow.
+ if (n<6) assert(!strcmp(shown,examples[n])); // Complete prose is retained.
+ else assert(!strstr(shown,"..."));
+ }
+}
+
+static void orphan_marker_checks(void)
+{
+ ht_scene_t s; ht_scene_clear(&s, 0);
+ ht_recap_lines(&s, 253, 0xffff, "The desktop sorts by last activity only (newest first +");
+ assert(!strcmp(s.runs[1].text, "activity only (newest"));
+ assert(!strcmp(s.runs[2].text, "first "));
+ assert(s.runs[3].font == &ht_open_20);
+ assert(s.runs[3].x == s.runs[2].x + s.runs[2].w);
+ assert(s.runs[3].y == s.runs[2].y);
+ // A very long unbroken token cannot move as a word. Still draw the glyph,
+ // never the internal marker; preserve the full token on its own row.
+ ht_scene_clear(&s, 0);
+ ht_recap_lines(&s, 253, 0xffff, "abcdefghijklmnopqrstuvwxyzab +");
+ assert(!strcmp(s.runs[0].text, "abcdefghijklmnopqrstuvwxyzab"));
+ assert(s.runs[3].font == &ht_open_20);
+ for (int i = 0; i < s.count; i++) assert(!strchr(s.runs[i].text, '+'));
+ // A literal C++ is not a continuation marker.
+ ht_scene_clear(&s, 0);
+ ht_recap_lines(&s, 253, 0xffff, "Built with C++");
+ assert(!strcmp(s.runs[0].text, "Built with C++ "));
+ assert(s.count == 4 && s.runs[3].font == &ht_open_20);
+ // This actual completed answer contains an authored arrow, not a suffix.
+ // Preserve it within prose, alongside the one consistently added marker.
+ ht_scene_clear(&s, 0);
+ ht_recap_lines(&s, 253, 0xffff,
+ "It was a wrapping bug: a + alone on a new line escaped conversion to \xe2\x86\x97.");
+ assert(s.count == 4 && s.runs[3].font == &ht_open_20);
+ bool arrow = false;
+ for (int i = 0; i < s.count; i++) {
+ assert(ht_can_display(s.runs[i].text, s.runs[i].font, 336, 1));
+ arrow |= strstr(s.runs[i].text, "\xe2\x86\x97.") != NULL;
+ }
+ assert(arrow);
+ ht_scene_clear(&s, 0);
+ ht_recap_lines(&s, 253, 0xffff, "");
+ assert(s.count == 3); // No summary, no floating arrow.
+ for (int i=0; i<s.count; i++) assert(!s.runs[i].text[0]);
+ // A long cached UTF-8 message remains bounded and gets exactly one marker.
+ char long_text[1024];
+ for (int i=0; i<300; i++) memcpy(long_text+i*2,"\xc3\xa9",2);
+ long_text[600]=0;
+ ht_scene_clear(&s,0);
+ ht_recap_lines(&s,253,0xffff,long_text);
+ assert(s.count==4 && s.runs[3].font==&ht_open_20);
+ for (int i=0; i<s.count; i++)
+ assert(ht_can_display(s.runs[i].text,s.runs[i].font,336,1));
+}
+
+static void activity_checks(void)
+{
+ const char *names[] = {"hn", "Deploy latest firmware", "Mobile app build and deploy",
+ "A very long session name that must leave room for current activity"};
+ const char *activities[] = {"Working", "Coalescing...", "[1] Working", "[2] Coalescing..."};
+ ht_scene_t before, after; ht_octopus_motion_t motion = {0};
+ face.mood = HT_TIM_WORKING;
+ recap = "The last build is installed. All checks passed.";
+ ht_scene_clear(&before, ht_rgb(0x080c08)); transition(NULL, &before);
+ for (unsigned n = 0; n < sizeof names / sizeof names[0]; n++) {
+ for (unsigned a = 0; a < sizeof activities / sizeof activities[0]; a++) {
+ face.recipient = names[n]; face.status = activities[a];
+ ht_scene_clear(&after, before.background);
+ ht_octopus_face(&after, &face, motion.frame, ht_rgb(0xc8a9f0), recap);
+ assert(after.count <= HT_RUNS - 2);
+ bool activity = false;
+ for (int i = 0; i < after.count; i++) {
+ const ht_run_t *r = &after.runs[i];
+ assert(strcmp(r->text, "Last result"));
+ if (!strcmp(r->text, activities[a])) {
+ activity = true;
+ assert(r->arc == 2);
+ }
+ if (!r->text[0] || !r->arc) continue;
+ assert((r->arc == 1 || r->arc == 2) && r->font == &ht_mono_20);
+ assert(!strchr(r->text, '+'));
+ for (int j = 0; j < i; j++) {
+ const ht_run_t *p = &after.runs[j];
+ if (!p->text[0] || !p->arc) continue;
+ assert(r->y + r->font->height <= p->y || p->y + p->font->height <= r->y);
+ }
+ }
+ assert(activity);
+ transition(&before, &after); before = after;
+ }
+ }
+ face.status = ""; face.recipient = "Parser helper"; recap = NULL;
+}
+
+static void traffic_checks(void)
+{
+ uint32_t idle_bytes = 0;
+ for (int mode = 0; mode < 4; mode++) {
+ ht_tim_mood_t mood = mode == 0 ? HT_TIM_CONTENT : mode == 1 ? HT_TIM_WORKING : HT_TIM_LISTENING;
+ if (mode == 3) mood = HT_TIM_CONTENT;
+ recap = mode == 3 ? "Fixed the parser. Tests pass." : NULL;
+ ht_octopus_motion_t m = {0}; ht_scene_t a, b; unsigned frames = 0; uint32_t pixels = 0;
+ tick(&m, 0, mood, false, true, false, 0); scene(&a, &m);
+ for (uint32_t t = 1; t <= 60000; t++) {
+ if (!tick(&m, t, mood, false, true, false, (t / 125) % 5)) continue;
+ scene(&b, &m); ht_damage_t d; ht_damage(&a, &b, &d);
+ if (d.count) { frames++; pixels += d.pixels; }
+ a = b;
+ }
+ printf("octopus simulated %s: %u redraws/min, %u DMA pixel-bytes/min (no timing claim)\n",
+ mode == 0 ? "idle" : mode == 1 ? "working" : mode == 2 ? "microphone" : "recap", frames, pixels * 2);
+ if (mode == 0) idle_bytes = pixels * 2;
+ if (mode == 3) assert(pixels * 2 < idle_bytes);
+ if (mode == 2) assert(pixels * 2 < 2500000); // face-only capture must stay inexpensive
+ }
+}
+
+int main(void)
+{
+ clock_checks(); text_checks(); orphan_marker_checks(); redraw_checks(); activity_checks(); traffic_checks();
+ printf("octopus: PASS (63 poses; clocks/wrap; five layouts; touch/voice/hidden scheduling; %u incremental redraw checks; %zu-byte motion state)\n", redraws, sizeof(ht_octopus_motion_t));
+}
diff --git a/devices/harness-device/firmware/test/test_octopus_art.py b/devices/harness-device/firmware/test/test_octopus_art.py
new file mode 100644
index 000000000..e32f90db0
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_octopus_art.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python3
+"""Compare every decoded cell with the user's approved gallery source frames."""
+import json
+from pathlib import Path
+import os
+import subprocess
+import tempfile
+
+root = Path(__file__).resolve().parents[1]
+source = json.loads((root.parent / 'prototype/habitat/assets/creature-references/clips.json').read_text())[0]
+native = root / 'main/ui/habitat'
+with tempfile.TemporaryDirectory() as tmp:
+ out = Path(tmp)
+ (out / 'decode.c').write_text('''
+#include "ascii_clip.h"
+#include "octopus_art.inc"
+#include <stdio.h>
+#include <assert.h>
+int main(void) {
+ char row[55];
+ for (unsigned f=0;f<octopus_clip.frames;f++) for(unsigned r=0;r<octopus_clip.rows;r++) {
+ assert(ht_ascii_clip_row(&octopus_clip,f,r,row,sizeof row));
+ assert(fwrite(row,1,54,stdout)==54);
+ }
+ return 0;
+}
+''')
+ subprocess.run(['cc','-std=c11','-O1','-g','-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I',str(native),str(out/'decode.c'),str(native/'ascii_clip.c'),
+ '-o',str(out/'decode')],check=True)
+ actual = subprocess.check_output([str(out/'decode')])
+expected = ''.join(row for frame in source['frames'] for row in frame).encode('ascii')
+assert actual == expected
+print(f'Octopus artwork: all {len(actual)} decoded cells / 63 frames exactly match approved source')
diff --git a/devices/harness-device/firmware/test/test_question_ui.py b/devices/harness-device/firmware/test/test_question_ui.py
new file mode 100644
index 000000000..5253245cf
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_question_ui.py
@@ -0,0 +1,260 @@
+"""Production decision handlers/renderers with deterministic transport and cJSON accessor doubles.
+
+The doubles construct already-decoded trees; JSON parsing and real USB are outside this fixture.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import defines
+
+native = Path(__file__).resolve().parent / '../main/ui/habitat'
+source = (native / 'ui_habitat.c').read_text()
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+code = r'''
+#include "terminal.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "../../cable_features.h"
+static bool cable_client_supports(uint32_t features) { (void)features; return true; }
+'''
+code += defines('ID_MAX','CABLE_NAME_MAX')
+code += defines('QUESTION_MAX','OPTION_MAX','PANE_RESULT_BYTES',source=source)
+code += source[source.index('typedef enum {'):source.index('typedef struct {\n char id[ID_MAX], name[CABLE_NAME_MAX]')]
+code += source[source.index('typedef struct {\n char key[256]'):source.index('static EXT_RAM_BSS_ATTR struct {')]
+code += r'''
+typedef struct cJSON { const char *string, *valuestring; int type; double valuedouble; struct cJSON *child, *next; } cJSON;
+enum { JSTRING=1, JTRUE=2, JARRAY=3, JOBJECT=4, JNUMBER=5 };
+static bool cJSON_IsString(const cJSON *v) { return v && v->type==JSTRING; }
+static bool cJSON_IsNumber(const cJSON *v) { return v && v->type==JNUMBER; }
+static bool cJSON_IsTrue(const cJSON *v) { return v && v->type==JTRUE; }
+static const cJSON *cJSON_GetObjectItemCaseSensitive(const cJSON *v,const char *key) {
+ for (const cJSON *p=v ? v->child : NULL;p;p=p->next) if (p->string && !strcmp(p->string,key)) return p;
+ return NULL;
+}
+static const cJSON *cJSON_GetArrayItem(const cJSON *v,int index) {
+ const cJSON *p=v ? v->child : NULL; while (p && index--) p=p->next; return p;
+}
+#define cJSON_ArrayForEach(it,v) for ((it)=(v) ? (v)->child : NULL;(it);(it)=(it)->next)
+static cJSON object(cJSON *children,int n) {
+ for (int i=0;i<n;i++) children[i].next=i+1<n ? &children[i+1] : NULL;
+ return (cJSON){.type=JOBJECT,.child=n ? children : NULL};
+}
+static struct { question_t q; bool voice_open,voice_waiting; uint32_t voice_question_revision; int voice_question_index; view_t voice_return; char title[80],message[256]; view_t view; int offset,pressed,hit_count,active,notice_count; char pending_focus[ID_MAX],opening_notice[ID_MAX]; bool connected; hit_t hits[24]; } s;
+typedef struct { char id[64],name[96]; } agent_t;
+static agent_t agents[2]={{.id="a",.name="Research helper"},{.id="b",.name="Remote helper"}};
+static bool b_known;
+static struct { bool available,pending; char agent[64]; } visit;
+static void ht_visit_close(void *v) { (void)v; visit.available=false; }
+static bool is_question(const char *id) { return !strcmp(id,"b"); }
+static int find(const char *id) { return !strcmp(id,"a") ? 0 : b_known && !strcmp(id,"b") ? 1 : -1; }
+static question_submit_t packet;
+static uint32_t now=100,random_value=1;
+static int gesture;
+static void ht_gesture_guard(int *g,uint32_t time) { (void)g;(void)time; }
+static bool congested,transport_ok=true,pending_receipt;
+static action_t queued;
+static int queued_answers,sent_answers,removed,notices,reads;
+static uint8_t sent_choices[4];
+static char sent_draft[48];
+static agent_t *active(void) { return &agents[s.active]; }
+static uint32_t ms(void) { return now; }
+static uint32_t esp_random(void) { return random_value++; }
+static void change(void) {}
+static void input_cancel(void) { s.pressed=-1; }
+static void view(view_t v) { input_cancel(); s.view=v; s.offset=0; }
+static void voice_close(void) { s.voice_open=s.voice_waiting=false; }
+static void display_lock(void) {}
+static void display_unlock(void) {}
+static bool queue(action_t a) {
+ if (congested) return false;
+ queued=a; if (a.kind==A_ANSWER) queued_answers++; return true;
+}
+static void notice_add(const char *id,const char *name,const char *machine,const char *text,bool question) {
+ (void)id;(void)name;(void)machine;(void)text;assert(question);notices++;
+}
+static void notice_remove(const char *id,bool all) { assert(id && all);removed++; }
+static void cable_client_question_read(const char *id,const char *fetch) { assert(id && fetch);reads++; }
+static bool cable_client_answer_reviewed(const char *id,const char *fetch,const char *token,const uint8_t *choices,const char drafts[][48],int n) {
+ assert(!strcmp(id,"a") && fetch[0] && !strcmp(token,"token-a") && n>0 && n<=4);
+ snprintf(sent_draft,sizeof sent_draft,"%s",drafts[0]); memcpy(sent_choices,choices,(size_t)n);sent_answers++;return transport_ok;
+}
+#include "theme.h"
+#define BG ht_rgb(HT_THEME_CANVAS)
+#define FG ht_rgb(HT_THEME_TEXT)
+#define DIM ht_rgb(HT_THEME_SECONDARY)
+#define ACCENT ht_rgb(HT_THEME_ACCENT)
+#define ERROR ht_rgb(HT_THEME_ERROR)
+#define SEL ht_rgb(HT_THEME_SELECTION)
+#define COPY(dst,src) copy(dst,sizeof(dst),src)
+'''
+for name in ['notice_sync_view','copy','control','text','center','heading','question_view','question_rows',
+ 'question_text','render_question','render_choices','render_answer_review',
+ 'open_question','question_answer','question_move','send_answer',
+ 'question_load','ui_question_show','ui_question_state','ui_answer_receipt','ui_question_close','ui_focus_project','ui_voice_question']:
+ code += function(name)
+actions = source.split(' case A_QUESTION_CHOICES:\n',1)[1].split(' case A_INBOX:',1)[0]
+code += 'static void dispatch(action_t a) { switch(a.kind) { case A_QUESTION_CHOICES:\n'+actions+'default: break; } }\n'
+worker = source.split('static void worker(',1)[1].split(' case A_QUESTION_READ:',1)[1].split(' default:',1)[0]
+code += 'static void work(action_t a) { switch(a.kind) { case A_QUESTION_READ:'+worker+'default: break; } }\n'
+code += r'''
+static void act(action_kind_t kind,int value) {
+ action_t a={.kind=kind,.value=value,.revision=s.q.revision,.dy=s.q.index};COPY(a.id,s.q.agent);dispatch(a);
+}
+static void state(const char *id,const char *fetch,const char *token,bool multi,const char *prompt) {
+ cJSON options[3]={{.type=JSTRING,.valuestring="This file only"},
+ {.type=JSTRING,.valuestring="The whole project"},{.type=JSTRING,.valuestring="Leave it as it is"}};
+ cJSON array=object(options,3);array.type=JARRAY;
+ cJSON fields[]={{.string="key",.type=JSTRING,.valuestring=prompt},
+ {.string="q",.type=JSTRING,.valuestring=prompt},
+ {.string="multi",.type=multi ? JTRUE : 0},
+ {.string="options",.type=JARRAY,.child=array.child},
+ {.string="canText",.type=multi ? 0 : JTRUE}};
+ cJSON question=object(fields,5),questions={.type=JARRAY,.child=&question};
+ cJSON reply[]={{.string="agentId",.type=JSTRING,.valuestring=id},
+ {.string="requestId",.type=JSTRING,.valuestring=fetch},
+ {.string="id",.type=JSTRING,.valuestring="q-a"},
+ {.string="token",.type=JSTRING,.valuestring=token},
+ {.string="ok",.type=JTRUE},
+ {.string="questions",.type=JARRAY,.child=questions.child}};
+ cJSON root=object(reply,6);ui_question_state(&root);
+}
+static void receipt(const char *token,bool ok) {
+ cJSON reply[]={{.string="agentId",.type=JSTRING,.valuestring="a"},
+ {.string="requestId",.type=JSTRING,.valuestring=s.q.fetch},
+ {.string="token",.type=JSTRING,.valuestring=token},
+ {.string="ok",.type=ok ? JTRUE : 0},
+ {.string="error",.type=JSTRING,.valuestring="Question changed. Check the terminal."},
+ {.string="pending",.type=pending_receipt ? JTRUE : 0}};
+ cJSON root=object(reply,6);ui_answer_receipt(&root);
+}
+static void spoken(const char *token,const char *text) {
+ cJSON reply[]={{.string="agentId",.type=JSTRING,.valuestring="a"},
+ {.string="token",.type=JSTRING,.valuestring=token},
+ {.string="questionIndex",.type=JNUMBER,.valuedouble=0},
+ {.string="draftId",.type=JSTRING,.valuestring="draft-1"},
+ {.string="text",.type=JSTRING,.valuestring=text}};
+ cJSON root=object(reply,5);ui_voice_question(&root);
+}
+static void recording(void) {
+ s.voice_open=s.voice_waiting=true;s.voice_return=QUESTION;
+ s.voice_question_revision=s.q.revision;s.voice_question_index=0;s.view=VOICE;
+}
+static const char *long_question="The helper found three related places using the old token. Should this change apply only to this file, across the whole project including tests, or should we leave the current behavior in place until the next release?";
+static void reset(bool multi) {
+ memset(&s,0,sizeof s);s.connected=true;s.pressed=-1;
+ congested=pending_receipt=false;transport_ok=true;queued_answers=sent_answers=removed=reads=0;
+ open_question();assert(s.q.loading && s.view==QUESTION);work(queued);assert(reads==1);
+ state("wrong",s.q.fetch,"token-a",multi,long_question);assert(s.q.loading);
+ state("a","old-read","token-a",multi,long_question);assert(s.q.loading);
+ state("a",s.q.fetch,"token-a",multi,long_question);assert(s.q.valid && s.q.supported && !s.q.loading);
+}
+static void render(const char *dir,const char *name) {
+ ht_scene_t scene;ht_scene_clear(&scene,BG);s.hit_count=0;
+ if(s.view==QUESTION) render_question(&scene);
+ else if(s.view==CHOICE) render_choices(&scene);
+ else render_answer_review(&scene);
+ assert(scene.count<=HT_RUNS);
+ if(!dir)return;
+ static uint16_t pixels[HT_WIDTH*HT_HEIGHT];ht_raster(&scene,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},pixels);
+ char path[512];snprintf(path,sizeof path,"%s/%s.ppm",dir,name);FILE *out=fopen(path,"wb");assert(out);
+ fprintf(out,"P6\n466 466\n255\n");
+ for(int y=0;y<466;y++)for(int x=0;x<466;x++) {
+ uint16_t v=pixels[y*466+x];v=(uint16_t)((v<<8)|(v>>8));
+ unsigned char rgb[3]={(unsigned char)((v>>11)*255/31),(unsigned char)(((v>>5)&63)*255/63),(unsigned char)((v&31)*255/31)};
+ if((x-233)*(x-233)+(y-233)*(y-233)>233*233)memset(rgb,0,3);
+ fwrite(rgb,1,3,out);
+ }
+ fclose(out);
+}
+int main(int argc,char **argv) {
+ const char *dir=argc>1 ? argv[1] : NULL;
+ reset(false);assert(s.q.item[0].can_text);recording();
+ spoken("token-a","Only update the parser. Keep the existing public API and add a regression test for empty input. Please leave the unrelated formatting alone and keep this change in one commit.");
+ assert(!s.voice_open && s.view==ANSWER_REVIEW && !s.q.item[0].selected && s.q.item[0].draft[0] && !queued_answers);
+ render(dir,"spoken-review");question_move(500);assert(s.offset>0 && !queued_answers);
+ act(A_ANSWER,0);work(queued);assert(!sent_choices[0] && !strcmp(sent_draft,"draft-1") && sent_answers==1);
+ reset(false);spoken("token-a","Unsolicited");assert(!s.q.item[0].draft[0] && s.view==QUESTION);
+ recording();spoken("wrong","Wrong question");assert(s.view==MESSAGE && !s.voice_open && !queued_answers);
+ reset(false);recording();s.q.revision++;spoken("token-a","Late");assert(s.view==MESSAGE && !s.q.item[0].draft[0]);
+ reset(false);recording();spoken("token-a","Unsupported \xe9\x9b\xaa");
+ assert(s.view==QUESTION && s.q.speech_error[0] && !s.q.item[0].draft[0]);
+ reset(false);recording();spoken("token-a","A new answer");act(A_QUESTION_BACK,0);
+ assert(s.view==QUESTION);act(A_QUESTION_REVIEW,0);assert(s.view==ANSWER_REVIEW && s.q.item[0].draft[0]);
+ act(A_QUESTION_BACK,0);act(A_QUESTION_CHOICES,0);act(A_CHOICE,1);assert(!s.q.item[0].draft[0] && s.q.item[0].selected==2);
+ reset(false);assert(question_rows(long_question)>6);render(dir,"question");
+ question_move(10000);assert(s.offset==question_rows(long_question)-5);render(dir,"question-end");
+ act(A_ANSWER,0);assert(!queued_answers); // Prompt never sends, and no default is selected.
+ act(A_QUESTION_CHOICES,0);assert(s.view==CHOICE && !s.q.item[0].selected);
+ act(A_QUESTION_REVIEW,0);assert(s.view==CHOICE);
+ question_move(40);assert(s.q.choice==1 && !s.q.item[0].selected);render(dir,"choice");
+ action_t stale={.kind=A_CHOICE,.value=2,.revision=s.q.revision-1,.id="a"};dispatch(stale);
+ assert(!s.q.item[0].selected);
+ act(A_CHOICE,1);assert(s.q.item[0].selected==2 && !queued_answers);
+ act(A_QUESTION_REVIEW,0);assert(s.view==ANSWER_REVIEW);render(dir,"review");
+ congested=true;act(A_ANSWER,0);assert(!s.q.pending && !queued_answers);
+ congested=false;act(A_ANSWER,0);assert(s.q.pending && queued_answers==1);
+ act(A_ANSWER,0);assert(queued_answers==1);work(queued);
+ assert(sent_answers==1 && sent_choices[0]==2 && s.q.pending && s.q.valid); // USB write is not completion.
+ receipt("old-token",true);assert(s.q.pending && !removed);
+ pending_receipt=true;receipt("token-a",true);assert(s.q.pending && s.q.valid && !removed);pending_receipt=false;
+ receipt("token-a",false);assert(s.q.pending && s.q.uncertain && s.q.error[0]);render(dir,"refused");
+ act(A_ANSWER,0);assert(queued_answers==1);
+ reset(true);act(A_QUESTION_CHOICES,0);act(A_CHOICE,0);act(A_CHOICE,2);
+ act(A_QUESTION_REVIEW,0);assert(!strcmp(s.q.item[0].answer,"This file only\n\nLeave it as it is"));
+ render(dir,"multi-review");act(A_ANSWER,0);work(queued);assert(sent_choices[0]==5);
+ receipt("token-a",true);assert(!s.q.valid && s.view==HOME && removed==1);
+ reset(false);act(A_QUESTION_CHOICES,0);act(A_CHOICE,1);act(A_QUESTION_REVIEW,0);act(A_ANSWER,0);
+ action_t old=queued;ui_question_close("a","old-question");assert(s.q.valid);
+ ui_question_show("b","Other","M2","q-b",NULL);assert(s.q.valid && s.q.pending && !strcmp(s.q.agent,"a"));
+ ui_question_show("a","Research","M2","q-new",NULL);assert(!s.q.valid && s.q.error[0]);
+ work(old);assert(!sent_answers); // Queued command cannot answer a replacement question.
+ reset(false);view(HOME);state("a",s.q.fetch,"token-a",false,long_question);assert(s.view==HOME);
+ reset(false);s.view=MESSAGE;visit.available=true;strcpy(visit.agent,"b");b_known=false;
+ ui_focus_project("b");assert(!strcmp(s.pending_focus,"b") && s.view==MESSAGE);
+ b_known=true;ui_focus_project("b");assert(s.view==QUESTION && s.q.loading && !strcmp(s.q.agent,"b"));
+ // The ESP32 compiler's -O0 restrict analysis sees the enclosing global s,
+ // not the disjoint options/answer fields. Exercise every selected subset
+ // at their real capacities and prove that no neighboring state changes.
+ unsigned combinations=0;
+ for(int index=0;index<QUESTION_MAX;index++) for(int options=1;options<=OPTION_MAX;options++)
+ for(unsigned mask=1;mask<(1u<<options);mask++) for(int length_case=0;length_case<4;length_case++) {
+ static const size_t lengths[]={1,127,254,255};
+ memset(&s.q,0,sizeof s.q);s.q.supported=true;s.q.index=index;
+ question_item_t *q=&s.q.item[index];q->count=options;q->selected=mask;
+ _Static_assert(OPTION_MAX*255+(OPTION_MAX-1)*2+1<=sizeof q->answer,"all full options fit the review buffer");
+ memset(q->answer,0x55,sizeof q->answer);
+ for(int i=0;i<options;i++) {memset(q->options[i],'A'+i,lengths[length_case]);q->options[i][lengths[length_case]]=0;}
+ question_t before=s.q;
+ char expected[sizeof q->answer];size_t used=0;
+ for(int i=0;i<options;i++) if(mask&(1u<<i)) {
+ if(used) {expected[used++]='\n';expected[used++]='\n';}
+ memset(expected+used,'A'+i,lengths[length_case]);used+=lengths[length_case];
+ }
+ expected[used]=0;
+ assert(question_answer() && !strcmp(q->answer,expected));
+ for(size_t i=used+1;i<sizeof q->answer;i++) assert(q->answer[i]==0x55);
+ memcpy(q->answer,before.item[index].answer,sizeof q->answer);
+ assert(!memcmp(&s.q,&before,sizeof s.q));combinations++;
+ }
+ printf("question UI: PASS (full prompt, focused choices, explicit review, correlated reads/receipts, stale commands, spoken drafts, pending and multi-select; %u full-capacity subsets preserve adjacent state); state=%zu bytes\n",combinations,sizeof(question_t));
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-question-ui-') as tmp:
+ out=Path(tmp);(out/'question_ui.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),'-I',str(native),
+ str(out/'question_ui.c'),str(native/'terminal.c'),str(native/'fonts.c'),'-o',str(out/'test')],check=True)
+ args=[str(out/'test')]
+ if os.environ.get('HABITAT_PREVIEW_DIR'):
+ dest=Path(os.environ['HABITAT_PREVIEW_DIR']);dest.mkdir(parents=True,exist_ok=True);args.append(str(dest))
+ subprocess.run(args,check=True)
diff --git a/devices/harness-device/firmware/test/test_raster_ascii.c b/devices/harness-device/firmware/test/test_raster_ascii.c
new file mode 100644
index 000000000..4027541de
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_raster_ascii.c
@@ -0,0 +1,71 @@
+// Direct ASCII decoding must retain every pixel from the generic Unicode path,
+// including clipping inside a cell, eviction, font/palette changes and fallback.
+#include "../main/ui/habitat/octopus.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t cached[HT_WIDTH * HT_HEIGHT + 2], original[HT_WIDTH * HT_HEIGHT + 2];
+static uint32_t seed = 0x4593082;
+static unsigned next(void) { seed ^= seed << 13; seed ^= seed >> 17; seed ^= seed << 5; return seed; }
+static void compare(const ht_scene_t *scene, ht_rect_t clip)
+{
+ size_t end = (size_t)clip.w * clip.h + 1;
+ cached[0] = original[0] = 0xabcd; cached[end] = original[end] = 0xdcba;
+ ht_raster_fast_ascii(false); ht_raster(scene, clip, original + 1);
+ ht_raster_fast_ascii(true); ht_raster(scene, clip, cached + 1);
+ assert(!memcmp(cached, original, (end + 1) * sizeof *cached));
+ assert(cached[0] == 0xabcd && cached[end] == 0xdcba);
+}
+int main(void)
+{
+ const ht_font_t *fonts[] = {&ht_octopus_font_2, &ht_octopus_font_4,
+ &ht_octopus_font_6, &ht_octopus_font_8, &ht_octopus_font_10, &ht_mono_20};
+ char alphabet[128];
+ for (int i = 0; i < 95; i++) alphabet[i] = i + 32;
+ memcpy(alphabet + 95, "\xe2\x80\x94\xe2\x80\x9c\xf0\x9f\x90\x99", 11);
+ ht_scene_t scene;
+ // Control bytes, every Latin-1 byte and punctuation/arrow fallback stay identical.
+ for (int cache = 0; cache < 2; cache++) {
+ ht_glyph_cache_enable(cache != 0);
+ for (int font = 0; font < 6; font++) for (unsigned byte = 1; byte < 256; byte++) {
+ char value[] = {(char)byte, 'A', (char)0xe2, (char)0x86, (char)0x97, 0};
+ ht_scene_clear(&scene, 0x7bef);
+ ht_text(&scene, -7, -3, 132, fonts[font], 0xefff, 0x031f, value);
+ compare(&scene, (ht_rect_t){0, 0, 150, 32});
+ }
+ }
+ ht_glyph_cache_enable(true);
+ for (unsigned i = 0; i < 6000; i++) {
+ ht_scene_clear(&scene, next());
+ for (unsigned row = 0, count = 1 + next() % 12; row < count; row++) {
+ const ht_font_t *font = fonts[next() % 6];
+ ht_text(&scene, (int)(next() % 120) - 40, (int)(next() % 130) - 25,
+ 1 + next() % 465, font, next(), next() % 2 ? scene.background : next(),
+ alphabet + next() % 95);
+ }
+ ht_rect_t clip = {next() % 80, next() % 110, 1 + next() % 380, 1 + next() % 40};
+ compare(&scene, clip);
+ }
+ ht_tim_face_t face = {.recipient = "Firmware", .status = "Coalescing",
+ .mood = HT_TIM_WORKING, .foreground = 0xffff, .dim = 0x7777, .ink = 0xafe0};
+ for (int layout = 0; layout < 4; layout++) {
+ face.focus = layout == 1;
+ const char *recap = layout == 2 ? "Fixed. All checks pass." : layout == 3 ?
+ "The update is installed. Voice input now sends to the selected agent. The result stays in the center." : NULL;
+ for (int frame = 0; frame < HT_OCTOPUS_FRAMES; frame++) {
+ face.pose = (ht_tim_pose_t){.blink = frame % 7 == 0, .level = frame % 5};
+ face.mood = (frame % 8);
+ face.unread = frame % 3 == 0;
+ ht_scene_clear(&scene, ht_rgb(0x080c08));
+ ht_octopus_face(&scene, &face, frame, ht_rgb(0xc8a9f0), recap);
+ compare(&scene, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT});
+ uint32_t builds = ht_glyph_cache_builds();
+ for (int y = 0; y < HT_HEIGHT; y += 24)
+ compare(&scene, (ht_rect_t){0, y, HT_WIDTH, y + 24 > HT_HEIGHT ? HT_HEIGHT - y : 24});
+ assert(ht_glyph_cache_builds() == builds); // full-to-strip reuse, no palette churn
+ }
+ }
+ assert(ht_glyph_cache_bytes() <= 2600);
+ puts("ASCII raster: 6000 clipped mixed scenes + 252 complete poses match the Unicode renderer; guards and warm reuse pass");
+}
diff --git a/devices/harness-device/firmware/test/test_reload_threads.py b/devices/harness-device/firmware/test/test_reload_threads.py
new file mode 100644
index 000000000..b01e21eb3
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_reload_threads.py
@@ -0,0 +1,66 @@
+"""Publish/read the production refresh-task handle concurrently, without FreeRTOS."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+root = Path(__file__).resolve().parent.parent
+source = Path(os.environ.get('UI_SOURCE',root/'main/ui/habitat/ui_habitat.c')).read_text()
+
+
+def function(name):
+ m = re.search(r'^[^\n]*\b'+name+r'\([^;\n]*\) \{[^\n]*\}',source,re.M)
+ if not m:
+ m = re.search(r'^[^\n]*\b'+name+r'\([^;]*?\)\n\{.*?^\}',source,re.M|re.S)
+ assert m, name
+ return m.group(0)+'\n'
+
+
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdatomic.h>
+#include <pthread.h>
+#include <stdio.h>
+typedef void *TaskHandle_t;
+static int a,b;
+static atomic_bool reload_requested,start;
+static atomic_uint wakes;
+static void xTaskNotifyGive(TaskHandle_t task) {
+ assert(task==&a || task==&b);atomic_fetch_add(&wakes,1);
+}
+'''
+code += re.search(r'^static [^\n]*\breload_waiter;',source,re.M).group(0)+'\n'
+for name in ['ui_set_reload_waiter','ui_request_agent_reload','ui_take_agent_reload_req','ui_peek_agent_reload_req']:
+ code += function(name)
+code += r'''
+static void *writer(void *unused) {
+ (void)unused;while(!atomic_load(&start)) {}
+ for(unsigned i=0;i<200000;i++)ui_set_reload_waiter(i&1?&a:&b);
+ return NULL;
+}
+static void *reader(void *unused) {
+ (void)unused;while(!atomic_load(&start)) {}
+ for(unsigned i=0;i<200000;i++) {
+ ui_request_agent_reload();assert(ui_peek_agent_reload_req());
+ assert(ui_take_agent_reload_req());assert(!ui_take_agent_reload_req());
+ }
+ return NULL;
+}
+int main(void) {
+ // Requests before task creation remain pending even without a wake target.
+ ui_request_agent_reload();assert(ui_take_agent_reload_req());assert(!atomic_load(&wakes));
+ ui_set_reload_waiter(&a);
+ pthread_t w,r;assert(!pthread_create(&w,NULL,writer,NULL));assert(!pthread_create(&r,NULL,reader,NULL));
+ atomic_store(&start,true);assert(!pthread_join(w,NULL));assert(!pthread_join(r,NULL));
+ assert(atomic_load(&wakes)==200000);
+ puts("UI reload: 200000 concurrent handle publications/notifications, pre-registration request and exact pending consumption PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-reload-threads-') as folder:
+ folder=Path(folder);(folder/'reload.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g','-pthread',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),str(folder/'reload.c'),
+ '-o',str(folder/'reload')],check=True)
+ subprocess.run([str(folder/'reload')],check=True,timeout=60)
diff --git a/devices/harness-device/firmware/test/test_render_guard.py b/devices/harness-device/firmware/test/test_render_guard.py
new file mode 100644
index 000000000..3c2cf0e29
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_render_guard.py
@@ -0,0 +1,71 @@
+"""Fault-inject time into the production display progress monitor, without hardware."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+source = (Path(__file__).resolve().parent / '../main/ui/habitat/display_habitat.c').read_text()
+
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+
+code = r'''
+#include <assert.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdatomic.h>
+#include <stdio.h>
+#include <string.h>
+static uint32_t clock_ms;
+static unsigned restarts;
+static char message[160];
+static atomic_uint render_stage, render_progress_ms;
+static bool advance_other_core;
+static uint32_t now_ms(void) {
+ uint32_t now = clock_ms;
+ // Another core advances progress between clock sampling and a later load.
+ if (advance_other_core) atomic_store(&render_progress_ms, now + 1);
+ return now;
+}
+#define ESP_LOGE(tag, fmt, ...) snprintf(message,sizeof message,fmt,__VA_ARGS__)
+#define abort() (++restarts)
+'''
+code += source[source.index('enum { RENDER_MODEL'):source.index('static atomic_uint render_stage')]
+if 'static uint32_t elapsed_since(' in source:
+ code += function('elapsed_since')
+code += function('render_progress') + function('render_watch')
+code += r'''
+int main(void) {
+ clock_ms=1000; atomic_store(&render_progress_ms,clock_ms);
+ advance_other_core=true; render_watch(NULL); assert(!restarts);
+ advance_other_core=false;
+ // Idle/sleep wakeups and normal frame stages keep making progress.
+ for (unsigned stage=RENDER_MODEL; stage<=RENDER_WAIT; stage++) {
+ for (unsigned i=0;i<100;i++) {
+ render_progress(stage); clock_ms+=1000; render_watch(NULL);
+ assert(!restarts);
+ }
+ // Every stage can block, including a panel call before DMA wait.
+ render_progress(stage); clock_ms+=3999; render_watch(NULL); assert(!restarts);
+ clock_ms++; render_watch(NULL); assert(restarts==1);
+ assert(strstr(message,"renderer stalled 4000 ms")); restarts=0;
+ }
+ // Clock wrap is ordinary uptime, not a multi-billion-millisecond stall.
+ clock_ms=UINT32_MAX-500; render_progress(RENDER_WAIT);
+ clock_ms=499; render_watch(NULL); assert(!restarts);
+ clock_ms=3499; render_watch(NULL); assert(restarts==1);
+ puts("render guard: cross-core timestamp race, every stage, idle/sleep, timeout boundary and clock wrap PASS");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-render-guard-') as folder:
+ folder = Path(folder)
+ (folder / 'guard.c').write_text(code)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'), str(folder / 'guard.c'),
+ '-o', str(folder / 'guard')], check=True)
+ subprocess.run([str(folder / 'guard')], check=True)
diff --git a/devices/harness-device/firmware/test/test_renderer_reference.c b/devices/harness-device/firmware/test/test_renderer_reference.c
new file mode 100644
index 000000000..aac5eda3e
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_renderer_reference.c
@@ -0,0 +1,53 @@
+// Identical-content comparison against the actual pre-optimization renderer.
+#include "reference48/reference.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static uint16_t old_pixels[HT_WIDTH*HT_HEIGHT], new_pixels[HT_WIDTH*HT_HEIGHT];
+static uint16_t region_pixels[HT_WIDTH*HT_HEIGHT];
+static ht_scene_t previous_old, previous_new, old_scene, new_scene;
+
+int main(void)
+{
+ const char *recaps[]={NULL,"The change is ready to try.",
+ "The update is installed. Voice input now sends to the selected agent. The result stays in the center."};
+ unsigned scenes=0;
+ for(int layout=0;layout<4;layout++) for(int mood=0;mood<8;mood++) {
+ memset(&previous_old,0,sizeof previous_old);memset(&previous_new,0,sizeof previous_new);
+ for(int frame=0;frame<HT_OCTOPUS_FRAMES;frame++) {
+ ht_tim_face_t f={.recipient=frame%2?"Deploy latest firmware":"Mobile app build and deploy",
+ .status=frame%3?"Inbox 2 / Working":"Inbox 2 / Wandering",.mood=mood,
+ .foreground=0xffff,.dim=ht_rgb(0x909990),.ink=ht_rgb(0xb9ed80),
+ .unread=(frame%2)!=0,.straight_title=layout==3,
+ .pose={.look=frame%3-1,.blink=frame%13==0,.level=frame%5,.pressed=frame%17==0}};
+ ht_scene_clear(&old_scene,ht_rgb(0x080c08)); ht_scene_clear(&new_scene,old_scene.background);
+ const char *recap=recaps[layout%3];
+ ht48_octopus_face(&old_scene,&f,frame,ht_rgb(0xc8a9f0),recap);
+ ht_octopus_face(&new_scene,&f,frame,ht_rgb(0xc8a9f0),recap);
+ if(old_scene.count!=new_scene.count || memcmp(old_scene.runs,new_scene.runs,old_scene.count*sizeof(ht_run_t))) {
+ fprintf(stderr,"Scene mismatch layout=%d mood=%d frame=%d\n",layout,mood,frame);return 1;
+ }
+ ht_damage_t new_damage;
+ ht_damage(frame?&previous_new:NULL,&new_scene,&new_damage);
+ assert(new_damage.count<=HT_DAMAGE_MAX);
+ for(int n=0;n<new_damage.count;n++) {
+ ht_rect_t r=new_damage.rect[n];
+ assert(r.x>=0&&r.y>=0&&r.w>0&&r.h>0&&r.x+r.w<=HT_WIDTH&&r.y+r.h<=HT_HEIGHT);
+ ht_raster(&new_scene,r,region_pixels);
+ for(int y=0;y<r.h;y++)memcpy(new_pixels+(y+r.y)*HT_WIDTH+r.x,region_pixels+y*r.w,r.w*sizeof *new_pixels);
+ }
+ ht_rect_t full={0,0,HT_WIDTH,HT_HEIGHT};
+ ht48_raster(&old_scene,full,old_pixels);
+ if(memcmp(old_pixels,new_pixels,sizeof old_pixels)) {
+ fprintf(stderr,"Incremental pixel mismatch layout=%d mood=%d frame=%d\n",layout,mood,frame);return 1;
+ }
+ if(frame%7==0) {
+ ht_raster(&new_scene,full,region_pixels);
+ assert(!memcmp(old_pixels,region_pixels,sizeof old_pixels));
+ }
+ previous_old=old_scene;previous_new=new_scene;scenes++;
+ }
+ }
+ printf("Renderer reference: %u exact scenes/incremental frames and 288 additional full renders across four layouts/eight moods PASS\n",scenes);
+}
diff --git a/devices/harness-device/firmware/test/test_scroll.c b/devices/harness-device/firmware/test/test_scroll.c
new file mode 100644
index 000000000..96ec11e57
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_scroll.c
@@ -0,0 +1,146 @@
+#include "../main/ui/habitat/scroll.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <stdlib.h>
+
+typedef struct { ht_scroll_phase_t phase; int dy, velocity; } report_t;
+static report_t reports[256];
+static int count;
+static bool stalled;
+static bool emit(ht_scroll_phase_t phase, int dy, int velocity, void *ctx)
+{
+ (void)ctx;
+ if (stalled && phase == HT_SCROLL_MOVE) return false;
+ assert(count < 256);
+ reports[count++] = (report_t){phase, dy, velocity};
+ return true;
+}
+static int travel(void)
+{
+ int result = 0;
+ for (int i = 0; i < count; i++) result += reports[i].dy;
+ return result;
+}
+static void begin(ht_scroll_t *g, bool reversed, uint32_t now)
+{
+ memset(g, 0, sizeof(*g)); count = 0; stalled = false;
+ ht_scroll_begin(g, 200, 200, now, reversed, false, emit, NULL);
+ assert(count == 1 && reports[0].phase == HT_SCROLL_DOWN);
+}
+int main(void)
+{
+ ht_scroll_t g;
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 201, 205, 4);
+ assert(!ht_scroll_end(&g, 201, 205, 8));
+ assert(count == 2 && travel() == 0 && reports[1].velocity == 0);
+
+ // Horizontal navigation can carry vertical jitter, but must not move the terminal.
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 160, 208, 8);
+ ht_scroll_move(&g, 100, 220, 16);
+ assert(!ht_scroll_end(&g, 90, 221, 24));
+ assert(count == 2 && travel() == 0);
+
+ // Real scrolling leaves the device while the finger is DOWN, not only on release.
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 202, 216, 8);
+ assert(count == 2 && reports[1].phase == HT_SCROLL_MOVE && travel() == 16);
+ ht_scroll_move(&g, 203, 238, 16);
+ assert(ht_scroll_end(&g, 203, 241, 20));
+ assert(reports[count - 1].phase == HT_SCROLL_UP && travel() == 41);
+ assert(reports[count - 1].velocity > 0 && reports[count - 1].velocity <= 6000);
+
+ // A slow drag below the 8px batch size still reports within the 16ms window.
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 200, 214, 8);
+ int before = count;
+ ht_scroll_move(&g, 200, 217, 24);
+ assert(count == before + 1 && reports[count - 1].dy == 3);
+ ht_scroll_end(&g, 200, 217, 25);
+
+ // Resting before lift cancels the throw; holding does not keep a stale velocity.
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 200, 300, 16);
+ for (int t = 32; t <= 208; t += 16) ht_scroll_move(&g, 200, 300, t);
+ assert(ht_scroll_end(&g, 200, 300, 224));
+ assert(reports[count - 1].velocity == 0 && travel() == 100);
+
+ begin(&g, true, 0);
+ ht_scroll_move(&g, 200, 250, 16);
+ assert(ht_scroll_end(&g, 200, 256, 24));
+ assert(travel() == -56 && reports[count - 1].velocity < 0);
+
+ // Returning to the origin is still a scroll, never an accidental tap on Speak.
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 200, 160, 16);
+ assert(ht_scroll_end(&g, 200, 200, 32) && travel() == 0);
+
+ // A full worker queue retains all movement, including the release remainder.
+ begin(&g, false, 0);
+ stalled = true;
+ ht_scroll_move(&g, 200, 230, 16);
+ ht_scroll_move(&g, 200, 260, 32);
+ assert(count == 1);
+ assert(ht_scroll_end(&g, 200, 263, 36));
+ assert(count == 2 && travel() == 63 && reports[1].phase == HT_SCROLL_UP);
+
+ begin(&g, false, 0);
+ ht_scroll_move(&g, 200, 240, 16);
+ ht_scroll_cancel(&g);
+ assert(reports[count - 1].phase == HT_SCROLL_UP && reports[count - 1].velocity == 0);
+ before = count;
+ assert(!ht_scroll_end(&g, 200, 300, 32) && count == before);
+
+ // Timer wrap at ~49 days and two readings at the same timestamp are valid.
+ begin(&g, false, UINT32_MAX - 8);
+ ht_scroll_move(&g, 200, 220, 8);
+ assert(ht_scroll_end(&g, 200, 230, 8) && travel() == 30);
+ assert(reports[count - 1].velocity <= 6000);
+ // Several complete clockwise/counterclockwise turns cross all octants and the angle seam.
+ for(int sign=-1;sign<=1;sign+=2) for(int reversed=0;reversed<2;reversed++) {
+ memset(&g,0,sizeof(g)); count=0;
+ ht_scroll_begin(&g,433,233,1000,reversed!=0,true,emit,NULL);
+ for(int step=1;step<=96;step++) {
+ double angle=sign*step*6.283185307179586/32;
+ int x=233+(int)lround(200*cos(angle)),y=233+(int)lround(200*sin(angle));
+ ht_scroll_move(&g,x,y,1000+step*20);
+ }
+ assert(ht_scroll_end(&g,433,233,2940));
+ int expected=-sign*(reversed?-1:1)*1800;
+ assert(abs(travel()-expected)<=2);
+ assert(g.axis==3 && reports[count-1].velocity==0);
+ }
+ memset(&g,0,sizeof(g)); count=0;
+ ht_scroll_begin(&g,433,233,1000,false,true,emit,NULL);
+ assert(ht_scroll_end(&g,433,233,1080) && travel()==0); // rim tap never speaks
+ memset(&g,0,sizeof(g)); count=0;
+ ht_scroll_begin(&g,433,233,1000,false,true,emit,NULL);
+ ht_scroll_move(&g,233,233,1010);
+ assert(!g.live && ht_scroll_end(&g,33,233,1020)); // radial/invalid path cannot become a swipe
+ assert(travel()==0 && reports[count-1].velocity==0);
+ unsigned seed=1899;
+ for(int trial=0;trial<6000;trial++) {
+ memset(&g,0,sizeof(g)); count=0;
+ ht_scroll_begin(&g,433,233,1000,false,true,emit,NULL);
+ for(int step=0;step<12;step++) {
+ seed=seed*1664525u+1013904223u; int x=(int)(seed%466);
+ seed=seed*1664525u+1013904223u; int y=(int)(seed%466);
+ ht_scroll_move(&g,x,y,1004+step*4);
+ }
+ assert(ht_scroll_end(&g,433,233,1060));
+ int downs=0,ups=0;
+ for(int j=0;j<count;j++) {
+ downs+=reports[j].phase==HT_SCROLL_DOWN;
+ ups+=reports[j].phase==HT_SCROLL_UP;
+ assert(abs(reports[j].dy)<=2048);
+ }
+ assert(downs==1 && ups==1 && reports[count-1].velocity==0);
+ }
+ assert(ht_scroll_coast_ms(0)==0 && ht_scroll_coast_ms(39)==0);
+ assert(ht_scroll_coast_ms(6000)>700 && ht_scroll_coast_ms(6000)<900);
+ assert(ht_scroll_coast_ms(-6000)==ht_scroll_coast_ms(6000));
+ puts("scroll: PASS (10 linear scenarios, full rim turns, reversal, seam, radial cancellation and brake window)");
+}
diff --git a/devices/harness-device/firmware/test/test_search_ui.py b/devices/harness-device/firmware/test/test_search_ui.py
new file mode 100644
index 000000000..a026455d2
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_search_ui.py
@@ -0,0 +1,83 @@
+"""Exercise production output search packet validators and callbacks with decoded JSON trees."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+native = Path(__file__).resolve().parent / '../main/ui/habitat'
+source = (native/'ui_habitat.c').read_text()
+def function(name):
+ m=re.search(r'^[^\n]*\b'+name+r'\([^;]*?\)\n\{.*?^\}',source,re.M|re.S)
+ assert m,name
+ return m.group(0)+'\n'
+code=r'''
+#include "terminal.h"
+#include "selection.h"
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+enum {HOME,SELECTION,VOICE};
+typedef struct cJSON {const char *string,*valuestring;int type,valueint;double valuedouble;struct cJSON *child,*next;} cJSON;
+enum {STRING=1,TRUE=2,NUMBER=3};
+static bool cJSON_IsString(const cJSON *v){return v && v->type==STRING;}
+static bool cJSON_IsNumber(const cJSON *v){return v && v->type==NUMBER;}
+static bool cJSON_IsTrue(const cJSON *v){return v && v->type==TRUE;}
+static const cJSON *cJSON_GetObjectItemCaseSensitive(const cJSON *v,const char *key){
+ for(const cJSON *p=v?v->child:NULL;p;p=p->next)if(p->string && !strcmp(p->string,key))return p;return NULL;
+}
+static cJSON object(cJSON *children,int n){for(int i=0;i<n;i++)children[i].next=i+1<n?&children[i+1]:NULL;return(cJSON){.child=children};}
+static ht_selection_t selection;
+static struct {bool voice_open,voice_waiting,voice_search;int voice_return,view;} s;
+static int gesture,changes;
+static uint32_t ms(void){return 1000;}
+static void change(void){changes++;}
+static void display_lock(void){}
+static void display_unlock(void){}
+static void voice_close(void){s.voice_open=s.voice_waiting=false;}
+static void view(int v){s.view=v;}
+static void ht_gesture_guard(int *g,uint32_t t){(void)g;(void)t;}
+static bool emit(const ht_select_command_t *c,void *ctx){(void)c;(void)ctx;return true;}
+#define COPY(dst,src) snprintf(dst,sizeof(dst),"%s",src)
+'''
+
+for name in ['selection_search_fields','ui_voice_search','ui_selection_state']:
+ code+=function(name)
+code+=r"""
+#define S(key,v) {.string=key,.type=STRING,.valuestring=v}
+#define N(key,v) {.string=key,.type=NUMBER,.valueint=v,.valuedouble=v}
+#define B(key) {.string=key,.type=TRUE}
+int main(void) {
+ ht_selection_open(&selection,"pick-one","a",1000,emit,NULL);
+ assert(ht_selection_reply(&selection,selection.request,"pick-one",true,1,"old passage",1,false,NULL,1001));
+ cJSON fields[]={S("selectionId","pick-one"),S("agentId","a"),N("revision",2),S("excerpt","error [x]"),
+ N("rows",1),S("query","error [x]"),N("match",1),N("matches",3),B("ok"),S("requestId","pick-2")};
+ cJSON p=object(fields,sizeof fields/sizeof *fields);
+ s.voice_open=s.voice_waiting=true;s.voice_return=SELECTION;s.view=VOICE;
+ ui_voice_search(&p);assert(selection.revision==1); // Ordinary dictation cannot consume a search reply.
+ s.voice_search=true;fields[1].valuestring="another";ui_voice_search(&p);assert(s.voice_open);
+ fields[1].valuestring="a";fields[2].valuedouble=2.5;ui_voice_search(&p);assert(s.voice_open);
+ fields[2].valuedouble=2;fields[6].valueint=fields[6].valuedouble=4;ui_voice_search(&p);assert(s.voice_open);
+ fields[6].valueint=fields[6].valuedouble=1;ui_voice_search(&p);
+ assert(!s.voice_open && s.view==SELECTION && selection.revision==2 && selection.matches==3);
+ ht_selection_move(&selection,60,1002);assert(selection.pending);
+ char request[32];snprintf(request,sizeof request,"pick-%lu",(unsigned long)selection.request);
+ fields[9].valuestring="pick-99";fields[2].valueint=fields[2].valuedouble=3;ui_selection_state(&p);assert(selection.pending);
+ fields[9].valuestring=request;fields[6].valueint=fields[6].valuedouble=2;ui_selection_state(&p);
+ assert(!selection.pending && selection.match==2 && changes>0);
+ // No matches still returns a usable Find control but no quote.
+ s.voice_open=s.voice_waiting=true;s.view=VOICE;fields[2].valueint=fields[2].valuedouble=4;
+ fields[4].valueint=fields[4].valuedouble=0;fields[6].valueint=fields[6].valuedouble=0;
+ fields[7].valueint=fields[7].valuedouble=0;fields[3].valuestring="";
+ ui_voice_search(&p);assert(!s.voice_open && selection.matches==0 && selection.rows==0 && !selection.excerpt[0]);
+ s.voice_open=s.voice_waiting=true;ht_selection_close(&selection);ui_voice_search(&p);assert(s.voice_open);
+ puts("search UI: PASS (purpose, recipient, revision, match metadata, pending movement, no matches and late cancellation)");
+}
+"""
+with tempfile.TemporaryDirectory(prefix='harness-search-ui-') as d:
+ root=Path(d);(root/'test.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g','-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ '-I',str(native),str(root/'test.c'),str(native/'selection.c'),'-o',str(root/'test')],check=True)
+ subprocess.run([str(root/'test')],check=True)
diff --git a/devices/harness-device/firmware/test/test_selection.c b/devices/harness-device/firmware/test/test_selection.c
new file mode 100644
index 000000000..2bf5a16f4
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_selection.c
@@ -0,0 +1,87 @@
+#include "../main/ui/habitat/selection.h"
+#include <assert.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+static ht_select_command_t last;
+static char last_id[48];
+static int count;
+static bool blocked;
+static bool emit(const ht_select_command_t *c, void *ctx)
+{
+ (void)ctx;
+ if (blocked) return false;
+ last = *c; snprintf(last_id, sizeof(last_id), "%s", c->id); last.id = last_id;
+ count++;
+ return true;
+}
+static void reply(ht_selection_t *s, uint32_t now)
+{
+ assert(ht_selection_reply(s, s->request, s->id, true, s->revision + 1, "a selected line", 1,
+ last.op == HT_SELECT_EXTEND, NULL, now));
+}
+int main(void)
+{
+ ht_selection_t s = {0};
+ ht_selection_open(&s, "pick-one", "agent-a", 10, emit, NULL);
+ assert(last.op == HT_SELECT_BEGIN && s.pending && !ht_selection_ready(&s));
+ uint32_t stale = s.request;
+ // Contacts continue while desktop is replying, without a flood of requests.
+ for (int i = 0; i < 1000; i++) ht_selection_move(&s, -466, 20);
+ assert(count == 1 && s.queued == -8);
+ reply(&s, 21);
+ assert(last.op == HT_SELECT_STEP && last.delta == -8 && s.pending);
+ assert(!ht_selection_reply(&s, stale, s.id, true, 1, "old", 1, false, NULL, 22));
+ reply(&s, 23);
+ assert(ht_selection_ready(&s));
+ ht_selection_extend(&s, 24); assert(!ht_selection_ready(&s));
+ reply(&s, 25); assert(s.extending);
+ // Wrong id, revision and oversized ranges cannot enable voice.
+ ht_selection_move(&s, 20, 26);
+ assert(!ht_selection_reply(&s, s.request, "wrong", true, s.revision + 1, "x", 1, false, NULL, 27));
+ assert(!ht_selection_reply(&s, s.request, s.id, true, s.revision + 2, "x", 1, false, NULL, 27));
+ assert(!ht_selection_reply(&s, s.request, s.id, true, s.revision + 1, "x", 17, false, NULL, 27));
+ assert(!ht_selection_ready(&s));
+ reply(&s, 28);
+ ht_selection_close(&s);
+ assert(last.op == HT_SELECT_CANCEL && !s.active && !ht_selection_ready(&s));
+ // Cancel before begin is acknowledged still names the cursor being created.
+ ht_selection_open(&s, "pick-two", "agent-a", 30, emit, NULL);
+ stale = s.request;
+ ht_selection_close(&s);
+ assert(last.op == HT_SELECT_CANCEL && !strcmp(last.id, "pick-two"));
+ assert(!ht_selection_reply(&s, stale, "pick-two", true, 1, "late", 1, false, NULL, 31));
+ // Queue failure is a retryable screen; it never drops into bare dictation.
+ blocked = true;
+ ht_selection_open(&s, "blocked", "a", 40, emit, NULL);
+ assert(s.error[0] && !s.announced && !ht_selection_ready(&s));
+ ht_selection_close(&s); blocked = false;
+ // Timeout works across the millisecond wrap, emits one cancel, stays quiet.
+ ht_selection_open(&s, "timeout", "a", UINT32_MAX - 1000, emit, NULL);
+ assert(!ht_selection_tick(&s, UINT32_MAX - 500));
+ assert(ht_selection_tick(&s, 2500));
+ assert(last.op == HT_SELECT_CANCEL && s.error[0]);
+ int after_timeout = count;
+ ht_selection_close(&s); assert(count == after_timeout);
+ ht_selection_open(&s,"search","a",3000,emit,NULL); reply(&s,3001);
+ assert(!ht_selection_found(&s,"search","b",2,"match",1,"error",1,3));
+ assert(!ht_selection_found(&s,"search","a",3,"match",1,"error",1,3));
+ assert(ht_selection_found(&s,"search","a",2,"first error",1,"error",1,3));
+ int before = count;
+ ht_selection_move(&s,59,3002); assert(count==before);
+ ht_selection_move(&s,1,3003); assert(last.op==HT_SELECT_MATCH && last.delta==1);
+ ht_selection_move(&s,120,3004); assert(s.queued==2);
+ assert(ht_selection_reply_search(&s,s.request,s.id,true,3,"second error",1,false,NULL,"error",2,3,3005));
+ assert(last.op==HT_SELECT_MATCH && last.delta==2 && s.pending);
+ assert(ht_selection_reply_search(&s,s.request,s.id,true,4,"first error",1,false,NULL,"error",1,3,3006));
+ ht_selection_extend(&s,3007); assert(last.op==HT_SELECT_LINES);
+ reply(&s,3008); assert(!s.query[0]);
+ assert(!ht_selection_found(&s,"search","a",6,"",0,"missing",1,0));
+ assert(ht_selection_found(&s,"search","a",6,"",0,"missing",0,0));
+ assert(ht_selection_ready(&s) && !s.excerpt[0]);
+ before=count; ht_selection_extend(&s,3009); assert(count==before);
+ assert(ht_selection_found(&s,"search","a",7,"found again",1,"found",1,1));
+ ht_selection_close(&s); assert(!ht_selection_found(&s,"search","a",8,"late",1,"found",1,1));
+ puts("selection: bounded movement, identity, cancellation, queue failure and wraparound passed");
+}
diff --git a/devices/harness-device/firmware/test/test_terminal.c b/devices/harness-device/firmware/test/test_terminal.c
new file mode 100644
index 000000000..80e77d3ef
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_terminal.c
@@ -0,0 +1,226 @@
+// The incremental DMA result must exactly match a fresh full render, including removed text.
+#include "../main/ui/habitat/terminal.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static uint16_t full[HT_WIDTH * HT_HEIGHT], incremental[HT_WIDTH * HT_HEIGHT];
+static uint16_t scratch[HT_WIDTH * HT_HEIGHT];
+static uint32_t rng = 0x5eed;
+static unsigned next(void) { rng ^= rng << 13; rng ^= rng >> 17; rng ^= rng << 5; return rng; }
+
+static void transition(const ht_scene_t *before, const ht_scene_t *after)
+{
+ ht_damage_t d;
+ ht_damage(before, after, &d);
+ uint32_t pixels = 0;
+ for (int i = 0; i < d.count; i++) {
+ ht_rect_t r = d.rect[i];
+ assert(r.x >= 0 && r.y >= 0 && r.x + r.w <= HT_WIDTH && r.y + r.h <= HT_HEIGHT);
+ assert(!((r.x | r.y | r.w | r.h) & 1));
+ assert(r.w > 0 && r.h > 0);
+ pixels += r.w * r.h;
+ ht_raster(after, r, scratch);
+ for (int y = 0; y < r.h; y++)
+ memcpy(incremental + (r.y+y)*HT_WIDTH+r.x, scratch+y*r.w, (size_t)r.w*2);
+ }
+ assert(pixels == d.pixels);
+ ht_raster(after, (ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT}, full);
+ assert(memcmp(incremental, full, sizeof(full)) == 0);
+}
+
+static void punctuation_checks(void)
+{
+ static const char *unicode[]={"‐","‑","‒","–","—","―","−","‘","’","‚","‛","“","”","„","‟"};
+ static const char *ascii[]={"-","-","-","-","-","-","-","'","'","'","'","\"","\"","\"","\""};
+ const ht_font_t *fonts[]={&ht_mono_16,&ht_mono_20,&ht_mono_24,&ht_mono_28,&ht_pixel_40};
+ for (unsigned f=0;f<sizeof fonts/sizeof fonts[0];f++) {
+ for (unsigned i=0;i<sizeof unicode/sizeof unicode[0];i++) {
+ ht_scene_t a,b; ht_scene_clear(&a,0); ht_scene_clear(&b,0);
+ ht_text(&a,80,100,fonts[f]->width,fonts[f],0xffff,0,unicode[i]);
+ ht_text(&b,80,100,fonts[f]->width,fonts[f],0xffff,0,ascii[i]);
+ assert(!strcmp(a.runs[0].text,unicode[i])); // storage remains exact
+ assert(ht_can_display(unicode[i],fonts[f],fonts[f]->width,1));
+ ht_raster(&a,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},full);
+ ht_raster(&b,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},scratch);
+ assert(!memcmp(full,scratch,sizeof full));
+ ht_damage_t damage; ht_damage(&a,&b,&damage); assert(!damage.count);
+ ht_scene_clear(&b,0);
+ ht_text(&b,80,100,fonts[f]->width,fonts[f],0xffff,0,"?");
+ ht_raster(&b,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},scratch);
+ assert(memcmp(full,scratch,sizeof full)); // no fallback question mark
+ }
+ }
+}
+
+static void inline_arrow_checks(void)
+{
+ const int x = 80, y = 100, cell = ht_mono_20.width;
+ ht_scene_t inline_text, separate, question;
+ ht_scene_clear(&inline_text, 0);
+ ht_scene_clear(&separate, 0);
+ ht_scene_clear(&question, 0);
+ const char *text = "Open \xe2\x86\x97 now";
+ ht_text(&inline_text, x, y, cell * 10, &ht_mono_20, 0xffff, 0, text);
+ ht_text(&separate, x, y, cell * 5, &ht_mono_20, 0xffff, 0, "Open ");
+ ht_text(&separate, x + cell * 5, y, cell, &ht_open_20, 0xffff, 0, "\xe2\x86\x97");
+ ht_text(&separate, x + cell * 6, y, cell * 4, &ht_mono_20, 0xffff, 0, " now");
+ ht_text(&question, x, y, cell * 10, &ht_mono_20, 0xffff, 0, "Open ? now");
+ assert(!strcmp(inline_text.runs[0].text, text));
+ assert(ht_can_display(text, &ht_mono_20, cell * 10, 1));
+ ht_raster(&inline_text, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT}, full);
+ ht_raster(&separate, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT}, scratch);
+ assert(!memcmp(full, scratch, sizeof full));
+ ht_raster(&question, (ht_rect_t){0, 0, HT_WIDTH, HT_HEIGHT}, scratch);
+ assert(memcmp(full, scratch, sizeof full));
+ // The damage pass must not mistake the arrow for the old fallback glyph.
+ ht_damage_t d; ht_damage(&question, &inline_text, &d);
+ assert(d.count && d.pixels == (uint32_t)(cell * ht_mono_20.height));
+ transition(NULL, &question);
+ transition(&question, &inline_text);
+ transition(&inline_text, &question);
+ // Rendering a clipped portion uses the same pixels and never leaves the atlas.
+ ht_rect_t clip = {x + cell * 5 + 2, y + 4, 6, 16};
+ ht_raster(&inline_text, clip, full);
+ ht_raster(&separate, clip, scratch);
+ assert(!memcmp(full, scratch, (size_t)clip.w * clip.h * sizeof *full));
+}
+
+
+static void arc_checks(void)
+{
+ const char *names[] = {"", "hn", "Deploy latest firmware", "Mobile app build and deploy",
+ "12345678901234567890123456789012", "A name that extends well beyond the available arc",
+ "caf\xc3\xa9 \xe2\x80\x94 \xe2\x80\x9cReady\xe2\x80\x9d \xe2\x86\x97", "a\xf0\x9f"};
+ ht_scene_t a, b;
+ ht_scene_clear(&a, 0); transition(NULL, &a);
+ for (int edge = 0; edge < 2; edge++) for (unsigned n = 0; n < sizeof names / sizeof names[0]; n++) {
+ ht_scene_clear(&b, 0);
+ if (edge) ht_arc_status(&b, 0xffff, names[n]); else ht_arc_title(&b, 0xffff, names[n]);
+ if (!names[n][0]) { assert(!b.count); transition(&a, &b); a = b; continue; }
+ assert(b.count == 1 && b.runs[0].arc);
+ const char *p = b.runs[0].text; int count = 0;
+ while (*p) { ht_utf8_next(&p); count++; }
+ assert(count <= HT_ARC_COLS);
+ transition(&a, &b); a = b;
+ uint32_t builds = ht_arc_cache_builds();
+ // Arbitrary subregions must be pixel-identical to full rendering.
+ // The output guard catches an accidental stride based on the full cache.
+ for (int i = 0; i < 50; i++) {
+ ht_rect_t r = {(int)(next()%466), (int)(next()%466), 1+next()%90, 1+next()%35};
+ if (r.x+r.w > HT_WIDTH) r.w = HT_WIDTH-r.x;
+ if (r.y+r.h > HT_HEIGHT) r.h = HT_HEIGHT-r.y;
+ uint32_t size = r.w*r.h; scratch[size] = 0xabc1;
+ ht_raster(&b, r, scratch);
+ assert(scratch[size] == 0xabc1);
+ for (int y = 0; y < r.h; y++)
+ assert(!memcmp(scratch+y*r.w, full+(y+r.y)*HT_WIDTH+r.x, r.w*2));
+ }
+ assert(ht_arc_cache_builds() == builds); // no rotation on animation/strip redraw
+ b.runs[0].fg = ht_rgb(0x999999);
+ transition(&a, &b); a = b;
+ assert(ht_arc_cache_builds() == builds); // recoloring reuses coverage
+ ht_damage_t d; ht_damage(&a, &a, &d); assert(!d.count);
+ // Straight/curved/removed names clear all old pixels in either direction.
+ ht_scene_clear(&b, 0); ht_center(&b, 41, &ht_mono_20, 0xffff, names[n]);
+ transition(&a, &b); a = b;
+ ht_scene_clear(&b, 0); ht_arc_title(&b, 0xffff, names[n]);
+ transition(&a, &b); a = b;
+ }
+ ht_scene_clear(&b, 0); transition(&a, &b);
+ ht_scene_clear(&a, 0); ht_arc_title(&a, 0xffff, "Agent A"); ht_arc_status(&a, 0xffff, "[1] Coalescing...");
+ transition(NULL, &a); uint32_t builds = ht_arc_cache_builds();
+ for (int i = 0; i < 40; i++) transition(&a, &a);
+ assert(ht_arc_cache_builds() == builds); // independent top/bottom cache keys never evict each other
+ puts("arc: upper/lower clipped/full comparisons; UTF-8, removal, recoloring and warm-cache reuse passed");
+}
+
+static void lock_dot_checks(void)
+{
+ assert(ht_lock_dot.first=='o'&&ht_lock_dot.last=='o');
+ assert(ht_lock_dot.width==ht_pixel_40.width&&ht_lock_dot.height==ht_pixel_40.height);
+ size_t bytes=((size_t)ht_lock_dot.width*ht_lock_dot.height+3)/4;
+ assert(!memcmp(ht_lock_dot.pixels,ht_pixel_40.pixels+('o'-ht_pixel_40.first)*bytes,bytes));
+ ht_scene_t original,compact;
+ ht_scene_clear(&original,0);ht_scene_clear(&compact,0);
+ for(int i=0;i<9;i++) {
+ int x=137+i%3*80,y=156+i/3*74;
+ uint16_t fg=ht_rgb(i%2?0xb9ed80:0x969f91);
+ ht_text(&original,x,y,40,&ht_pixel_40,fg,0,"o");
+ ht_text(&compact,x,y,40,&ht_lock_dot,fg,0,"o");
+ }
+ ht_raster(&original,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},full);
+ ht_raster(&compact,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},scratch);
+ assert(!memcmp(full,scratch,sizeof full));
+ puts("lock dot: exact old glyph bytes and nine-dot screen; 45120 unused font bytes removed");
+}
+
+int main(void)
+{
+ lock_dot_checks();
+ arc_checks();
+ punctuation_checks();
+ inline_arrow_checks();
+ ht_scene_t a = {0}, b = {0};
+ assert(ht_text_rows("one\ntwo\nthree",&ht_mono_20,348)==3);
+ assert(ht_text_rows("abcdefghi",&ht_mono_20,ht_mono_20.width*3)==3);
+ assert(ht_text_rows("",&ht_mono_20,348)==0);
+ assert(ht_text_rows("cannot fit",&ht_mono_20,1)==0);
+ ht_scene_clear(&a, ht_rgb(0x080c08));
+ ht_text(&a, 70, 121, 324, &ht_mono_20, ht_rgb(0xb9ed80), a.background, "A complete thread name");
+ transition(NULL, &a);
+ ht_damage_t d;
+ ht_damage(&a, &a, &d);
+ assert(d.count == 0 && d.pixels == 0);
+ ht_scene_clear(&b, a.background);
+ ht_text(&b, 70, 121, 324, &ht_mono_20, ht_rgb(0xb9ed80), b.background, "A");
+ transition(&a, &b);
+ a = b;
+ ht_scene_clear(&b, a.background);
+ transition(&a, &b); // removed run clears its old pixels
+ a = b;
+ static const char *labels[] = {"", "3 working", "1 needs you", "caf\xc3\xa9", "=^o.o^=", "\xf0\x9f\x90\x88 cat", "short", "A longer line of work"};
+ for (int frame = 0; frame < 500; frame++) {
+ ht_scene_clear(&b, frame % 23 ? a.background : ht_rgb(next() & 0xffffff));
+ unsigned count = next() % HT_RUNS;
+ for (unsigned i = 0; i < count; i++) {
+ int x = (int)(next()%560)-45, y = (int)(next()%540)-40;
+ const ht_font_t *font = next()&1 ? &ht_mono_20 : &ht_mono_16;
+ ht_text(&b, x, y, 1+next()%390, font, ht_rgb(next()&0xffffff),
+ next()%5 ? b.background : ht_rgb(0x263720), labels[next()%8]);
+ }
+ transition(&a, &b);
+ a = b;
+ }
+ ht_scene_clear(&b, 0);
+ assert(ht_wrap(&b, 0, 0, 1, 10, 0, &ht_mono_20, 0xffff, "no infinite loop") == 0);
+ assert(ht_wrap(&b, 0, 0, 36, 3, 1, &ht_mono_20, 0xffff, "one two three four") > 0);
+ const char *truncated = "\xf0\x9f";
+ assert(ht_utf8_next(&truncated) == '?');
+ for (int i=0; i<3 && *truncated; i++) ht_utf8_next(&truncated);
+ assert(*truncated == 0);
+ assert(ht_can_display("A short answer",&ht_mono_20,348,6));
+ assert(!ht_can_display("one\ntwo\nthree\nfour",&ht_mono_20,348,3));
+ assert(!ht_can_display("\xf0\x9f\x90\x88",&ht_mono_20,348,3));
+ assert(!ht_can_display("this is long",&ht_mono_20,36,1));
+ // A compact Unicode atlas has neither space nor '?'. Neither may index
+ // before the atlas. Unsupported codepoints are empty cells; damage agrees.
+ static const uint8_t block_pixels[] = {255,255,255,255};
+ const ht_font_t blocks = {0x2588,0x2588,4,4,block_pixels};
+ assert(ht_can_display("█ █",&blocks,24,1));
+ assert(!ht_can_display("?",&blocks,24,1));
+ ht_scene_clear(&a,0);
+ ht_text(&a,10,10,24,&blocks,0xffff,0,"█ ?█");
+ transition(NULL,&a);
+ ht_scene_clear(&b,0);
+ ht_text(&b,10,10,24,&blocks,0xffff,0,"█ A█");
+ ht_damage(&a,&b,&d);assert(d.count==0);
+ transition(&a,&b);
+ a=b;
+ ht_scene_clear(&b,0);
+ ht_text(&b,10,10,24,&blocks,0xffff,0," █ ");
+ transition(&a,&b);
+ puts("terminal: 503 incremental/full-frame equivalence checks; UTF-8, clipping, bounds, wrap passed");
+ return 0;
+}
diff --git a/devices/harness-device/firmware/test/test_tim.c b/devices/harness-device/firmware/test/test_tim.c
new file mode 100644
index 000000000..eeb376df8
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_tim.c
@@ -0,0 +1,78 @@
+#include "../main/ui/habitat/tim.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+static ht_scene_t scene(ht_tim_pose_t pose, bool focus, ht_tim_mood_t mood)
+{
+ ht_scene_t s; ht_scene_clear(&s,ht_rgb(0x080c08));
+ ht_tim_face_t f={.recipient="Deploy latest firmware",.status="working",.hint="tap to talk",
+ .detail="Running firmware checks",.mood=mood,.pose=pose,.focus=focus,
+ .ink=ht_rgb(0xb9ed80),.foreground=ht_rgb(0xe8e9df),.dim=ht_rgb(0x969f91)};
+ ht_tim_face(&s,&f); assert(s.count<HT_RUNS); return s;
+}
+int main(void)
+{
+ ht_tim_motion_t m={0};
+ ht_tim_motion_tick(&m,1000,HT_TIM_CONTENT,false,true,false,233,0,0);
+ ht_scene_t before=scene(m.pose,false,HT_TIM_CONTENT);
+ unsigned frames=0,pixels=0,max_pixels=0;
+ for(uint32_t t=1025;t<=61000;t+=25) {
+ if(!ht_tim_motion_tick(&m,t,HT_TIM_CONTENT,false,true,false,233,0,0)) continue;
+ ht_scene_t after=scene(m.pose,false,HT_TIM_CONTENT); ht_damage_t damage;
+ ht_damage(&before,&after,&damage);
+ assert(damage.pixels>0 && damage.pixels<=4096);
+ frames++; pixels+=damage.pixels;
+ if(damage.pixels>max_pixels) max_pixels=damage.pixels;
+ before=after;
+ }
+ assert(frames>=12 && frames<=24); // sparse two-frame blinks, never a continuous redraw loop
+ printf("tim-motion: {\"idle_seconds\":60,\"frames\":%u,\"display_bytes\":%u,\"max_frame_bytes\":%u}\n",frames,pixels*2,max_pixels*2);
+ ht_tim_motion_tick(&m,62000,HT_TIM_CONTENT,true,true,false,233,0,0);
+ for(uint32_t t=62025;t<82000;t+=25)
+ assert(!ht_tim_motion_tick(&m,t,HT_TIM_CONTENT,true,true,true,400,4,3));
+ ht_tim_motion_tick(&m,83000,HT_TIM_CONTENT,false,false,false,233,0,0);
+ for(uint32_t t=83025;t<103000;t+=25)
+ assert(!ht_tim_motion_tick(&m,t,HT_TIM_WORKING,false,false,false,233,0,t));
+ assert(ht_tim_motion_tick(&m,104000,HT_TIM_CONTENT,false,true,true,400,0,0));
+ assert(m.pose.look==2 && m.pose.pressed && !m.pose.blink);
+ assert(ht_tim_motion_tick(&m,104100,HT_TIM_CONTENT,false,true,true,50,0,0));
+ assert(m.pose.look==-2);
+ ht_tim_motion_tick(&m,104150,HT_TIM_CONTENT,false,true,false,50,0,0);
+ assert(m.pose.look==-2 && !m.pose.pressed);
+ ht_tim_motion_tick(&m,104550,HT_TIM_CONTENT,false,true,false,50,0,0);
+ assert(m.pose.look==0);
+ ht_tim_motion_tick(&m,105000,HT_TIM_WORKING,false,true,false,233,0,10);
+ assert(m.pose.hands);
+ ht_tim_motion_tick(&m,105850,HT_TIM_WORKING,false,true,false,233,0,11);
+ assert(!m.pose.hands); // event storm cannot continuously restart the reaction
+ ht_tim_motion_tick(&m,107100,HT_TIM_WORKING,false,true,false,233,0,12);
+ assert(m.pose.hands);
+ ht_tim_motion_tick(&m,108000,HT_TIM_LISTENING,false,true,false,233,4,12);
+ assert(m.pose.level==4);
+ before=scene(m.pose,false,HT_TIM_LISTENING);
+ ht_tim_motion_tick(&m,108050,HT_TIM_LISTENING,false,true,true,233,0,12);
+ assert(m.pose.level==4); // raw touch reports cannot raise mic animation above 8Hz
+ ht_tim_motion_tick(&m,108125,HT_TIM_LISTENING,false,true,false,233,0,12);
+ ht_scene_t after=scene(m.pose,false,HT_TIM_LISTENING); ht_damage_t damage;
+ ht_damage(&before,&after,&damage); assert(damage.pixels>0 && damage.pixels<=4096);
+ before=scene((ht_tim_pose_t){0},true,HT_TIM_CONTENT);
+ after=scene((ht_tim_pose_t){.blink=true},true,HT_TIM_CONTENT);
+ ht_damage(&before,&after,&damage); assert(damage.pixels>0 && damage.pixels<=4096);
+ m=(ht_tim_motion_t){0};
+ ht_tim_motion_tick(&m,UINT32_MAX-2000,HT_TIM_CONTENT,false,true,false,233,0,0);
+ ht_tim_motion_tick(&m,3800,HT_TIM_CONTENT,false,true,false,233,0,0); assert(m.pose.blink);
+ ht_tim_motion_tick(&m,3950,HT_TIM_CONTENT,false,true,false,233,0,0); assert(!m.pose.blink);
+ ht_tim_motion_tick(&m,15000,HT_TIM_CONTENT,false,true,true,233,0,0);
+ assert(m.next_ms>=100); // holding through a blink deadline must not create a 1ms render loop
+ m=(ht_tim_motion_t){0};
+ ht_tim_motion_tick(&m,100,HT_TIM_WORKING,false,true,false,233,0,0);
+ ht_tim_motion_tick(&m,200,HT_TIM_DONE,false,true,false,233,0,0); assert(m.pose.look==2);
+ ht_tim_motion_tick(&m,600,HT_TIM_DONE,false,true,false,233,0,0); assert(m.pose.look==-2);
+ ht_tim_motion_tick(&m,1060,HT_TIM_DONE,false,true,false,233,0,0); assert(m.pose.blink);
+ ht_tim_motion_tick(&m,1600,HT_TIM_DONE,false,true,false,233,0,0); assert(!m.pose.look && !m.pose.blink);
+ ht_tim_motion_tick(&m,2000,HT_TIM_CONTENT,false,true,false,233,0,0);
+ ht_tim_motion_tick(&m,2200,HT_TIM_DONE,true,true,false,233,0,0); assert(!m.pose.look && !m.pose.blink);
+ ht_tim_motion_tick(&m,2400,HT_TIM_DONE,false,true,true,50,0,0); assert(m.pose.look==-2 && m.pose.pressed);
+ puts("tim: PASS (bounded idle/event/mic damage, quiet, hidden screen, touch gaze, cooldown, wrap)");
+}
diff --git a/devices/harness-device/firmware/test/test_touch_driver.py b/devices/harness-device/firmware/test/test_touch_driver.py
new file mode 100644
index 000000000..db0916ee3
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_touch_driver.py
@@ -0,0 +1,126 @@
+"""Exercise the production touch task against controller ACK/error/wake traces."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+p=Path(__file__).resolve().parent
+source=(p/'../main/ui/habitat/touch_habitat.c').read_text()
+body=re.search(r'static void task\(void \*arg\)\n\{.*?^\}',source,re.M|re.S).group(0)
+code=r'''
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdatomic.h>
+#include <stddef.h>
+#include <assert.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include "creature_gallery.h"
+#define HT_WIDTH 466
+#define HT_HEIGHT 466
+#define ESP_OK 0
+#define ESP_ERR_INVALID_RESPONSE 1
+#define ESP_FAIL 2
+#define TOUCH_CST9217 9217
+#define pdTRUE 1
+#define pdMS_TO_TICKS(x) (x)
+typedef int esp_err_t;
+static void *controller=(void*)1, *io=(void*)1;
+static atomic_uint presses, failures, inferred, last_press;
+static atomic_bool held, controller_ready;
+static struct {int touch;} b={9217};
+static const void *board_(void) { return &b; }
+#define board() ((const typeof(b)*)board_())
+typedef struct {uint32_t ms; int rc; bool down; uint16_t x,y;} sample_t;
+static sample_t *samples; static int count, at, forwarded_down, forwarded_up, canceled, woke;
+static bool asleep;
+static int power_off_at, power_on_at, sleep_on_lock, locks;
+static ht_gallery_t gallery;
+static jmp_buf stop;
+static int64_t esp_timer_get_time(void) { return samples[at].ms*1000ll; }
+static bool open_touch(void) {controller=(void*)1;return true;}
+static void ulTaskNotifyTake(int a,int t) { (void)a;(void)t;if(++at==count)longjmp(stop,1); }
+static int esp_lcd_touch_read_data(void *c) {
+ (void)c;if(at==power_off_at)asleep=true;if(at==power_on_at)asleep=false;return samples[at].rc;
+}
+static bool esp_lcd_touch_get_coordinates(void*c,uint16_t*x,uint16_t*y,uint16_t*s,uint8_t*n,int m) {
+ (void)c;(void)s;(void)m;*x=samples[at].x;*y=samples[at].y;*n=samples[at].down?1:0;return samples[at].down;
+}
+static void esp_lcd_touch_del(void*c){(void)c;}
+static void esp_lcd_panel_io_del(void*c){(void)c;}
+static void display_lock(void){if(++locks==sleep_on_lock)asleep=true;}
+static void display_unlock(void){}
+static bool display_is_asleep(void){return asleep;}
+static void display_wake(void){asleep=false;woke++;}
+static void display_bump_activity(void){}
+static void habitat_input_stamp(int64_t n){(void)n;}
+static void habitat_touch_cancel(void){canceled++;ht_gallery_cancel(&gallery);}
+static void habitat_touch(bool down,int x,int y,uint32_t n) {
+ ht_gallery_touch(&gallery,down,x,y,n);if(down)forwarded_down++;else forwarded_up++;
+}
+'''+body+r'''
+static void run(sample_t *s,int n,bool sleep,int off,int on,int lock_sleep) {
+ samples=s;count=n;at=forwarded_down=forwarded_up=canceled=woke=0;asleep=sleep;
+ power_off_at=off;power_on_at=on;sleep_on_lock=lock_sleep;locks=0;
+ ht_gallery_init(&gallery,s[0].ms);
+ gallery.creature=0; // Exercise original reaction traces, independent of gallery boot art.
+ controller=(void*)1;if(!setjmp(stop))task(NULL);
+}
+#define RUN(s,asleep_) run(s,sizeof(s)/sizeof(s[0]),asleep_,-1,-1,-1)
+#define RUN_POWER(s,off,on,lock_sleep) run(s,sizeof(s)/sizeof(s[0]),false,off,on,lock_sleep)
+int main(void) {
+ sample_t idle_ack[]={ {0,1,0,0,0},{20,0,1,233,220},{80,0,0,233,220} };
+ RUN(idle_ack,false);assert(forwarded_down==1&&forwarded_up==1&&canceled==0);
+ sample_t ack_between_taps[]={ {0,0,1,233,220},{70,0,0,233,220},{90,1,0,0,0},{190,0,1,233,220},{260,0,0,233,220} };
+ RUN(ack_between_taps,false);assert(forwarded_down==2&&forwarded_up==2&&canceled==0);
+ sample_t broken_contact[]={ {0,0,1,233,220},{20,1,1,233,220},{40,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{270,0,0,233,220} };
+ RUN(broken_contact,false);assert(forwarded_down==2&&forwarded_up==1&&canceled==1);
+ sample_t read_error[]={ {0,0,1,233,220},{20,2,0,0,0},{40,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{270,0,0,233,220} };
+ RUN(read_error,false);assert(forwarded_down==2&&forwarded_up==1&&canceled==1);
+ sample_t corrupt[]={ {0,0,1,900,220},{20,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{270,0,0,233,220} };
+ RUN(corrupt,false);assert(forwarded_down==1&&forwarded_up==1&&canceled==1);
+ sample_t wake[]={ {0,0,1,233,220},{20,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{270,0,0,233,220} };
+ RUN(wake,true);assert(forwarded_down==1&&forwarded_up==1&&canceled==1&&woke==1);
+ assert(gallery.booped); // First real tap after the swallowed wake tap must work.
+ sample_t wake_swipe[]={ {0,0,1,233,220},{20,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{230,0,1,100,220},{270,0,0,100,220} };
+ RUN(wake_swipe,true);assert(gallery.creature==1&&!gallery.booped);
+ sample_t wake_mood[]={ {0,0,1,233,220},{80,0,0,233,220},
+ {200,0,1,233,220},{230,0,1,233,90},{270,0,0,233,90} };
+ RUN(wake_mood,true);assert(gallery.mood==1&&!gallery.booped);
+ RUN(broken_contact,false);assert(gallery.booped); // Driver swallowed damaged contact's UP.
+ RUN(read_error,false);assert(gallery.booped);
+ RUN(corrupt,false);assert(gallery.booped);
+ sample_t idle_error[]={ {0,2,0,0,0},{20,0,1,233,220},{80,0,0,233,220} };
+ RUN(idle_error,false);assert(gallery.booped&&canceled==1);
+ sample_t off_mid_swipe[]={ {0,0,1,233,220},{20,0,1,100,220},{80,0,0,100,220} };
+ RUN_POWER(off_mid_swipe,1,-1,-1);
+ assert(gallery.creature==0&&!gallery.booped&&asleep&&canceled==1&&forwarded_up==0);
+ // PWR wakes the screen while that finger is still held: it stays quarantined.
+ sample_t off_on_held[]={ {0,0,1,233,220},{20,0,1,220,220},{40,0,1,100,220},
+ {80,0,0,100,220},{200,0,1,233,220},{270,0,0,233,220} };
+ RUN_POWER(off_on_held,1,2,-1);
+ assert(gallery.creature==0&&gallery.booped&&canceled==1&&forwarded_up==1);
+ // A release arriving exactly after sleep cannot finish a partially moved gesture.
+ sample_t off_at_release[]={ {0,0,1,233,220},{20,0,1,100,220},{80,0,0,100,220} };
+ RUN_POWER(off_at_release,2,-1,-1);
+ assert(gallery.creature==0&&!gallery.booped&&canceled==1&&forwarded_up==0);
+ // Screen power may change after the initial wake check, while waiting for the UI lock.
+ RUN_POWER(off_mid_swipe,-1,-1,2);
+ assert(gallery.creature==0&&!gallery.booped&&canceled==1&&forwarded_up==0);
+ puts("touch driver: PASS (production task + gallery; ACK/error recovery, wake gestures, power off/on during contact and sleep at dispatch)");
+}
+'''
+with tempfile.TemporaryDirectory(prefix='harness-touch-driver-') as d:
+ root=Path(d);(root/'driver.c').write_text(code)
+ subprocess.run(['cc','-std=gnu11','-Wall','-Wextra','-Werror','-O1',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ '-I',str(p/'../main/ui/habitat'),str(root/'driver.c'),
+ str(p/'../main/ui/habitat/creature_gallery.c'),str(p/'../main/ui/habitat/creature_font.c'),
+ str(p/'../main/ui/habitat/terminal.c'),str(p/'../main/ui/habitat/fonts.c'),
+ '-o',str(root/'driver')],check=True)
+ subprocess.run([str(root/'driver')],check=True)
diff --git a/devices/harness-device/firmware/test/test_touch_ui.py b/devices/harness-device/firmware/test/test_touch_ui.py
new file mode 100644
index 000000000..3726e0619
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_touch_ui.py
@@ -0,0 +1,1432 @@
+"""Replay physical contacts through the production Habitat handler and render its actual scenes."""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+from native_shapes import defines, typedef
+
+here = Path(__file__).resolve().parent
+native = here / '../main/ui/habitat'
+source = Path(os.environ.get('UI_SOURCE', native / 'ui_habitat.c')).read_text()
+def function(name):
+ m = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert m, name
+ return m.group(0) + '\n'
+
+code = r'''
+#include "runtime.h"
+#include "../../cable_features.h"
+#include "gestures.h"
+#include "scroll.h"
+#include "selection.h"
+#include "carry.h"
+#include "visit.h"
+#include "form.h"
+#include "draft.h"
+#include "octopus.h"
+#include "workspace.h"
+#include "command_face.h"
+#include "arc_geometry.inc"
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+'''
+# Keep real protocol capacities: a larger fake buffer can hide target truncation.
+code += defines('ID_MAX','CABLE_NAME_MAX','SWARM_ID_MAX','SWARMS_MAX','CABLE_MAX_AGENTS','MAX_PROJECTS')
+code += defines('NOTICES','QUESTION_MAX','OPTION_MAX','PANE_MEMORY_MAX',source=source)
+if '#define PANE_RESULT_BYTES ' in source:
+ code += defines('PANE_RESULT_BYTES', source=source)
+code += '\n'.join(re.findall(r'^#define TAB_\w+ \d+$', source, re.M)) + '\n'
+code += source[source.index('typedef enum {'):source.index('static EXT_RAM_BSS_ATTR struct {')]
+code += typedef('cable_swarm_t') + typedef('cable_notif_t')
+code += r'''
+static struct {
+ bool ready, locked, connected, loading, voice_open, voice_start_pending, voice_waiting, voice_carry, voice_review, voice_draft_append, voice_review_preview, voice_search;
+ bool quick_open, coasting, touch_brake, touch_down, touch_cancelled, pattern_error, lock_armed, quiet, nap, rim_enabled, focus_face, straight_title, muted;
+ int brightness;
+ char pattern[32], voice_target[CABLE_NAME_MAX];
+ int pattern_mask, pattern_len, view, voice_return, offset, active, count, pressed, hit_count;
+ int draft_drag, tab_drag, quick_choice, start_x, start_y, last_x, last_y, tab_count, machine_count, model_count, notice_count, pet_pose;
+ uint32_t touch_started, voice_second, coast_until, tim_activity, pet_until, last_celebration;
+ cable_swarm_t tabs[SWARMS_MAX];
+ struct { char id[64], name[96], state[16]; bool local; } machines[2];
+ char selected_tab[ID_MAX], pending_focus[ID_MAX], opening_notice[ID_MAX], title[80], message[256];
+ cable_notif_t notice[NOTICES];
+ pane_memory_t memory[PANE_MEMORY_MAX];
+ uint32_t memory_serial;
+ struct { char id[192]; } models[2];
+ char model_agent[64];
+ question_t q;
+ agent_t agents[MAX_PROJECTS]; hit_t hits[24];
+ ht_rect_t inbox_arc;
+} s;
+static ht_gesture_t gesture;
+static ht_octopus_motion_t octopus_motion;
+static ht_scroll_t scroll;
+static ht_selection_t selection;
+static ht_carry_t carry;
+static ht_visit_t visit;
+static action_t visit_queued;
+static int visit_sends,visit_wire;
+static char visit_wire_op[16];
+static bool question_pending;
+static bool visit_emit(const ht_visit_command_t *c,void *ctx);
+static ht_form_t form;
+static ht_draft_t draft;
+static ht_workspace_t workspace;
+static int tab_switches;
+static char tab_target[64];
+static action_t tab_queued;
+static int draft_actions, reviews;
+static ht_draft_command_t draft_command;
+static bool draft_emit(const ht_draft_command_t *c, void *ctx) { (void)ctx; draft_command=*c; draft_actions++; return true; }
+static ht_select_command_t selected_command;
+static int selections;
+static int carry_prepares, carry_drops, question_sends, desktop_opens;
+static char opened_agent[64];
+static char voice_context[48];
+static bool scroll_reversed, congestion, recording;
+static uint32_t host_features = 31;
+static bool cable_client_supports(uint32_t features) { return (host_features & features) == features; }
+typedef struct cJSON { const char *string,*valuestring; int type; struct cJSON *child,*next; } cJSON;
+enum { JSTRING=1,JTRUE=2 };
+static bool cJSON_IsString(const cJSON *v) { return v && v->type==JSTRING; }
+static bool cJSON_IsTrue(const cJSON *v) { return v && v->type==JTRUE; }
+static const cJSON *cJSON_GetObjectItemCaseSensitive(const cJSON *v,const char *key) {
+ for(const cJSON *p=v?v->child:NULL;p;p=p->next) if(p->string && !strcmp(p->string,key)) return p;
+ return NULL;
+}
+static action_t pressed_action;
+static int returns, form_actions;
+static ht_form_command_t form_command;
+static bool form_emit(const ht_form_command_t *c, void *ctx) {
+ (void)ctx; form_command=*c; form_actions++; return true;
+}
+static int starts, stops, boops, switches, down_reports, moves, ups, travel, waiting_count;
+static char target[64];
+#define COPY(dst, src) snprintf(dst, sizeof(dst), "%s", src)
+#include "theme.h"
+static uint16_t color(unsigned rgb);
+static unsigned preview_brightness = 100;
+#define BG color(HT_THEME_CANVAS)
+#define FG color(HT_THEME_TEXT)
+#define DIM color(HT_THEME_SECONDARY)
+#define ACCENT color(HT_THEME_ACCENT)
+#define ERROR color(HT_THEME_ERROR)
+#define SEL color(HT_THEME_SELECTION)
+#define ESP_LOGI(...) ((void)0)
+#define EXT_RAM_BSS_ATTR
+static void change(void) {}
+static void display_lock(void) {}
+static void display_unlock(void) {}
+static void display_wake(void) {}
+static bool config_check_lock(const char *s_) { (void)s_; return false; }
+static bool display_is_asleep(void) { return false; }
+static bool audio_client_active(void) { return recording; }
+static bool audio_client_recording(void) { return recording; }
+static unsigned audio_client_input_level(void) { return 3; }
+static agent_t *active(void) { return s.active >= 0 && s.active < s.count ? &s.agents[s.active] : NULL; }
+static int find(const char *id);
+static bool is_question(const char *id) { (void)id; return question_pending; }
+static void open_question(void) { s.view=QUESTION; }
+static bool visit_emit(const ht_visit_command_t *c,void *ctx) {
+ (void)ctx; if(congestion)return false;
+ visit_queued=(action_t){.kind=A_VISIT_SEND,.value=c->op,.revision=c->request};
+ COPY(visit_queued.id,c->agent); COPY(visit_queued.text,c->id); visit_sends++; return true;
+}
+static void cable_client_visit(const char *id,uint32_t request,const char *op,const char *agent) {
+ assert(id[0] && request); (void)agent; COPY(visit_wire_op,op); visit_wire++;
+}
+static int waiting(void) { return waiting_count; }
+static int working(void) { return s.agents[0].busy + s.agents[1].busy; }
+static bool select_emit(const ht_select_command_t *c, void *ctx) {
+ (void)ctx; if (congestion) return false; selected_command=*c; selections++; return true;
+}
+static bool carry_emit(const ht_carry_command_t *c, void *ctx) {
+ (void)ctx; if (congestion) return false;
+ if (c->cancel) carry_drops++;
+ else { carry_prepares++; assert(!strcmp(c->selection,"pick-test") && !strcmp(c->agent,"a")); }
+ return true;
+}
+static uint32_t fake_ms;
+static uint32_t ms(void) { return fake_ms ? fake_ms : gesture.began+75; }
+static uint32_t esp_random(void) { return 123; }
+static bool queue(action_t a) {
+ if (congestion) return false;
+ if (a.kind==A_ANSWER) question_sends++;
+ if (a.kind==A_TAB) { tab_switches++; COPY(tab_target,a.id); tab_queued=a; }
+ if (a.kind==A_TAB_REFRESH) tab_queued=a;
+ if (a.kind==A_DESKTOP) { desktop_opens++; COPY(opened_agent,a.id); }
+ return true;
+}
+static bool scroll_emit(ht_scroll_phase_t phase, int dy, int velocity, void *ctx) {
+ (void)velocity; (void)ctx;
+ if (congestion) return false;
+ if (phase == HT_SCROLL_DOWN) down_reports++;
+ if (phase == HT_SCROLL_MOVE) { moves++; travel += dy; }
+ if (phase == HT_SCROLL_UP) { ups++; travel += dy; }
+ return true;
+}
+'''
+code += function('color')
+code += function('settings_item') + function('settings_count') + function('hit_contains')
+code += function('find')
+for name in ['copy', 'recap_preview', 'pane_memory', 'pane_memory_apply', 'dismiss_result', 'activity_text', 'ensure', 'input_cancel', 'view', 'workspace_index', 'workspace_failed', 'ui_scroll_reportable', 'control', 'home_footer', 'footer_control', 'text', 'center', 'heading', 'question_view', 'question_rows', 'question_move', 'question_text', 'render_question', 'render_choices', 'render_answer_review', 'question_answer', 'send_answer', 'make_action', 'tim_mood', 'surface_tick', 'render_quick', 'command_face', 'render_workspace_preview', 'render_home', 'render_voice', 'render_selection', 'render_form', 'draft_move', 'render_draft', 'render_draft_options', 'ui_swarms_replace', 'ui_workspace_applied', 'ui_land_after_reload']:
+ code += function(name)
+code += function('render_settings') + function('ui_visit_state')
+code += function('ui_project_known') + function('ui_focus_project') + function('ui_apply_pending_focus')
+code += function('render_agents') + function('tabs_move') + function('render_tabs') + function('page_controls') + function('render_notice') + function('render_list')
+for name in ['notice_remove', 'notice_sync_view', 'notice_selection', 'notice_restore_selection', 'notice_add', 'ui_notify_task_done', 'ui_notif_seen', 'ui_notif_replace', 'ui_notif_open', 'ui_question_close', 'ui_answer_receipt']:
+ code += function(name)
+for name in ['event', 'ui_project_emit', 'ui_project_restore_event', 'ui_project_clear_event', 'ui_project_set_name', 'ui_project_remove', 'ui_project_clear_all', 'ui_project_apply_order']:
+ code += function(name)
+visit_actions=source.split(' case A_LATEST:',1)[1].split(' case A_TABS:',1)[0]
+code+='static void visit_action(action_t a) { switch(a.kind) { case A_LATEST:'+visit_actions+'default: break; } }\n'
+notice_actions=source.split(' case A_NOTICE:',1)[1].split(' case A_LATEST:',1)[0]
+code+='static void notice_action(action_t a) { switch(a.kind) { case A_NOTICE:'+notice_actions+'default: break; } }\n'
+desktop_actions=source.split(' case A_DESKTOP:',1)[1].split(' case A_UP:',1)[0]
+code+='static void desktop_action(action_t a) { switch(a.kind) { case A_DESKTOP:'+desktop_actions+'default: break; } }\n'
+visit_worker=source.split('static void worker(',1)[1].split(' case A_VISIT_SEND:',1)[1].split(' case A_SELECT_SEND:',1)[0]
+code+='static void visit_work(action_t a) { switch(a.kind) { case A_VISIT_SEND:'+visit_worker+'default: break; } }\n'
+carry_actions = source.split('case A_CARRY:\n',1)[1].split('case A_COMPANION:',1)[0]
+code += 'static void carry_action(action_t a) { switch(a.kind) { case A_CARRY:\n' + carry_actions + 'default: break; } }\n'
+code += 'static void dispatch(action_t a);\n'
+question_actions = source.split(' case A_QUESTION_CHOICES:\n',1)[1].split(' case A_INBOX:',1)[0]
+code += 'static void question_action(action_t a) { switch(a.kind) { case A_QUESTION_CHOICES:\n'+question_actions+'default: break; } }\n'
+draft_actions = source.split(' case A_DRAFT_EDIT:\n',1)[1].split(' case A_HOME:',1)[0]
+code += 'static void draft_action(action_t a) { switch(a.kind) { case A_DRAFT_EDIT:\n'+draft_actions+'default: break; } }\n'
+form_actions = source.split(' case A_FIND:\n case A_FORM:',1)[1].split(' case A_SETTINGS:',1)[0]
+code += 'static void form_action(action_t a) { switch(a.kind) { case A_FIND:\n case A_FORM:'+form_actions+'default: break; } }\n'
+workspace_actions = source.split(' case A_TABS:',1)[1].split(' case A_MACHINE:',1)[0]
+code += 'static void workspace_action(action_t a) { switch(a.kind) { case A_TABS:'+workspace_actions+'default: break; } }\n'
+page_actions = source.split(' case A_UP:',1)[1].split(' case A_LOCK:',1)[0]
+code += 'static void page_action(action_t a) { switch(a.kind) { case A_UP:'+page_actions+'default: break; } }\n'
+code += r'''
+static void dispatch(action_t a) {
+ if ((s.view==DRAFT || s.view==DRAFT_OPTIONS) && a.kind!=A_VOICE) { draft_action(a); return; }
+ if (question_view(s.view) && a.kind!=A_VOICE) { question_action(a); return; }
+ if (a.kind==A_CARRY || a.kind==A_CARRY_DROP) { carry_action(a); return; }
+ if (a.kind == A_FIND || a.kind == A_FORM || a.kind == A_FORM_MAIN || a.kind == A_FORM_BACK || a.kind == A_FORM_SAY) {
+ form_action(a);
+ } else if (a.kind == A_SELECT_FIND) { a.kind=A_VOICE; a.value=7; dispatch(a);
+ } else if (a.kind == A_VOICE) {
+ starts++; COPY(target, a.id); COPY(s.voice_target, a.value==7 ? "Find in output" : active()->name);
+ s.voice_carry=a.value==3; s.voice_search=a.value==7; COPY(voice_context,a.text);
+ s.voice_return=s.view; s.voice_open = recording = true; view(VOICE);
+ } else if (a.kind == A_VOICE_STOP) { stops++; if(a.value==1)reviews++; recording = false; }
+ else if (a.kind == A_VOICE_ABORT) { recording = s.voice_open = false; view(HOME); }
+ else if (a.kind == A_RETURN || a.kind == A_LATEST) { if(a.kind==A_RETURN)returns++; visit_action(a); }
+ else if (a.kind == A_PET) boops++;
+ else if (a.kind == A_AGENT) {
+ switches++; s.active = !strcmp(a.id, "b") ? 1 : 0; view(AGENT);
+ } else if (a.kind == A_SETTINGS) view(SETTINGS);
+ else if (a.kind == A_FIND) view(FORM);
+ else if (a.kind == A_AGENTS) view(AGENTS);
+ else if (a.kind == A_INBOX) view(s.notice_count ? INBOX : HOME);
+ else if (a.kind == A_HOME) view(HOME);
+ else if (a.kind == A_NOTICE) notice_action(a);
+ else if (a.kind == A_RECAP_DISMISS) dismiss_result(a.id);
+ else if (a.kind == A_DESKTOP) desktop_action(a);
+ else if (a.kind == A_UP || a.kind == A_DOWN) page_action(a);
+ else if (a.kind == A_TABS || a.kind == A_TAB) workspace_action(a);
+ else if (a.kind == A_SELECT_BEGIN) {
+ view(SELECTION); ht_selection_open(&selection,"pick-test",active()->id,1800,select_emit,NULL);
+ } else if (a.kind == A_SELECT_EXTEND) ht_selection_extend(&selection,3000);
+}
+'''
+code += function('habitat_touch') + function('habitat_touch_cancel')
+code += r'''
+static ht_scene_t scene;
+static void scene_take(void) {
+ ht_scene_clear(&scene, BG); s.hit_count = 0;
+ if (s.view == DRAFT) render_draft(&scene);
+ else if (s.view == DRAFT_OPTIONS) render_draft_options(&scene);
+ else if (s.view == QUESTION) render_question(&scene);
+ else if (s.view == CHOICE) render_choices(&scene);
+ else if (s.view == ANSWER_REVIEW) render_answer_review(&scene);
+ else if (s.view == FORM) render_form(&scene);
+ else if (s.view == VOICE) render_voice(&scene);
+ else if (s.view == TABS || s.view == INBOX || s.view == MACHINES) render_list(&scene);
+ else if (s.view == AGENTS) render_agents(&scene);
+ else if (s.view == SELECTION) render_selection(&scene); else render_home(&scene);
+ if (s.view == SETTINGS) { ht_scene_clear(&scene,BG); s.hit_count=0; render_settings(&scene); }
+}
+static void reset(void) {
+ host_features=31; fake_ms=0;
+ memset(&visit,0,sizeof visit); visit_sends=visit_wire=returns=0; question_pending=false;
+ memset(&workspace,0,sizeof workspace); tab_switches=0; tab_target[0]=0;
+ memset(&selection,0,sizeof(selection)); selections=0;
+ memset(&carry,0,sizeof(carry)); carry_prepares=carry_drops=0; voice_context[0]=0;
+ ht_draft_reset(&draft); draft_actions=reviews=0; ht_form_reset(&form); form_actions=0;
+ memset(&octopus_motion,0,sizeof(octopus_motion)); memset(&s, 0, sizeof(s)); memset(&gesture, 0, sizeof(gesture)); memset(&scroll, 0, sizeof(scroll));
+ s.ready = s.connected = true; s.count = 2; s.active = 0; s.view = HOME; s.pressed = -1;
+ s.brightness = preview_brightness;
+ strcpy(s.agents[0].id, "a"); strcpy(s.agents[1].id, "b");
+ strcpy(s.agents[0].name, "Deploy latest firmware"); strcpy(s.agents[1].name, "Agent B");
+ recording = congestion = false; starts = stops = boops = switches = question_sends = 0;
+ down_reports = moves = ups = travel = waiting_count = 0; target[0] = 0;
+ desktop_opens=0; opened_agent[0]=0;
+ scene_take();
+}
+static void workspace_setup(void) {
+ reset(); s.tab_count=4; strcpy(s.selected_tab,"tab-1");
+ static const char *names[]={"M2","Product","Device","Research"};
+ for(int i=0;i<s.tab_count;i++) {
+ snprintf(s.tabs[i].id,sizeof s.tabs[i].id,"tab-%d",i);
+ snprintf(s.tabs[i].name,sizeof s.tabs[i].name,"%s",names[i]);
+ s.tabs[i].panes=i;
+ }
+ scene_take();
+}
+static void tap(uint32_t t, int x, int y) {
+ habitat_touch(true, x, y, t);
+ habitat_touch(false, x, y, t + 75);
+ scene_take();
+}
+static bool action_enabled(action_kind_t action) {
+ for (int i=0;i<s.hit_count;i++) if (s.hits[i].action==action) return s.hits[i].enabled;
+ return false;
+}
+static void portrait(const char *dir, const char *name) {
+ if (!dir) return;
+ char path[1024]; snprintf(path, sizeof(path), "%s/%s.ppm", dir, name);
+ FILE *fp = fopen(path, "wb"); assert(fp);
+ fprintf(fp, "P6\n466 466\n255\n");
+ uint16_t row[466];
+ for (int y=0; y<466; y++) {
+ ht_raster(&scene, (ht_rect_t){0,y,466,1}, row);
+ for (int x=0; x<466; x++) {
+ uint16_t c = (uint16_t)((row[x] >> 8) | (row[x] << 8));
+ unsigned char rgb[3] = {(unsigned char)(((c>>11)&31)*255/31),
+ (unsigned char)(((c>>5)&63)*255/63),(unsigned char)((c&31)*255/31)};
+ if ((x-233)*(x-233)+(y-233)*(y-233)>233*233) memset(rgb, 0, 3);
+ fwrite(rgb, 1, 3, fp);
+ }
+ }
+ fclose(fp);
+}
+static void carry_return_setup(bool with_text) {
+ reset();
+ assert(ht_visit_latest(&visit,"reading-return","a",100,visit_emit,NULL));
+ assert(ht_visit_reply(&visit,visit.id,visit.request,true,"Your reading"));
+ if(with_text) {
+ ht_carry_open(&carry,"carried-passage","a","pick-test",1,200,carry_emit,NULL);
+ assert(ht_carry_reply(&carry,carry.id,carry.request,true,"Research helper","Keep this paragraph",3,300000,NULL,250));
+ }
+ scene_take();
+}
+static bool result_visible(void) {
+ for (int i=0;i<scene.count;i++) if (scene.runs[i].font==&ht_octopus_font_4 || scene.runs[i].font==&ht_octopus_font_6) return true;
+ return false;
+}static void recap_checks(const char *dir) {
+ // The live row has always received the 1,024-byte memory record's prefix.
+ // Exercise actual production capacities before/after removing unused tail
+ // storage, and preserve all fields through full-roster permutations.
+ static char complete[8193];
+ static const size_t lengths[] = {0, 1, 239, 1023, 1024, 4095, 8192};
+ for (unsigned sample=0; sample<sizeof lengths/sizeof lengths[0]; sample++) {
+ reset();
+ size_t len=lengths[sample];
+ for (size_t i=0;i<len;i++) complete[i]=(char)('a'+i%26);
+ complete[len]=0;
+ ui_project_emit("a","session-a","summary",complete,"Visible recap.");
+ const char *want=len?complete:"Visible recap.";
+ size_t kept=strlen(want);
+ if (kept>=sizeof s.memory[0].full) kept=sizeof s.memory[0].full-1;
+ assert(strlen(s.agents[0].full)==kept && !memcmp(s.agents[0].full,want,kept));
+ assert(!strcmp(s.agents[0].preview,"Visible recap."));
+ }
+ reset(); ui_project_clear_all();
+ char ids[MAX_PROJECTS][ID_MAX]; const char *order[MAX_PROJECTS];
+ for (int i=0;i<MAX_PROJECTS;i++) {
+ snprintf(ids[i],sizeof ids[i],"pane-%d",i);
+ ui_project_set_name(ids[i],ids[i]);
+ ui_project_emit(ids[i],ids[i],"summary",ids[i],ids[i]);
+ }
+ s.active=MAX_PROJECTS/2;
+ for (int pass=0;pass<64;pass++) {
+ for (int i=0;i<MAX_PROJECTS;i++) order[i]=ids[(MAX_PROJECTS-1-i+pass)%MAX_PROJECTS];
+ ui_project_apply_order(order,MAX_PROJECTS);
+ assert(!strcmp(s.agents[s.active].id,ids[MAX_PROJECTS/2]));
+ for (int i=0;i<MAX_PROJECTS;i++) {
+ assert(!strcmp(s.agents[i].id,order[i]));
+ assert(!strcmp(s.agents[i].name,order[i]));
+ assert(!strcmp(s.agents[i].full,order[i]));
+ assert(!strcmp(s.agents[i].preview,order[i]));
+ }
+ }
+ printf("roster storage: sizeof(agent_t)=%zu; full=%zu; exact result prefixes and 64 full-roster permutations PASS\n", sizeof(agent_t),sizeof s.agents[0].full);
+ reset();
+ char preview[32];
+ activity_text(preview,sizeof preview,"Wandering..."); assert(!strcmp(preview,"Wandering"));
+ activity_text(preview,sizeof preview,"Coalescing\xe2\x80\xa6"); assert(!strcmp(preview,"Coalescing"));
+ activity_text(preview,sizeof preview,"Working"); assert(!strcmp(preview,"Working"));
+ activity_text(preview,sizeof preview,"A...B"); assert(!strcmp(preview,"A...B"));
+ recap_preview(preview,sizeof preview," \nFixed\t the\r\nparser. ");
+ assert(!strcmp(preview,"Fixed the parser."));
+ recap_preview(preview,5,"caf\xc3\xa9"); assert(!strcmp(preview,"caf"));
+ recap_preview(preview,6,"caf\xc3\xa9"); assert(!strcmp(preview,"caf\xc3\xa9"));
+ recap_preview(preview,sizeof preview," \t\r\n"); assert(!preview[0]);
+ recap_preview(preview,sizeof preview,"bad\xe2"); assert(!strcmp(preview,"bad?"));
+ recap_preview(preview,1,"x"); assert(!preview[0]);
+ recap_preview(preview,sizeof preview,"Details continue\xe2\x80\xa6"); assert(!strcmp(preview,"Details continue +"));
+ recap_preview(preview,sizeof preview,"Details continue+"); assert(!strcmp(preview,"Details continue +"));
+ recap_preview(preview,sizeof preview,"Details continue +"); assert(!strcmp(preview,"Details continue +"));
+ recap_preview(preview,sizeof preview,"Written in C++"); assert(!strcmp(preview,"Written in C++"));
+ recap_preview(preview,sizeof preview,"Wait... then proceed."); assert(!strcmp(preview,"Wait... then proceed."));
+
+ reset();
+ ui_project_emit("a","session-a","summary","It isn't external. That is the branch name.","It isn't external.");
+ scene_take(); portrait(dir,"complete-sentence");
+ ui_project_emit("a","session-a","summary","Yes. The fix is installed.","Yes. The fix is installed.");
+ scene_take(); portrait(dir,"acknowledgment-explanation");
+ ui_project_emit("a","session-a","summary","Yes. The fix is installed and the device has reconnected successfully to the desktop application.","Yes. The fix is installed and the device has reconnected successfully to the+");
+ scene_take(); portrait(dir,"continued-sentence");
+ ui_project_emit("a","session-a","summary","Fixed the parser. All tests pass. Voice input now sends to the selected agent. More details follow.","Fixed the parser. All tests pass. Voice input now sends to the selected agent.");
+ scene_take(); portrait(dir,"three-sentences");
+ const char *long_result="The update is installed. Voice input sends to the selected agent. The summary has more room, the octopus is larger, and unread messages open from the bottom edge of the screen.";
+ assert(strlen(long_result)>160);
+ ui_project_emit("a","session-a","summary",long_result,long_result);
+ scene_take(); portrait(dir,"long-reading");
+ char visible[400]="";
+ for(int i=0;i<scene.count;i++) if(scene.runs[i].font==&ht_mono_20 && !scene.runs[i].arc && scene.runs[i].y>=194 && scene.runs[i].y<400) {
+ if(visible[0] && scene.runs[i].text[0])strcat(visible," ");
+ strcat(visible,scene.runs[i].text);
+ }
+ assert(strlen(visible)>160);
+ ui_notify_task_done("b","Other pane","M2","The checks passed.");
+ scene_take(); portrait(dir,"long-reading-inbox");
+ ui_project_emit("a","session-a","summary","\xe2\x80\x9cReady\xe2\x80\x9d \xe2\x80\x94 don\xe2\x80\x99t change the \xe2\x80\x9c" "cache\xe2\x80\x9d.","\xe2\x80\x9cReady\xe2\x80\x9d \xe2\x80\x94 don\xe2\x80\x99t change the \xe2\x80\x9c" "cache\xe2\x80\x9d.");
+ scene_take(); portrait(dir,"punctuation");
+
+ reset();
+ ui_project_emit("a","session-a","processing",NULL,NULL);
+ ui_project_emit("a","session-a","summary","Full explanation in the reader.","Fixed the parser. All tests pass.");
+ scene_take(); assert(result_visible()); portrait(dir,"completed");
+ assert(!strcmp(s.agents[0].preview,"Fixed the parser. All tests pass."));
+ assert(!strcmp(s.agents[0].full,"Full explanation in the reader."));
+ surface_tick(60000); scene_take(); assert(result_visible()); // no timed dismissal
+ ui_project_emit("b","session-b","summary","Another agent's result.","Updated the website.");
+ scene_take(); assert(result_visible() && s.active==0);
+ bool recipient_below=false;
+ for(int i=0;i<scene.count;i++) {
+ const ht_run_t *r=&scene.runs[i];
+ if(!strcmp(r->text,"Deploy latest firmware")) {
+ assert(r->arc==1);
+ recipient_below=true;
+ }
+ }
+ assert(recipient_below);
+ tap(61000,233,310); // Recap dismisses locally; the portrait starts voice.
+ assert(!desktop_opens && !starts && s.view==HOME && !result_visible());
+ scene_take(); portrait(dir,"summary-dismissed");
+ bool large=false;
+ for(int i=0;i<scene.count;i++) if(scene.runs[i].font==&ht_octopus_font_10)large=true;
+ assert(large);
+ ui_project_restore_event("a","summary","Full explanation in the reader.","Fixed the parser. All tests pass.");
+ scene_take(); assert(!result_visible()); // tab/history replay cannot resurrect a dismissed result
+ ui_project_emit("a","session-a","summary","Full explanation in the reader.","Fixed the parser. All tests pass.");
+ scene_take(); assert(result_visible());
+ tap(61600,233,252); // The lowered portrait must not inherit the old recap hit area.
+ assert(starts==1 && !strcmp(target,"a") && s.view==VOICE && !result_visible());
+ portrait(dir,"completed-listening");
+ tap(62600,233,220); assert(stops==1);
+ dispatch((action_t){.kind=A_VOICE_ABORT}); scene_take(); assert(result_visible());
+ ui_project_emit("a","session-a","processing",NULL,NULL);
+ scene_take(); assert(!result_visible()); portrait(dir,"next-turn");
+ ui_project_restore_event("a","summary","Old restored answer.","Old restored recap.");
+ scene_take(); assert(!result_visible() && s.agents[0].busy);
+ assert(!strcmp(s.agents[0].preview,"Fixed the parser. All tests pass."));
+ ui_project_emit("a","session-a","done",NULL,NULL);
+ scene_take(); assert(!result_visible()); // Done alone cannot resurrect the previous turn.
+ ui_project_restore_event("a","summary","Fixed the parser. All tests pass.","Fixed the parser. All tests pass.");
+ scene_take(); assert(!result_visible());
+ ui_project_emit("a","session-a","summary","Patched the voice handler.","Patched the voice handler.");
+ scene_take(); assert(result_visible());
+ waiting_count=1; scene_take(); assert(result_visible()); portrait(dir,"completed-attention");
+ waiting_count=0; s.connected=false; scene_take(); assert(!result_visible());
+ s.connected=true; s.loading=true; scene_take(); assert(!result_visible());
+ s.loading=false; s.nap=true; scene_take(); assert(!result_visible());
+ s.nap=false; carry.active=true; scene_take(); assert(!result_visible());
+ carry.active=false; scene_take(); assert(result_visible());
+ // Scrolling and switching work across the smaller portrait and outcome.
+ habitat_touch(true,233,310,63000); habitat_touch(true,233,250,63050);
+ habitat_touch(false,233,250,63100); assert(moves && starts==1);
+ s.coasting=false; s.coast_until=0;
+ habitat_touch(true,320,220,64000); habitat_touch(false,150,220,64120);
+ scene_take(); assert(switches==1 && s.active==1 && result_visible());
+ assert(!strcmp(s.agents[1].preview,"Updated the website."));
+ ui_project_clear_event("b"); scene_take(); assert(!result_visible());
+ ui_project_restore_event("b","summary","Cached completion.","Cached completion.");
+ scene_take(); assert(result_visible());
+ ui_project_emit("b",NULL,"summary"," \n",NULL); scene_take(); assert(result_visible());
+ // A recap gesture remains pinned and cannot open a different pane on release.
+ reset(); ui_project_emit("a","session-a","summary","Fixed.","Fixed."); scene_take();
+ habitat_touch(true,233,285,65000); s.active=1; input_cancel();
+ habitat_touch(false,233,285,65100); assert(!desktop_opens && !starts);
+ // Reading motion still scrolls; returning to its origin never opens or talks.
+ reset(); ui_project_emit("a","session-a","summary","Fixed.","Fixed."); scene_take();
+ habitat_touch(true,233,285,66000); habitat_touch(true,233,225,66040);
+ habitat_touch(true,233,285,66080); habitat_touch(false,233,285,66120);
+ assert(moves && !desktop_opens && !starts);
+ reset();
+}
+static void notice_checks(const char *dir) {
+ // Opening a read notification must not present its recap a second time.
+ // Exercise either receipt order, panes outside the current roster, and a
+ // notification restored before that pane's result history has arrived.
+ for(int off_tab=0;off_tab<2;off_tab++) for(int cached=0;cached<2;cached++)
+ for(int seen_first=0;seen_first<2;seen_first++) {
+ reset();
+ const char *id=off_tab ? "outside" : "a";
+ const char *result="The build is installed. All checks passed.";
+ if(cached) ui_project_emit(id,"session","summary",result,result);
+ ui_notify_task_done(id,"Build","M2",result);
+ ui_notify_task_done("b","Another pane","M2","The website is ready.");
+ ui_notif_open(); s.offset=1; scene_take();
+ tap(1000,233,340);
+ assert(desktop_opens==1 && !strcmp(opened_agent,id));
+ assert(s.notice_count==2 && s.view==INBOX); // wait for host acknowledgement
+ ui_apply_pending_focus();
+ assert(s.view==INBOX); // a periodic roster refresh is not an open receipt
+ if(seen_first) ui_notif_seen(id);
+ else ui_focus_project(id);
+ if(off_tab) {
+ assert(find(id)<0); // opening never fabricates a local roster row
+ ui_project_set_name(id,"Build");
+ ui_apply_pending_focus();
+ }
+ if(seen_first) ui_focus_project(id);
+ else ui_notif_seen(id);
+ scene_take();
+ assert(active() && !strcmp(active()->id,id) && s.view==HOME);
+ assert(s.notice_count==1 && !result_visible() && !starts && !question_sends);
+ // History fills the reader, while the already-read recap stays hidden.
+ ui_project_restore_event(id,"summary",result,result);
+ scene_take(); assert(!result_visible() && !strcmp(active()->full,result));
+ ui_project_remove(id); ui_project_set_name(id,"Build"); ui_focus_project(id);
+ ui_project_restore_event(id,"summary",result,result);
+ scene_take(); assert(!result_visible());
+ if(!off_tab && cached && !seen_first) portrait(dir,"notification-opened");
+ ui_project_emit(id,"session","processing","Working",NULL);
+ ui_project_emit(id,"session","done",NULL,NULL);
+ ui_project_emit(id,"session","summary","The next change is ready.","The next change is ready.");
+ scene_take(); assert(result_visible());
+ }
+ // A refused local queue leaves both the recap and inbox entry unread.
+ reset();
+ ui_project_emit("a","session","summary","The build is ready.","The build is ready.");
+ ui_notify_task_done("a","Build","M2","The build is ready.");
+ ui_notif_open(); congestion=true;
+ dispatch((action_t){.kind=A_NOTICE,.id="a"});
+ assert(!desktop_opens && !s.pending_focus[0] && !s.opening_notice[0] && s.notice_count==1);
+ assert(s.agents[0].recap_ready && !pane_memory("a",false)->dismissed);
+ // Reading a question is never an approval or a completed-result dismissal.
+ reset();
+ ui_project_emit("a","session","summary","The previous build is ready.","The previous build is ready.");
+ cable_notif_t pending_question={.agent_id="a",.name="Build",.question=true,
+ .summary="May I deploy this build?"};
+ ui_notif_replace(&pending_question,1); ui_notif_open();
+ dispatch((action_t){.kind=A_NOTICE,.id="a"}); ui_notif_seen("a");
+ assert(desktop_opens==1 && !question_sends && s.notice_count==1);
+ assert(!pane_memory("a",false)->dismissed);
+ // Desktop navigation without an Open gesture changes the recipient, but
+ // keeps the inbox on the card being read, including an off-tab focus.
+ reset();
+ ui_notify_task_done("a","Build","M2","The build is installed.");
+ ui_notify_task_done("b","Website","M2","The site is deployed.");
+ ui_notif_open();
+ ui_focus_project("outside"); ui_project_set_name("outside","Other tab");
+ ui_apply_pending_focus(); assert(s.view==INBOX && s.notice_count==2);
+ // Back cancels the pending inbox landing, even if a delayed receipt arrives
+ // after the user has reopened the inbox to read another message.
+ reset();
+ ui_notify_task_done("a","Build","M2","The build is installed.");
+ ui_notify_task_done("b","Website","M2","The site is deployed.");
+ ui_notif_open(); dispatch((action_t){.kind=A_NOTICE,.id="a"});
+ view(HOME); assert(!s.opening_notice[0]);
+ ui_notif_open(); ui_focus_project("a"); assert(s.view==INBOX);
+ const char *recaps[]={
+ "It isn't external.",
+ "Yes. The fix is installed.",
+ "Fixed the parser. All tests pass. Voice input now sends to the selected agent.",
+ "Yes. The fix is installed and the device has reconnected successfully to the +",
+ "A much longer recap from an older host needs to fit three rows, with the same continuation as the home result.",
+ "“Yes” means “go”; “no” means “stop”. Keep “A”, “B”, “C”, “D”, “E”, “F”."
+ };
+ for(unsigned i=0;i<sizeof recaps/sizeof recaps[0];i++) {
+ reset();
+ ui_project_emit("a","session-a","summary",recaps[i],recaps[i]);
+ scene_take();
+ int home_arrows=0;
+ for(int j=0;j<scene.count;j++) home_arrows+=scene.runs[j].font==&ht_open_20;
+ assert(home_arrows==1); // Complete and clipped home summaries both carry it.
+ // Notifications may name a pane outside the device's current tab.
+ ui_notify_task_done("off-tab","Other pane","Another Mac",recaps[i]);
+ ui_notif_open(); scene_take();
+ int inbox_arrows=0;
+ for(int j=0;j<scene.count;j++) inbox_arrows+=scene.runs[j].font==&ht_open_20;
+ assert(inbox_arrows==1); // Exactly the same rule on notification previews.
+ // Home and inbox share the expanded reading layout.
+ // Both preserve the same source text and one action arrow.
+ assert(!strcmp(s.notice[0].summary,s.agents[0].preview));
+ assert(s.view==INBOX && s.notice_count==1 && !desktop_opens && !starts);
+ if(i==2) portrait(dir,"notification-preview");
+ if(i==3) portrait(dir,"notification-clipped");
+ if(i==5) { assert(strlen(recaps[i])>100); portrait(dir,"notification-punctuation"); }
+ tap(1000,233,340);
+ assert(desktop_opens==1 && !strcmp(opened_agent,"off-tab") && !starts);
+ assert(s.notice_count==1); // Opening is reconciled by the host's seen event.
+ }
+ reset();
+ ui_notify_task_done("a","Deploy latest firmware","M2","Yes. The fix is installed.");
+ ui_notify_task_done("b","Website","M2","The new page is live.");
+ ui_notif_open(); scene_take(); portrait(dir,"notification-multiple");
+ habitat_touch(true,300,260,2000); habitat_touch(true,170,260,2060);
+ habitat_touch(false,170,260,2120); scene_take();
+ assert(s.offset==1 && s.notice_count==2 && !desktop_opens && !starts);
+ habitat_touch(true,233,275,2500); habitat_touch(true,233,190,2560);
+ habitat_touch(false,233,190,2620); scene_take();
+ assert(s.offset==0 && s.notice_count==2 && !desktop_opens && !moves && !starts);
+ tap(3000,233,250); assert(desktop_opens==1 && !strcmp(opened_agent,"b"));
+ reset();
+ cable_notif_t question={.agent_id="off-tab",.name="Release",.question=true,
+ .summary="Should I deploy this build to staging?"};
+ ui_notif_replace(&question,1); ui_notif_open(); scene_take();
+ bool question_shown=false;
+ for(int i=0;i<scene.count;i++) if(strstr(scene.runs[i].text,"Should I deploy"))question_shown=true;
+ assert(question_shown && s.notice_count==1 && !question_sends);
+ portrait(dir,"notification-question");
+ s.connected=false; scene_take(); assert(!action_enabled(A_NOTICE));
+ tap(3500,233,340); assert(!desktop_opens && !question_sends && !starts);
+ reset(); ui_notify_task_done("a","No saved recap","M2",NULL); ui_notif_open(); scene_take();
+ bool fallback=false;
+ for(int i=0;i<scene.count;i++) if(!strcmp(scene.runs[i].text,"No preview available. "))fallback=true;
+ assert(fallback); portrait(dir,"notification-missing");
+ reset();
+}
+static uint32_t soak_random(uint32_t *state) {
+ *state ^= *state << 13; *state ^= *state >> 17; *state ^= *state << 5;
+ return *state;
+}
+static void pane_notification_soak(void) {
+ // Long mixed histories exercise cache eviction and list reconciliation,
+ // including contacts held across host updates and both 32-bit wraps.
+ // Everything uses local production handlers; no desktop or audio I/O.
+ reset(); s.memory_serial=UINT32_MAX-100;
+ uint32_t seed=0x48a6197u; fake_ms=UINT32_MAX-300000;
+ unsigned operations[12]={0},contacts=0,rasters=0;
+ static uint16_t pixels[HT_WIDTH*HT_HEIGHT];
+ for(unsigned step=0;step<200000;step++) {
+ uint32_t r=soak_random(&seed);
+ char id[ID_MAX],name[80],result[260];
+ snprintf(id,sizeof id,"soak-%03u",(r>>8)%256);
+ snprintf(name,sizeof name,"Pane %u / turn %u",(r>>8)%256,step);
+ snprintf(result,sizeof result,"Turn %u is complete. The parser handles the next result after a notification has been opened.",step);
+ fake_ms+=17;
+ bool held=s.view==INBOX && s.notice_count && (r&31)==0;
+ if(held) { scene_take(); habitat_touch(true,233,250,fake_ms); contacts++; }
+ unsigned op=r%12; operations[op]++;
+ switch(op) {
+ case 0: ui_project_set_name(id,name); break;
+ case 1: ui_project_remove(id); break;
+ case 2: ui_project_emit(id,"soak-session","processing","Working",NULL); break;
+ case 3: ui_project_emit(id,"soak-session","summary",result,result); break;
+ case 4: ui_project_restore_event(id,"summary",result,result); break;
+ case 5: ui_notify_task_done(id,name,"M2",result); break;
+ case 6: ui_notif_seen(id); break;
+ case 7: ui_notif_open(); break;
+ case 8: ui_focus_project(id); ui_apply_pending_focus(); break;
+ case 9: {
+ cable_notif_t rows[NOTICES]={0};
+ int count=(r>>16)%(NOTICES+1);
+ for(int i=0;i<count;i++) {
+ snprintf(rows[i].agent_id,sizeof rows[i].agent_id,"soak-%03u",((r>>8)+i)%256);
+ COPY(rows[i].name,name); COPY(rows[i].summary,result);
+ rows[i].question=(i%5)==0;
+ }
+ ui_notif_replace(rows,count); break;
+ }
+ case 10:
+ if(s.view==INBOX && s.notice_count) {
+ action_t a={.kind=A_NOTICE}; COPY(a.id,s.notice[s.offset].agent_id);
+ congestion=(r&256)!=0; dispatch(a); congestion=false;
+ }
+ break;
+ case 11:
+ if(r&256) view(HOME);
+ else ui_project_clear_all();
+ break;
+ }
+ if(held) habitat_touch(false,233,250,fake_ms+75);
+ assert(s.count>=0 && s.count<=MAX_PROJECTS);
+ assert(s.active>=-1 && s.active<s.count);
+ assert(s.notice_count>=0 && s.notice_count<=NOTICES);
+ if(s.view==INBOX) assert(s.notice_count && s.offset>=0 && s.offset<s.notice_count);
+ for(int i=0;i<s.notice_count;i++) {
+ assert(s.notice[i].agent_id[0] && memchr(s.notice[i].agent_id,0,ID_MAX));
+ assert(memchr(s.notice[i].summary,0,sizeof s.notice[i].summary));
+ for(int j=0;j<i;j++) assert(strcmp(s.notice[i].agent_id,s.notice[j].agent_id));
+ }
+ if((step&255)==0) {
+ for(int i=0;i<PANE_MEMORY_MAX;i++) {
+ const pane_memory_t *m=&s.memory[i];
+ assert(memchr(m->id,0,sizeof m->id));
+ assert(memchr(m->preview,0,sizeof m->preview));
+ assert(memchr(m->full,0,sizeof m->full));
+ if(m->id[0]) for(int j=0;j<i;j++) assert(strcmp(m->id,s.memory[j].id));
+ }
+ scene_take(); assert(scene.count<=HT_RUNS && s.hit_count<=24);
+ }
+ if((step&4095)==0) {
+ ht_raster(&scene,(ht_rect_t){0,0,HT_WIDTH,HT_HEIGHT},pixels); rasters++;
+ }
+ assert(!starts && !question_sends); // inbox activity cannot start a mic/answer
+ }
+ for(unsigned i=0;i<12;i++) assert(operations[i]>10000);
+ assert(contacts>100);
+ printf("Pane/inbox soak: 200000 mixed updates, 256 identities, %u held contacts, %u full rasters, cache/time wraps; bounds/identity/modal invariants PASS\n",contacts,rasters);
+ reset();
+}
+static void pane_memory_checks(const char *dir) {
+ // The reported failure: leave mobile's tab, receive its completion while
+ // absent, then return without any history replay from the bridge.
+ reset();
+ ui_project_emit("a","mobile-session","processing","Coalescing...",NULL);
+ ui_project_remove("a"); assert(find("a")==-1);
+ ui_project_emit("a","mobile-session","done",NULL,NULL);
+ ui_project_emit("a","mobile-session","summary","The mobile build is installed. All checks passed.","The mobile build is installed. All checks passed.");
+ assert(find("a")==-1 && !starts && !desktop_opens); // background data never adds a visible pane
+ ui_project_set_name("a","Mobile app build and deploy"); s.active=find("a"); scene_take();
+ assert(result_visible() && !active()->busy && !strcmp(active()->preview,"The mobile build is installed. All checks passed."));
+ portrait(dir,"mobile-restored");
+ ui_project_remove("a"); ui_project_set_name("a","Mobile app build and deploy");
+ s.active=find("a"); scene_take(); assert(result_visible());
+ // Starting the next turn returns to the large companion and hides old prose.
+ ui_project_emit("a","mobile-session","processing","Coalescing...",NULL); scene_take();
+ assert(!result_visible() && active()->busy && !strcmp(active()->tool,"Coalescing"));
+ bool caption=false;
+ for(int i=0;i<scene.count;i++) if(!strcmp(scene.runs[i].text,"Last result"))caption=true;
+ assert(!caption); portrait(dir,"mobile-working");
+ s.notice_count=2; scene_take(); portrait(dir,"working-notifications-activity");
+ bool footer=false;
+ for(int i=0;i<scene.count;i++) if(strstr(scene.runs[i].text,"Coalescing")) {
+ assert(scene.runs[i].arc==2 && scene.runs[i].fg==ACCENT); footer=true;
+ }
+ assert(footer); s.notice_count=0;
+ scene_take(); footer=false;
+ for(int i=0;i<scene.count;i++) if(strstr(scene.runs[i].text,"Coalescing")) {
+ assert(scene.runs[i].arc==2 && scene.runs[i].fg==FG); footer=true;
+ }
+ assert(footer);
+ ui_project_emit("a",NULL,"processing","Processing",NULL);
+ assert(!strcmp(active()->tool,"Coalescing")); // heartbeat never flashes a replacement label
+
+ ui_project_remove("a"); ui_project_emit("a","mobile-session","activity","Summarizing...",NULL);
+ ui_project_set_name("a","Mobile app build and deploy"); s.active=find("a"); scene_take();
+ assert(!result_visible() && active()->busy && !strcmp(active()->tool,"Summarizing"));
+ ui_project_restore_event("a","summary","An older result.","An older result.");
+ assert(!strcmp(active()->preview,"The mobile build is installed. All checks passed."));
+ ui_project_emit("a","mobile-session","done",NULL,NULL); scene_take(); assert(!result_visible());
+ ui_project_emit("a","mobile-session","summary","The next build is installed.","The next build is installed.");
+ assert(!strcmp(active()->preview,"The next build is installed."));
+ scene_take(); assert(result_visible() && !active()->busy); portrait(dir,"next-result");
+ // History arriving before the roster is safe too, without a notification.
+ ui_project_clear_all(); ui_project_restore_event("history","summary","Saved result.","Saved result.");
+ assert(!s.count && !s.notice_count);
+ ui_project_set_name("history","History"); s.active=find("history"); scene_take(); assert(result_visible());
+ ui_project_clear_event("history"); ui_project_remove("history"); ui_project_set_name("history","History");
+ s.active=find("history"); scene_take(); assert(!result_visible());
+ // Bounded cache: current panes stay pinned; old off-tab slots are evicted.
+ reset(); ui_project_emit("a",NULL,"summary","Pinned.","Pinned.");
+ ui_project_emit("b",NULL,"summary","Also pinned.","Also pinned.");
+ for(int i=0;i<PANE_MEMORY_MAX+40;i++) {
+ char id[64]; snprintf(id,sizeof id,"background-%d",i);
+ ui_project_emit(id,NULL,"summary","Background result.","Background result.");
+ }
+ assert(pane_memory("a",false) && pane_memory("b",false) && !pane_memory("background-0",false));
+ ui_project_remove("a"); ui_project_set_name("a","Pinned"); s.active=find("a"); scene_take();
+ assert(result_visible() && !strcmp(active()->preview,"Pinned."));
+ s.memory_serial=UINT32_MAX;
+ ui_project_emit("wrap",NULL,"summary","Wrap-safe.","Wrap-safe.");
+ assert(pane_memory("wrap",false) && pane_memory("b",false));
+ reset(); ui_project_emit("a",NULL,"processing","",NULL); scene_take();
+ assert(!active()->tool[0] && !result_visible());
+ ui_project_emit("a",NULL,"activity","Working",NULL);
+ strcpy(active()->name,"hn"); scene_take(); portrait(dir,"short-name-working");
+ ui_project_remove("a"); pane_memory_t *m=pane_memory("a",false); assert(m);
+ m->last_busy=ms()-26000; ui_project_set_name("a","Expired busy");
+ assert(!s.agents[find("a")].busy);
+ reset(); strcpy(active()->name,"Mobile app build and deploy");
+ ui_project_emit("a",NULL,"processing","Coalescing",NULL); scene_take();
+ tap(2000,233,43); assert(s.view==AGENTS && !starts); // curved title never speaks
+ reset(); ui_project_emit("a",NULL,"summary","The result is ready.","The result is ready.");
+ scene_take(); tap(3000,233,280); scene_take(); assert(!result_visible() && !desktop_opens);
+ ui_project_remove("a"); ui_project_set_name("a","Return to pane"); s.active=find("a");
+ ui_project_restore_event("a","summary","The result is ready.","The result is ready.");
+ ui_project_emit("a",NULL,"processing","Processing",NULL);
+ scene_take(); assert(!result_visible());
+ ui_project_emit("a",NULL,"summary","A new result is ready.","A new result is ready.");
+ scene_take(); assert(result_visible());
+ printf("pane memory: PASS (off-tab completion, returning panes, late restores, live activity, alternating work/results, 128-slot bound); %zu bytes\n",sizeof s.memory);
+ reset();
+}
+int main(int argc, char **argv) {
+ const char *brightness = getenv("HABITAT_PREVIEW_BRIGHTNESS");
+ if (brightness) {
+ char *end; long value = strtol(brightness, &end, 10);
+ assert(*brightness && !*end && value >= 0 && value <= 100);
+ preview_brightness = (unsigned)value;
+ }
+ // Identity boundaries are exact, including IDs that share a full-length prefix.
+ {
+ reset();
+ char exact[ID_MAX], oversized[ID_MAX+1];
+ memset(exact,'a',sizeof exact-1);exact[sizeof exact-1]=0;
+ snprintf(oversized,sizeof oversized,"%sx",exact);
+ int count=s.count, target=ensure(exact);assert(target==count);
+ assert(ensure(oversized)==-1 && s.count==count+1);
+ assert(ensure(NULL)==-1 && ensure("")==-1);
+ strcpy(s.pending_focus,"b");ui_focus_project(oversized);
+ assert(!strcmp(s.pending_focus,"b"));
+ s.active=0;ui_apply_pending_focus();assert(s.active==1 && !s.pending_focus[0]);
+ ui_focus_project(exact);assert(s.active==target);
+ notice_add(exact,"Exact target","M2","This target fits.",false);
+ unsigned exact_notices=s.notice_count;
+ notice_add(oversized,"Wrong target","M2","Must not alias another pane.",false);
+ assert((unsigned)s.notice_count==exact_notices && !strcmp(s.notice[0].agent_id,exact));
+ reset();
+ }
+ const char *dir = argc > 1 ? argv[1] : NULL;
+ recap_checks(dir);
+ notice_checks(dir);
+ pane_memory_checks(dir);
+ pane_notification_soak();
+ carry_return_setup(true);
+ assert(action_enabled(A_RETURN) && action_enabled(A_CARRY_DROP));
+ portrait(dir,"carry-return");
+ tap(1000,173,410);
+ assert(visit.pending && visit.op==HT_VISIT_BACK && carry.active && !carry_drops && !starts);
+ assert(!strcmp(carry.id,"carried-passage") && !strcmp(carry.excerpt,"Keep this paragraph"));
+ assert(!down_reports && !moves && !ups); // A footer is not a terminal contact.
+ {
+ char request[32]; snprintf(request,sizeof request,"visit-%lu",(unsigned long)visit.request);
+ cJSON fields[]={
+ {.string="requestId",.type=JSTRING,.valuestring=request},
+ {.string="visitId",.type=JSTRING,.valuestring=visit.id},
+ {.string="agentId",.type=JSTRING,.valuestring="a"},
+ {.string="ok",.type=JTRUE}};
+ for(int i=0;i<3;i++)fields[i].next=&fields[i+1];
+ cJSON reply={.child=fields}; ui_visit_state(&reply); scene_take();
+ assert(s.view==HOME && !visit.available && carry.active && !carry_drops);
+ assert(action_enabled(A_CARRY_DROP) && !action_enabled(A_RETURN));
+ portrait(dir,"carry-after-return");
+ }
+ carry_return_setup(true); s.rim_enabled=true; scene_take();
+ tap(1000,317,413); // This point is on the rim; visible Drop owns it.
+ assert(!carry.active && carry_drops==1 && visit.available && !visit.pending);
+ assert(!starts && !switches && !down_reports && !moves && !ups);
+ tap(1700,233,420); assert(visit.pending && visit.op==HT_VISIT_BACK);
+ carry_return_setup(true); s.rim_enabled=true; scene_take();
+ tap(1000,173,413); assert(visit.pending && carry.active && !carry_drops && !moves);
+ carry_return_setup(false); s.rim_enabled=true; scene_take();
+ tap(1000,233,425); assert(visit.pending && !starts && !moves && !down_reports);
+ // Sliding off either button, crossing to the other one, or a sensor loss
+ // cannot discard, navigate, scroll, or start speech.
+ for(int rim=0;rim<2;rim++) {
+ static const int drags[][4]={{173,410,317,410},{317,410,173,410},{173,410,233,250},{317,410,233,250}};
+ for(size_t i=0;i<sizeof drags/sizeof drags[0];i++) {
+ carry_return_setup(true); s.rim_enabled=rim; scene_take();
+ habitat_touch(true,drags[i][0],drags[i][1],1000);
+ habitat_touch(true,drags[i][2],drags[i][3],1070);
+ habitat_touch(false,drags[i][2],drags[i][3],1150);
+ assert(carry.active && visit.available && !visit.pending && !carry_drops && visit_sends==1);
+ assert(!starts && !switches && !down_reports && !moves && !ups);
+ }
+ }
+ carry_return_setup(true); habitat_touch(true,173,410,1000); habitat_touch_cancel();
+ habitat_touch(false,173,410,1100); assert(!visit.pending && carry.active && !carry_drops);
+ carry_return_setup(true); s.coasting=true; s.coast_until=2000;
+ tap(1000,317,410); assert(carry.active && !carry_drops && down_reports==1 && ups==1);
+ tap(1700,317,410); assert(!carry.active && carry_drops==1 && visit.available);
+ carry_return_setup(true); congestion=true; tap(1000,173,410);
+ assert(!visit.pending && visit.available && carry.active && !carry_drops && s.view==MESSAGE);
+ congestion=false; view(HOME); scene_take(); tap(1700,173,410); assert(visit.pending && carry.active);
+ carry_return_setup(true); s.connected=false; scene_take();
+ assert(!action_enabled(A_RETURN) && action_enabled(A_CARRY_DROP));
+ tap(1000,173,410); assert(!visit.pending && carry.active);
+ tap(1700,317,410); assert(!carry.active && carry_drops==1);
+ // Expiry changes the carry identity. An old finger cannot drop a new quote.
+ carry_return_setup(true); habitat_touch(true,317,410,1000);
+ assert(ht_carry_tick(&carry,300250)); scene_take(); portrait(dir,"carry-expired-return");
+ assert(action_enabled(A_RETURN) && action_enabled(A_CARRY_DROP));
+ ht_carry_open(&carry,"replacement-passage","a","pick-test",1,1100,carry_emit,NULL);
+ assert(ht_carry_reply(&carry,carry.id,carry.request,true,"New source","New quote",1,300000,NULL,1101));
+ int drops=carry_drops; habitat_touch(false,317,410,1150);
+ assert(carry.active && !strcmp(carry.id,"replacement-passage") && carry_drops==drops);
+ carry_return_setup(true); habitat_touch(true,173,410,1000);
+ ht_visit_close(&visit);
+ assert(ht_visit_latest(&visit,"new-reading","b",1100,visit_emit,NULL));
+ assert(ht_visit_reply(&visit,visit.id,visit.request,true,"Different reading"));
+ int sends=visit_sends; habitat_touch(false,173,410,1150);
+ assert(!visit.pending && visit.available && visit_sends==sends && carry.active);
+ reset(); s.view=SETTINGS; s.offset=6; scene_take(); assert(action_enabled(A_LATEST)); portrait(dir,"reading-controls");
+ tap(1000,233,300); assert(visit.pending && visit.op==HT_VISIT_LATEST && visit_sends==1 && !starts);
+ action_t old_visit=visit_queued; visit_work(old_visit); assert(visit_wire==1 && !strcmp(visit_wire_op,"latest"));
+ char visit_request[32]; snprintf(visit_request,sizeof visit_request,"visit-%lu",(unsigned long)visit.request);
+ cJSON visit_fields[]={
+ {.string="requestId",.type=JSTRING,.valuestring=visit_request},
+ {.string="visitId",.type=JSTRING,.valuestring=visit.id},
+ {.string="agentId",.type=JSTRING,.valuestring="a"},
+ {.string="label",.type=JSTRING,.valuestring="Your reading"},
+ {.string="ok",.type=JTRUE},{.string="active",.type=JTRUE}};
+ for(int i=0;i<5;i++)visit_fields[i].next=&visit_fields[i+1];
+ cJSON visit_reply={.child=visit_fields};
+ question_pending=true; ui_visit_state(&visit_reply); scene_take();
+ assert(s.view==HOME && visit.available && !visit.pending && !starts); // Latest never opens a question.
+ portrait(dir,"reading-return");
+ tap(2000,233,410); assert(visit.pending && visit.op==HT_VISIT_BACK);
+ visit_work(visit_queued); assert(visit_wire==2 && !strcmp(visit_wire_op,"back"));
+ snprintf(visit_request,sizeof visit_request,"visit-%lu",(unsigned long)visit.request);
+ visit_fields[5].type=0; ui_visit_state(&visit_reply); assert(!visit.available && s.view==HOME);
+ reset(); dispatch((action_t){.kind=A_LATEST,.id="a"}); old_visit=visit_queued;
+ ht_visit_close(&visit); visit_work(old_visit); assert(!visit_wire); // A cancelled queued action cannot jump later.
+ dispatch((action_t){.kind=A_LATEST,.id="a"}); visit_work(old_visit); assert(!visit_wire && visit.pending);
+ reset(); s.view=SETTINGS; s.offset=6; scene_take(); habitat_touch(true,233,300,1000); s.active=1;
+ habitat_touch(false,233,300,1080); assert(!visit_sends && !starts); // Destination changed under the finger.
+ reset(); s.view=SETTINGS; s.offset=6; scene_take(); congestion=true;
+ tap(1000,233,300); assert(!visit.pending && !visit_sends && s.view==MESSAGE);
+ reset(); s.connected=false; s.view=SETTINGS; scene_take(); assert(!action_enabled(A_LATEST));
+ workspace_setup(); assert(!action_enabled(A_TABS)); portrait(dir,"workspace-home");
+ for(int i=0;i<scene.count;i++) assert(!strstr(scene.runs[i].text,"Product") && !strstr(scene.runs[i].text,"[ tabs ]"));
+ tap(1000,233,413); assert(s.view==HOME && !starts && !tab_switches);
+ // Hold-left reveals Tabs before release, without scrolling or opening a mic.
+ workspace_setup(); habitat_touch(true,233,230,2000);
+ habitat_touch(true,233,230,2700); habitat_touch(true,100,230,2800); scene_take();
+ assert(s.quick_open && s.quick_choice==3 && s.view==HOME && !starts && !moves && !tab_switches);
+ portrait(dir,"shortcut-tabs");
+ habitat_touch(false,100,230,2900); scene_take();
+ assert(s.view==TABS && !starts && !tab_switches && !moves);
+ // The compact count keeps a broad bottom target, separated from voice/title.
+ const int update_contacts[][2]={{233,405},{233,417},{100,417},{366,417},{233,437}};
+ for (int question=0;question<2;question++) for (unsigned i=0;i<sizeof update_contacts/sizeof update_contacts[0];i++) {
+ workspace_setup(); s.notice_count=1; waiting_count=question; s.rim_enabled=true; scene_take();
+ assert(action_enabled(A_INBOX) && !action_enabled(A_TABS));
+ bool label=false;
+ for (int j=0;j<scene.count;j++) if(!strcmp(scene.runs[j].text,"[1]")) {
+ assert(scene.runs[j].arc==2); label=true;
+ }
+ assert(label);
+ tap(1000,update_contacts[i][0],update_contacts[i][1]);
+ assert(s.view==INBOX && !tab_switches && !starts);
+ }
+ workspace_setup(); s.notice_count=1; scene_take(); portrait(dir,"clear-notification");
+ // Long bottom labels curve above y=400. Their visible end letters must
+ // remain Inbox targets, even where the old rectangle reached the portrait.
+ for(int length=11;length<=32;length++) for(int side=-1;side<=1;side+=2) for(int dy=-6;dy<=6;dy+=6) {
+ workspace_setup();s.notice_count=1;s.rim_enabled=true;active()->busy=true;
+ memset(active()->tool,'x',(size_t)length-4);active()->tool[length-4]=0;scene_take();
+ int x=233+side*(205*arc_trig[length-1][0]>>14);
+ int y=233+(205*arc_trig[length-1][1]>>14)+dy;
+ tap(1000,x,y);assert(s.view==INBOX&&!starts&&!tab_switches&&!moves);
+ }
+ workspace_setup();s.notice_count=1;active()->busy=true;
+ strcpy(active()->tool,"Recontextualizing");scene_take();portrait(dir,"long-curved-notification");
+ tap(1000,233,220);assert(starts==1&&s.view==VOICE); // the central companion still speaks
+ workspace_setup(); s.notice_count=1; scene_take();
+ habitat_touch(true,233,413,1000); habitat_touch(true,233,320,1100);
+ habitat_touch(false,233,320,1200);
+ assert(s.view==HOME && !tab_switches && !starts); // drag never opens the inbox or microphone
+ // Hold-right opens the inbox deliberately from the companion.
+ workspace_setup(); s.notice_count=1; scene_take(); habitat_touch(true,233,230,2000);
+ habitat_touch(true,233,230,2700); habitat_touch(true,350,230,2800);
+ habitat_touch(false,350,230,2900); assert(s.view==INBOX && !starts && !tab_switches);
+ // A host clear during contact cannot retarget the release to the tabs.
+ workspace_setup(); s.notice_count=1; scene_take(); habitat_touch(true,233,413,1000);
+ s.notice_count=0; scene_take(); habitat_touch(false,233,413,1080);
+ assert(s.view==HOME && !tab_switches && !starts);
+ // The existing hold-left gesture still reaches workspaces while updates wait.
+ workspace_setup(); s.notice_count=1; scene_take(); habitat_touch(true,233,230,1000);
+ habitat_touch(true,233,230,1700); habitat_touch(true,100,230,1800);
+ habitat_touch(false,100,230,1900); assert(s.view==TABS && !starts && !tab_switches);
+ workspace_setup(); s.notice_count=1; scene_take(); s.notice_count=0; scene_take();
+ assert(!action_enabled(A_TABS) && !action_enabled(A_INBOX));
+ workspace_setup(); fake_ms=30000; surface_tick(fake_ms);
+ ui_notify_task_done("b","Other pane","M2","Finished.");
+ assert(s.pet_pose==3 && s.pet_until==32000);
+ surface_tick(30010); scene_take(); portrait(dir,"notification-glance-right");
+ assert(octopus_motion.reaction.pose.look==2);
+ surface_tick(30400); scene_take(); portrait(dir,"notification-glance-left");
+ assert(octopus_motion.reaction.pose.look==-2);
+ surface_tick(30860); assert(octopus_motion.reaction.pose.blink);
+ surface_tick(31400); assert(!octopus_motion.reaction.pose.look && !octopus_motion.reaction.pose.blink);
+ s.pet_pose=0; fake_ms=33000; surface_tick(fake_ms); scene_take();
+ assert(tim_mood()!=HT_TIM_DONE && action_enabled(A_INBOX)); portrait(dir,"unread-persistent");
+ cable_notif_t restored={.agent_id="b",.name="Other pane",.summary="Finished."};
+ ui_notif_replace(&restored,1); assert(!s.pet_pose); // history never replays a celebration
+ waiting_count=1; surface_tick(33500); scene_take(); portrait(dir,"needs-attention");
+ assert(tim_mood()==HT_TIM_ATTENTION);
+ surface_tick(60000); assert(tim_mood()==HT_TIM_ATTENTION); // persists until resolved
+ waiting_count=0; surface_tick(61000); assert(tim_mood()!=HT_TIM_ATTENTION);
+ ui_notif_seen("b"); assert(!s.notice_count); scene_take(); portrait(dir,"inbox-handled");
+ // The last seen result exits the inbox even while a finger is on the card.
+ workspace_setup(); ui_notify_task_done("a","Deploy latest firmware","M2","Installed.");
+ ui_notif_open(); scene_take(); portrait(dir,"inbox-unread");
+ assert(s.view==INBOX && action_enabled(A_NOTICE));
+ habitat_touch(true,233,215,1000); ui_notif_seen("a"); scene_take();
+ assert(s.view==HOME && !s.notice_count && s.touch_cancelled);
+ habitat_touch(false,233,215,1100); assert(!starts && !desktop_opens);
+ ui_notif_open(); assert(s.view==HOME); // no empty-inbox dead end
+ // Snapshot reconciliation is atomic: replacing the only row stays in inbox.
+ cable_notif_t notices[2]={
+ {.agent_id="a",.name="Deploy latest firmware",.machine="M2",.summary="Installed."},
+ {.agent_id="b",.name="Research",.machine="M2",.summary="Which branch?",.question=true}};
+ ui_notif_replace(notices,1); ui_notif_open();
+ ui_notif_replace(notices,1); assert(s.view==INBOX && s.notice_count==1);
+ ui_notif_replace(notices,2); s.offset=1;
+ ui_notif_seen("a"); assert(s.view==INBOX && s.notice_count==1 && s.offset==0);
+ ui_notif_seen("b"); assert(s.view==INBOX && s.notice_count==1); // a glance is not an answer
+ scene_take(); portrait(dir,"inbox-question");
+ ui_question_close("b","question-1"); assert(s.view==HOME && !s.notice_count);
+ ui_notif_replace(notices,1); ui_notif_open(); scene_take();
+ habitat_touch(true,233,215,2000); ui_notif_replace(NULL,0); scene_take();
+ assert(s.view==HOME && s.touch_cancelled);
+ habitat_touch(false,233,215,2100); assert(!starts && !desktop_opens);
+ // Clearing notifications never interrupts another screen or a live microphone.
+ s.view=TABS; ui_notif_replace(NULL,0); assert(s.view==TABS);
+ s.view=VOICE; s.voice_open=true; ui_notif_replace(NULL,0); assert(s.view==VOICE);
+ // New arrivals, repeated updates and reordered host snapshots must preserve
+ // the message being read. A changed card consumes an in-flight release.
+ workspace_setup();
+ ui_notify_task_done("a","First pane","M2","The update is installed. Voice input sends to the selected agent. The summary has more room, the octopus is larger, and unread messages open from the bottom edge of the screen.");
+ ui_notify_task_done("b","Second pane","M2","All tests pass.");
+ ui_notif_open(); s.offset=1; scene_take(); portrait(dir,"notification-long-reading");
+ assert(!strcmp(s.notice[s.offset].agent_id,"a"));
+ habitat_touch(true,233,250,3000);
+ ui_notify_task_done("c","Third pane","M2","The build is ready.");
+ assert(!strcmp(s.notice[s.offset].agent_id,"a")&&s.touch_cancelled);
+ habitat_touch(false,233,250,3100);assert(!desktop_opens&&!starts);
+ ui_notify_task_done("a","First pane","M2","A newer result from the same pane.");
+ assert(!strcmp(s.notice[s.offset].agent_id,"a")&&s.offset==0);
+ cable_notif_t reordered[3]={
+ {.agent_id="d",.name="Fourth",.summary="The deploy is complete."},
+ {.agent_id="a",.name="First pane",.summary="A newer result from the same pane."},
+ {.agent_id="b",.name="Second pane",.summary="All tests pass."}};
+ ui_notif_replace(reordered,3);assert(!strcmp(s.notice[s.offset].agent_id,"a")&&s.offset==1);
+ ui_notif_seen("d");assert(!strcmp(s.notice[s.offset].agent_id,"a")&&s.offset==0);
+ scene_take();tap(3700,150,430);assert(s.view==HOME&&!desktop_opens&&!starts);
+ ui_notif_open();scene_take();tap(4400,300,430);
+ assert(desktop_opens==1&&!strcmp(opened_agent,"a")&&!starts);
+ // A full inbox evicts another row instead of the oldest card being read.
+ workspace_setup();
+ for(int i=0;i<NOTICES;i++) {
+ char id[24];snprintf(id,sizeof id,"notice-%d",i);
+ ui_notify_task_done(id,"A pane","M2","A complete result to read.");
+ }
+ ui_notif_open();s.offset=NOTICES-1;
+ for(int i=0;i<2*NOTICES;i++) {
+ char id[24];snprintf(id,sizeof id,"incoming-%d",i);
+ ui_notify_task_done(id,"New pane","M2","Another result arrived.");
+ assert(s.notice_count==NOTICES&&!strcmp(s.notice[s.offset].agent_id,"notice-0"));
+ }
+ ui_notif_seen(NULL);assert(s.notice_count==NOTICES);
+ ui_notif_replace(NULL,1000);assert(s.view==HOME&&!s.notice_count);
+ // Five names fit without losing the sixth tab; list drags respond before UP.
+ workspace_setup(); s.tab_count=6;
+ strcpy(s.tabs[4].id,"tab-4"); strcpy(s.tabs[4].name,"Tools");
+ strcpy(s.tabs[5].id,"tab-5"); strcpy(s.tabs[5].name,"Notes");
+ dispatch((action_t){.kind=A_TABS}); scene_take(); portrait(dir,"tabs-names");
+ assert(s.view==TABS && s.hit_count==6 && !action_enabled(A_UP) && !action_enabled(A_DOWN));
+ assert(!action_enabled(A_MACHINES));
+ int highlighted=0;
+ for(int i=0;i<scene.count;i++) {
+ assert(!strstr(scene.runs[i].text,"panes") && !strstr(scene.runs[i].text,"selected"));
+ assert(!strchr(scene.runs[i].text,':') && strcmp(scene.runs[i].text,">"));
+ if(scene.runs[i].bg==SEL) { highlighted++; assert(!strcmp(scene.runs[i].text," Product")); }
+ }
+ assert(highlighted==1);
+ for(int i=1;i<s.hit_count;i++) {
+ assert(s.hits[i].action==A_TAB && s.hits[i].rect.h>=48);
+ if(i>1) assert(s.hits[i].rect.y>=s.hits[i-1].rect.y+s.hits[i-1].rect.h);
+ }
+ habitat_touch(true,233,300,3000); habitat_touch(true,233,240,3060); scene_take();
+ assert(s.offset==1 && s.view==TABS && !tab_switches && !starts && !moves);
+ habitat_touch(false,233,160,3120); scene_take();
+ assert(s.offset==1 && s.view==TABS && !tab_switches && !starts);
+ portrait(dir,"tabs-scrolled");
+ tap(3300,233,360); assert(tab_switches==1 && !strcmp(tab_target,"tab-5") && !starts);
+ // A short list never scrolls into an empty page; out-and-back is not a tap.
+ workspace_setup(); dispatch((action_t){.kind=A_TABS}); scene_take();
+ habitat_touch(true,233,300,4000); habitat_touch(true,233,120,4100);
+ habitat_touch(false,233,300,4200); scene_take();
+ assert(s.offset==0 && !tab_switches && !starts && s.view==TABS);
+ // All 24 supported tabs remain reachable, including the last current tab.
+ workspace_setup(); s.tab_count=24;
+ for(int i=4;i<24;i++) {
+ snprintf(s.tabs[i].id,sizeof s.tabs[i].id,"tab-%d",i);
+ snprintf(s.tabs[i].name,sizeof s.tabs[i].name,"Workspace %d",i);
+ }
+ strcpy(s.selected_tab,"tab-23"); dispatch((action_t){.kind=A_TABS}); scene_take();
+ assert(s.offset==19 && s.hit_count==6 && s.hits[5].value==23);
+ portrait(dir,"tabs-last");
+ habitat_touch(true,233,180,5000); habitat_touch(true,233,300,5060); scene_take();
+ assert(s.offset==17 && !tab_switches && !starts);
+ habitat_touch(false,233,300,5120); assert(s.offset==17);
+ // Reversing the scroll preference only changes direction, never the target.
+ scroll_reversed=true; scene_take();
+ habitat_touch(true,233,180,5300); habitat_touch(true,233,300,5360);
+ habitat_touch(false,233,300,5420); scene_take();
+ assert(s.offset==19 && !tab_switches && !starts); scroll_reversed=false;
+ // A changed roster during contact cancels the stale choice and clamps view.
+ habitat_touch(true,233,360,5600); ui_swarms_replace(s.tabs,2,"tab-1");
+ habitat_touch(false,233,360,5675); scene_take();
+ assert(s.offset==0 && !tab_switches && !starts && s.hit_count==3);
+ ui_swarms_replace(NULL,0,NULL); scene_take(); portrait(dir,"tabs-empty");
+ assert(s.hit_count==1 && action_enabled(A_HOME) && !action_enabled(A_TAB));
+ workspace_setup(); s.connected=false; dispatch((action_t){.kind=A_TABS}); scene_take();
+ assert(!action_enabled(A_TAB)); tap(5800,233,140); assert(!tab_switches && !starts);
+ reset(); s.view=INBOX; dispatch((action_t){.kind=A_NOTICE,.id="off-tab-agent"});
+ assert(desktop_opens==1 && !strcmp(opened_agent,"off-tab-agent") && s.view==INBOX);
+ assert(!visit.pending && !visit_sends && !starts); // Works with the shipping agent.open protocol.
+ reset(); s.view=INBOX; s.connected=false; dispatch((action_t){.kind=A_NOTICE,.id="a"});
+ assert(!desktop_opens && !visit_sends);
+ reset(); s.view=INBOX; congestion=true; dispatch((action_t){.kind=A_NOTICE,.id="a"});
+ assert(!desktop_opens && s.view==MESSAGE && !visit.pending);
+ workspace_setup(); habitat_touch(true,233,230,1000);
+ habitat_touch(true,233,230,1700); habitat_touch(true,100,230,1800);
+ habitat_touch(false,100,230,1900); scene_take(); portrait(dir,"tabs-from-gesture");
+ tap(2100,233,294); // Fourth row: Research. The normal switch receipt still applies.
+ assert(tab_switches==1 && !strcmp(tab_target,"tab-3") && s.loading && s.view==MESSAGE);
+ uint32_t serial=workspace.serial;
+ ui_land_after_reload(); assert(s.loading); // A periodic refresh is not a switch receipt.
+ ui_workspace_applied("tab-3",3); ui_land_after_reload(); assert(s.loading);
+ ui_swarms_replace(s.tabs,s.tab_count,"tab-3"); assert(tab_queued.kind==A_TAB_REFRESH);
+ assert(ht_workspace_refresh(&workspace,serial,10));
+ ui_workspace_applied("tab-1",11); ui_land_after_reload(); assert(s.loading);
+ ui_workspace_applied("tab-3",10); ui_land_after_reload(); assert(s.loading);
+ ui_workspace_applied("tab-3",11); ui_land_after_reload(); assert(!s.loading && s.view==HOME);
+ assert(workspace.phase==HT_WORKSPACE_IDLE && !starts);
+ // Empty tabs have a valid receipt too, without inventing a voice recipient.
+ dispatch((action_t){.kind=A_TAB,.id="tab-0"});
+ ui_swarms_replace(s.tabs,s.tab_count,"tab-0"); assert(ht_workspace_refresh(&workspace,workspace.serial,11));
+ s.count=0; s.active=-1; ui_workspace_applied("tab-0",12); ui_land_after_reload();
+ assert(!s.loading && s.view==HOME && !active() && !starts);
+ workspace_setup(); habitat_touch(true,233,230,1000); habitat_touch(true,233,230,1700);
+ habitat_touch(true,100,230,1800); habitat_touch_cancel(); habitat_touch(false,100,230,1900);
+ assert(!tab_switches && !starts && s.view==HOME);
+ // The same gesture works on the smaller completed-turn portrait.
+ workspace_setup(); s.agents[0].recap_ready=true; s.agents[0].has_event=true;
+ strcpy(s.agents[0].preview,"Installed. The device reconnected."); scene_take(); portrait(dir,"completed-quiet-footer");
+ habitat_touch(true,233,130,2000); habitat_touch(true,233,130,2700);
+ habitat_touch(true,100,130,2800); habitat_touch(false,100,130,2900); scene_take();
+ assert(s.view==TABS && !starts && !desktop_opens && !tab_switches);
+ workspace_setup(); s.rim_enabled=true; scene_take(); tap(1000,233,413);
+ assert(s.view==HOME && !starts && !moves);
+ workspace_setup(); s.coasting=true; s.coast_until=2000; tap(1000,233,413);
+ assert(s.view==HOME && down_reports==1 && ups==1 && !tab_switches && !starts);
+ tap(1300,233,413); assert(s.view==HOME && !starts && !tab_switches);
+ workspace_setup(); visit.available=true; strcpy(visit.label,"Return"); scene_take();
+ assert(action_enabled(A_RETURN) && !action_enabled(A_TABS));
+ workspace_setup(); carry.active=true; scene_take();
+ assert(action_enabled(A_CARRY_DROP) && !action_enabled(A_TABS));
+ workspace_setup(); congestion=true; dispatch((action_t){.kind=A_TAB,.id="tab-2"});
+ assert(!s.loading && s.view==MESSAGE && workspace.phase==HT_WORKSPACE_IDLE && !tab_switches);
+ reset(); dispatch((action_t){.kind=A_FIND}); scene_take();
+ assert(s.view==FORM && form.pending && form.id[0] && form_actions==1 && form_command.op==HT_FORM_OPEN);
+ char opening_id[48]; COPY(opening_id,form.id); uint32_t opening_request=form.request;
+ assert(action_enabled(A_FORM_BACK) && !action_enabled(A_FORM_SAY));
+ tap(2000,113,389); assert(s.view==HOME && !form.id[0] && form_command.op==HT_FORM_CLOSE);
+ ht_form_page_t late={.active=true,.can_query=true,.revision=1};
+ assert(!ht_form_reply(&form,opening_id,opening_request,true,&late,2100));
+ dispatch((action_t){.kind=A_FIND}); assert(form.pending && form.request>opening_request);
+ assert(ht_form_tick(&form,6000)); scene_take();
+ assert(form.failed && action_enabled(A_FORM_BACK));
+ tap(6500,113,389); assert(s.view==HOME && !form.id[0]);
+ // A background refresh can coincide with any repaint. Its unchanged reply
+ // must restore both the visible Say control and its real touch target.
+ reset(); view(FORM);
+ ht_form_page_t finder_page={.active=true,.can_query=true,.revision=1,
+ .title="Find Harness",.label="Say a name",.action="open"};
+ ht_form_open(&form,"find-test",1000,form_emit,NULL);
+ if (ht_form_reply(&form,"find-test",form.request,true,&finder_page,1010)) scene_take();
+ assert(action_enabled(A_FORM_SAY));
+ ht_form_tick(&form,2010); assert(form.pending);
+ scene_take(); // Touch or an agent status causes a frame while the read is in flight.
+ assert(!action_enabled(A_FORM_SAY));
+ if (ht_form_reply(&form,"find-test",form.request,true,&finder_page,2020)) scene_take();
+ assert(action_enabled(A_FORM_SAY));
+ tap(2200,223,389); assert(starts==1);
+ reset(); portrait(dir, "ready");
+ s.agents[0].busy = true; strcpy(s.agents[0].tool,"Running firmware checks"); scene_take(); portrait(dir, "working");
+ habitat_touch(true,233,220,1000); assert(!starts); // act only on release
+ habitat_touch(false,233,220,1075); scene_take();
+ assert(starts==1 && !strcmp(target,"a") && s.view==VOICE);
+ portrait(dir,"listening");
+ tap(1200,233,220); tap(1400,233,220); assert(!stops); // double/triple are one intent
+ s.active=1; input_cancel();
+ assert(!strcmp(target,"a") && !strcmp(s.voice_target,"Deploy latest firmware"));
+ tap(2400,233,220); assert(stops==1);
+ tap(3200,233,422); assert(s.view==HOME && !s.voice_open);
+ tap(4000,233,220); assert(starts==2 && !strcmp(target,"b"));
+
+ reset(); tap(1000,233,220); tap(1200,233,422);
+ assert(!s.voice_open && s.view==HOME); // explicit Discard bypasses the rapid-tap guard
+
+ reset(); habitat_touch(true,233,220,1000); s.active=1; input_cancel();
+ habitat_touch(false,233,220,1075); assert(!starts);
+ tap(1200,233,220); assert(starts==1 && !strcmp(target,"b"));
+ reset(); habitat_touch(true,233,220,1000); habitat_touch_cancel();
+ habitat_touch(false,233,220,1080); assert(!starts);
+ tap(1200,233,220); assert(starts==1);
+ reset(); habitat_touch(true,233,220,1000);
+ habitat_touch(true,233,170,1020); assert(moves>0 && !starts && travel==-50);
+ habitat_touch(true,233,220,1040); habitat_touch(false,233,220,1080);
+ assert(!starts && s.coasting);
+ tap(1200,233,220); assert(!starts); // tap brakes, even over Tim
+ tap(1500,233,220); assert(starts==1);
+ reset(); habitat_touch(true,233,220,1000);
+ habitat_touch(true,310,220,1020); habitat_touch(true,233,220,1040);
+ habitat_touch(false,233,220,1080); assert(!starts && !switches);
+ tap(1200,233,220); assert(starts==1);
+ reset(); habitat_touch(true,320,220,1000); habitat_touch(false,150,220,1120);
+ assert(switches==1 && s.active==1 && !moves);
+ reset(); congestion=true;
+ habitat_touch(true,233,220,1200); habitat_touch(true,233,300,1220);
+ habitat_touch(false,233,220,1270); assert(!starts);
+ tap(1390,233,220); assert(starts==1);
+ reset(); habitat_touch(true,233,220,1000); habitat_touch(false,233,220,1700);
+ assert(s.view==HOME && !starts);
+ reset(); tap(1000,200,50); assert(s.view==AGENTS && !starts);
+ reset(); s.connected=false; scene_take(); portrait(dir,"offline");
+ tap(1000,233,220); assert(!starts);
+ reset(); s.count=0; s.active=-1; scene_take();
+ tap(1000,233,220); assert(!starts);
+ // Hold previews do not execute. A later slide chooses a destination, never scrolls or talks.
+ reset(); s.notice_count=1; habitat_touch(true,233,220,1000); surface_tick(1650);
+ assert(s.quick_open && s.view==HOME && !starts); scene_take(); portrait(dir,"shortcuts");
+ habitat_touch(true,330,220,1700); assert(!moves && s.view==HOME);
+ scene_take(); portrait(dir,"shortcut-attention");
+ habitat_touch(false,330,220,1800); assert(s.view==INBOX && !starts);
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650);
+ habitat_touch(true,130,220,1700); habitat_touch(false,130,220,1800);
+ assert(s.view==TABS && !starts && !moves);
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650);
+ habitat_touch(true,233,130,1700); habitat_touch(false,233,130,1800);
+ assert(s.view==AGENTS && !starts && !moves);
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650);
+ habitat_touch(true,233,320,1700); habitat_touch(false,233,320,1800);
+ assert(s.view==SETTINGS && !starts && !moves); scene_take(); portrait(dir,"controls");
+ dispatch((action_t){.kind=A_SELECT_BEGIN});
+ assert(s.view==SELECTION && !starts && selected_command.op==HT_SELECT_BEGIN);
+ assert(ht_selection_reply(&selection,selection.request,"pick-test",true,1,"Which part should change?",1,false,NULL,1810));
+ scene_take(); portrait(dir,"selection");
+ habitat_touch(true,233,290,2100); habitat_touch(true,233,240,2160);
+ habitat_touch(false,233,240,2210); assert(!starts && !moves && selection.pending);
+ assert(selected_command.op==HT_SELECT_STEP && selected_command.delta==2);
+ scene_take(); tap(2400,233,220); assert(!starts); // await the current highlight
+ assert(ht_selection_reply(&selection,selection.request,"pick-test",true,2,"A highlighted paragraph",3,true,NULL,2500));
+ scene_take(); portrait(dir,"selection-range");
+ action_t to_carry=make_action((hit_t){.action=A_CARRY});
+ to_carry.dy--; dispatch(to_carry); assert(!carry.pending && !carry_prepares);
+ tap(2650,330,350); assert(carry.pending && carry_prepares==1 && !starts);
+ tap(2800,233,220); assert(!starts); // no voice while the selected text is being frozen
+ assert(ht_carry_reply(&carry,carry.id,carry.request,true,"Research helper","A highlighted paragraph",3,300000,NULL,3000));
+ ht_selection_close(&selection); view(HOME); s.active=1; scene_take(); portrait(dir,"carry-home");
+ tap(3400,233,220); assert(starts==1 && s.voice_carry && !strcmp(target,"b") && !strcmp(voice_context,carry.id));
+ scene_take(); portrait(dir,"carry-listening");
+ dispatch((action_t){.kind=A_VOICE_ABORT}); scene_take();
+ tap(4100,233,410); assert(!carry.active && carry_drops==1 && starts==1);
+ reset(); view(SELECTION); ht_selection_open(&selection,"pick-test","a",1000,select_emit,NULL);
+ assert(ht_selection_reply(&selection,selection.request,"pick-test",true,1,"A highlighted paragraph",3,true,NULL,1010));
+ action_t selected_action=make_action((hit_t){.action=A_PET});
+ assert(!strcmp(selected_action.text,"pick-test") && selected_action.dy==1);
+ tap(2700,233,220); assert(starts==1 && s.view==VOICE && !strcmp(target,"a"));
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650); habitat_touch_cancel();
+ habitat_touch(false,233,220,1800); assert(s.view==HOME && !s.quick_open && !starts);
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650); surface_tick(6000);
+ habitat_touch(false,233,220,6100); assert(s.view==HOME && !starts); // resting hand
+ reset(); habitat_touch(true,233,220,1000); habitat_touch(true,233,170,1100);
+ surface_tick(1650); habitat_touch(false,233,170,1800);
+ assert(!s.quick_open && s.view==HOME && !starts); // a drag can never become a hold
+ reset(); s.rim_enabled=true; tap(1000,433,233); assert(!starts && !switches);
+ habitat_touch(true,433,233,2000); habitat_touch(true,418,310,2100);
+ habitat_touch(true,374,374,2200); habitat_touch(true,310,418,2300);
+ habitat_touch(false,233,433,2400); assert(travel<0 && !switches && !starts && !s.coasting);
+ reset(); s.rim_enabled=true; congestion=true;
+ habitat_touch(true,433,233,2000); habitat_touch(true,233,433,2100);
+ habitat_touch(false,33,233,2200); assert(!starts && !switches); // even backpressured rim owns contact
+ reset(); s.focus_face=true; s.agents[0].busy=true;
+ strcpy(s.agents[0].tool,"Running firmware checks"); scene_take(); portrait(dir,"focus");
+ tap(1000,233,220); assert(starts==1); // same voice muscle memory in both faces
+ reset(); s.straight_title=true; scene_take(); portrait(dir,"straight-title");
+ reset(); s.nap=true; scene_take(); portrait(dir,"asleep");
+ reset(); s.pet_pose=3; scene_take(); portrait(dir,"done");
+ reset(); s.pet_pose=1; scene_take(); portrait(dir,"booped");
+ reset(); waiting_count=1; s.notice_count=1; scene_take(); portrait(dir,"attention");
+ tap(1000,233,375); assert(s.view==HOME && !starts);
+ habitat_touch(true,233,230,2000); surface_tick(2700);
+ habitat_touch(true,350,230,2800); habitat_touch(false,350,230,2900);
+ assert(s.view==INBOX && !starts);
+ reset(); visit.available=true; scene_take(); portrait(dir,"return");
+ tap(1000,233,409); assert(returns==1 && !starts); visit.available=false;
+ reset(); strcpy(s.agents[0].name,"A very long recipient name that still needs to be readable on a tiny circular display");
+ scene_take(); portrait(dir,"long-name");
+ reset(); ht_form_open(&form,"form-test",100,form_emit,NULL);
+ ht_form_page_t page={.active=true,.enabled=true,.revision=1,.position=4,.total=4,
+ .title="New Harness",.label="New Harness",.action="start",.previous="Options",
+ .detail="Claude Code\nM2:~/code/harness"};
+ ht_form_reply(&form,"form-test",form.request,true,&page,101); s.view=FORM; scene_take();
+ portrait(dir,"new-harness");
+ tap(1000,290,405); assert(form_actions==2 && form_command.op==HT_FORM_ACTIVATE && !starts);
+ page.revision++; ht_form_reply(&form,"form-test",form.request,true,&page,1090); scene_take();
+ tap(1200,290,405); assert(form_actions==2); // a double tap cannot launch twice
+ tap(1700,290,405); assert(form_actions==3 && !starts);
+ ht_form_reply(&form,"form-test",form.request,true,&page,1800); scene_take();
+ int before=form_actions;
+ habitat_touch(true,233,260,2500); habitat_touch(true,234,180,2590); habitat_touch(false,234,180,2660);
+ assert(form_actions==before+1 && form_command.op==HT_FORM_MOVE && !starts && !switches);
+ page.revision++; ht_form_reply(&form,"form-test",form.request,true,&page,2700); scene_take();
+ habitat_touch(true,120,233,3100); habitat_touch(true,280,234,3190); habitat_touch(false,280,234,3260);
+ assert(form_command.op==HT_FORM_BACK && !starts && !switches);
+ page.revision++; strcpy(page.error,"Choices changed. Try again.");
+ ht_form_reply(&form,"form-test",form.request,false,&page,3300); scene_take(); portrait(dir,"new-harness-stale");
+ page.can_query=true; strcpy(page.title,"Project"); strcpy(page.label,"harness");
+ strcpy(page.query,"harness"); strcpy(page.action,"choose"); page.error[0]=0;
+ form.page=page; form.pending=false; scene_take(); portrait(dir,"spoken-project");
+ int speech_before=starts;
+ habitat_touch(true,220,390,4000); habitat_touch(true,220,300,4090); habitat_touch(false,220,300,4160);
+ assert(starts==speech_before); // a drag starting on Say is still only movement
+ page.revision++; ht_form_reply(&form,"form-test",form.request,true,&page,4200); scene_take();
+ tap(5000,220,391); assert(starts==speech_before+1);
+ tap(5200,220,391); assert(starts==speech_before+1); // rapid duplicate cannot open twice
+ reset(); strcpy(form.id,"find-test"); s.view=FORM;
+ form.page=(ht_form_page_t){.active=true,.enabled=true,.can_query=true,.revision=1,
+ .position=1,.total=2,.title="Find Harness",.label="Fix login screen",
+ .detail="Codex / M2\nopenharness",.query="login",.next="Login flow tests",.action="open"};
+ scene_take(); portrait(dir,"find-named");
+ reset(); s.view=QUESTION; s.q.valid=s.q.supported=true; s.q.count=1; s.q.revision=1;
+ strcpy(s.q.agent,"a"); strcpy(s.q.token,"token-a"); strcpy(s.q.name,"Research helper");
+ strcpy(s.q.item[0].prompt,"One\nTwo\nThree\nFour\nFive\nSix\nSeven\nEight");
+ s.q.item[0].count=3;
+ strcpy(s.q.item[0].options[0],"This file"); strcpy(s.q.item[0].options[1],"Whole project"); strcpy(s.q.item[0].options[2],"Leave it");
+ scene_take(); habitat_touch(true,233,270,1000); habitat_touch(true,233,150,1100); habitat_touch(false,233,150,1180);
+ assert(s.offset==3 && !starts && !question_sends && !s.q.item[0].selected);
+ scene_take(); tap(2000,300,393); assert(s.view==CHOICE);
+ scene_take(); habitat_touch(true,233,240,2500); habitat_touch(true,233,195,2580); habitat_touch(false,233,195,2650);
+ assert(s.q.choice==1 && !s.q.item[0].selected && !question_sends);
+ scene_take(); tap(3000,233,340); assert(s.q.item[0].selected==2);
+ scene_take(); tap(4000,305,393); assert(s.view==ANSWER_REVIEW && !question_sends);
+ scene_take(); tap(4150,305,393); assert(!question_sends); // Rapid second tap cannot skip review.
+ scene_take(); tap(4800,305,393); assert(question_sends==1 && s.q.pending && !starts);
+ strcpy(s.agents[0].name,"Research helper");
+ s.q.pending=false;s.q.item[0].selected=0;s.q.item[0].can_text=true;question_sends=0;view(QUESTION);scene_take();
+ habitat_touch(true,223,390,6000);habitat_touch(true,223,280,6100);habitat_touch(false,223,280,6180);
+ assert(!starts && !question_sends); // Drag beginning on Say still reads.
+ scene_take();tap(7000,223,390);assert(starts==1 && s.view==VOICE && s.voice_return==QUESTION);
+ assert(!strcmp(target,"a") && !strcmp(voice_context,"token-a"));scene_take();portrait(dir,"question-listening");
+ tap(7140,233,220);assert(!stops); // Say's second tap cannot instantly end the new capture.
+ tap(7800,233,220);assert(stops==1 && !question_sends);
+ s.voice_open=false;strcpy(s.q.item[0].draft,"reviewed-draft");
+ strcpy(s.q.item[0].answer,"Keep the public API. Only change the parser.");view(ANSWER_REVIEW);
+ ht_gesture_guard(&gesture,9000);scene_take();tap(9050,330,399);assert(!question_sends);
+ scene_take();tap(9600,330,399);assert(question_sends==1);
+
+ reset(); tap(1000,233,220); scene_take();
+ habitat_touch(true,233,220,2000); surface_tick(2675); assert(s.voice_review_preview); scene_take(); portrait(dir,"voice-review-hold");
+ habitat_touch(false,233,220,2750); assert(stops==1 && reviews==1);
+ reset(); tap(1000,233,220); scene_take();
+ habitat_touch(true,233,220,2000); habitat_touch(true,233,195,2050); surface_tick(2700);
+ assert(!s.voice_review_preview); habitat_touch(false,233,220,2800); assert(!stops && !reviews);
+ reset(); tap(1000,233,220); scene_take();
+ habitat_touch(true,233,220,2000); surface_tick(4000); habitat_touch(false,233,220,4100);
+ assert(!stops && !reviews); // Resting a hand is not review.
+ reset(); s.view=DRAFT;
+ ht_draft_page_t draft_page={.active=true,.revision=1,.can_send=true,.id="draft-one",.agent="a",.name="Parser helper",
+ .text="Keep the public API.\n\nOnly change the parser.\nPreserve existing tests.\nAdd Unicode coverage.\nDo not rename exports.\nKeep async behavior.\nKeep all exported types.",.position=1,.total=2};
+ ht_draft_open(&draft,&draft_page,draft_emit,NULL);scene_take();portrait(dir,"voice-draft");
+ ht_gesture_guard(&gesture,1000);tap(1100,300,389);assert(!draft_actions); // Fast second tap cannot Send.
+ scene_take();habitat_touch(true,233,250,2000);habitat_touch(true,233,170,2080);habitat_touch(false,233,170,2160);
+ assert(!starts && s.offset==2 && !draft_actions);scene_take();
+ habitat_touch(true,233,250,3000);habitat_touch(true,233,90,3080);habitat_touch(false,233,90,3160);
+ assert(draft_actions==1 && draft_command.op==HT_DRAFT_MOVE && !starts);
+ draft_page.revision=2;draft_page.position=2;strcpy(draft_page.text,"And keep the documentation up to date.");
+ ht_draft_reply(&draft,draft_page.id,draft.request,true,&draft_page);scene_take();tap(4000,233,220);
+ assert(starts==1 && s.voice_return==DRAFT && !strcmp(voice_context,"draft-one"));
+ s.voice_open=recording=false;view(DRAFT);scene_take();
+ habitat_touch(true,233,220,5000);habitat_touch(false,233,220,5750);scene_take();
+ assert(s.view==DRAFT_OPTIONS && starts==1);portrait(dir,"voice-draft-options");
+ tap(6400,200,330);assert(s.view==DRAFT);scene_take();tap(7200,305,389);
+ assert(draft.pending && draft_command.op==HT_DRAFT_SEND && draft_actions==2);
+ reset(); view(SELECTION); ht_selection_open(&selection,"pick-test","a",1000,select_emit,NULL);
+ assert(ht_selection_reply(&selection,selection.request,"pick-test",true,1,"A remembered phrase",1,false,NULL,1010));
+ scene_take(); tap(1600,110,362); assert(starts==1 && s.voice_search && !strcmp(voice_context,"pick-test"));
+ scene_take(); portrait(dir,"search-listening");
+ tap(2300,233,220); assert(stops==1 && !reviews);
+ s.voice_open=recording=false; view(SELECTION);
+ assert(ht_selection_found(&selection,"pick-test","a",2,"ERROR: connection refused. Retrying in five seconds.",2,"connection refused",2,7));
+ scene_take(); portrait(dir,"output-search");
+ habitat_touch(true,233,290,3000); habitat_touch(true,233,230,3060); habitat_touch(false,233,230,3120);
+ assert(selected_command.op==HT_SELECT_MATCH && selected_command.delta==1 && starts==1 && !moves);
+ assert(ht_selection_reply_search(&selection,selection.request,"pick-test",true,3,"connection refused again",1,false,NULL,"connection refused",3,7,3200));
+ scene_take(); tap(3700,233,220); assert(starts==2 && !s.voice_search); // matched passage becomes ordinary quoted speech
+ s.voice_open=recording=false; view(SELECTION);
+ assert(ht_selection_found(&selection,"pick-test","a",4,"",0,"missing phrase",0,0));
+ scene_take(); portrait(dir,"output-search-empty");
+ tap(4400,233,220); assert(starts==2); // Nothing to quote.
+ tap(5100,233,362); assert(starts==3 && s.voice_search); // Search remains usable.
+ // The compass uses the final release coordinates and its center cancels.
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650);
+ habitat_touch(true,330,220,1700); assert(s.quick_choice==2);
+ habitat_touch(false,233,220,1800); assert(s.view==HOME && !s.quick_open && !starts && !moves);
+ reset(); habitat_touch(true,233,220,1000); surface_tick(1650);
+ habitat_touch(false,233,130,1800); assert(s.view==AGENTS && !starts && !moves);
+ scene_take(); portrait(dir,"panes");
+ reset(); s.count=8; s.active=7;
+ for(int i=0;i<8;i++) { snprintf(s.agents[i].id,sizeof s.agents[i].id,"pane-%d",i); snprintf(s.agents[i].name,sizeof s.agents[i].name,"Pane %d",i); }
+ view(AGENTS); scene_take(); assert(s.hit_count==6);
+ habitat_touch(true,233,380,1000); habitat_touch(true,233,100,1300);
+ assert(s.offset==3 && !starts && !switches && !moves);
+ habitat_touch(false,233,100,1375); scene_take();
+ assert(s.offset==3 && !strcmp(make_action(s.hits[5]).id,"pane-7"));
+ portrait(dir,"panes-last");
+ // Every advertised optional control is present, none appear for a legacy host.
+ reset(); host_features=0; view(SETTINGS); scene_take();
+ assert(settings_count()==7 && !action_enabled(A_FORM) && !action_enabled(A_LATEST));
+ portrait(dir,"controls-core");
+ habitat_touch(true,233,370,1000); habitat_touch(true,233,160,1250); habitat_touch(false,233,160,1300);
+ scene_take(); assert(s.offset==2 && action_enabled(A_MUTE) && action_enabled(A_BRIGHT));
+ portrait(dir,"controls-core-scroll");
+ dispatch((action_t){.kind=A_FIND}); assert(s.view==AGENTS && !form_actions && !starts);
+ dispatch((action_t){.kind=A_LATEST,.id="a"}); assert(!visit_sends);
+ reset(); host_features=0; tap(1000,233,220); assert(starts==1 && recording);
+ habitat_touch(true,233,220,2000); surface_tick(2700); assert(!s.voice_review_preview);
+ habitat_touch(false,233,220,2800); assert(!stops && !reviews && recording);
+ tap(3400,233,220); assert(stops==1 && !reviews);
+ puts("touch UI: PASS (production contacts/renderers; voice start/finish/discard, target pinning, sensor cancellation, immediate scroll, swipes, round trips, congestion and holds)");
+}
+'''
+extra_sources = []
+extra_includes = []
+if os.environ.get('HABITAT_BRIDGE_TRACE'):
+ from bridge_flow_replay import instrument
+ code = instrument(code, os.environ['HABITAT_BRIDGE_TRACE'], native.parent.parent)
+ json_dir = Path(os.environ['IDF_PATH']) / 'components/json/cJSON'
+ extra_sources = [str(json_dir / 'cJSON.c'), str(native.parent.parent / 'cable_frame.c'),
+ str(native.parent.parent / 'cable_json_guard.c')]
+ extra_includes = ['-I', str(json_dir), '-I', str(native.parent.parent), '-Wno-deprecated-declarations']
+
+with tempfile.TemporaryDirectory(prefix='harness-touch-ui-') as d:
+ out = Path(d)
+ (out / 'touch_ui.c').write_text(code)
+ subprocess.run(['cc','-std=c11','-Wall','-Wextra','-Werror','-O1','-g',
+ '-fsanitize='+os.environ.get('SANITIZERS','undefined,bounds'),
+ *extra_includes, '-I',str(native),str(out/'touch_ui.c'), *extra_sources, str(native/'gestures.c'),
+ str(native/'form.c'),str(native/'visit.c'),str(native/'draft.c'), str(native/'scroll.c'),str(native/'selection.c'),str(native/'carry.c'),str(native/'tim.c'),str(native/'terminal.c'),
+ str(native/'fonts.c'),str(native/'octopus.c'),str(native/'ascii_clip.c'),str(native/'octopus_font.c'),str(native/'workspace.c'),str(native/'command_face.c'),'-o',str(out/'touch_ui')],check=True)
+ args=[str(out/'touch_ui')]
+ if os.environ.get('HABITAT_PREVIEW_DIR'):
+ dest=Path(os.environ['HABITAT_PREVIEW_DIR']);dest.mkdir(parents=True,exist_ok=True)
+ args.append(str(dest))
+ subprocess.run(args,check=True)
diff --git a/devices/harness-device/firmware/test/test_visit.c b/devices/harness-device/firmware/test/test_visit.c
new file mode 100644
index 000000000..5b5d92444
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_visit.c
@@ -0,0 +1,62 @@
+#include "../main/ui/habitat/visit.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+static bool full;
+static int sends;
+static ht_visit_op_t last;
+static bool emit(const ht_visit_command_t *c, void *unused)
+{
+ (void)unused;
+ if (full) return false;
+ sends++; last=c->op;
+ assert(c->id[0] && c->request);
+ return true;
+}
+int main(void)
+{
+ ht_visit_t s={0};
+ assert(ht_visit_open(&s,"visit-1","agent-a",10,emit,NULL));
+ uint32_t request=s.request;
+ assert(!ht_visit_open(&s,"visit-2","agent-b",11,emit,NULL));
+ assert(!ht_visit_back(&s,20));
+ assert(!ht_visit_reply(&s,"visit-2",request,true,"origin"));
+ assert(!ht_visit_reply(&s,"visit-1",request+1,true,"origin"));
+ assert(ht_visit_reply(&s,"visit-1",request,true,"origin"));
+ assert(s.available && !s.pending && !strcmp(s.label,"origin"));
+ assert(ht_visit_open(&s,"visit-1","agent-b",30,emit,NULL));
+ assert(s.available && !strcmp(s.agent,"agent-b"));
+ assert(ht_visit_reply(&s,"visit-1",s.request,true,"origin"));
+ assert(ht_visit_back(&s,50)); assert(last==HT_VISIT_BACK);
+ assert(ht_visit_reply(&s,"visit-1",s.request,false,""));
+ assert(!s.available && !s.id[0] && !ht_visit_back(&s,60));
+ assert(ht_visit_open(&s,"visit-2","agent-a",UINT32_MAX-100,emit,NULL));
+ request=s.request;
+ assert(!ht_visit_tick(&s,30));
+ assert(ht_visit_tick(&s,3500)); assert(last==HT_VISIT_CANCEL);
+ assert(!ht_visit_reply(&s,"visit-2",request,true,"late"));
+ full=true;
+ assert(!ht_visit_open(&s,"visit-3","agent-a",9000,emit,NULL));
+ assert(!s.pending && !s.available);
+ full=false;
+ assert(ht_visit_latest(&s,"visit-reading","agent-a",10000,emit,NULL));
+ assert(last==HT_VISIT_LATEST && s.op==HT_VISIT_LATEST);
+ request=s.request;
+ assert(!ht_visit_latest(&s,"visit-reading","agent-a",10001,emit,NULL));
+ assert(ht_visit_reply(&s,"visit-reading",request,true,"Your reading"));
+ full=true;
+ assert(!ht_visit_open(&s,"visit-reading","agent-b",10020,emit,NULL));
+ assert(s.available && !s.pending && !strcmp(s.agent,"agent-a"));
+ full=false;
+ assert(ht_visit_latest(&s,"visit-reading","agent-a",10100,emit,NULL));
+ assert(!ht_visit_reply(&s,"visit-reading",request,true,"Old receipt"));
+ assert(ht_visit_reply(&s,"visit-reading",s.request,true,"Your reading"));
+ assert(ht_visit_back(&s,10200)); assert(s.op==HT_VISIT_BACK);
+ assert(ht_visit_reply(&s,"visit-reading",s.request,false,""));
+ ht_visit_close(&s);
+ full=false;
+ assert(ht_visit_open(&s,"visit-4","agent-a",9000,emit,NULL));
+ ht_visit_close(&s); assert(last==HT_VISIT_CANCEL);
+ assert(!s.pending && !s.available);
+ printf("visit: correlated replies, chained visits, return, timeout/wrap, congestion, cancel; state=%zu bytes\n",sizeof s);
+}
diff --git a/devices/harness-device/firmware/test/test_voice_buffer.c b/devices/harness-device/firmware/test/test_voice_buffer.c
new file mode 100644
index 000000000..6df48fa59
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_voice_buffer.c
@@ -0,0 +1,74 @@
+#include "../main/voice_buffer.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+int main(void)
+{
+ voice_buffer_t b;
+ uint8_t storage[1024], input[400];
+ voice_buffer_init(&b, storage, sizeof(storage));
+ uint32_t produced = 0, consumed = 0;
+ for (int i = 0; i < 20000; i++) {
+ size_t size = (unsigned)(i * 29) % sizeof(input) + 1;
+ for (size_t j = 0; j < size; j++)
+ input[j] = (uint8_t)(produced + j);
+ if (voice_buffer_write(&b, input, size))
+ produced += (uint32_t)size;
+ const uint8_t *p;
+ size_t n = voice_buffer_peek(&b, &p, (unsigned)(i * 13) % 300 + 1);
+ for (size_t j = 0; j < n; j++)
+ assert(p[j] == (uint8_t)(consumed + j));
+ voice_buffer_consume(&b, n);
+ consumed += (uint32_t)n;
+ assert(voice_buffer_used(&b) == produced - consumed);
+ }
+ // Unsigned counters also wrap safely after long-running use.
+ voice_buffer_init(&b, storage, sizeof(storage));
+ atomic_store(&b.head, UINT32_MAX - 255);
+ atomic_store(&b.tail, UINT32_MAX - 255);
+ memset(input, 0x6a, sizeof(input));
+ assert(voice_buffer_write(&b, input, sizeof(input)));
+ const uint8_t *p;
+ size_t n = voice_buffer_peek(&b, &p, 1024);
+ assert(n == 256);
+ voice_buffer_consume(&b, n);
+ n = voice_buffer_peek(&b, &p, 1024);
+ assert(n == 144);
+ for (size_t j = 0; j < n; j++)
+ assert(p[j] == 0x6a);
+ voice_buffer_consume(&b, n);
+ assert(!voice_buffer_used(&b));
+ int16_t pcm[640];
+ for (int i = 0; i < 640; i++)
+ pcm[i] = 2000;
+ for (int chunk = 160; chunk <= 640; chunk *= 2) {
+ voice_gate_t gate = {0};
+ int elapsed = 0;
+ while (elapsed < 5120) {
+ assert(!gate.heard);
+ voice_gate_feed(&gate, pcm, chunk, 16000);
+ elapsed += chunk;
+ }
+ assert(gate.heard);
+ }
+ voice_gate_t gate = {0};
+ voice_gate_feed(&gate, pcm, 640, 16000);
+ memset(pcm, 0, sizeof(pcm));
+ voice_gate_feed(&gate, pcm, 640, 16000);
+ assert(!gate.heard && !gate.loud_samples);
+ voice_level_t meter={0};
+ assert(voice_level_feed(&meter,pcm,0)==0);
+ for(int i=0;i<640;i++) pcm[i]=1500; // DC offset is not a mic signal
+ assert(voice_level_feed(&meter,pcm,640)==0);
+ pcm[0]=-32768; pcm[1]=32767;
+ assert(voice_level_feed(&meter,pcm,640)==4);
+ assert(pcm[0]==-32768 && pcm[1]==32767); // meter never modifies captured audio
+ memset(pcm,0,sizeof(pcm));
+ assert(voice_level_feed(&meter,pcm,160)==4); // fast attack, slow release
+ for(int i=0;i<300;i++) voice_level_feed(&meter,pcm,160);
+ assert(voice_level_feed(&meter,pcm,160)==0);
+ pcm[0]=-150; pcm[1]=150;
+ assert(voice_level_feed(&meter,pcm,160)==2); // quiet input remains visible
+ puts("voice_buffer: byte order, backpressure, wraparound, overflow refusal and 320ms gate "
+ "passed");
+}
diff --git a/devices/harness-device/firmware/test/test_voice_buffer_threads.c b/devices/harness-device/firmware/test/test_voice_buffer_threads.c
new file mode 100644
index 000000000..fb9096cf4
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_voice_buffer_threads.c
@@ -0,0 +1,65 @@
+// The deployed single-producer/single-consumer ring under actual parallel
+// execution, variable chunk sizes, backpressure and 32-bit counter wrap.
+#include "../main/voice_buffer.h"
+#include <assert.h>
+#include <pthread.h>
+#include <sched.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static voice_buffer_t buffer;
+static atomic_bool done;
+static uint32_t total;
+static unsigned seed;
+static uint32_t random_step(uint32_t *r) { *r ^= *r << 13; *r ^= *r >> 17; *r ^= *r << 5; return *r; }
+static void *produce(void *unused)
+{
+ (void)unused;uint8_t bytes[800];uint32_t sent=0,rng=seed;
+ while(sent<total) {
+ unsigned cap=buffer.capacity<sizeof bytes?buffer.capacity:sizeof bytes;
+ size_t n=1+random_step(&rng)%cap;
+ if(n>total-sent)n=total-sent;
+ for(size_t i=0;i<n;i++)bytes[i]=(uint8_t)(sent+i);
+ if(voice_buffer_write(&buffer,bytes,n))sent+=(uint32_t)n;
+ else sched_yield();
+ if(!(rng&31))sched_yield();
+ }
+ atomic_store_explicit(&done,true,memory_order_release);return NULL;
+}
+static void *consume(void *unused)
+{
+ (void)unused;uint32_t received=0,rng=seed^0x84813;
+ while(received<total) {
+ const uint8_t *bytes;
+ size_t n=voice_buffer_peek(&buffer,&bytes,1+random_step(&rng)%1200);
+ if(!n){sched_yield();continue;}
+ for(size_t i=0;i<n;i++)assert(bytes[i]==(uint8_t)(received+i));
+ // Keep ownership of bytes while the producer fills remaining space.
+ if(!(rng&15))sched_yield();
+ voice_buffer_consume(&buffer,n);received+=(uint32_t)n;
+ }
+ return NULL;
+}
+int main(void)
+{
+ static const unsigned sizes[]={32,256,1024,32768};
+ const char *amount=getenv("VOICE_THREAD_BYTES");
+ total=amount?(uint32_t)strtoul(amount,NULL,10):2*1024*1024;
+ assert(total&&total<UINT32_MAX/2);
+ uint64_t verified=0;
+ for(unsigned cycle=0;cycle<8;cycle++) {
+ unsigned cap=sizes[cycle%4];uint8_t *storage=malloc(cap+16);assert(storage);
+ memset(storage,0xa5,cap+16);voice_buffer_init(&buffer,storage+8,cap);done=false;
+ if(cycle&1){atomic_store(&buffer.head,UINT32_MAX-255);atomic_store(&buffer.tail,UINT32_MAX-255);}
+ seed=0x4d6a1985u+cycle*38119u;
+ pthread_t producer,consumer;
+ assert(!pthread_create(&producer,NULL,produce,NULL));
+ assert(!pthread_create(&consumer,NULL,consume,NULL));
+ assert(!pthread_join(producer,NULL)&&!pthread_join(consumer,NULL));
+ assert(atomic_load_explicit(&done,memory_order_acquire)&&!voice_buffer_used(&buffer));
+ for(int i=0;i<8;i++)assert(storage[i]==0xa5&&storage[cap+8+i]==0xa5);
+ free(storage);verified+=total;
+ }
+ printf("Voice ring threads: %llu bytes in exact order across four capacities, backpressure and counter wrap PASS\n",(unsigned long long)verified);
+}
diff --git a/devices/harness-device/firmware/test/test_voice_ui.py b/devices/harness-device/firmware/test/test_voice_ui.py
new file mode 100644
index 000000000..5a78d49cb
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_voice_ui.py
@@ -0,0 +1,272 @@
+"""Compile the actual Habitat voice handlers with deterministic hardware/queue stubs.
+
+Exercises asynchronous start, discard, late replies, screen ownership and duration limits.
+This tests production function bodies, not a second implementation of the state machine.
+"""
+from pathlib import Path
+import os
+import re
+import subprocess
+import tempfile
+
+native = Path(__file__).resolve().parent / '../main/ui/habitat'
+source = (native / 'ui_habitat.c').read_text()
+
+
+def function(name):
+ match = re.search(r'^[^\n]*\b' + name + r'\([^;]*?\)\n\{.*?^\}', source, re.M | re.S)
+ assert match, name
+ return match.group(0) + '\n'
+
+
+harness = re.search(r'^#define PANE_MEMORY_MAX \d+$', source, re.M).group(0) + '\n'
+harness += r'''
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "../../cable_features.h"
+static uint32_t host_features=31;
+static bool cable_client_supports(uint32_t features) { return (host_features & features)==features; }
+#include "selection.h"
+#include "carry.h"
+#include "visit.h"
+#include "form.h"
+#include "draft.h"
+#include "workspace.h"
+enum { HOME, AGENTS, AGENT, COMPANION, VOICE, MESSAGE, SELECTION, FORM, QUESTION, CHOICE, ANSWER_REVIEW, DRAFT, DRAFT_OPTIONS, INBOX };
+enum { A_VOICE, A_VOICE_STOP, A_VOICE_ABORT };
+enum { VOICE_CMD_NONE, VOICE_CMD_GOAL };
+typedef int view_t;
+typedef struct { int kind, value, dy; uint32_t revision; char id[64], text[192]; } action_t;
+typedef struct { char name[64], id[64]; } agent_t;
+static ht_selection_t selection;
+static ht_carry_t carry;
+static ht_visit_t visit;
+static ht_form_t form;
+static ht_draft_t draft;
+static ht_workspace_t workspace;
+static struct {
+ bool quick_open, coasting, ready, connected, loading, nap, voice_open, voice_start_pending, voice_waiting, voice_carry, voice_review, voice_review_preview, voice_draft_append, voice_search, touch_down, touch_cancelled;
+ int pet_pose, view, voice_return, offset, pressed, active;
+ uint32_t pet_until, nap_until, voice_started, voice_second, voice_wait_until, voice_generation, voice_question_revision, voice_draft_revision;
+ int voice_question_index;
+ char title[80], message[256], voice_target[64], pending_focus[64], pending_machine[64], opening_notice[48];
+ struct { bool valid, supported, loading, pending, uncertain; uint32_t revision, deadline; int index; char error[120],speech_error[96],agent[64],token[48]; struct { bool can_text; } item[4]; } q;
+ agent_t agents[1];
+ struct { bool live_summary; } memory[PANE_MEMORY_MAX];
+} s;
+static uint32_t now;
+static bool audio_active, recording, abort_requested, queue_full;
+static int starts, stops, aborts, cancels, confirms, scroll, gesture, reviews;
+static action_t queued;
+static agent_t *active(void) { return &s.agents[0]; }
+#define COPY(dst, src) snprintf(dst, sizeof(dst), "%s", (src) ? (src) : "")
+#define ESP_LOGI(...) ((void)0)
+uint32_t ms(void) { return now; }
+void change(void) {}
+void surface_tick(uint32_t value) { (void)value; }
+void display_lock(void) {}
+void display_unlock(void) {}
+void display_bump_activity(void) {}
+void ht_scroll_cancel(int *value) { (void)value; }
+void ht_gesture_guard(int *value, uint32_t time) { (void)value; (void)time; }
+void ht_gesture_cancel(int *value) { (void)value; }
+bool audio_client_active(void) { return audio_active; }
+bool audio_client_recording(void) { return recording; }
+void audio_client_stop(void) { stops++; }
+void audio_client_request_review(void) { reviews++; }
+void audio_client_abort(void) { aborts++; abort_requested = true; }
+void audio_client_copy_upload_id(char *dst, size_t cap) { snprintf(dst, cap, "capture-%d", starts); }
+void audio_client_start_cable(const char *id, int cmd) {
+ (void)id; (void)cmd; starts++; audio_active = recording = true; abort_requested = false;
+}
+void audio_client_start_search(const char *id, const char *selected, unsigned revision) {
+ assert(!strcmp(selected,"search-test") && revision==3); audio_client_start_cable(id,VOICE_CMD_NONE);
+}
+void audio_client_start_form(const char *id, unsigned revision) {
+ assert(!strcmp(id, "form-test") && revision==3); audio_client_start_cable(NULL, VOICE_CMD_NONE);
+}
+void audio_client_start_question(const char *id,const char *token,unsigned index) {
+ assert(!strcmp(token,"question-token") && index==0); audio_client_start_cable(id,VOICE_CMD_NONE);
+}
+void audio_client_start_draft(const char *id, unsigned revision, bool append) {
+ assert(!strcmp(id,"draft-test") && revision==3); (void)append; audio_client_start_cable(NULL,VOICE_CMD_NONE);
+}
+void cable_client_voice_cancel(const char *id) { assert(id[0]); cancels++; }
+void audio_client_start_selection(const char *id, const char *selected, unsigned revision) {
+ assert(selected && selected[0] && revision); audio_client_start_cable(id, VOICE_CMD_NONE);
+}
+void audio_client_start_carry(const char *id, const char *carried) {
+ assert(!strcmp(carried,"carry-test")); audio_client_start_cable(id, VOICE_CMD_NONE);
+}
+void cable_client_voice_confirm(const char *route, const char *id) { (void)route; (void)id; confirms++; }
+int find(const char *id) { return id && !strcmp(id, "agent") ? 0 : -1; }
+bool is_question(const char *id) { (void)id; return false; }
+void open_question(void) { assert(false); }
+bool queue(action_t action) { if (queue_full) return false; queued = action; return true; }
+'''
+harness += function('question_view') + function('copy') + function('input_cancel') + function('view') + function('voice_close') + function('workspace_failed')
+dispatch = source.split('case A_VOICE:\n', 1)[1].split('case A_PET:', 1)[0]
+harness += 'static void dispatch(action_t a) { switch (a.kind) { case A_VOICE:\n' + dispatch + '} }\n'
+worker = source.split('static void worker(', 1)[1].split('case A_VOICE:\n', 1)[1].split('case A_STOP_YES:', 1)[0]
+harness += 'static void work(action_t a) { switch (a.kind) { case A_VOICE:\n' + worker + '} }\n'
+for name in ['habitat_tick', 'ui_set_connected', 'ui_show_error', 'ui_cable_toast',
+ 'ui_voice_error', 'ui_voice_routed', 'ui_voice_route_abort']:
+ harness += function(name)
+harness += r'''
+static void reset(void) {
+ memset(&workspace,0,sizeof workspace);
+ host_features=31; memset(&draft,0,sizeof draft); reviews=0; memset(&s, 0, sizeof(s)); memset(&visit, 0, sizeof(visit)); memset(&carry,0,sizeof(carry)); now = 1000;
+ s.ready = s.connected = true; s.view = HOME;
+ strcpy(s.agents[0].name, "Agent");
+ audio_active = recording = abort_requested = queue_full = false;
+ starts = stops = aborts = cancels = confirms = 0;
+}
+static void speak(void) { dispatch((action_t){.kind = A_VOICE, .id = "agent"}); }
+static void done(void) { dispatch((action_t){.kind = A_VOICE_STOP}); }
+static void discard(void) { dispatch((action_t){.kind = A_VOICE_ABORT}); }
+static void finish_audio(void) { audio_active = recording = false; }
+static void begin(void) { speak(); work(queued); assert(recording && s.view == VOICE); }
+int main(void) {
+ reset(); host_features=0; begin(); dispatch((action_t){.kind=A_VOICE_STOP,.value=1});
+ assert(!reviews && !s.voice_review && s.voice_waiting);
+ reset(); begin(); dispatch((action_t){.kind=A_VOICE_STOP,.value=1});
+ assert(reviews==1 && s.voice_review && s.voice_waiting);
+ finish_audio(); ui_voice_routed(true,false,"","agent","Agent",1);
+ assert(s.voice_open && s.voice_waiting); // Normal route receipt cannot bypass review.
+ discard(); assert(!s.voice_open && !s.voice_review);
+ reset(); s.view=DRAFT; draft.page=(ht_draft_page_t){.active=true,.revision=3,.id="draft-test",.name="Original"};
+ view(HOME); assert(s.view==DRAFT);
+ action_t edit={.kind=A_VOICE,.value=5,.revision=2,.dy=2,.text="draft-test"};
+ dispatch(edit); assert(!s.voice_open);
+ edit.revision=edit.dy=3; dispatch(edit); work(queued);
+ assert(starts==1 && s.voice_return==DRAFT && s.voice_review && !strcmp(s.voice_target,"Original"));
+ done(); finish_audio(); ui_voice_error("Couldn't hear it");
+ assert(s.view==DRAFT && draft.failed && draft.page.error[0]);
+ draft.failed=false; dispatch(edit); work(queued); discard(); finish_audio();
+ assert(s.view==DRAFT && draft.page.active && !s.voice_open);
+ ui_set_connected(false); assert(s.view==HOME && !draft.page.active);
+
+ reset(); s.view=QUESTION; s.q.valid=s.q.supported=s.q.item[0].can_text=true;
+ s.q.revision=5; strcpy(s.q.token,"question-token"); strcpy(s.q.agent,"agent");
+ action_t question_voice={.kind=A_VOICE,.value=4,.revision=4,.dy=0,.id="agent",.text="question-token"};
+ dispatch(question_voice); assert(!s.voice_open && !starts); // stale target never records
+ question_voice.revision=5; dispatch(question_voice); work(queued);
+ assert(recording && s.voice_return==QUESTION && s.voice_question_revision==5 && s.voice_question_index==0);
+ done(); finish_audio(); ui_voice_routed(true,false,"","agent","Agent",1);
+ assert(s.voice_open && s.voice_waiting); // a task-routing reply cannot consume question speech
+ ui_voice_error("Transcription failed"); assert(!s.voice_open && s.view==QUESTION && s.q.speech_error[0]);
+ dispatch(question_voice); work(queued); discard(); finish_audio();
+ assert(!s.voice_open && s.view==QUESTION && starts==2); // Discard goes back to the question
+ reset(); carry.active=true; strcpy(carry.id,"carry-test"); carry.deadline=now+100;
+ dispatch((action_t){.kind=A_VOICE,.value=3,.id="agent",.text="wrong"});
+ assert(!s.voice_open && !starts);
+ dispatch((action_t){.kind=A_VOICE,.value=3,.id="agent",.text="carry-test"});
+ work(queued); assert(s.voice_carry && recording);
+ now+=200; habitat_tick(); assert(carry.active); // the started recording keeps its frozen context
+ discard(); finish_audio(); assert(carry.active); // Discard drops audio, not the held text
+ habitat_tick(); assert(!carry.active && carry.error[0]);
+ speak(); assert(!s.voice_open && starts==1); // expiry cannot fall through to bare voice
+ ht_carry_close(&carry); begin(); assert(recording && !s.voice_carry);
+ reset(); carry.active=true; strcpy(carry.id,"carry-test"); carry.deadline=now+300000;
+ dispatch((action_t){.kind=A_VOICE,.value=3,.id="agent",.text="carry-test"});
+ work(queued); done(); finish_audio(); ui_voice_routed(true,false,"","agent","Agent",1);
+ assert(!carry.active && !s.voice_carry && !s.voice_open);
+ reset(); strcpy(form.id, "form-test"); speak();
+ assert(!s.voice_open && !starts && s.view==FORM);
+ memset(&form,0,sizeof form);
+ reset(); visit.pending=true; speak();
+ assert(!s.voice_open && !starts); // Do not speak to a pane during an unresolved visit.
+ reset(); dispatch((action_t){.kind = A_VOICE});
+ assert(!s.voice_open && !starts); // Home routing is deferred, never fall into Cmd-B by accident.
+ reset(); speak(); action_t delayed = queued;
+ now += 5000; habitat_tick();
+ assert(s.voice_start_pending && s.view == VOICE && !starts);
+ discard(); work(delayed);
+ assert(!starts && !s.voice_open && s.view == HOME);
+ begin();
+ for (; now < 66000; now += 50) habitat_tick();
+ assert(recording && s.voice_open && !stops);
+ view(HOME); ui_cable_toast("unrelated desktop notice");
+ ui_voice_error("old route failed");
+ ui_voice_routed(true, false, "", "agent", "Agent", 1);
+ assert(s.view == VOICE && recording && s.voice_open);
+ done(); uint32_t deadline = s.voice_wait_until;
+ now += 20; done();
+ assert(stops == 1 && s.voice_wait_until == deadline);
+ finish_audio();
+ ui_cable_toast("unrelated desktop notice"); view(HOME);
+ assert(s.view == VOICE && s.voice_waiting);
+ discard(); work(queued);
+ assert(cancels == 1 && s.view == HOME && !s.voice_waiting);
+ ui_voice_error("discarded route failed");
+ ui_voice_routed(true, false, "", "agent", "Agent", 1);
+ assert(s.view == HOME);
+ begin();
+ ui_voice_error("discarded route replied during new capture");
+ assert(s.view == VOICE && recording);
+ done(); finish_audio(); ui_voice_error("current route failed");
+ assert(s.view == MESSAGE && !s.voice_open);
+ begin(); done(); finish_audio();
+ ui_voice_routed(true, false, "", "agent", "Agent", 1);
+ assert(s.view == AGENT && !s.voice_open);
+
+ reset(); begin(); now = 601000; habitat_tick();
+ assert(stops == 1 && s.voice_waiting);
+ deadline = s.voice_wait_until;
+ now++; habitat_tick(); assert(stops == 1 && s.voice_wait_until == deadline);
+ finish_audio(); now = deadline; habitat_tick();
+ assert(s.view == MESSAGE && !s.voice_open && !s.voice_waiting);
+ begin(); // expiration must not disable the next Speak
+
+ reset(); speak(); delayed = queued; COPY(s.pending_machine,"machine"); ui_set_connected(false); work(delayed);
+ assert(!s.pending_machine[0]);
+ assert(!starts && !s.voice_open && s.view == HOME);
+ ui_set_connected(true); begin();
+ // Recover from a legacy hidden capture without allocating a second one.
+ s.view = HOME; s.voice_open = false; speak();
+ assert(s.view == VOICE && s.voice_open && starts == 1);
+ ui_set_connected(false); assert(abort_requested && !s.voice_open);
+
+ reset(); queue_full = true; speak();
+ assert(!s.voice_open && !s.voice_start_pending && !starts);
+ queue_full = false; begin(); finish_audio(); now += 1000; habitat_tick();
+ assert(s.view == MESSAGE && !s.voice_open);
+ reset(); strcpy(form.id,"form-test"); form.page.active=form.page.can_query=true;
+ form.page.revision=3; s.view=FORM;
+ action_t search={.kind=A_VOICE,.value=2,.dy=2,.text="form-test"};
+ dispatch(search); assert(!starts && !s.voice_open); // stale field
+ search.dy=3; dispatch(search); work(queued);
+ assert(starts==1 && recording && s.view==VOICE && s.voice_return==FORM);
+ done(); finish_audio(); ui_voice_routed(true,false,"","agent","Agent",1);
+ assert(s.view==VOICE && s.voice_waiting); // never accept a task-routing reply
+ ui_voice_error("No matches yet"); assert(s.view==FORM && !s.voice_open);
+ assert(!strcmp(form.page.error,"No matches yet"));
+ dispatch(search); work(queued); discard(); work(queued); finish_audio();
+ assert(s.view==FORM && !s.voice_open && cancels==1);
+ dispatch(search); delayed=queued; discard(); work(delayed); assert(starts==2);
+ memset(&form,0,sizeof form);
+ reset(); memset(&selection,0,sizeof selection); selection.active=true; selection.revision=3;
+ strcpy(selection.id,"search-test"); strcpy(selection.agent,"agent"); s.view=SELECTION;
+ action_t lookup={.kind=A_VOICE,.value=7,.dy=2,.id="agent",.text="search-test"};
+ dispatch(lookup); assert(!s.voice_open); lookup.dy=3; dispatch(lookup); work(queued);
+ assert(recording && s.voice_search && s.voice_return==SELECTION && !s.voice_review);
+ dispatch((action_t){.kind=A_VOICE_STOP,.value=1}); assert(s.voice_waiting && !s.voice_review && !reviews);
+ finish_audio(); ui_voice_routed(true,false,"","agent","Agent",1); assert(s.voice_open);
+ ui_voice_error("Say the phrase again"); assert(!s.voice_open && s.view==SELECTION && selection.error[0]);
+ selection.error[0]=0; dispatch(lookup); work(queued); discard(); finish_audio();
+ assert(!selection.active && s.view==HOME);
+ puts("voice UI: PASS (production handlers; queued cancellation, discard/retry, late replies, modal ownership, timeout, cap, disconnect and hidden-capture recovery)");
+}
+'''
+
+with tempfile.TemporaryDirectory(prefix='harness-voice-ui-') as directory:
+ root = Path(directory)
+ (root / 'voice_ui.c').write_text(harness)
+ subprocess.run(['cc', '-std=c11', '-Wall', '-Wextra', '-Werror', '-O1', '-g',
+ '-fsanitize=' + os.environ.get('SANITIZERS', 'undefined,bounds'),
+ '-I', str(native), str(root / 'voice_ui.c'), str(native / 'selection.c'), str(native / 'carry.c'), str(native / 'visit.c'), str(native / 'form.c'), str(native / 'draft.c'), str(native / 'workspace.c'),
+ '-o', str(root / 'voice_ui')], check=True)
+ subprocess.run([str(root / 'voice_ui')], check=True)
diff --git a/devices/harness-device/firmware/test/test_workspace.c b/devices/harness-device/firmware/test/test_workspace.c
new file mode 100644
index 000000000..0261faf7f
--- /dev/null
+++ b/devices/harness-device/firmware/test/test_workspace.c
@@ -0,0 +1,77 @@
+#include "../main/ui/habitat/workspace.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+int main(void)
+{
+ ht_workspace_t w={0};
+ ht_workspace_touch(&w,1,4,233,410,100);
+ assert(w.touching && w.choice==1);
+ assert(ht_workspace_release(&w,233,410,0,175)==-1 && !w.touching);
+ ht_workspace_touch(&w,1,4,233,410,200);
+ assert(ht_workspace_move(&w,176,410,2,250) && w.choice==2);
+ assert(ht_workspace_move(&w,110,410,2,275) && w.choice==3);
+ assert(ht_workspace_release(&w,110,410,2,300)==3);
+ assert(ht_workspace_release(&w,110,410,2,301)==-1); // one navigation per contact
+ ht_workspace_touch(&w,1,4,233,410,400);
+ ht_workspace_move(&w,160,410,2,450);
+ assert(ht_workspace_release(&w,233,410,2,500)==-1); // slide back to stay
+ ht_workspace_touch(&w,0,4,233,410,600);
+ assert(ht_workspace_release(&w,450,410,2,700)==-1); // edge clamps; never wraps
+ ht_workspace_touch(&w,1,4,233,410,800);
+ assert(ht_workspace_release(&w,233,390,1,900)==-1 && !w.touching);
+ ht_workspace_touch(&w,1,4,233,410,1000);
+ ht_workspace_move(&w,220,380,1,1050);
+ assert(ht_workspace_release(&w,100,400,2,1100)==-1); // vertical first stays cancelled
+ ht_workspace_touch(&w,1,4,233,410,1200);
+ ht_workspace_move(&w,160,410,2,1250);
+ assert(ht_workspace_release(&w,160,340,2,1300)==-1); // lifting out of the strip cancels
+ ht_workspace_touch(&w,1,4,233,410,1400);
+ assert(ht_workspace_release(&w,160,410,2,1420)==-1); // sample glitch
+ ht_workspace_touch(&w,1,4,233,410,1500);
+ assert(ht_workspace_release(&w,160,410,2,6500)==-1); // missing release cannot navigate
+ ht_workspace_touch(&w,1,4,233,410,UINT32_MAX-50);
+ assert(ht_workspace_release(&w,160,410,2,50)==2); // timestamp wrap
+ for (int count=1;count<=24;count++) for(int index=0;index<count;index++) {
+ ht_workspace_touch(&w,index,count,233,410,100);
+ ht_workspace_move(&w,0,410,2,150);
+ assert(w.choice>=0 && w.choice<count);
+ ht_workspace_cancel_touch(&w);
+ assert(ht_workspace_release(&w,0,410,2,175)==-1);
+ }
+ ht_workspace_touch(&w,0,25,233,410,100); assert(!w.touching);
+ ht_workspace_touch(&w,-1,4,233,410,100); assert(!w.touching);
+
+ assert(!ht_workspace_request(&w,"",100));
+ assert(ht_workspace_request(&w,"workspace-a",100));
+ uint32_t serial=w.serial;
+ assert(!ht_workspace_request(&w,"workspace-b",101));
+ ht_workspace_touch(&w,1,4,233,410,150); assert(!w.touching);
+ assert(!ht_workspace_selected(&w,"workspace-b"));
+ assert(!ht_workspace_applied(&w,"workspace-a",99));
+ assert(ht_workspace_selected(&w,"workspace-a"));
+ assert(!ht_workspace_selected(&w,"workspace-a"));
+ assert(!ht_workspace_refresh(&w,serial+1,12));
+ assert(ht_workspace_refresh(&w,serial,12));
+ assert(!ht_workspace_applied(&w,"workspace-b",13));
+ assert(!ht_workspace_applied(&w,"workspace-a",12));
+ assert(ht_workspace_applied(&w,"workspace-a",13));
+ assert(w.phase==HT_WORKSPACE_READY);
+ ht_workspace_cancel_request(&w);
+ assert(!w.pending[0] && w.phase==HT_WORKSPACE_IDLE && w.serial==serial);
+ assert(ht_workspace_request(&w,"workspace-b",UINT32_MAX-2000));
+ assert(w.serial!=serial && !ht_workspace_tick(&w,5998));
+ assert(ht_workspace_tick(&w,5999) && w.phase==HT_WORKSPACE_IDLE);
+ assert(!ht_workspace_selected(&w,"workspace-b"));
+ assert(!ht_workspace_applied(&w,"workspace-b",14));
+ assert(ht_workspace_request(&w,"workspace-c",100));
+ assert(ht_workspace_selected(&w,"workspace-c"));
+ assert(ht_workspace_refresh(&w,w.serial,UINT32_MAX));
+ assert(ht_workspace_applied(&w,"workspace-c",0));
+ ht_workspace_cancel_request(&w);
+ char long_id[65]; memset(long_id,'x',sizeof long_id); long_id[64]=0;
+ assert(!ht_workspace_request(&w,long_id,100));
+ long_id[63]=0; assert(ht_workspace_request(&w,long_id,100));
+ puts("workspace: bounded preview, cancellation, single commit, exact tab/snapshot, deadlines and wraparound PASS");
+}
diff --git a/devices/harness-device/prototype/habitat/CREATURE_GALLERY.md b/devices/harness-device/prototype/habitat/CREATURE_GALLERY.md
new file mode 100644
index 000000000..8993eecb9
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/CREATURE_GALLERY.md
@@ -0,0 +1,95 @@
+# ASCII creature gallery / study 01
+
+September 27, 2026. A local visual prototype for the 466 × 466 round Harness device. Ten creatures, four moods, and a brief tap reaction. The purpose is to choose a character and animation direction by looking at the physical screen.
+
+**Historical first set:** the installed [study 02 / gallery .4](CREATURE_GALLERY_02.md) retains these ten, adds ten reference/adaptation studies and removes labels. The implementation and .3 validation below describe the original gallery baseline.
+
+**Reference collection:** [Creature directions and artwork](CREATURE_REFERENCES.md) records the user's request to keep all ten, the four richer examples they also liked, their tiny ASCII cat, solid-block/textmode exploration, and the supplied conversion/animation links including the Brrtfetch octopus. Those are retained research directions; this document describes the installed first set.
+
+## On the device
+
+- Swipe left/right to change creature. The list wraps at both ends.
+- Swipe up/down to change mood: **calm → curious → playful → sleepy**. The mood stays selected when changing creature, making comparisons easy.
+- Tap for a short reaction. Drags, ambiguous diagonal gestures, long rests and cancelled sensor contacts do not turn into taps.
+- PWR still controls the screen. The usual five-minute screen timeout remains; touch wakes it.
+
+The gallery opens immediately on boot and works without a computer. Agent commands, voice, approvals, pane switching and app-controlled visuals are disabled for this build. The existing cable connection remains available for device health and firmware operations. Speaker initialization is skipped, and the saved mute preference is preserved.
+
+| # | Resident | Main movement | Sleep pose |
+|---|---|---|---|
+| 01 | **Miso**, cat | Ear flick, curling tail, raised paws | Curls into a loaf |
+| 02 | **Hopper**, frog | Crouches, stretches and jumps | Settles low between its feet |
+| 03 | **Pip**, rabbit | Flops an ear, stretches both ears and hops | Folds its ears around its head |
+| 04 | **Rook**, penguin | Flipper wave and alternating waddle | Tucks its flippers inward |
+| 05 | **Moo**, cow | Ear flick, chewing muzzle and bouncing feet | Lowers its head |
+| 06 | **Boo**, ghost | Floats, changes its hem, spreads its arms | Deflates toward the floor |
+| 07 | **Sprout**, plant | Sways, opens leaves and blooms | Droops over its pot |
+| 08 | **Drift**, jellyfish | Contracts its bell and spreads its tentacles | Gathers its tentacles |
+| 09 | **Bolt**, robot | Bends its antenna and dances with alternating arms | Lowers its antenna and idles its chest display |
+| 10 | **Echo**, bat | Glides and folds its wings | Wraps its wings around its body |
+
+Curious changes gaze/expression and adds a small question mark. Calm includes brief blinks. Playful uses a held anticipation pose, two action poses and a rest. Sleep uses slower breathing and a small `z`. These are visual experiments; moods are manually selected.
+
+## Research: what survived the small-screen constraint
+
+This is the initial survey of relevant traditions and projects, rather than an exhaustive catalog of every ASCII artwork. Sources include original artists, maintainers, archives and project documentation. The first set favored recognizable silhouettes, a small expressive face, and motion within a 25 × 9 character canvas. That canvas was an initial choice, not a hardware limit; the [expanded reference collection](CREATURE_REFERENCES.md) explores additional densities and character sets.
+
+| Reference | Evidence / reason to study it | Device lesson |
+|---|---|---|
+| [Scott Fahlman's original smiley thread, 1982](https://www.cs.cmu.edu/~sef/Orig-Smiley.htm) | The original post and surrounding discussion survive. A few punctuation marks convey tone. | Eyes and mouth can carry expression without an elaborate portrait. |
+| [Joan G. Stark and Usenet line art](https://velvetyne.fr/news/about-ascii-art-and-jgs-font/) | ASCII artist Adel Faure documents Stark's work beginning in the 1990s, her animal drawings, and the influence of Usenet's line style. | Clear outlines and familiar animals are strong starting points for a tiny companion. |
+| [Christopher Johnson's ASCII collection](https://asciiart.website/browse.php) | A large, categorized collection with many animal and character examples, preserving the variety of contributed text art. | Compare silhouettes and character proportions; retain individual attribution when considering an existing drawing. |
+| [aSCIIaRENA](https://www.asciiarena.se/) | An active archive and community for Amiga ASCII, with collections and artist credits. | Dense banners and logos are impressive at terminal width; their detail becomes hard to read on this device. |
+| [16colo.rs / Sixteen Colors](https://16colo.rs/faq/) | A continuing ANSI/ASCII art-pack archive. Its documentation stresses original character geometry, spacing, preservation and author rights. | Font geometry is part of the art. ANSI, CP437 and strict ASCII need to be distinguished. |
+| [Simon Jansen's Star Wars ASCIIMATION, 1997–](https://www.asciimation.co.nz/asciimation/ascii_faq.html) | The creator describes fixed-size text frames, frame holds and compression of repeated poses. The [project remains maintained](https://www.asciimation.co.nz/). | Timing and a few well-chosen poses produce character. Store a pose once and hold it for the intended duration. |
+| [Tony Monroe's cowsay, first released 1999](https://cowsay.diamonds/) | Continued maintenance and package distribution show the enduring appeal of a small terminal mascot. Configurable expressions are central to the idea. | A character can be readable, funny and personal with very little text. Moo is a new drawing inspired by that principle. |
+| [ASCIIQuarium, Kirk Baucom](https://robobunny.com/projects/asciiquarium/html/?page=2) | The creator's animated aquarium credits much of its art to Joan Stark. | Drift's bell and tentacles, and Boo's floating movement, explore quiet continuous life. A full aquarium would crowd the display. |
+| [Andy Sloane's donut.c, 2006](https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html) | The original compact C program demonstrates moving volume using a luminance ramp of ordinary characters. | Text can express depth. A shaded creature is a useful future direction; a continuously rotating donut is less characterful for this first companion set. |
+| [Nyancat CLI, K. Lange](https://github.com/klange/nyancat) | About 1.6k GitHub stars were displayed during research; the project documents packaging across Linux and BSD distributions. It credits the original animation to prguitarman. | A short, unmistakable motion loop can be memorable. Borrow that principle while keeping this study's art original and printable ASCII. |
+| [cbonsai, John Allbritten](https://gitlab.com/jallbrit/cbonsai/-/raw/master/README.md) | Its maintained C/ncurses project documents growing trees, live mode, saved growth and several packaging routes. | A companion need not be an animal. Sprout explores a quieter, organic alternative. |
+| [Stone Story RPG](https://stonestoryrpg.com/faq.html) | Its creators describe hand-authored text animation, development from 2014, a 2019 Steam release, and community-created pets and cosmetics. | Pose design and animation craft make text feel alive. Different bodies deserve different actions. |
+| [Durdraw](https://durdraw.org/) | A contemporary terminal animation editor explicitly builds on TheDraw, ACiDDraw and PabloDraw traditions. | Frame-based ASCII authoring is still useful. An artist-friendly pose source should remain easy to edit outside the embedded runtime. |
+| [Jgs Font, Adel Faure / Velvetyne, 2023](https://velvetyne.fr/fonts/jgs-font/) | Designed expressly for ASCII drawing, with glyphs that join across cells and exact pixel-size/line-height recommendations. | Use the art font's intended grid. Jgs7 at 28 px gives 14 × 28 px cells with clean joins. |
+
+The longevity, distribution, community work and adoption signals above indicate sustained interest. They do not establish a universal ranking of what people love. The initial design hypothesis favored Miso, Drift and Sprout for familiar animal warmth, soft continuous motion, and calm organic life. Subsequent user feedback retains **all ten**, alongside richer artwork and tiny ASCII companions. No final creature has been selected; further comparison should include substantially different visual styles.
+
+## What was built
+
+All ten portraits are **new ASCII drawings for this study**, inspired by the traditions above. No original Joan Stark, cowsay, Nyan Cat, film or game frame was copied into the firmware. This keeps the experiment easy to reshape while respecting the original artists. Existing archival artwork would need its own attribution and reuse review before adoption; the [16colo.rs archive explicitly explains this](https://16colo.rs/faq/).
+
+The art consists of printable characters **32–126**. No Unicode pictograms, CP437 block characters, character images, video decoder, image frames, SVG or browser runtime are involved. The glyph atlas is the normal text-rendering mechanism: the device draws characters, and only the font's individual glyphs are pre-rasterized.
+
+- **C on ESP-IDF / FreeRTOS**, using the existing direct RGB565 → QSPI DMA text compositor.
+- **25 × 9 cells**, 60 authored poses, **14,040 bytes** of fixed ASCII pose data.
+- **9,310-byte** ASCII-only font atlas derived from Jgs7, named *Habitat ASCII Art 28*.
+- **32 bytes** of gallery state, no dynamic allocation in the gallery module.
+- Animation scheduling at **125 ms** while awake, **250 ms** in sleepy mode. Touch changes notify the renderer immediately rather than waiting for this cadence. Unchanged frames cause no display transfer.
+- Existing partial-region redraws and two DMA strip buffers are retained. The gallery adds no framebuffer.
+- One stable creature name, one mood label and one gesture hint keep screen text minimal.
+
+Jgs7 is copyright © 2022 Adel Faure, distributed by Velvetyne under the SIL Open Font License 1.1. The original font and [full license](../../firmware/fonts/Jgs-OFL.txt) are retained. The generated atlas remains under that license and uses a different name from the reserved original font name. The surrounding interface retains Geist Mono and its existing license.
+
+## Validation and build
+
+**Gallery .3 cancels a gesture when the screen turns off.** Previously, turning the display off partway through a swipe could still change creature on release. The production touch task now checks screen power while holding the same lock used to deliver input, and suppresses the entire interrupted contact even if PWR wakes the display before the finger lifts. Driver/gallery traces reproduce the old failure and cover sleep during movement, sleep at release, PWR off/on while held, and sleep occurring while input waits for the UI lock.
+
+**Gallery .2 fixes recovery after wake-up and interrupted contacts.** The driver already suppresses the wake/damaged contact through its release. Gallery .1 also waited for that release, which the driver deliberately never forwarded, so the next healthy gesture was discarded. The gallery now simply resets its local contact when cancelled. A regression replays the actual production touch task into the gallery: it failed against .1 and passes for wake → tap, wake → creature swipe, wake → mood swipe, stale ACK, read error and malformed-coordinate recovery. This changes no portraits, animation timing or gesture mappings.
+
+The native gallery test rendered **3,840 scenes** covering every creature/mood combination. It checks printable ASCII, scene bounds, visible animation in every mode, horizontal/vertical wrapping, diagonal rejection, drag-return rejection, sensor cancellation, unreliable release coordinates and the 32-bit clock wrap. The complete existing native firmware suite passed under undefined-behavior and bounds sanitizers.
+
+Across **3,800 consecutive-frame comparisons** in that test, the compositor marked a mean of **14,282 pixels** and a maximum of **88,900 pixels** dirty, compared with 217,156 pixels for a full screen. These are deterministic scene-damage measurements on the host, not device latency or FPS measurements. Creature switches and initial full-screen paint are excluded from this particular calculation.
+
+The contact sheets in results/creature-gallery (local experiment artifact) were rasterized by the actual production C compositor and inspected with the round display mask. They are useful for layout review; physical viewing remains the authority for brightness, apparent size and motion quality.
+
+Build in a separate directory so the experimental flag cannot leak into a normal build:
+
+```sh
+idf.py -B build-gallery -DSDKCONFIG=build-gallery/sdkconfig \
+ -DDEVICE_HABITAT=1 -DDEVICE_CREATURE_GALLERY=1 \
+ -DDEVICE_PERF_BENCH=0 -DDEVICE_FORCE_PROD=1 \
+ -DPROJECT_VER=0.0.87-gallery.3 build
+```
+
+For a normal Habitat build use its own build directory and `-DDEVICE_CREATURE_GALLERY=0`. The gallery source and font are omitted entirely when this flag is off. The normal .25 image has been retained for restoration; the in-progress .26 carry/return changes remain in the worktree and are separate from this visual study.
+
+Sources: [gallery module](../../firmware/main/ui/habitat/creature_gallery.c), [editable portraits](../../firmware/scripts/gen_creature_art.py), [font generator](../../firmware/scripts/gen_creature_font.py), [native test](../../firmware/test/test_creature_gallery.c), [driver/gallery recovery regression](../../firmware/test/test_touch_driver.py). The .3 image is **527,040 bytes**, SHA-256 `64ab3d212cbf4a9f070f5249364d54c775f90783c4fd4642ab6d15b8c5350c76`. The expected board and version booted, the bridge reconnected, and live heartbeats confirmed animation with mute enabled. Host/desktop hashes and desktop layout were unchanged. Physical gesture ergonomics await the user’s inspection. Installation evidence is recorded in the gallery deployment record (local experiment artifact); .2 (local experiment artifact) and the original .1 record (local experiment artifact) retain their earlier evidence.
diff --git a/devices/harness-device/prototype/habitat/CREATURE_GALLERY_02.md b/devices/harness-device/prototype/habitat/CREATURE_GALLERY_02.md
new file mode 100644
index 000000000..576fe8e73
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/CREATURE_GALLERY_02.md
@@ -0,0 +1,63 @@
+# Creature gallery / study 02
+
+September 27, 2026. Firmware `0.0.87-gallery.4`. Twenty entries: all ten original creatures plus ten new text-animation studies. Only the artwork appears on the display. No title, status, instructions, voice, agent commands or companion mechanics.
+
+The subsequent [connected octopus build](README.md) uses entry 11 with the live Harness controls. This gallery remains a separate, preserved visual comparison.
+
+## Controls
+
+- Opens on **11 — Octopus / ASCII**. Swipe left for 12, then 13, and so on. Swipe right for the previous entry. Both ends wrap.
+- Swipe vertically to change the animation. New entries cycle through **original timing → half speed → double speed → quarter speed**. The original ten retain their four moods.
+- Tap a new entry to replay its loop; tap an original creature for its existing brief reaction.
+- PWR and the five-minute screen timeout still work. The first touch after sleep only wakes the display.
+- Sound stays muted. The USB connection provides device health and firmware access, with app actions disabled.
+
+The selected mode carries between entries for comparison. This is a visual player, not the future companion behavior system.
+
+## Device feedback
+
+After installation, the user said **“i love the octopus!”** They subsequently clarified **“i like the text one more”**: **11 — Octopus / ASCII** is the preferred rendering. After seeing its actual installed text frame in chat, they confirmed **“yeah this is it.”** This exact text octopus is the confirmed visual reference for the next iteration. Keep the block rendering and all other entries for comparison; no app wiring or additional behavior was requested by this feedback.
+
+## New entries
+
+| # | Study | Source and adaptation |
+|---|---|---|
+| 11 | **Octopus / ASCII** | The [Brrtfetch octopus](https://github.com/ferrebarrat/brrtfetch/blob/main/gifs/defaults/brrt.gif), converted before the build into a punctuation/letter density ramp. Every second source pose is retained, with the combined original holds: 63 poses across 5.21 seconds. |
+| 12 | **Octopus / blocks** | The same movement rendered with standard Unicode shade/block characters. Its 39 × 19 grid uses an 8 × 16 glyph atlas. This comparison isolates the visual vocabulary while preserving the source animation. |
+| 13 | **Tiny cat** | The user's three-line cat, with newly authored blink, glance and pleased expressions. Long quiet holds between small changes. |
+| 14 | **Party Parrot** | [John Hobbs's terminal-parrot](https://github.com/jmhobbs/terminal-parrot), ten original ASCII frames at 100 ms per frame, shown in one color. |
+| 15 | **Stone giant** | [Stone Story RPG](https://stonestoryrpg.com/), character grids recovered from the [published animation](https://clan.akamai.steamstatic.com/images/30519309/0fc363cf3b74de81fddd4338632f7f6856285ae6.gif). Source holds retained; the separate player is cropped out. |
+| 16 | **Stone spider** | Character grids recovered from the [published Stone Story animation](https://clan.fastly.steamstatic.com/images/30519309/55db1b7f85cea872b4b1a1782ef56fdabe0c3be1.gif). Source holds retained. Accented eye symbols and infinity are approximated as printable `o` and `8`; source colors become one foreground color. |
+| 17 | **Stark dragon** | Joan G. Stark's signed, front-facing [dragon](https://www.asciiart.eu/mythology/dragons), with new blink and wing-tip poses. The `jgs` signature remains. This is a second Stark reference that fits the screen; the previously documented, larger fire-breathing dragon remains a research reference. The added animation is ours, not the artist's. |
+| 18 | **Turning face** | Newly authored poses inspired by [Adel Faure's Face Study](https://adelfaure.net/docs/lures/ascii_faces.gif). This is a simplified turning-head study, not a transcription of the artist's full animation. |
+| 19 | **Nyan / blocks** | The original twelve-frame [Nyan Cat CLI matrix](https://github.com/klange/nyancat/blob/master/src/animation.c), cropped to the cat and mapped to monochrome Unicode shade blocks. Original animation credited to prguitarman; terminal project by K. Lange. |
+| 20 | **Desk companion** | Polyducks's *Button Presser* (2021), [source preview](https://adelfaure.net/docs/lures/POLYDUCKS-BUTTON_PRESSER.GIF), cropped to the companion and converted to monochrome Unicode shade blocks. Eight source frames and their encoded holds. [Artist attribution](https://adelfaure.net/docs/lures/). |
+
+Entries 01–10 remain Miso, Hopper, Pip, Rook, Moo, Boo, Sprout, Drift, Bolt and Echo. Their artwork and moods remain in [study 01](CREATURE_GALLERY.md); its labels have been removed in this build so both sets show just the art.
+
+The full [reference collection](CREATURE_REFERENCES.md) remains available. Following the comparison, the user confirmed the text octopus as the preferred visual reference. Agent-state behavior remains deferred. The third-party art is credited here for this local visual comparison.
+
+## Representation and build
+
+All installed character poses are text. GIF decoding and image conversion happen on the computer during preparation; the device receives immutable strings and frame holds. There is no on-device GIF/image decoder, raster character sprite, browser or animation framework.
+
+- Existing C / ESP-IDF renderer, partial-region updates and two DMA strip buffers.
+- 227 new stored text poses, **263,599 bytes** including UTF-8 and string terminators. The original 60 poses remain.
+- Six ASCII font sizes derived from OFL Jgs7 plus two compact, geometrically generated Unicode Block Elements atlases: **50,369 bytes** total glyph data.
+- **32-byte** gallery state; no gallery heap allocation or new framebuffer.
+- Original frame holds determine wake-ups. Unchanged text produces no screen transfer. Vertical speed choices rescale playback locally.
+- Unicode-only atlases safely treat spaces and unsupported glyphs as empty cells. A compositor regression checks rendering and incremental damage without indexing before the atlas.
+
+The canonical editable text and credits are in [clips.json](assets/creature-references/clips.json). Run [gen_creature_clips.py](../../firmware/scripts/gen_creature_clips.py) to regenerate the C data and [gen_creature_font.py](../../firmware/scripts/gen_creature_font.py) for the font atlases. Builds need no network or original GIFs.
+
+The font source and [OFL license](../../firmware/fonts/Jgs-OFL.txt) remain in the firmware tree. The derived fonts use the name *Habitat ASCII Art*; the block glyphs are generated independently.
+
+## Validation
+
+The native firmware suite passed under undefined-behavior and bounds sanitizers. Gallery checks cover **25,600 scenes**, all 80 entry/mode combinations, glyph support, row byte limits, scene bounds, wrapping, interrupted contacts and time wrap. Driver traces retain the wake/sleep recovery checks. The Unicode compositor regression also passed.
+
+Round-screen contact sheet (local experiment artifact) uses the actual production C compositor. Every entry was visually inspected at that mask. Physical brightness and how each motion feels on the desk remain for the user to judge.
+
+The image is **816,512 bytes**, SHA-256 `775e181f551876f1407104e920526cb4e3976f137b70374b50a1a92848805009`. It fits the existing application partition without changing partition layout or NVS. This is larger than gallery .3 because it contains substantially more artwork; no new latency or performance-improvement claim is made.
+
+The previous gallery .3 and daily-use Habitat .25 images remain available for restoration. Deployment evidence (local experiment artifact) confirms both flash-write hashes, the expected device MAC and .4 firmware hello, live animation, touch activity, zero touch-read failures and mute enabled. The flashing wrapper reported a serial error during the final watchdog reset; the independent live hello and heartbeats confirmed that the new image booted successfully. Host and desktop binaries were preserved.
diff --git a/devices/harness-device/prototype/habitat/CREATURE_REFERENCES.md b/devices/harness-device/prototype/habitat/CREATURE_REFERENCES.md
new file mode 100644
index 000000000..11a585387
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/CREATURE_REFERENCES.md
@@ -0,0 +1,129 @@
+# Creature experiment / reference collection
+
+Updated September 27, 2026. This is the evolving visual and animation collection for the small round Harness device. The [original ten-creature gallery](CREATURE_GALLERY.md) is the first comparison set. [Study 02 / gallery .4](CREATURE_GALLERY_02.md) now installs ten more reference/adaptation studies. Its entry list distinguishes original text, converted frames and newly authored adaptations; the broader references below remain available for exploration.
+
+## User direction
+
+- Keep **all ten original creatures** and **all four richer references**: Stone Story, Terminal Party Parrot, Joan Stark's dragon, and Adel Faure's Face Study.
+- Explore solid-block text art as another visual direction.
+- Keep very simple ASCII companions too. The user supplied the three-line cat below and explicitly likes this genre.
+- Study the user-supplied image converter and animated conversion examples.
+- The user specifically likes **the Brrtfetch octopus and its animation**.
+- After trying gallery .4 on the physical device, the user said **“i love the octopus!”** They then explicitly preferred **the text version**, entry **11 — Octopus / ASCII**, over the solid-block version. After seeing the actual installed ASCII frame in chat, they confirmed **“yeah this is it.”** This exact text octopus is the confirmed visual reference for the next iteration. Retain the other candidates for comparison.
+- The next request explicitly connected this choice to the app: [Octopus / connected buddy](README.md) records the deployed animation, voice, touch and agent-state behavior. The rest of this collection remains available for future visual studies.
+- Preserve the supplied [daemon craft research](DAEMON_CRAFT_NOTES.md), including its historical references and the distinction between an eight-cell status sprite and a larger device portrait.
+- Continue a visual-only study. App synchronization and agent behavior remain deferred.
+
+The first set was made from original sketches inspired by historical projects. It was not a collection of those projects' best artwork. The next comparisons should include genuinely different visual styles and stronger movement. Complexity is not a quality ranking: the tiny cat and the detailed octopus are both valid directions.
+
+## Directions to compare
+
+These are working categories for this experiment, not a definitive art-history taxonomy.
+
+| Direction | Appearance | Reference | What to explore |
+|---|---|---|---|
+| **Tiny ASCII companions** | A few lines of punctuation, with a readable face | User's cat | Gaze, slow blinks, a small head tilt, expressive pauses |
+| **Hand-drawn line characters** | Deliberate outlines, recognizable anatomy and poses | Original ten; Joan Stark; Face Study; Stone Story | Turning, stretching, grooming, curling up, anticipation and recovery |
+| **Shaded ASCII creatures** | Dense letters and punctuation create volume | Terminal Party Parrot; user's converter animation | Strong silhouettes, coordinated body motion, quiet versus energetic loops |
+| **Solid-block / filled-glyph text art** | Filled shapes using `█ ▄ ▀ ▓ ▒ ░`, dots and related glyphs | Terminal sprites, Nyan Cat, Brrtfetch octopus, ANSI art traditions | Monochrome silhouettes and restrained color; eyes and limbs cut into a substantial body |
+| **PETSCII / custom textmode** | A graphic character set supplies blocks, diagonals, curves and patterns | Polyducks | Sculptural forms and characterful poses assembled from a small glyph vocabulary |
+
+Image/GIF conversion is an **authoring method**, which can produce several of these styles. It is recorded separately below.
+
+## Tiny ASCII companions — user reference
+
+```text
+ /\_/\
+ ( o.o )
+ > ^ <
+```
+
+Source: supplied by the user in this conversation. Original authorship is unspecified; do not attribute its invention to this project. Preserve this reference alongside the larger artwork.
+
+The appeal is a face you can recognize immediately and read as text. A next study could alter only the eyes for a blink or sideways glance, then use an occasional distinct resting pose. Keep long quiet holds between reactions. These are proposed animation experiments; the supplied drawing itself is static.
+
+## Set A — retain the original ten
+
+All are original printable-ASCII drawings made for this experiment. Their existing poses and controls remain described in [the gallery record](CREATURE_GALLERY.md).
+
+| Number | Creature | Direction retained |
+|---|---|---|
+| 01 | Miso — cat | Familiar animal; ears, paws and curling tail |
+| 02 | Hopper — frog | Crouch, stretch and jump |
+| 03 | Pip — rabbit | Expressive ears and hops |
+| 04 | Rook — penguin | Waddle and flipper wave |
+| 05 | Moo — cow | Muzzle and ear movement |
+| 06 | Boo — ghost | Floating, spreading and deflating |
+| 07 | Sprout — plant | Swaying, blooming and drooping |
+| 08 | Drift — jellyfish | Bell contraction and tentacles |
+| 09 | Bolt — robot | Antenna and alternating arm poses |
+| 10 | Echo — bat | Open and folded wings |
+
+Calm contact sheet (local experiment artifact) · Curious (local experiment artifact) · Playful (local experiment artifact) · Sleepy (local experiment artifact) · Animated comparison (local experiment artifact)
+
+## Set B — retain the four richer references
+
+| Reference and credit | View the work | Why it belongs in the experiment | Character-set / adoption note |
+|---|---|---|---|
+| **Stone Story RPG creatures**, Martian Rex / Stone Story team | [Game](https://stonestoryrpg.com/), [creature animation](https://clan.akamai.steamstatic.com/images/30519309/0fc363cf3b74de81fddd4338632f7f6856285ae6.gif), [spider animation](https://clan.fastly.steamstatic.com/images/30519309/55db1b7f85cea872b4b1a1782ef56fdabe0c3be1.gif) | Bodies bend and change pose; movement conveys weight and intent. Study how a creature acts, including its pauses. | ASCII-style animation includes some symbols outside printable ASCII. Reference for animation craft; these frames are not in the firmware. |
+| **Terminal Party Parrot**, John Hobbs / terminal-parrot; parrot tradition credited by the project | [Project](https://github.com/jmhobbs/terminal-parrot), [actual text frames](https://github.com/jmhobbs/terminal-parrot/blob/main/animations/parrot.animation) | A bold shaded silhouette and a complete dance cycle. The text has much more visual mass than the first gallery's outlines. | Inspected source has ten frames, all printable ASCII apart from line breaks. The animation file is 7,018 bytes including metadata. This is asset size, not a device performance measurement. |
+| **Fire-breathing dragon**, Joan G. Stark, 1996 | [Artwork preview](https://tanglepatterns.com/images/joan-stark-ascii-art-fire-breathing-dragon-1.jpg.webp), [artist's archived gallery](https://oldcompcz.github.io/jgs/joan_stark/) | Wings, scales, flame and the curved tail form a memorable silhouette. Study line economy and texture. | This particular reference is static. An animated adaptation would need newly authored motion and appropriate reuse permission. |
+| **Face Study**, Adel Faure, 2023 | [Animated study](https://adelfaure.net/docs/lures/ascii_faces.gif), [artist's presentation and attribution](https://adelfaure.net/docs/lures/) | Turning heads maintain identity across front, side and back views with very few marks. Useful for gaze and orientation experiments. | The artist identifies this as interactive ASCII with Jgs Font. It is a portrait/movement reference, not a proposed human-only companion direction. |
+
+The animation references above were inspected as sequences of frames. The dragon was inspected as a still. This table records the research before deployment. [Study 02](CREATURE_GALLERY_02.md) records the later installed selection: recovered Stone Story grids, native parrot frames, a different signed Stark dragon with new motion, and a newly authored turning-face adaptation. The linked full Face Study and fire-breathing dragon remain references.
+
+## Set C — solid blocks and graphic characters
+
+Solid blocks such as `█`, half blocks `▀ ▄`, and shading `░ ▒ ▓` are **text glyphs outside 7-bit ASCII**. The [Unicode Block Elements chart](https://www.unicode.org/charts/PDF/U2580.pdf) identifies these characters. Historical ANSI art often combines a PC graphic character set with color controls; PETSCII has its own character repertoire. A PNG or GIF preview of textmode work is not itself the character source.
+
+| Reference and credit | View | Observation / experiment to borrow |
+|---|---|---|
+| **Nyan Cat CLI**, K. Lange; original animation credited to prguitarman | [Project and preview](https://github.com/klange/nyancat), [renderer source](https://github.com/klange/nyancat/blob/master/src/nyancat.c) | Clear filled silhouette, tiny face and a recognizable loop. The renderer supports colored spaces, Unicode full blocks, a legacy block mode, and plain-text fallbacks. Study a compact filled mascot with a limited palette. |
+| **Pokémon colorscripts**, Phoney badger; source sprites from PokéSprite | [Project](https://gitlab.com/phoneybadger/pokemon-colorscripts), [terminal examples](https://gitlab.com/phoneybadger/pokemon-colorscripts/-/raw/main/demo_images/pokemon-colorscripts-screenshot-1.png), [more examples](https://gitlab.com/phoneybadger/pokemon-colorscripts/-/raw/main/demo_images/pokemon-colorscripts-screenshot-2.png) | Small colored text sprites demonstrate strong silhouettes and facial contrast. These examples are static; study the representation and scale. Pokémon characters are references, not proposed Harness mascots. |
+| **pokeget-rs**, talwat | [Project](https://github.com/talwat/pokeget-rs) | Its half-square rendering is a useful related technique for fitting more vertical detail into text cells. This is a renderer reference; no need to adopt its Rust application or runtime conversion. |
+| **Button Presser**, Polyducks, 2021 | [Animation](https://adelfaure.net/docs/lures/POLYDUCKS-BUTTON_PRESSER.GIF), [attribution](https://adelfaure.net/docs/lures/) | Eight inspected GIF frames combine a substantial blocky figure, a blink and a little action at a desk. A useful companion-scale behavior reference. The presentation identifies it as PETSCII made with Lvllvl. |
+| **Fear the Creeper**, Polyducks, 2019 | [Artwork](https://adelfaure.net/docs/lures/POLYDUCKS-FEAR_THE_CREEPER.PNG), [attribution](https://adelfaure.net/docs/lures/) | A large face, filled silhouette and patterned shadows remain striking with a limited palette. This is static custom textmode art; its scene is inspiration for an isolated portrait, not a ready device asset. |
+
+For broader exploration, retain [Blocktronics at Sixteen Colors](https://16colo.rs/group/blocktronics) and the [cat-art index](https://16colo.rs/tags/content/cat). These archives include several formats and sizes; inspect each piece's actual artwork and character source before treating it as a device candidate. Archive inclusion alone does not establish quality, animation, compatibility or reuse rights.
+
+## Set D — user-supplied conversion and animation references
+
+### Brrtfetch octopus — explicitly liked
+
+[User's Reddit post](https://www.reddit.com/r/unixporn/comments/1nz31gv/oc_brrtfetch_animated_ascii_art_for_your_fetcher/) · [Brrtfetch source, ferrebarrat](https://github.com/ferrebarrat/brrtfetch) · [octopus source GIF](https://github.com/ferrebarrat/brrtfetch/blob/main/gifs/defaults/brrt.gif) · [terminal demonstration](https://github.com/ferrebarrat/brrtfetch/blob/main/docs/readme-md-main.gif)
+
+The user specifically praised both the octopus and its movement. Preserve this exact example as a leading reference for the next animation comparison. Brrtfetch converts a source GIF into colored character frames; its author says the octopus source was made through an image-generation and animation workflow. The README's example uses an 80-column rendering at 17 fps. Those are desktop demonstration settings, not a measured target for our device. [Project documentation](https://github.com/ferrebarrat/brrtfetch).
+
+Inspected the source animation and the terminal demo as sequences of frames. The large round head, stable eyes and mouth, and curling/uncurling tentacles keep the identity clear while the body moves. The source GIF has 125 frames; its encoded durations total 5.21 seconds. These source timings differ from Brrtfetch's configurable playback cadence.
+
+The inspected renderer at commit `d32d15331089e31591520013fe121d44f29ca31d` maps brightness to a mixture of spaces, punctuation and Unicode circles: `◌ ● ⦾ ⦿ ⬤`. At the demo's high multiplier, its filled-circle choice dominates. Classify this as **filled-glyph textmode**, despite the project's broad use of the name ASCII. [Actual mapping](https://github.com/ferrebarrat/brrtfetch/blob/d32d15331089e31591520013fe121d44f29ca31d/go/main.go#L284).
+
+For Harness, explore preparing the character frames on the computer and storing them in firmware. Compare monochrome and restrained-color versions at the actual round-screen size. Preserve the original motion timing when evaluating the movement. This authoring proposal adds no app wiring.
+
+### Image to ASCII — Design Minis / nanmu
+
+[User's Design Minis link](https://www.designminis.com/tools/image-to-ascii) points to [imagetoascii.art](https://imagetoascii.art/). The tool exposes width, character selection, tonal controls and dithering. Its page distinguishes ASCII-only styles from **Blocks (`█▓▒░ `)** and offers text/ANSI export alongside image exports. Its GIF input currently uses a single browser-provided frame, so do not assume it exports an animation.
+
+Use it to compare the same source in several text styles and densities. Export actual characters for firmware; use image previews for reference review. The site's large 180–220-column showcase examples need a separate small-screen study before adoption. These findings come from inspecting the page and its published page source; no user files were uploaded. [Tool](https://imagetoascii.art/).
+
+### Animated image/GIF conversion — r/vibecoding
+
+[User's post](https://www.reddit.com/r/vibecoding/comments/1uhr11l/ascii_art_always_fascinated_me_so_i_build_a/) · [animated text-art example](https://i.redd.it/fa78mivr8z9h1.gif) · [source animation credited by the poster](https://tenor.com/view/chango-lero-lero-leronlero-gif-4368030733658011142)
+
+The inspected example has eight GIF frames: a shaded figure changes its arm and head poses while retaining its outline. It is a useful example of recognizable whole-body motion carried through a text conversion. The poster says their converter is not yet released and links [ASCII Art EU](https://www.asciiart.eu/image-to-ascii) and [Asciify](https://asciify.org/editor) as other tools; those are not the poster's own converter.
+
+## Next comparison and rendering approach
+
+Retain the first ten as the baseline. Add examples spanning tiny line art, detailed hand-drawn movement, shaded animation and filled block silhouettes. Compare silhouette recognition, facial readability, natural pauses, animation coherence and how distracting the loop feels on a desk. Do not equate more characters or a higher frame rate with a better companion.
+
+The [supplied daemon craft notes](DAEMON_CRAFT_NOTES.md) add several useful principles: keep identity stable across poses; use eyes and posture deliberately; author poses with holds; tie a walking cycle to distance; make color supplementary; give quiet holds as much attention as movement. Their eight-cell status-line limits, two-cell changes and event-only animation policy belong to that application surface. The device's local visual experiment should also test the richer octopus-style loop the user likes. Growth, lore and agent-event behavior are recorded context, not new implementation scope.
+
+For converted animation, crop the source and simplify its background before conversion, use a consistent character ramp/palette across frames, preserve frame holds, then inspect for flicker and hand-clean important features. Convert before the firmware build. The device should receive prepared text frames and timing data.
+
+The first gallery's **25 × 9** grid was an initial art choice, not the display's inherent limit. Study 02 tests several cell sizes and adds compact Unicode Block Elements atlases alongside ASCII 32–126. It uses the same C compositor; arbitrary PETSCII alphabets and per-cell ANSI colors are not supported by this addition. Color-rich references are shown as monochrome text conversions. See [font data](../../firmware/main/ui/habitat/creature_font.c) and [compositor structures](../../firmware/main/ui/habitat/terminal.h).
+
+Measure CPU time, bytes transferred, memory and touch responsiveness once a candidate is implemented. No new device speed or memory claim is established by this research. Third-party previews remain linked with credits; commercial adoption needs the artwork's own applicable terms, independently of a converter's code license.
+
+## Status
+
+The user subsequently requested deployment. Gallery `0.0.87-gallery.4` installs the [twenty-entry visual comparison](CREATURE_GALLERY_02.md), keeping all ten original creatures and adding ten studies. App wiring remains disabled. Earlier records of waiting for a favorite describe the prior state; the current direction is to retain the options and compare them on the physical device.
diff --git a/devices/harness-device/prototype/habitat/DAEMON_CRAFT_NOTES.md b/devices/harness-device/prototype/habitat/DAEMON_CRAFT_NOTES.md
new file mode 100644
index 000000000..dd4db16e8
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/DAEMON_CRAFT_NOTES.md
@@ -0,0 +1,113 @@
+# Daemon craft research supplied by the user
+
+Received September 27, 2026; the supplied research is dated September 26. Preserved below as reference material for the [creature experiment](CREATURE_REFERENCES.md). The original `daemons/README.md` and `daemons/tools/generate.mjs` references belong to the daemon project; they are not relative paths within this device experiment.
+
+**Provenance:** the material below was supplied by the user. Its source-specific historical dates, competitor implementation details, biological timing figures and terminal-portability claims have not all been independently verified in this documentation update. Preserve its own uncertainty labels. The device application notes in `CREATURE_REFERENCES.md` describe what we are taking from it; this is not a blanket adoption of its status-line constraints or product mechanics.
+
+---
+
+# ASCII creature craft: what early text art teaches the daemons
+
+2026-09-26. Research behind the daemons' art (`daemons/README.md`, "Art rules"): how people drew with
+characters before pixels, what each era contributed as a technique, what works at our sizes (an 8-cell
+status sprite and portraits up to 8 rows by 28 columns), and the pitfalls. Sources are linked; claims
+that could not be confirmed are marked.
+
+## An existing product to stand apart from
+
+Claude Code's `/buddy` (April 2026; its source leaked a day before launch) is already a terminal
+tamagotchi: 18 species, rarity tiers, five stats, 5×12 sprites with 3 frames on a 500 ms tick, drawn as
+body, eye and hat layers beside the input box ([Castellano](https://jacopocastellano.com/blog/anthropic-leaked-claude-code-source-tamagotchi-buddy/),
+[claudefa.st](https://claudefa.st/blog/guide/mechanics/claude-buddy); both are write-ups of the leak).
+The daemons stand apart on lore (each is a piece of terminal history), pure 7-bit ASCII, living in the
+status line, growth earned from real work, and doing real work.
+
+## What each era added as a technique
+
+| Era | Technique |
+|---|---|
+| Typewriter art (Flora Stacey's butterfly, 1898) [src](https://oztypewriter.blogspot.com/2020/02/flora-fanny-stacey-1845-1909-worlds.html) | Glyphs used as strokes, not letters |
+| RTTY art (1960s–70s; Baudot code, uppercase only) [src](https://en.wikipedia.org/wiki/ASCII_art), [src](https://hughpyle.com/ASR33/) | Carriage return without line feed, then typing over the line: layered overstrike tones |
+| Line printers (IBM 1403; the Mona Lisa passed around on DECUS tapes) [src](https://hughpyle.com/ASR33/) | Density ramps. [Bourke](https://paulbourke.net/dataformats/asciiart/) gives `` .:-=+*#%@``; density varies by font; cells are about 2:1 tall |
+| Rogue 1980, then Hack (~1982, which added the pet dog) [src](https://en.wikipedia.org/wiki/Hack_(video_game)) | One glyph is the identity: `@` for you, `d` for the dog |
+| NetHack [src](https://nethackwiki.com/wiki/Growing_up) | Pets grow as they level: kitten → housecat → large cat, little dog → dog → large dog |
+| Zork's grue [src](https://en.wikipedia.org/wiki/Grue_(monster)) | A creature made only of a sentence, never drawn |
+| `:-)` (Fahlman, 19 Sep 1982) vs `(^_^)` (Wakabayashi, 1986) [src](http://www.cs.cmu.edu/~sef/Orig-Smiley.htm), [src](https://en.wikipedia.org/wiki/Kaomoji) | Sideways and read from the mouth, vs upright and read from the eyes. Japanese readers judge emotion by the eyes, Americans by the mouth ([Yuki 2007](https://www.sciencedirect.com/science/article/abs/pii/S0022103106000321)). `orz` is a whole kneeling body in 3 letters |
+| cowsay (Monroe, 1999) [source](https://github.com/tnalpgge/rank-amateur-cowsay) | A drawing with 2-character eye and tongue slots; each mood is an eye preset: `==` borg, `xx` + `U` dead, `$$` greedy, `@@` paranoid, `--` tired, `OO` wired, `..` young |
+| FIGlet 1991 / toilet [src](http://caca.zoy.org/wiki/toilet) | Banner letters that overlap ("smushing"); toilet adds colour filters on plain glyphs |
+| The art scene [src](http://www.roysac.com/roy-sac_styles_of_underground_text_art.html) | Oldskool (Amiga) is 7-bit line art in `/\-\|_`; newskool is fill made of `$#Xxo`; block style needs code page 437 shading `░▒▓`. Our lane is oldskool |
+| ASCIImation (Jansen, 1997) [FAQ](https://www.asciimation.co.nz/asciimation/ascii_faq.html) | 67×13 frames at 15 fps; each frame starts with a hold count, which packed 17,357 frames into 3,849 |
+| sl (Toyoda, 1993) [source](https://github.com/mtoyoda/sl) | Wheel frames picked by x-position, so wheels roll instead of sliding; smoke ages `( )` → `()` → `O` → blank with eased drift; 40 ms tick |
+| asciiquarium (Baucom, 2003; art mostly Joan Stark) [source](https://github.com/cmatsuoka/asciiquarium) | Colour masks re-rolled per spawn; random speed and depth; bubbles at 3% per frame; a dying visitor's callback spawns the next |
+| Neko, xeyes (SIGGRAPH '88), eSheep [src](https://en.wikipedia.org/wiki/Neko_(software)), [src](https://illuminex.com/mac/eyespy/Heritage.html) | Pets that react to the pointer and the desktop: chase it, sleep when idle, follow it with their eyes, walk along window edges |
+| Tamagotchi (1996) [src](https://en.wikipedia.org/wiki/Tamagotchi) | Hatches from an egg and grows in stages; quality of care picks the adult form |
+| fortune (1979), ELIZA (1964–67) [src](https://en.wikipedia.org/wiki/ELIZA) | A small daily voice; reflecting the user back makes a trivial program feel present |
+| The twirling baton (PLATO) [Jargon](http://jargon.net/jargonfile/t/twirlingbaton.html) | `-/\|\` typed over itself spins in place; a space after each backspace makes it travel while spinning |
+| Text-mode demos (TMDC since 1996; AAlib, 1997) [src](https://aa-project.sourceforge.net/tune/summary.html) | AAlib sampled 2×2 pixels per cell and used dim, bold and reverse as extra tones |
+
+## Techniques that work at our size
+
+- **Eyes.** `oo` idle, `^^` pleased, `--` blinking or asleep, `OO` alert, `@@` overwhelmed, `xx` failed,
+ `==` focused, `><` straining, `TT` sad, `o.` a glance, `-o` a wink. Shifting the eyes one cell toward
+ what changed reads as looking (xeyes).
+- **Glyph shape as pixel.** `( )` round, `/\` ears, `_` floor. `'` and `"` sit at the top of the cell,
+ `,` and `.` at the bottom. A size ladder: `. o O @`. Motion: `~`.
+- **Tone.** The density ramp above, in dim, normal and bold; a reverse-video space is a solid block.
+- **Cycles** (intervals from [cli-spinners](https://github.com/sindresorhus/cli-spinners)): `-\|/`
+ 130 ms, `` .oO@* `` 140 ms, `+x*` 80 ms, `dqpb` 100 ms (a letter turning), `. .. ...` 400 ms, a bouncing
+ `[= ]` ↔ `[====]` 80 ms. Classics with no spinner source: `oo` → `--` blink, `zZ` sleep, `><>` ↔ `<><`
+ turn around, `v`/`^` wing flap, the Kirby dance `(>'-')> <('-'<) ^('-')^`.
+- **Timing.** Write animation as poses with hold counts, not frame by frame. Blinks last about
+ 100–150 ms, 15–20 a minute, dropping to about 5–7 during concentration
+ ([Blinking](https://en.wikipedia.org/wiki/Blinking)). Squash for one frame before a hop
+ (`(..)` → `(__)`). Tie movement frames to position, as sl does.
+- **Ambient life.** A low chance of an event per tick, randomised details, the next event queued: never
+ empty, never busy (asciiquarium).
+- **Personality from one glyph** (NetHack). Chatting with a pet reads out its hidden state: it *whines*
+ when distressed, *yips* when well fed, *barks* otherwise ([Chat](https://nethackwiki.com/wiki/Chat)).
+ Out of sight: "You feel worried about <pet>"; on its death, "You have a sad feeling for a moment, then
+ it passes" ([Pet](https://nethackwiki.com/wiki/Pet)). An `f` stays an `f` as it grows.
+
+## Tiny creatures and eggs
+
+- Creatures: `:-)` `(^_^)` `orz` `><>` `<('.')>`, the bunny `(\_/)(='.'=)(")_(")`, the owl `{o,o}` /
+ `|)__)`, the cow `^__^ (oo)\___`, sl's `(O)` ↔ `\O/ Help!`.
+- Eggs: a Tamagotchi egg wiggles for about five minutes before hatching (from a
+ [fan wiki](https://tamagotchi.fandom.com/wiki/Tamagotchi_(1996_Pet)), not verified). In NetHack a
+ hatchling bonds with you: "Its cries sound like "mommy"." ([Egg](https://nethackwiki.com/wiki/Egg)).
+ Pokémon egg messages build up to "will hatch soon" (exact wording not confirmed).
+
+## Pitfalls
+
+- **Fonts.** Density and aspect ratio vary between fonts. Ligature fonts (Fira Code, JetBrains Mono,
+ Cascadia) merge `->`, `==`, `<=`, `=>` and more into single glyphs
+ ([qterminal#684](https://github.com/lxqt/qterminal/issues/684)).
+- **Width.** Unicode "ambiguous width" characters (Greek letters, `°`, `·`, `×`) take two cells in CJK
+ setups; emoji and `ツ` are always wide ([UAX #11](https://www.unicode.org/reports/tr11/)). 7-bit ASCII
+ is always one cell.
+- **Pasting into GitHub and Slack.** Markdown eats `\` (the one-armed shrug); `_` and `*` become
+ formatting; whitespace collapses outside code blocks; Slack turns `:D` into an emoji by default
+ ([Slack](https://slack.com/help/articles/202931348-Use-emoji-and-emoticons)). So copy creatures out as a
+ fenced code block.
+- **Colour.** Palettes come from the user's theme; Solarized makes bright black equal to the background
+ ([terminal#6696](https://github.com/microsoft/terminal/issues/6696)). Respect
+ [NO_COLOR](https://no-color.org/); never carry state by colour alone. Support for dim varies between
+ terminals (from experience, not verified).
+- **CP437** is a DOS code page; anywhere else it becomes Unicode, with the width and font problems above.
+
+## Principles, and what the daemons took from them
+
+| Principle | In the daemons |
+|---|---|
+| The eyes are the face: a 2-character eye slot, the body still | `{e}` eye placeholders; a mood changes at most two cells of the sprite |
+| It must read in monochrome; colour is a filter | Each daemon has one colour, never the only signal; in the status line it takes the bar's own colour |
+| Oldskool 7-bit only, no ligature pairs, no ambiguous width | Printable ASCII only; `rules.ligatureUnsafe` checked on every frame by `daemons/tools/generate.mjs`; two eyes never touch |
+| Each cell is a pixel, chosen for its shape | tim's face is a tmux window, vim sits on `~` lines past the end of its buffer, bat is "a cat(1) clone with wings" |
+| Animate poses with hold counts; change at most 2 of 8 cells per step | Work frames per daemon; one step per real agent event, at most two a second |
+| Stillness is the default; life is random | No idle animation timer; blinks only as answers (ack, look, slow) |
+| React to the work, not the clock | Moods come from agent events; fewer blinks while agents work |
+| Say it in words | NetHack-style one-line voice, with slot templates filled from real facts |
+| Grow by earned levels, keep the identity | Versions 0.1 → 1.0 → 2.0, one face; tldr shrinks on purpose |
+| The egg is anticipation | The nest fills with habits; wobble, crack with a rarity tell, silhouette, banner, card |
+| Lore is a Unix naming joke | tim is tmux improved, the way vim is vi improved |
+| Stay visibly different from `/buddy` | Lore, pure ASCII, status line, earned growth, real work |
diff --git a/devices/harness-device/prototype/habitat/DESIGN_SYSTEM.md b/devices/harness-device/prototype/habitat/DESIGN_SYSTEM.md
new file mode 100644
index 000000000..ef0066d71
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/DESIGN_SYSTEM.md
@@ -0,0 +1,74 @@
+# Harness device: charcoal and lilac
+
+One companion, one surface, one accent. The screen should belong to the same
+desk as the Harness terminal. Its character provides personality; the surrounding
+interface stays quiet and readable.
+
+## Color
+
+The source of truth is [theme.h](../../firmware/main/ui/habitat/theme.h).
+
+| Role | Color | Use |
+| --- | --- | --- |
+| Canvas | `#181818` | Every screen; the desktop pane and command-dialog charcoal |
+| Primary text | `#EFE7DE` | Session name, recap, active status, ordinary list labels |
+| Secondary text | `#ADA6AD` | Hints, metadata, unavailable controls |
+| Accent | `#C6AAEF` | Octopus, inbox action, selected destination, pressed feedback |
+| Selection | `#392C4A` | Flat terminal-style selection behind a row or pressed control |
+| Error | `#E7A6AD` | Actual failures and the final Stop action |
+
+The canvas follows the **pane**, not the tab or workspace surface. The desktop's
+`NewHarnessForm._surface` and `SwarmScreen._buildSearchOverlay` both use
+`terminalTheme.background`, the same fill as the terminal. Its Graphite/Dusk
+match-app value is `#181818`. There is no live desktop palette sync yet.
+
+All six values survive RGB565 conversion without a further color shift when
+expanded with the usual bit replication. At full software brightness, primary
+text, secondary text, and accent have calculated full-ink contrast ratios of
+14.51:1, 7.47:1, and 8.79:1 on the canvas. Antialiased edges, saved software
+brightness, and the physical panel affect what the eye sees; these figures are
+not physical-display measurements. Saved brightness remains in effect. Its control
+advances through 25%, 50%, 75%, and 100%; byte/percentage conversion rounds so a
+chosen level survives a save and reload. The dimmed canvas snaps to neutral
+RGB565 grays (`#080808` at 25%, `#101010` at 60%, `#181818` at 100%) so the
+extra green bit cannot give the charcoal a green cast. Other inks keep the same
+brightness scaling.
+
+Purple remains the creature's identity through working, listening, completion,
+and requests for help. Expressions and words carry those states. A routine
+question does not turn the creature gold; a completed turn does not turn it green.
+Errors never recolor the whole companion.
+
+## Type and hierarchy
+
+Use the existing **Geist Mono 20 px**, with a fixed 12 × 28 cell, for all interface
+text. It is rasterized at build time. The character keeps its separate ASCII
+glyph atlas. No runtime font engine, extra font family, gradients, or shadows.
+
+- The curved session name identifies the recipient in primary text. Position,
+ rather than a different size or bright color, separates it from the recap.
+- During work, the large octopus is central. Native activity uses primary text
+ on the bottom arc; an actionable unread count uses the accent. Show `[1]`,
+ or `[1] Working` when there is native activity. Use the existing text glyphs,
+ with no emoji asset. Keep the broad bottom touch target independent of label width.
+- On completion, a smaller companion supports the recap. It sits lower beneath
+ the curved title, with 24–26 px between its frame and the prose. Brief results
+ use a 162 px portrait and three rows; long results use 108 px and six tapered
+ rows ending above the footer. The prose remains primary text, even while a
+ notification is pressed. The action responds.
+- Lists use ordinary primary text and one flat lilac selection. Back remains
+ readable and neutral. Disabled choices use secondary text.
+- Quiet mode stops motion without adding another layer of dimming.
+
+## Behavior belongs to the same system
+
+Reading a notification does not switch the desktop. Opening it explicitly focuses
+that pane and returns to the large companion after the host acknowledges it. Its
+already-read recap stays dismissed across tab/history refreshes; a new live result
+can appear when the next turn finishes. Opening a question does not answer it.
+
+The theme uses constant color tokens and the existing bounded text compositor.
+It adds no allocated theme objects, animation tasks, or artwork frames. The
+working layout, gesture thresholds, and approved octopus poses remain the same.
+Reading touch regions follow the lowered content, keeping voice on the portrait
+and local dismissal on the summary.
diff --git a/devices/harness-device/prototype/habitat/FONTS.md b/devices/harness-device/prototype/habitat/FONTS.md
new file mode 100644
index 000000000..e0603ed99
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/FONTS.md
@@ -0,0 +1,10 @@
+# Fonts
+
+- **Geist Mono Regular**, Vercel, v1.4.2. [Official source](https://github.com/vercel/geist-font). Licensed under the SIL Open Font License 1.1; the license is in [`firmware/fonts/GeistMono-OFL.txt`](../../firmware/fonts/GeistMono-OFL.txt). The browser and firmware generator use the vendored TTF.
+- **Unscii-8**, Viznut. [Project and license](http://viznut.fi/unscii/). Public-domain bitmap shapes, used for the text resident. The TTF was taken from the pinned LVGL 9.5.0 font-conversion assets. Unscii's optional Unifont fallback is not used.
+
+Firmware atlases are generated by [`gen_habitat_fonts.py`](../../firmware/scripts/gen_habitat_fonts.py) with Pillow 12.2.0. They contain fixed-size 2-bit glyph cells; no font engine runs on the ESP32. The browser and firmware use text characters, not creature image assets.
+
+## ASCII creature study
+
+The gallery uses a 14 × 28 px, printable-ASCII atlas derived from **Jgs7**, copyright © 2022 Adel Faure, distributed by [Velvetyne](https://velvetyne.fr/fonts/jgs-font/) under the [SIL Open Font License 1.1](../../firmware/fonts/Jgs-OFL.txt). The original is retained at `firmware/fonts/jgs7.ttf`. The derived atlas is named **Habitat ASCII Art 28**, generated by `gen_creature_font.py`, and retains the OFL license. It is included only in `DEVICE_CREATURE_GALLERY` builds.
diff --git a/devices/harness-device/prototype/habitat/README.md b/devices/harness-device/prototype/habitat/README.md
new file mode 100644
index 000000000..0abe9005a
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/README.md
@@ -0,0 +1,81 @@
+# Habitat: the round Harness companion
+
+An opt-in native C interface for the 466 × 466 ESP32-S3 dial. It uses precomputed
+monospaced glyphs, bounded scenes, curved text caches and partial RGB565 updates.
+There is no runtime image decoder, font rasterizer, scripting engine or LVGL
+object/timer runtime in the Habitat application.
+
+The session name follows the upper edge. Current work uses a large animated ASCII
+octopus and the engine's own activity on the lower edge. A completed turn switches
+to a smaller companion and readable recap; a new turn hides the previous result.
+Recaps come from the engine's final text, with local Markdown cleanup and as many
+complete opening sentences as fit the 180-character budget. No summary model or
+additional prompt is used.
+
+The [design system](DESIGN_SYSTEM.md) uses the desktop pane's charcoal, one lilac
+accent and one interface font size. `[1]` indicates unread messages and retains
+a wide bottom touch target. Opening an inbox message focuses its pane, acknowledges
+it and returns to the large companion without showing the same recap again.
+
+## Rendered preview
+
+These 466 × 466 images come from the actual C compositor with synthetic session
+messages, replayed from the built bridge. They are not photographs of the panel.
+
+| Working | Completed |
+| --- | --- |
+| ![Working companion](images/bridge-codex-working.png) | ![Completed turn](images/bridge-completed.png) |
+
+## Controls
+
+- Tap the octopus to speak; tap again to finish.
+- Drag vertically to scroll the selected desktop pane; swipe horizontally to
+ switch panes. A drag cannot also start the microphone.
+- Hold for the directional menu: up for panes, left for tabs, right for inbox,
+ down for controls. Slide and release; return to the center to cancel.
+- Optional experiments add passage selection/carry, spoken search, voice draft
+ review, New Harness and reviewed question answers. These require matching host
+ capabilities; unavailable commands are hidden or return a useful error.
+
+## Build
+
+Use ESP-IDF 5.5 and an isolated build directory. From `firmware/`, with the SDK
+environment active:
+
+```sh
+idf.py -B build-habitat -DSDKCONFIG=build-habitat/sdkconfig \
+ -DDEVICE_HABITAT=1 -DDEVICE_FORCE_PROD=1 \
+ -DDEVICE_CREATURE_GALLERY=0 -DDEVICE_PERF_BENCH=0 \
+ -DDEVICE_OCTOPUS_BENCH=0 -DDEVICE_LAYOUT_BENCH=0 \
+ -DDEVICE_TRANSPORT_BENCH=0 -DDEVICE_RENDER_FAULT=0 \
+ -DDEVICE_RENDER_STRESS=0 -DPROJECT_VER=0.0.87-habitat build
+```
+
+The shipped LVGL path remains selectable with `DEVICE_HABITAT=0`; this experiment
+does not change the stock default or the partition layout. Preserve NVS when
+installing. Benchmark and fault-injection flags must be off for daily use.
+
+## Verification
+
+Run `devices/harness-device/firmware/test/run.sh` from the repository root. With
+`SANITIZERS=address,undefined` and `IDF_PATH`, it includes memory checks, real SDK
+JSON parsing, transport fragmentation, animation bounds, exact pixel comparisons,
+voice races, touch cancellation, sleep/wake, and simulated OTA failures.
+
+The [release check](RELIABILITY.md) also tests an exact built bridge and replays
+its encoded turn messages through the C renderer. It records artifact hashes and
+rejects changes to its inputs during a run. Hardware touch, microphone, desktop
+focus and physical display checks remain separate; no test count establishes
+100% coverage of all possible failures.
+
+On the same ESP32-S3, a controlled 4,800-update A/B comparison against the archived
+original octopus renderer reduced full-size animation CPU time by 47.5% and
+scene-through-final-DMA time by 21.4%. Final pixels matched. Those measurements
+exclude sensor sampling, event queues, USB/app delivery, panel scanout and STT;
+they are not end-to-end interaction latency. Test reference sources are retained
+under `firmware/test/reference48` so identical-content comparisons remain possible.
+
+Artwork sources are retained for reproducible generation; see the
+[creature references](CREATURE_REFERENCES.md), [gallery study](CREATURE_GALLERY.md),
+[animation study](CREATURE_GALLERY_02.md), and [font licenses](FONTS.md).
+Historical deployment logs and user session data are not part of this change.
diff --git a/devices/harness-device/prototype/habitat/RELIABILITY.md b/devices/harness-device/prototype/habitat/RELIABILITY.md
new file mode 100644
index 000000000..1ddf1027d
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/RELIABILITY.md
@@ -0,0 +1,93 @@
+# Device release checks
+
+A passing source test is not evidence that the installed app contains that fix.
+The missing native activity footer was caused by an installed CLI bundle without
+the activity provider, while the development source contained it. The device
+received turn liveness but no native status words. The release check now inspects
+and exercises the exact built artifact, then replays its framed output through
+the firmware's C parser, turn handlers, scene builder, and RGB565 renderer.
+
+## Repeatable software gate
+
+Install the CLI's locked dependencies and set `IDF_PATH` to the firmware's SDK.
+Use a host C compiler with working AddressSanitizer and UndefinedBehaviorSanitizer.
+The serial regression uses an isolated pseudo-terminal and loopback server; the
+environment must permit those. It does not open the connected device.
+
+```sh
+python3 devices/harness-device/firmware/test/device_release_check.py \
+ --bundle /path/to/the/built/cli.js \
+ --firmware-image /path/to/the/built/firmware.bin \
+ --out /tmp/device-release-check
+```
+
+The output directory must be new or empty. The command returns nonzero on a
+failure, missing prerequisite, or changed input during the run. It records hashes
+of the bundle, any status helper, firmware image, SDK JSON parser, and tested
+sources. Recording an image hash does **not** establish that it was built from
+those sources: the build must separately record and verify its source inputs.
+
+The artifact inspector never runs the CLI entry point. It evaluates the actual
+built CableSession and wire codec in a fixture, plus its local activity provider.
+An unsupported bundle shape is a failed check, not a fallback to source tests.
+The inspector supports the minified release shape, the narrow status repair, and
+the bundled companion controllers. It loads only definitions and literal constants;
+CLI startup and I/O imports never run. Changes to bundling require updating this
+adapter explicitly.
+
+## Acceptance matrix
+
+| Boundary | Required cases | How it is checked |
+| --- | --- | --- |
+| Installed activity wiring | Codex Working, Claude activity, absent footer, capture failure, local-only capture | Actual built class and provider; fixture terminal |
+| Delayed work | Completion, summary, error, focus switch, disconnect during status capture | Deferred fixture replies must not revive old work |
+| Work/result alternation | Working hides the old recap; completed turn shows it; next turn hides it | Built wire output through production C handlers and raster |
+| Protocol | Fragmented frames, CRC, malformed and oversized JSON, reconnect, repeat hello | Built codec comparison and native transport/JSON suites |
+| Navigation | Populated/empty tab round trips, stale roster, timeouts, failed queues | Built bridge fixtures plus production UI contact tests |
+| Touch and notifications | Tap/drag separation, holds, target changes, raised arc ends, wide count target, read/open/clear | Production gesture/UI replay, including 200,000 mixed pane/inbox events |
+| Voice | Start/finish/discard/retry, pinned recipient, buffers, races, backpressure | Host source contracts and native C suites; not real STT or installed voice E2E |
+| Memory and display | Bounds, partial/full-frame equivalence, cache limits, allocation failures, sleep/wake | Native ASan/UBSan and targeted fault/concurrency tests |
+
+The initial built-artifact suite has 18 cases. The activity repair passed 18/18;
+the previous installed artifact passed only 5/18 and was correctly rejected.
+Four actual output sequences are replayed at four fragmentation sizes, giving
+16 C render replays. These are defined acceptance cases, **not 100% line or branch
+coverage**, and do not prove every possible edge case has been found.
+
+## Native desktop fixtures
+
+Run the six device interaction scenarios together so Flutter launches one native
+fixture process:
+
+```sh
+cd desktop
+FLUTTER_TEST=1 flutter test -d macos --no-pub \
+ integration_test/native_device_e2e_test.dart
+```
+
+The fixtures use synthetic terminals and in-memory state for Finder, New Harness,
+output search, passage selection, reading position and notification visits. They
+assert navigation and retained native renderer state, not physical focus or input.
+Rebuild the ordinary review artifact afterward, as described in `desktop/CLAUDE.md`.
+
+## Before merge and before installation
+
+1. Run the repository's required CLI and desktop checks for changed packages.
+ Run real multiplexer tests when changing terminal discovery or input.
+2. Build the candidate firmware and bridge from recorded inputs. Run the gate on
+ that bundle; inspect generated device previews at the real 466 px size.
+3. Check compatibility with the shipping bridge. Optional device commands must
+ use advertised capabilities or existing fallbacks; they must not hang older apps.
+4. Install only the validated files. Compare installed hashes after restart.
+ Preserve unrelated app changes. An updater replacing a binary invalidates its
+ earlier test evidence and requires checking the replacement artifact again.
+5. On hardware, verify boot/version, live native footer delivery, memory health,
+ touch/animation progress, and no panic/drop markers. Separately record a real
+ speak/send/discard/retry, scroll, tab switch, and completion/notification round
+ trip when a person can exercise the device. Logs alone are not proof of what
+ the physical panel or microphone did.
+
+Physical finger-to-photon latency, microphone quality, transcription service
+behavior, native desktop focus, and firmware OTA recovery remain separate checks.
+Do not mark unavailable hardware or real-engine rows as passed. Hardware timing
+must report the measured interval; render CPU time is not end-to-end latency.
diff --git a/devices/harness-device/prototype/habitat/assets/GeistMono-Regular.ttf b/devices/harness-device/prototype/habitat/assets/GeistMono-Regular.ttf
new file mode 100644
index 000000000..18f4acb5e
Binary files /dev/null and b/devices/harness-device/prototype/habitat/assets/GeistMono-Regular.ttf differ
diff --git a/devices/harness-device/prototype/habitat/assets/creature-references/clips.json b/devices/harness-device/prototype/habitat/assets/creature-references/clips.json
new file mode 100644
index 000000000..67d820dc7
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/assets/creature-references/clips.json
@@ -0,0 +1,5407 @@
+[
+ {
+ "name": "Octopus / ASCII",
+ "cols": 54,
+ "rows": 27,
+ "font": "ascii12",
+ "color": "c8a9f0",
+ "frames": [
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@############%;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ;xoo, .;o%####x:%####o;#####xo: xxox. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. x:.:%x; ",
+ " o@#: .. ..,oxx#######%xx:., ,. x@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,:,. .%@@ ",
+ " .@@#x;;;;;;oo.o%#%oo%%#@%%%%;%#%;,;o;;;;;;o#@x: ",
+ " .,o@@%%@@;,:%#@@,o%##@@%###%,o##%o;@@#x@@%,.. ",
+ " ;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " ,x#@@%@@x,:. o##@; @@##. .:,x@@@@%@#%%;, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " ;@::, .:o, o@@. %@#. .oo: @@x ",
+ " xo; :#, .x@@. x@@,. .o% o;:o#; ",
+ " :@@;:o#@%: ,o@@%;:#@% ,:: ",
+ " ..x#@#x: .x#@#x:. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@##############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###x.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .oxxx,. ,;o%####%:%###%o;#####o;: ,xxx,. ",
+ " ,x#;. ;: :;o%####;::::x###%x;:. ;,.,%%o ",
+ " o@#, ...oox#######%oo:.. %@@ ",
+ " ;#@x:. .:::oo;;oooooooo;oo;,;,. .#@# ",
+ " .@@#o;;;;;;ox.o%#%oo##@@%##%;%#%;,;x;;;;;;o#@o, ",
+ " ..o@@%%@@;::%#@@.o%##@@####%,o@#%o;@@#x@@%,. ",
+ " .;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " o%#@##@@@x,,. o##@; @@##. .,,x@@@@%@#%%;, ",
+ " #@% o#@%: %@@#. .%x#:. ",
+ " @#::. o@@. %@#. :@#: ",
+ " ,xo, .xxo .x@@. x@@,. xxx ,x:;x%, ",
+ " :@# ,;@@%: ,o@@x: x@ ::: ",
+ " :%%#@#x, .x#@#%%o ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " oooooooooooo:. ",
+ " .;%@@@@###########%o. ",
+ " .:@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%xo,o#####%;, ",
+ " :;;;. :o%##x.%::######;,#.o####%;. :;; ",
+ " .xo;,,o: .,o###%%%%%#####%x%%%###x;. x;:ox: ",
+ " ;@#: .,;x%###%;ooooo;o####x;:, %@@ ",
+ " ;@#: .:;o####xxxxx%###xo;.. %@@ ",
+ " .@#; ....;;o%%%%%%%x;;,.... .,@o ",
+ " o@@x......,:::o%xooxxxxxxxo;x%o.;;:......;@x: ",
+ " .x@@#@@o;;;;%#@xox##@@%##%ox%#%:;;%@@#@@#. ",
+ " .,:::::%%%##@#o o##@@@@####.x@#@#%#;::;,,, ",
+ " ,o%@@#@@@@xo%o,. o###o,,@@##...o%oo@@@@#@@@%o: ",
+ " o@%;,.,,,,. o##@; @@##. ,,,,.,,,:@@x, ",
+ " x@,:o o@@:. :#@#. o@#. ",
+ " .:xo: o@@. %@#. ;o.,x@. ",
+ " x@@. #@#. .;o; ",
+ " oo: :#@%. o@@;, ,;x, ",
+ " %#x;;x%@x: .o@@%;:o%@, ",
+ " ,;oooo,. ,:oxoo; ",
+ " "
+ ],
+ [
+ " .. .. ",
+ " .,:@@@#########x;:. ",
+ " :#@@@@@############%:. ",
+ " .:o@@@##############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xo%########%oo%######o, ",
+ " :xxx, ,ox###o.@xo######[email protected]####%o,. oxx. ",
+ " .%#o. ,;x##x:::;######o:::x###%x: :..:#%; ",
+ " ,@@; ,;x%####%;#####xo#####xo: #@@ ",
+ " ,@#; .:;x%###%:::::o%###%o;, ##x ",
+ " @@; ,,,xx%########xx;,, ,x@o ",
+ " x@@:. :,,:;;;oooooooo;;;:,:, :x@:. ",
+ " :%@##@xxxo:ox##oo%%##%%%x;##%,.;xx###@@x. ",
+ " o;;ooooo##@@:ox#%@@%##%x:%@#%xooo;:o, ",
+ " .,x%##%###@%%@%,., o##@@##@###.;%o##x@###%##%%o, ",
+ " :%@o;ox:oooo. o##@; @@##. oooo;oo;o#@o. ",
+ " %@#,. o#@@: @@@#. .:@#o ",
+ " ,;;, o@@. %@#. .;..o@o ",
+ " o@@. %@#. ,ox%,. ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " %x, .,:#@x. :@@x;, .:@, ",
+ " :x#%#@@o, ;%@@%%%;. ",
+ " ..... ..... "
+ ],
+ [
+ " ;;;;;;;;;;;;,. ",
+ " :o%@@@#########%%x;. ",
+ " .,#@@@@@###########@@#x;. ",
+ " ,o%@@@###############@@#%x: ",
+ " .;x#######################%o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ,,, ;%####x,:x########x:,o######;, . ",
+ " .x#x:.. :o%##o.@;:######;:@.o####%; ,;#x: ",
+ " ,@@; .:o##%xxxx######%xxx%###x;. %@@ ",
+ " ,@#; .:;x%###x:xxxxx;;####%;;, %@@ ",
+ " ,@#: ,:ox####ooooo%###%o;,. .;@x. ",
+ " %@#, ....;;o%%%%%%%%;;:... ,o@x: ",
+ " x@%o;;;;;;,:;xxo;oooooooo;xxo.,:;;;;;;##x ",
+ " .,@%#@::::x%%#%oo##@@%##%;%%#xx;::x%x#o, ",
+ " ..oooooo;o##@@%##% o%#@@@####%.o#o@@##xooooooo;, ",
+ " o%#%%@#x@@@#,::, o###o::@@##. ::,;#@##x##%@@x, ",
+ " @#x o##@;. @@##. .:%@#,",
+ " ,:: o@@o, o#@#. .::@#:",
+ " o@@. %@#. ,:;: ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " o@@. %@#. ",
+ " ,, :#@o :%@o:. .: ",
+ " o%x,;x%@x, .,@@#x,:x@. ",
+ " :oxxo ,;ooo: "
+ ],
+ [
+ " .%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " .:@@@@@############@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " :x%###o.xxx######xxx.o#####x:. ",
+ " .,xx: :o%##o.o,:######;,o.o####%; ;o ",
+ " o@:. ,;%#####%x#####%x#####%o: .:@, ",
+ " x@;. .,;o%###%o;;;;;ox###%x;:. ,o@, ",
+ " ;@@x;. .::;%%%#%%%%%##%%o;:. .o#@. ",
+ " .x@#x,. ,.,,;;oxxxxxxxo;;:,.,. .:x@%; ",
+ " ,x@%xxxxxxx.:o%%ooxx%xxxxx;%%x..;xxxxxx%#@:. ",
+ " ::::::::::::###@oox##@@%##%oo%@##o::,,,::,:,. ",
+ " ox%#@@#@@@@@@@@@o:; o##@@@@####.,o#@@#@@@@#@@#@%oo. ",
+ " @x, . . .. o###; @@##. ... .. o#x@#:",
+ " :, o@@o, o#@#. .o##:",
+ " %@#. .:@#: ... ",
+ " #@# ,@@; ",
+ " #@# :@@; ",
+ " #@# ,@@; ",
+ " #@# ,@#; ",
+ " .,@#o .%@o, ",
+ " :x ;@;. :%#;.:o ",
+ " .x%xo ,#xoo "
+ ],
+ [
+ " ..###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " .:xx; :o%##x.;,:######;,;.o###%x; ;x. ",
+ " o@,. ,;%#####%o#####xx#####%o: :@, ",
+ " x@;. ..;ox###%x:::::ox###%o;:. ,o@: ",
+ " ;#@%;. ,::%%%########%%o::. .o@@ ",
+ " .o@@x:. ,,,:;;oxxxxxxxo;;:,.,. ,;%@%; ",
+ " .o@%xxxxxxx,;x%%oo%%%%%%%x;%#x,,;xxxxxxx%@:. ",
+ " .;::::::::::;##@@;ox#%@@%##%o;%@##o::::::::::, ",
+ " x%%%@@%@@@@@#@@@o:: o##@@@@####.,;#@@#@@@@%@@%@@%%x: ",
+ " @x. o#@@: @@##. .o@@:",
+ " ,. ;%@@;. ;#@#o, .:::.",
+ " #@@ ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " #@# ,@#; ",
+ " .,@%; .x@x: ",
+ " ,x..;@:. ,x@o.;o ",
+ " oxo; .%oo; "
+ ],
+ [
+ " .,###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###x.xxx######xo%.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%x; ",
+ " ,,: ,;%#####%o#####xx#####%o: . ",
+ " @x: .,;ox###%x:::::ox###%o;:. ,;## ",
+ " @#o. ,::%%%########%%o::. .:@#.",
+ " o#@%;, ,,,,;;oxxxxxxxo;;:,.,. ,o#@x, ",
+ " .;@@#x,,,,,,:;,;x#%oo%%%%%%%x;%#x,;;;,,,,,,:x@@#, ",
+ " .:;:,@##@@@%;;%#@;ox##@@%##%o;x##:;x@@@#@@%;.::. ",
+ " :#xo%x .,,,::o#@%: o##@@@@####.x@##xo,:,.,:;##xxx%, ",
+ " ,;, ;#@###@#@@#, :x#@x, #@@#;.,@x#@@@@#@@@#. ,ox. ",
+ " ;;;:o;o; .#@#; :x@#x; :;;;;:o;: ",
+ " ;@#; #@%:. ",
+ " ;@, %@# ",
+ " o@, %@# ",
+ " o@. %@# ",
+ " o@:. .%@% ",
+ " ,x@; ##% ",
+ " ;x%;. :x%x. ",
+ " "
+ ],
+ [
+ " oooooooooooo:. ",
+ " .;%@@@@###########%o. ",
+ " .:@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%x;,o#####%;, ",
+ " :o%##o.%::######;:#.o####%; ",
+ " .,o###%%%%%#####%x%%%###x;. ",
+ " .:;x%###%;ooooo;o####x;:, ",
+ " .:;o####xxxxx%###xo;,. ",
+ ",#o ,..,;;o%%%%%%%x;;:.... ;o,",
+ ".@x, .:::o%%ooxxxxxxxo;x%o.;:: #@:",
+ " %%#@%%%%%%%%xxx,x#@xox##@@%##%ox%#%,;%%%%%%%%%%%%%#x,",
+ " .;.;%xooxx, .%@#x o##@@@@###%.x@#x:.xxx;%xxx%x:. ",
+ " .. .:@#o.x#@@#;,,@@##%oo@#x: ,%%: ",
+ " ;#;. .o@%,:%@@@x ;#@@#x @@%;. ,;ox. ",
+ " :x@#%%%#x: x#@%;. .:#@@#x::@#%x@@% ",
+ " :@@; ,o@@x ",
+ " %@% ,@# ",
+ " %@% :@% ",
+ " .%%o. .,@%; ",
+ " ,oo, :xo. ",
+ " ",
+ " "
+ ],
+ [
+ " ::::::::::::,. ",
+ " ,;x@@@#########%xo: ",
+ " ..%@@@@@###########@@#o:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#@#####################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###o.@;:######;;@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:o%####x:%%%%%o;####%o;: ",
+ " ,;ox####;;;;;%###%x;,. ",
+ " ....oox#######%oo:.. ",
+ "o%; ,:,;:;xxo;oooooooo;xxo,;:::. oo,",
+ "x#x. :ooo%@@.o%#%oo##@@%##%;%#%o,x@#xoo .##:",
+ " ;%@@%#@@%%@#: .%#@#.o%##@@####%.x@#x:. ##x@@#%%##@%;.",
+ " .,,,:;;. ,;@%: o%#@@%oo@@##oox@#o: :::;:::: ",
+ " ;#:;x%#@@#, .%@@@%x:@#x. ",
+ " .,%@@@x: ,x@@@@o:,o. ",
+ " o.:@@x:, .,:o@@@o. ",
+ " ,;x@::@@;. x@#.:: ",
+ " ::::..:@%x; .:o#@: ,: ",
+ " oxx :%%;. ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " oooooooooooo:. ",
+ " .o%@@@@###########%o.. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@@###############@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x.;x%######%x;.o#####%;, ",
+ " :o%##o.%::######;,%.o####%;. ",
+ " .,o###%%%%%#####%x%%%###x;. ",
+ " .,;x%###%;ooooo;o####x;:, ",
+ " .:;o####xxxxx%###xo;,. ",
+ " ....;;o%%%%%%%x;;:.... ",
+ "... ;;;::o%%ooxxxxxxxo;x%o.;;;;. .. ",
+ "%#o .o%#%%##,x#@xox##@@%##%ox%#%:x@%#%%... %%:",
+ ":##%xo%@@@@xo. .%@#o o##@@@@###%.x@##x: oxo@@%;;::x@#,",
+ " ,;;::;:. :%@o:,%#@@#;,,@@##x;;@@#%. o::o;;oo. ",
+ " .,,ox#@@@o ;#@@%x.::;. ",
+ " :ox@@#o%: .:@@@@#%x:. ",
+ " %@#o#; ,:;@@@@x, ",
+ " ., :%o;, ,;o@o. ",
+ " , ::, ,:::. ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ,;o%####x:%####oo#####oo: ",
+ " :;o%####;::::x###%x;:. ",
+ " .,,oox#######%xo:,, ",
+ " %#xo,. .;::oo;;oooooooo;oo;,;,. .;ox@, ",
+ " oox@#%;;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o%@@@o. ",
+ " ,,o@@##@@;::%#@@,o%##@@####%,x##%o;@@@%@@@,,,, ",
+ " ,;;;%##@%; o##@#xx@@##.;%@##%;;;;;. ",
+ " x%@@@@%,:. o%@@:. @@##. .:,x@@@@@#%; ",
+ " @@x ,;;;..,@@@o o#@o, ::: ,@@x ",
+ " @%::,,@%:;x@@o, :#@%; o%% .@@x ",
+ " ;xx: #@@@@x o%#@@@# xx%#: ",
+ " ,:;:, .;;:, ::: ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######o;@.o####%o. ",
+ " ,;x##%;;;o######o;;;x###%o: ",
+ " ,;o%####%:#####o;#####xo: ",
+ " :;o%####;::::x###%x;:. ",
+ " :xoo: .,,oxx#######%xx:,, .;oxo ",
+ " ;@%o:. .:::;o;;oooooooo;o;;,:, .,o%@@ ",
+ " ,;@@@@@@@@#@#%.o%##oo%%#@%%%%;%#%;,;%#@##@@@@@x: ",
+ " ..,,,,:#;::x#@@,o%##@@%###x,o##%o;%o;,:,, . ",
+ " ;;;;;%##@%; o##@#%%@@##.;#@##%:;;;;;: ",
+ " :x#@@#@@%,:. o##@; @@##. .:,x@@@@#@@#o ",
+ " o@#, x@@:. x@@#. o#@:. ",
+ " o@;:, xooo. x@@, x@@;, xo;: o@#: ",
+ " .xx; @@%,,x@#;. .:%@#x:,o#@,.oxx%# ",
+ " :x@@@@o. ;%@@@@@:. .;;, ",
+ " .... ..,,.. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ::::::::::::,. ",
+ " ,;o@@@#########%xo: ",
+ " .x@@@@@###########@@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " .;x#@##################@##%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###o.@;:######;;@.o####%;. ",
+ " ,:o##%ooox######xooo%###%o, ",
+ " .;xxx; .:o%#######x,;#######%o;: %xx%, ",
+ " @@% xo ,;ox#####%;o#####%x;,. %::%@o ",
+ " @@#.,. ...oox#######%oo:.. ,.:#@o ",
+ " :%@@x;;;;;;::;ooo;oooooooo;ooo,;;;;;;;;%@@;, ",
+ " ..,##x@@#%.o%#%oo##@@%##%;%#%o,o@@@#%@o,. ",
+ " o;;;#@@#.o%##@@####%.o@##x;;. ",
+ " ,x%%####@%%@#x: o##@%oo@@##.:x@#%##%#%%%%%,,. ",
+ " .#@#;x;;xo, o##@; @@##. :xxxo;xo;@#o ",
+ " ,@o,. o#@%: x@@#. .#@%. ",
+ " .;x%% o@@. %@#. :: ,@@: ",
+ " .. oxx ,%@@. %@@,. xxo, .;x%;, ",
+ " #%: ,;@@%: ,o@@x: ,x@, ",
+ " ;%@x#@#x, .x%@@%@@x. ",
+ " .:o;, ",
+ " "
+ ],
+ [
+ " ",
+ " oooooooooooo:. ",
+ " .o%@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.;x%######%x;.o#####%;, ",
+ " ::: :o%##o.%::######;,%.o####%;.,;;. ",
+ " .o%%% .,o%##%%%%###%%#%%%%%###x;. ;o#%o ",
+ " .@@o. .,;x%######x.:#######x;:, .%@@ ",
+ " .@#; .:;o#####%x%#####xo;,. ;@@ ",
+ " .@#x:::::....;;o%%%%%%%x;;:...,::::o#@% ",
+ " ,;%@@@@#::o%%ooxxxxxxxo;x%o.:%@@@@%o, ",
+ " :%::::x%#@xox##@@%##%oo%##;:,,. . ",
+ " ..;oooooo##@@#xoo o##@@@@####.x@%@@##x;;;;;;,.. ",
+ " ,o##x%#%###%,... o###o,,@@##. ..,,,@@@@%#@@###;. ",
+ " #@o. o##@; @@##. ,;@%o ",
+ " ,;oo. o@@:. :#@#. ,. .o@x ",
+ " o@@. %@#. ,;x%x: ",
+ " o@@. #@#. ",
+ " o; :#@@. %@@:. : ",
+ " ##x:;x#@%: ,%@@x,..:@, ",
+ " ,;oooo,. :;o@##%;. ",
+ " "
+ ],
+ [
+ " ",
+ " ..,@@@#########o:,. ",
+ " ,%@@@@@############%:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#xo######xo#.o#####x,. ",
+ " :x% :o%##x,::;######;,;,o###%x; ;%:. ",
+ " .%#x: ,;x########%ox########xo: .:#%o ",
+ " .@@o .;ox######x.:######%o;,. .%@@ ",
+ " .@%;. ,::x%%########%%;::. .,x@# ",
+ " o@@xoooo:,,:;;;oooooooo;;:,,:;ooo%@@x: ",
+ " .;#@@%x,;x#%oo%%%%%%%x;%#%,,o#@@x:. ",
+ " ;;;;##@@:ox#%@@%##%x:%@##x;;. ",
+ " :oxx%%x%%%#%#@%:,, o##@@@@@###.;#x@#%#%%%x%%xx;, ",
+ " %#%%ox%;xx%x. o##@; @@##. .x%%x;x%o%#@#:. ",
+ " @#o o##@; @@##. ,:o@#,",
+ " o@@. %@#. .:,:x@; ",
+ " o@@. %@#. oo; ",
+ " o@@. %@#. ",
+ " ;: :#@@. %@#:. ",
+ " %%o:;x%@%;. .:@@%o. .:#. ",
+ " :ooxxo,. ;%@@%%%o. ",
+ " ..,,,. "
+ ],
+ [
+ " ,,,,,,,,,,,,.. ",
+ " ,:o@@@#########%x;, ",
+ " .o@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;#%; .;x###o.@o;######;;@.o####%o. .%x, ",
+ " o@#: ,;x##%;;;o######x;;;x###%o, o@@ ",
+ " o@%, ,;o%#######x,;########o;: %@ ",
+ " o@x, :;ox#####%;o#####%x;:. .%@ ",
+ " o@%;, ...oox#######%oo:.. .%@@ ",
+ " ,o@#x:::,,::;oo;;oooooooo;oo;,::,:;;;@#x ",
+ " o#@@@%::o%#%oo##@@%%#%;%#%;.:##@%xo, ",
+ " ,::, ,o%#@@,o%##@@####%,o##x;. ",
+ " o%%o#@#;::,o%#@@#o o##@%xx@@##. ,%@@##%%x##%oxxxo. ",
+ " %x, ,;@@@@@o:;:. o##@; o@@#. ;;o@@@#x;:%;;x@#; ",
+ " o#@%: o#@%: ,:;@; ",
+ " o@@. ,@#; .::, ",
+ " o@@. :@@; ",
+ " o@@. ,@@; ",
+ " x@@. ,@@; ",
+ " ox.,:;##x .%@x, ",
+ " ,:%#%::. :%@x;o: ",
+ " .,,. "
+ ],
+ [
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o#@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x####x,;x%######%x;,o#####%;, ",
+ " :x%##o.#::######;:#.o####%;. ,,, ",
+ " ,@%x .:o##%xxx%###%##%xxx%###x;. :x@o, ",
+ " @@o .:;x%######x.:#######%;:, :#@x ",
+ " @@o .:oo#####%x%#####xo;,. :#@o ",
+ " ;#@x. ....;;o%%%%%%%x;;:.... .:%@x, ",
+ " o#@%oooooo;,:;xxooxxxxxxxo;xxo.;;oo;;oo#@; ",
+ " .:@%%@@@x,x%##xox##@@%##%;x%#%,x@@@#%@o, ",
+ " .oo; ,;x@@#xx o##@@@@###%.x@##x: ,, ... ",
+ " o,x#%,,:x##@@;, o##@o::@@##x;o@#######@@#@#@@%:. ",
+ " . :%@@%o%, o##@; o#@#o, ,oxxoo:::; ..o@#,",
+ " ,,. o@@;. .;@@#. :x##,",
+ " o@@. %@% ",
+ " o@@. x@# ",
+ " o@@. x@#. ",
+ " ;%@@, .#@: ",
+ " ,%xoo%@#x. ##%: ",
+ " .oooo;. ,,,, ",
+ " "
+ ],
+ [
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@############x,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###o.ox%######%xo.o#####%:. ",
+ " :o%##o.x::######;,%.o####%;. ",
+ " %%o ,o%##%%%%##%x%##%%%###%x; :x%#: ",
+ " @#: .,;x%######x.:#######x;:, ,;#@; ",
+ " %@#x,. .:;;%#####%%#####x;;. .o%@#, ",
+ " :%@#o, ,..,;;oxxxxxxxx;;:,.,. ,;%@#o ",
+ " .:@@%xxxoooo;.:o%%ooxxxxxxxx;%%x.;oxooxxx#@@;. ",
+ " ;##x%@#;;x#@@@oox##@@%##%oo%##:x#@@%x@x; ",
+ " o%@@#xoo o##@@@@####.x@##x; .:oooooo;; ",
+ " .;%x#x.. o###;..@@@#%;:@%###x%#@#%@x#@#@o.",
+ " :%#o o##@; ;%@@%; :xxxxx:. .;##:",
+ " .:@@x o@@,. .,@@@%,. ,,..",
+ " o@#, o@@. ,o@@%: ",
+ " ;@%x; .;#@: ,@@% ",
+ " ,%@; ,;%@%; ",
+ " o; :x@@: o%#;,. ",
+ " ;ox%%%o ",
+ " ",
+ " "
+ ],
+ [
+ " ..,#@#%%%%%%%%%o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%x:. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.%xx######xo#.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x;. ",
+ " ,;x########%ox########%o: ",
+ " ..;ox######x.:######%o;:. oo.",
+ ";x; ,::%%%########%%o::. .@@:",
+ "x@o :,,:;;oxxxxxxxo;;:,,,. ,x@x,",
+ ";@#x:,,,x%%##xxx,;x##oo%%%%%%%x;%#%,:x####%#%%o#@@@, ",
+ " ,oxxoo%@xoxooox#@@@;ox##@@%##%o;x##;oxxxo;%xoxoo: ",
+ " :ox%%%@@#;:: o##@@@@####.x@##%o. ,o%xx%x%x;. ",
+ " .:@@#x%, o##@: %@@##:,%o%@@@@@%xo%ox%x@x.",
+ " :%@x:, o@@o. ,x@#x; ,:;::: .o##:",
+ " ,#%. x@@@ %@@#;:, ",
+ " ;#%:;. :%@@. ,;%#@@ ",
+ " ,,,,. o@@, .,%@ ",
+ " .:;#@o. ,x%#@. ",
+ " ;@@o, .,,,. ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ..,@@@#########o:,. ",
+ " ,%@@@@@############x:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#xo######xo#.o#####x,. ",
+ " :o%##x,;:;######;,;,o###%x: ",
+ " ,;x#####%o#####xx#####xo: ",
+ " .;ox###%x:::::o%###%o;,. ",
+ " ,::x%%########%%;:: ",
+ " :,,:;;;oooooooo;;::,:. :;.",
+ ";%o. ;oo%xxxxxxo,;x##oo%%##%%%x;##%,:ox###%@#%,.;xo@#:",
+ ";%%;.,;xoo;;;;;o##@@;ox#%@@%##%x:x##o;;oxo;xo;;:;;oxo,",
+ " .:%#####@@@@#%#:,, o##@@@@@###.x@@#####%%##%%#%o. ",
+ " @#;;, o#@o, %@@#. .o:;xxxo;xxo,xxx@o, ",
+ " ##o: ;%@@. %@#;, ,##; ",
+ " ... .#@# :@@x;,,. ",
+ " .#@% .o#@@@%;, ",
+ " .,:@@x ..,;%@, ",
+ " x%%#;. ., ",
+ " .,,. ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ..%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " ,;@@@@@@###########@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " :x%###o.xxx######xxx.o#####x:. ",
+ " :o%##x.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;;;;;ox###%x;:. ",
+ " ::;%%%#%%%%%##%%o::. ",
+ " ,,:: ,,,,;;oxxxxxxxx;;:,.,. .::: ",
+ " .####x%%x%xxx,;o%%oo%%%%x%xx;%%x.;ox%%%x%%%@@@% ",
+ " .:;::;:%x:xo;;##@@oox##@@%##%o;x##;:;%%xo%%o ",
+ " x%##@@@@#%%%###@o:: o##@@@@####.x@@###xxxxxxxxx: ",
+ " @o :xxo%x; o#@o, @@##. ;%#%%o#xx###%:. ",
+ " :, x@@. @@##. ,o@; ",
+ " .:#@x x@@:. :xx, ",
+ " ;@@; ,%@#o :;;o. ",
+ " ,x%%, :x#@@@#x. ",
+ " .@#x, ..,;. ",
+ " %%%x ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " :::::::::::;,. ",
+ " ,;x@@@#########%xo: ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;:@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:;x%###%:x%%%%;;####%o;: ",
+ " ,:ox####o;;;;%###%x;,. ",
+ " :,,, ....ooo##%##%%%oo:... .,,, ",
+ " .@@@@;:::::::::;xxo;oooooooo;xxo.;;:::::::o#@@% ",
+ " ,:::@@#%@o::xx%#%oo##@@%##%;%##x,,:@@@%@@#::,. ",
+ " :;;#@@#:::::%##@%x# o%#@@@####%.o@@##%::::::::,. ",
+ " @%:,;::%@@#@@%:;. o##@x;;@@##.:;;:%@@@@#@@#@@%o ",
+ " o: . .. o@@. @@##. .. ..;%@, ",
+ " ;#@o o@@#. ox%@, ",
+ " .:@#o %@@:. .,,. ... ",
+ " ;%@;. ,;x#%x;:o#@, ",
+ " .@#o, .o%@@##o. ",
+ " .@#%x ",
+ " ,,,. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##x.%::######;,x.o####%;. ",
+ " ,o%##%%%%%#####%x%%###%x; ",
+ " .,;x%###%;oo;oooo####x;:, ",
+ " .... .:;;####%%%%%%###xo;, ,xo;, ",
+ " o@#x: ,..,;;o%%%%%%%x;;:,.,. .,o@@. ",
+ " :#@#x;......,;,:o%%ooxxxxxxxx;%%x.;;:......,x#@@. ",
+ " ooox@@#@@#x;:x#@oox##@@%##%oo%##::o@@@#@@@xx: ",
+ " .:%%%x.,,;:,;o#@@o o##@@@@####.x@##%x:::,::: ",
+ " o@x;x@@#xx%%#@@o. o##@;..@@##. ,#o%@@@@#@@#o;: ",
+ " ;%x, .,%#x##%, o#@#; @@##. ,::::,;:,@@@x. ",
+ " x@@. ,#@#. ,;.;@@: ",
+ " ... #@@% %@@, :;;, ,%%%%: ",
+ " o@%:o#@x: :o@@x:,x#@; ",
+ " o@@@#%,. .;#@@@@o. ",
+ " .;:, ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " ;xxx, ,;o%####x:%####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " x@#, .. .,,oox#######%oo:,,. .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%%%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@.o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, ",
+ " ;@%, o@@%: %@@#. ,#@x: ",
+ " o@::, .:x, o@@. %@#. .xx: . @@% ",
+ " .xx; ;@, .%@@. %@@,. .o% o;:x#; ",
+ " ;@@o:;@@%: ,o@@%;:#@# ,:: ",
+ " .x#@#x: .x#@#%;. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " oxxx, ,;o%####x:#####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. .,,oox#######%oo:,, ,. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%#%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@@%%o, ",
+ " ;@%, o@@%: %@@#. ,#@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@% ",
+ " .xx; ;@, .%@@. %@@,. .o% o;;x#; ",
+ " ;@@;:o@@%: ,o@@%;:#@% ,:: ",
+ " .x#@#x:. .x#@#%:. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@#############;,. ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " oxxx, ,;o%####x:%####o;#####oo: xxxx. ",
+ " ,o#;, oo :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:.. .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%#%%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%%@@o::%#@@,o%##@@%###%,o##%o;@@@x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,:. o##@;. @@##. .:,x@@@@%@#%%o, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@% ",
+ " oo; ;@, .%@@. %@@,. .o% o;;x%; ",
+ " ;@@;:o@@%: ,o@@%;:#@% ,:: ",
+ " .x#@#x:. .x#@#%:. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " :;;;. ,;x##%;;;o######x;;;x###%o, :;;. ",
+ " .,%o:,,o: ,;o%####x:%####o;#####oo: x:,o%;. ",
+ " o@#, :;o%####;::::x###%x;:. %@@ ",
+ " o@#, ...oox#######%oo:.. %@@ ",
+ " ,;@x:. .:::oo;;oooooooo;oo;,;,. .#%; ",
+ " .@@#x;;;;;;ox.o%#%oo#%@@%##%;%#%;,;x;;;;;;o#@o ",
+ " .,o@@%%@@;::%#@@,o%##@@####%,x@#%o;@@@x@@%,.. ",
+ " ,;;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " o##@##@@@x,,. o##@;. @@##. .:,x@@@@%@#%%;, ",
+ " #@% o#@%: %@@#. ,%@%; ",
+ " @#::. o@@. %@#. #@@. ",
+ " :xx, oxx .%@@. %@@,. xxx: ;;:o##; ",
+ " ##, ,;@@%: ,o@@%; ,x@. .::, ",
+ " ;%@x#@#x: .x#@#%%%: ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ;;;;;;;;;:;;,. ",
+ " ,;x@@@#########%%x:. ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " ,,,. :x###x.@;:######;:@.o####%;. .,, ",
+ " .oxo;o;. .:o##%ooox######xooo%###xo, ;;;xo, ",
+ " ;@#: . .:;x%###x:xxxxx;;####%o;: . %@# ",
+ " o@#, ,:ox####ooooo%###%x;,. %@@ ",
+ " .:@o, ....ooo#######%oo:... .##x ",
+ " .@@%; .,::;xxo;oooooooo;xxo.;:. .:%@o ",
+ " ;%@#%%##xxx,x%#%oo##@@%##%;%##x,;x###%#@#o,. ",
+ " .:x;oxo;;o#@@% o%#@@@####%.o@##x;xxo;%o: ",
+ " .;x%%%##%#%#@;, o##@x;;@@##.,;@#%#%#%%%#%%,.. ",
+ " ,#@%%o;x%xx, o##@;. @@##. oxxxo;xxo@@% ",
+ " ,@o, o@@o, o@@#. ,x@x, ",
+ " ,#xoo. o@@. %@#. ., .o@%, ",
+ " ,,, .,. o@@. %@#. ., .:o%%o ",
+ " %o. .;#@%. ;#@x:. ,;o. ",
+ " %%%;o%#@x: .:@@@o;x##, ",
+ " ,;oooo,. ..:ooo; ",
+ " "
+ ],
+ [
+ " ",
+ " xxxxxxxxxxxx:, ",
+ " .o#@@@@############o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :x#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%:. ",
+ " ,xx;. :o%##o.x::######;,x.o####%;. .xxo ",
+ " x@:..: ,;%##%%%%%#####%x%%###%x; .: :x@, ",
+ " x@o, .,;o%###%oo;;;;;o####x;:, :%@, ",
+ " ,@%;. .:;;%###%%%%%%###x;;. .%##. ",
+ " .x@#x,. ,..,;;oxxxxxxxx;;:,.,. .;#@o. ",
+ " ,x@%xooxxxx,:o%%ooxxxxxxxx;%%x.;oooooox%#@,. ",
+ " .@%%@#;::%##@oox##@@%##%oo%##:::#@#x@#o ",
+ " :o;;;oo%@@@x;; o##@@@@####.x@#@@#o;;;;;;;. ",
+ " .:#x%@@##@@;.,. o###;..@@##....,,:@@@@%@@%##%, ",
+ " .%@x, o##@;. @@##. :%@o, ",
+ " ;#@,,,, o@@,. ,#@#. . :@#; ",
+ " :o;;, o@@. %@#. .o;ox%, ",
+ " o@@. %@#. ::, ",
+ " :, ,%@@. ;#@%;. .;. ",
+ " #%;..:o@@%, .:@@@o,:o@, ",
+ " :%%%%%;, :o#%%x. ",
+ " "
+ ],
+ [
+ " ",
+ " .,:@@@#########x;:. ",
+ " :#@@@@@############%:. ",
+ " .:o@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%########%xx%######o, ",
+ " ,o%###x.@xo######[email protected]#####x,. ",
+ " ,;x##x,::;######o:;:x###%x: ",
+ " oxx: ,;x%####%;#####xo#####xo: ",
+ " @%, .;;x%###%:::::o%###%o;,. ::oo ",
+ " %##o,. ,,,xx%########xx;,,. ,:;@@. ",
+ " :x@%o, :,,:;;;oooooooo;;;:,:, ,%@@@; ",
+ " .x##%%%%%xo,,ox##oo%%##%%%x;##%,:;%xxxxx#@@#%;. ",
+ " ,::::;;x%##@@@:ox#%@@%##%x:%@####;;;;;;;;:. ",
+ " .,#@@#@@@#%#@,,,. o##@@##@###..,,@#x#@@@@@@@@%x. ",
+ " ,x#%o;, o##@; @@##. o%#x: ",
+ " @#: .x@@;. o@@#. ;@@:",
+ " %x:,:, %@@ ;@%: :;o%o,",
+ " ,::. #@@ :@@o, .,,. ",
+ " #@# ,@@x. ",
+ " #@# :#@%. ",
+ " .. .,@#o .;@@x:, ",
+ " ,;oo%@@x, o%%%, ",
+ " .,,,, "
+ ],
+ [
+ " ::::::::::::,. ",
+ " ,;x@@@#########%xo: ",
+ " ..%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#@#####################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;;@.o####%;. ",
+ " ,:o##%ooox######xooo%###%o, ",
+ " .:o%####x:%%%%%o;####%o;: ",
+ " ;;: ,;ox####;;;;;%###%x;,. ",
+ " @@o ...oox#######%oo:... ",
+ " ;%#o;: ,::. ::;xxo;oooooooo;oxo,:,,:,. .,x##% ",
+ " .:@o:,,,::::;oox%#%oo##@@%##%;%#%ooxx:::,,,::ooo ",
+ " ,x##%###%##@x#@#.o%##@@####%.o#x@##%#######%o,. ",
+ " ,o@xox;xxx::;o o##@%oo@@##. ;;:;ooxo;ox;%@#;, ",
+ " x##, x#@@; @@##. .,o@#:",
+ " @%. ;#@x o#@;, .;##:",
+ " :o%x, ,o@@o ,@@o, ,,,.",
+ " :#@o @@% ",
+ " :@@o o#@o. ",
+ " :#@; :%@o, ",
+ " :x@; ,#@%; ",
+ " .,o#x, o%%x. ",
+ " :o;: ... "
+ ],
+ [
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##o.x::######;,%.o####%;. ",
+ " .,o%##%%%%%#####%x%%###%x;. ",
+ " .,;x%###%;ooooo;o####x;:, ",
+ " .:;o####%xxxx%###xo;, ..,. ",
+ " @#%% ,..,;;oxxxx%%%x;;:,.,. ,;%@# ",
+ " @@#o;;, ,:o%%ooxxxxxxxx;%%x..,:oox%@%; ",
+ " ,,,,::,:;x##@@@oox##@@%##%oo%@###%:::::,,,,. ",
+ " ;%@@#@@@##@@:ooo o##@@@@####.:o:@#%#@@@@@@@#x;: ",
+ " ,o#@:.......... o%@@%;.,@@##x: ............x@@%;.",
+ " @#o ,:#@@o o#@#o, ,@@;",
+ " @%:. .;%@@;, .;@@@o. ,x%%:",
+ " :oo. .%@@@ ,x@@o, ",
+ " .#@%, ,@@#% ",
+ " #@%, .;@@% ",
+ " ,o%#%; @@% ",
+ " ,;, x%x ",
+ " ;%x. ",
+ " "
+ ],
+ [
+ " ..,###%%%%%%%%%o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%x: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%%######o, ",
+ " ,o%###o.xxx######xx%.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x; ",
+ " ,;%#####%o#####xx#####%o: ",
+ " ..;ox###%x:::::ox###%o;:. ",
+ " xxo; ,::%%%########%%o::. ,ox%x ",
+ " .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@# ",
+ " ,%#xxx;.,;x##oo%%%%%%%x;%#x,,;oxx%#@o. ",
+ " :::;;;;;;;o#@@@;ox##@@%##%o;%@###o;;;;;;;;;, ",
+ " ,o%@@@%@@@@@@@@;:: o##@@@@####.,:x@@%@@@@#%@@###x. ",
+ " x#@,. .,#@@@o, #@@##; ,%@#,",
+ " @x. :o%@x:, :x@#x; .;@@:",
+ " ;xxo. .,%#@#. .#@@#:. .,,,.",
+ " ... ,o@@x: :x@@%; ",
+ " x@,. .,#@x. ",
+ " %@ ;@@; ",
+ " o#o;: .o@o ",
+ " .;;; o%#, ",
+ " ",
+ " "
+ ],
+ [
+ " .,#@#%%%%%%%%#o:,. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@@#x:. ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%%%##########%%%######o, ",
+ " ,o%###o.%xx######xo#.o#####x:. ",
+ " :o%##x.;,:######;,;,o###%x;. ",
+ " ,;%#####%o#####xx#####%o: ",
+ " ..;ox###%x:::::ox###%o;:. ",
+ " .@#%x ,::%%%########%%o:: :x%@# ",
+ " .@#o, :,,:;;oxxxxxxxo;;:,.:. .:%@# ",
+ " ,%@@#%%%.;x##oo%%%%%%%x;%#x.,;x#%#@@;. ",
+ " .:. ,:o%@@;ox##@@%##%o;x###o;xx:..,, ,:::. ",
+ " .:ooxxxxxxxxx%##@%:.o##@@@@####.x@@###%%%%@@#@@#%##; ",
+ " @@x:;x#xx%###%o%,.,#@@@o, %@@##; ;%%%xo .:##:",
+ " :x%x. :x#@x:, ,x@#%; .,,,.",
+ " ,,:%@@#. #@@#:, ",
+ " .;%#@@@x: ,o@@@#;. ",
+ " :@#;... ...,@@x ",
+ " :@%o .;;@% ",
+ " ... ;;;, ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " .%%%%%%%%%%%%;,. ",
+ " ,x@@@@@############x,. ",
+ " .:@@@@@@###########@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :x%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%###################o, ",
+ " :x%###o.oxx######xxx.o#####%:. ",
+ " :o%##o.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%x: ",
+ " . .,;o%###%o;;;;;ox####x;:, ",
+ " @#xo: .:;;%%%#%%%%%##%%o;:. ;x%@% ",
+ " .@#o,: ,.,,;;oxxxxxxxx;;:,.,. .:%@# ",
+ " :#@@xxxx,;o%%ooxx%%xxxx;%%x.;oxxx#@@o, ",
+ " .##x;:%#@oox##@@%##%oox##;:;#%o. ,,,, ",
+ " .;oooo; ;ox#@#; o##@@@@####.x@@###oooxxxx#@@@@%: ",
+ " @@x::x@@@#%@@@##,.,%#@@x: .@@@##;.. o###%x@;.....:##:",
+ " :;;;. xxo;xxo, :o%@%;, :%@#x; .:::.",
+ " .,,,o#@@,. ,@@@%,... ",
+ " .:@@@@@%: :x@@@@@;. ",
+ " :@%;,,. .,,,%@x ",
+ " :@%x. ,;@x ",
+ " ... .::, ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ;;;;;;;;;;;;,. ",
+ " .:o%@@@#########%%x;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@##############@@@#%x: ",
+ " .;x########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,:x########x:,x######;, ",
+ " :o###o.@;:######;:@.o####%;. ",
+ " .:o##%xxxx######%xxx%###x;. ",
+ " :::: .:;x%###x:xxxxx;;####%o:: :::::, ",
+ " ;%#;o# ,:ox####ooooo%###%o;,. %x::%%# ",
+ " x@%::x ....;;o%%%%%%%%o;:... o; o#@ ",
+ " :x@#x;;;;;::;xxo;oooooooo;xxo.;;;;;;ox#@x ",
+ " .::,. ,,o@@@#x.x%#%oo##@@%##%;%%#x,,:@@@@;:,.,:;:. ",
+ " ;@x#x, .:#@@% o%#@@@@###%.o@@##%::::::;#@x;x%, ",
+ " :xx:o@o;;:;ox#@o, o%@@@x;;@@##::;:@@@@@@#@@#o:..oo, ",
+ " .#xo;:::: .:#@@x. x@@#; ,,::.. ",
+ " ;;.@#%x :x@@x, ,#@#o ox#@;, ",
+ " .@####@@%. x@@@%%@@@o ",
+ " :oo;:. .:;ooo,;, ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " .,:@@@#########o;,. ",
+ " :#@@@@@############%:. ",
+ " .,o@@@##############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%########%xx%######o, ",
+ " ,o%###x.#xo######[email protected]#####x,. ",
+ " :ox##x,::;######o::,x###%x: ",
+ " ,;x%####%;#####xo#####xo; .,,,, ",
+ " .o%xx%o .;ox####%:::::o%###%o;,. ,#xx%:. ",
+ " :@@#: ;o ,,,xx%########xx;,, .x, .#@# ",
+ " ;@@%: .. :,,:;;;oooooooo;;;:,:, %@@ ",
+ " ,@%o;;;;;;;ox,;x##oo%%##%%%%;##%::;o::::::;%@#o ",
+ " ,o@@##@@x;;o%@@:ox#%@@%##%x:x##o;o@@@#@@@;:, ",
+ " .,,,x%%@@x. o##@@@#@###.o@@##%:::,:. ",
+ " :x#@@@#;o, o##@:. @@##. .o;%@@@@@#o, ",
+ " %@@:,,. o@@;. #@@#. .,,,;@@#; ",
+ " @@,,. :oo; :#@@ o@@:. ooo ,@@; ",
+ " :o%%: %@o..;@@x, .;#@%:,x#@.;ox@:. ",
+ " :x@@@@%. o#@@@@x :o; ",
+ " ,:,. .,,,. ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ::::::::::::,. ",
+ " ,:o@@@#########%xo, ",
+ " .x@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%x, ",
+ " :x#@##################@##%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;x########%;;x######o, ",
+ " :x###x.@o:######;;@.o####%;. ",
+ " .,,,. ,:x##%;;oo######xooox###%o, .,,: ",
+ " ;xo;;;: .;o%####%:%%%%%o;#####o;: %o;xo: ",
+ " ;@#: :, ,:ox####;;;;;x###%x;:. . %@@ ",
+ " o@#: ...oox#######%oo:.. %@@ ",
+ " ,x@%o, .,;:;ooo;oooooooo;ooo,;:. .,@@@ ",
+ " .#@@xoooooxxx.o%#%oo##@@%##%;%#%o,;xoooooox@@o. ",
+ " ;@@%%@#o::#@@@.o%##@@####%.o@##o;#@#x@@% ",
+ " .ooooo%##@%: o##@%oo@@##.:x@###ooo;oo, ",
+ " :%@@#%@@x.. o##@o. @@##. ..o@@@#%@@#x ",
+ " o@x, o@@%: x@@#. o%@;, ",
+ " o@;;, .%%o o@@, %@#. ,xx: . .;@%: ",
+ " .oo: :@#;..;#@@. o@@o,.,%@% .;ox%x. ",
+ " .:@###@#; ,o@@@#@x: ,,, ",
+ " ;xo:. :;o;. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@##############o:. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " :;;; ,;x##%;;;o######x;;;x###%o, ;;;, ",
+ " .;#;,,x, ,;o%#######x:o#xx#####o;: :x,,ooo ",
+ " o@%, :;ox#####%:o#####%x;:. .#@ ",
+ " o@#: ...oox#######%oo:.. x@@ ",
+ " ,:@%;. ..;::oo;;oooooooo;oo;,;:. .,@x, ",
+ " .#@@x;;;;;oox.o%#%oo##@@%%%%;%#%o,;x;;;;;;x@@; ",
+ " .o@@%%@@o::%#@@.o%##@@####%,x@#%o;@@#x@@%. ",
+ " .:;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :%#@@@#@@%,,. o##@;. @@##. .,,x@@@@%@#%%o, ",
+ " x@#, o#@%: %@@#. o#@o, ",
+ " x@::. .;x: o@@. %@#. ,xx: .@@o ",
+ " ,xo: :@,. ,%@@. %@@:. ,#% .x;;x#: ",
+ " :@@o;o@@%, .;@@#x;@@% ::: ",
+ " x###o, o%#%o, ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " oxxxxxxooooo:. ",
+ " .o%@@@@###########%o,. ",
+ " .:@@@@@@###########@@#%;, ",
+ " :o#@@################@@##%; ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.ox%######%xo.o#####%;. ",
+ " :o%##x.%::######;,%.o####%;. ",
+ " .,o%##%%%%###%%#%%%%###%x;. ",
+ " .,,: .,;x%######x.:#######x;:, :oo,. ",
+ " @%; .:;o%####%x%#####xo;,. .,x@o ",
+ " @#: ,...;;o%%%%%%%x;;:.... .:#@o ",
+ " x#@%;, .:::o%%ooxxxxxxxo;x%x.;:: ,o%@#, ",
+ " .;x@@##%#@#xxo:%#@xox##@@%##%oo%##:;x###%#####x; ",
+ " ,;;::;;xox#@#o o##@@@@####.x@##%o;;;:oo; ",
+ " ::x#@#@@@@%x#:. o###;,,@@##..,@xx@@@@#@@@%:,. ",
+ " ,#@%:o:;oo;, o##@o. @@##. .oooo:;o;;@@x ",
+ " ,@;. : o@@:. ,#@#. .o@#, ",
+ " .x%xo. o@@. %@#. .; ,o@;. ",
+ " .,. ,,. x@@. #@#. .,,, ,x%x, ",
+ " #%, .,%@@x. :%@#;. ,;@. ",
+ " ;%@%#@@%;, .,%@@#x#@o. ",
+ " .,:::, .:;;:, ",
+ " "
+ ],
+ [
+ " ............. ",
+ " .,:@@@#########xo:, ",
+ " :@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@xo######[email protected]####%o,. ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ,;x%#######%;o########xo: ",
+ " :;o%#####x:;#####%%o:, ",
+ " ,,,xx%#######%xx;,,. ",
+ "xx; ....;,:;;;;oooooooo;;;:,:,.. %%:",
+ "o@%:,,:::::;oooo:ox##oo%%##%%%%;%#%;:;o#o;::::,,:::@@:",
+ " :x@@;::::::oxxx##@@,o%#%@@%##%x:x##xxox;;::::,;@@@;,.",
+ " .,:%#@%#@@@%%@x,:, o##@@##@@##.;%o##x@@####@##o:. ",
+ " ;%@@oox:oooo. o##@;. @@##. oooo;oo;o#@@;. ",
+ " @#: o#@@:. @@@#. ..,@#:",
+ " @%, :, o@@. %@#. ;..,@x,",
+ " :xo:. o@@. %@#. ,ox%:. ",
+ " o@@. %@#. ",
+ " ,x@@. %@#,. ",
+ " %x, .:o@@x :#@%;, .:@. ",
+ " ,o##@@@:. ;%@@##%;. ",
+ " "
+ ],
+ [
+ " ;ooooooooooo,. ",
+ " .;x%@@@#########%%%;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@##############@@@#%x: ",
+ " .;%########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,;x%######%x;,o######;, ",
+ " :o%##x.@;:######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " .:;x%######x.:#######%o:, ",
+ " ,:oo#####%xx#####%o;,. ",
+ " ....;;o%%%%%%%x;;:.... ",
+ ".,. :;;,:;xxooxxxxxxxo;xxo.,:;;. ,, ",
+ "x#o ,:;.:::%%##%oo##@@%##%;x%#xxo:,xx, .%%:",
+ ":xo:x%%xxxxxo@@@#%%% o##@@@@###%.o##@@##%xxxxxxxxo;#x,",
+ " ;%@#%#@x@@@@;::, o##@o::@@##. :;::o###x%#x@##@o, ",
+ " @%, o##@; x#@#. .,@@;",
+ " x%x:. o#@x. ,o@x: .:;@%,",
+ " ,,, %@@ ,@#; ,::, ",
+ " %@@ :@@; ",
+ " %@@ ,@@; ",
+ " ;@@, :@#; ",
+ " ..%@@; ,%@x, ",
+ " ;x::x@@o, ;#@o,;x. ",
+ " .;:, ,xoo; "
+ ],
+ [
+ " ..###%%%%%%%%%o:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%ox######xx%.o#####x:. ",
+ " :o%##x.o,:######;,o.o####x;. ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;;:::ox####o;:. ",
+ " ,::%%%########%%o::. ",
+ " :,,,;;oxxxxxxxo;;:,.,. ",
+ " ,. .oxo,;o#%oo%%%%%%%x;%#x.,;xx, .o%x ",
+ " :::::::::::;#@@@;ox##@@%##%o;%@##x::::::::::::, ",
+ " ,;x@@@@@#@@@#@@@o:: o##@@@@####.,;%@@@#@@@@@@#@@#x. ",
+ " @@% o#@x, @@@#:. ,x@%,",
+ " @#o x@@. :x@%: .o@@;",
+ " ... .#@# .@@x ... ",
+ " #@% @@% ",
+ " #@x @@% ",
+ " #@x @@% ",
+ " %@% @@% ",
+ " .,##o @@x ",
+ " ,..;@o, :#@;. ",
+ " :xx; ,xx: "
+ ],
+ [
+ " .,,@@@#########o;,. ",
+ " :#@@@@@############%:. ",
+ " .,o@@@@@############@@@#x;. ",
+ " :x#@@#################@##%;. ",
+ " :x#########################%;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%xx%#########xx%######o, ",
+ " ,o%###o.#oo######xo#.o#####x,. ",
+ " :o%##x,:,;######;:;,o###%x: ",
+ " ,;x%####%o#####xx#####xo: ",
+ " .;ox####x;::::o%###%o;,. ",
+ " .,,, ,::xx%########%%;::. .,,. ",
+ " o@@%, :,,:;;;oooooooo;;::,:. ;%@@: ",
+ " .,;@@@#@@#%.;x##oo%%##%%%x;##%,:x@@@@#@@#... ",
+ " .;;;, ,::;;:,o%@@:ox#%@@%##%x:x##o;ooo;..,:,;;: ",
+ " %%%x@@%###%###%@@x, o##@@@@@###,x@@#%%%%%x@%%@####%o.",
+ " @x .o;;;ooo;x. :x@@o, x@@##; oxx%xxox, .;##:",
+ " ,. .#@#: ,o@@#x. ,,,.",
+ " ;#@: x%@@. ",
+ " ;@o. :@x: ",
+ " o@ :@@; ",
+ " o@,. ,@#; ",
+ " ;@@: :x@, ",
+ " ,o@; .o%o ",
+ " ;%%,. ",
+ " .,: "
+ ],
+ [
+ " ..###%%%%%%%%%o:. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%x;. ",
+ " ,;%#####%x#####xx#####%o: ",
+ " .,;ox###%x;::::ox####o;:. ",
+ " @#xo ,::%%%########%%o::. :x%@% ",
+ " .@#o, :,,,;;oxxxxxxxo;;:,.,. .:%@@ ",
+ " ,%@@%%%%,;x#%oo%%%%%%%x;%#x,;x%%%#@@o. ",
+ " .:::, .o%%xo;%@@;ox##@@%##%o;x##;ox%xo; .,::: ",
+ " xxx:@@#ooxxxxxx#@%: o##@@@@####.x@##%o ;ooxxx#@@##x: ",
+ " @x .##%x##%x#, ,x#@x, #@@##;:#x%@@@@@#o, .:##:",
+ " :. #@#; :x@@#x ,;;;;: .:::.",
+ " ,;#@: x#@@;, ",
+ " ##o .o@#o ",
+ " @# ;#@ ",
+ " @#, .:@@# ",
+ " x#@;. :##o. ",
+ " ,ox, ",
+ " ",
+ " "
+ ],
+ [
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o%@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;x####x,;x%######%x;,o#####%;, ",
+ " :o%##x.#::######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " :::;..:;x%###%:ooooo;o####%;:, .:::. ",
+ " @#%x: .:oo####xxxxx%###xo;,. :xx#o: ",
+ " @@x: ....;;o%%%%%%%x;;:.... ,;#@# ",
+ " o#@#;;;;::oxxooxxxxxxxo;xxo.;;;;;x#@x: ",
+ " .,,;: ..,@@#%,x##xoo##@@%##%;x%#%:x@@@#x,. ...., ",
+ " o#%o%@%;:, :;;#@#x o##@@@@###%.x@##x: ,:;x@@xo%x. ",
+ " ;x. ,:,%@@###%@;, %####o,:@@##x;o@###%%%##@#:,.,x%, ",
+ " ,xoo: #@@% o#@@%o .x%%%xx:. ",
+ " ..:x@x, .;@@@x;:. ",
+ " ,#@@@ .:##@@;. ",
+ " :@x;, ,o#@, ",
+ " ,@o;, ox#@. ",
+ " ::;; ::,, ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ............. ",
+ " .:;@@@#########xo;, ",
+ " ;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######[email protected]#####o, ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ,;o%####%:#####oo#####xo; ",
+ " ,x%x#, :;o%####:::::x###%%;:, #%x%;, ",
+ " .@@o #, .,,xxx#######%xx;,,. %;.o@# ",
+ " .@@%;:,..;::;o;;oooooooo;o;;,;,..:;o#@% ",
+ " ::, o%%@@@#.o%##oo####%%%%;%#%::x@@@@#x, ,:: ",
+ " :xx#%; ::::x#@@,o%##@@%###x,x##xo:::,, .;%%%x, ",
+ " :xo,;@@#x::x##@#o :x##@@%%@@##:o#@##%:::::x#@#:,x, ",
+ " .o;x@#x;:;. %#@@:. ;@@##:.;::;;@@@@x;: ",
+ " ;xxx.,;@@x ;@@x: x%%;..:. ",
+ " @@x::x@@, .,@@@;ox#@,o% ",
+ " o@@@@#x .;#@@#%.., ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " oooooooooooo:. ",
+ " .;%#@@@##########%%o. ",
+ " .,@@@@@@###########@@#x;, ",
+ " :o%@@@###############@@##%: ",
+ " ,o%########################x,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;x####x.;x%######%x;,o#####%;, ",
+ " :o%##o.#::######;,#.o####%;. ",
+ " .,o##%xxx%%#####%xxx%###x;. ",
+ " .;;;; .:;x%###%;ooooo;o####x;:, :;;;o: ",
+ " ;#%;;# .:;o####xxxxx%###xo;,. xx,:%#@ ",
+ " x@x,,x ,...;;o%%%%%%%x;;,.... ;: o@@ ",
+ " ;#@xo;;;;;::;xxooxxxxxxxo;xxo.;;;;;;;x##;.,. ",
+ " xo;;xo%@@@@%,x#@xoo##@@%##%;x%#%:x@@@@@#:.:;xx ",
+ " .:x#o, .:;#@#x o%#@@@@###%.x@##x: ..:o@o:: ",
+ " ;@@#%x%###@;. o##@o,,@@##..;@###%xxx%@@%. ",
+ " .oxxo%x;, ;x@@, o@@#. :o;@@@@x: ",
+ " x%x:...#@@. ,x@#o, xxx; ,@x ",
+ " #@x::o@@x: .;@@#;:x@% :o@; ",
+ " ;%@#@@%. .;%@@@% xxo, ",
+ " .:;:, ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " .,,,...,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o. ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######o;@.o####%o, ",
+ " ,;x##x:::o######o:::x###%o: ",
+ " ;xxx, ,;o%####%:#####oo#####xo: xxxx. ",
+ " ,;#;, oo :;o%####:::::x###%x;:. %:.:#x: ",
+ " x@#, .. .,,,xxx#######%xx;,,. ,. %@@ ",
+ " ;@@o:. .:,:;o;;oooooooo;o;;,:,. .%@@ ",
+ " .@@#x;;;;;;oo.o%#%oo%%##%%%%;%#%;:;x;;::;;o#@%: ",
+ " ,:x@@##@@o::x#@@,o%##@@%###x,o##xo;@@@%@@#:,. ",
+ " :::::%##@#o o##@#%%@@##.;#@##%::::::: ",
+ " ,x#@@#@@%,:. o##@; @@##. .:,%@@@@#@@%x;, ",
+ " ;@#: o#@#: #@@#. ,#@x: ",
+ " o@::, ,;x, o@@. %@#. ,xx: . @@% ",
+ " .xx; ;@,. .x@@. %@@,. ,x% x;:o#; ",
+ " ;@@o:;#@%: ,o@@x;:#@# :;; ",
+ " .x#@@%:. .x#@#x:. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########%x;, ",
+ " .x@@@@@############@#o:. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;x########%;;x######o, ",
+ " :x###x.@o:######;;@.o####%;. ",
+ " ;oo;. ,;x##%;;;o######x;;;x###%o, :oo. ",
+ " .:%o:.,;. ,;o%####%:%%%%%o;#####o;: x:,;%o, ",
+ " o@#, ,;ox####;;;;;x###%x;:. %@@ ",
+ " o@#, ...oox#######%oo:... %@@ ",
+ " ..@%;. .;::oo;;oooooooo;oo;,;:. .:@%: ",
+ " %@@xooooooox.o%#%oo##@@%%#%;%#%o,;xoooooox@#; ",
+ " ;@@%%@#;::%#@@.o%##@@####%.o@#%o:@@#x@@x. ",
+ " .;;;;;;%##@%; o##@%ox@@##.:%@##%;;;;;;: ",
+ " o%#@##@@@x.,. o##@; @@##. .,.x@@@#%@#%%o: ",
+ " #@% o@@%, %@@#. ,%@%; ",
+ " @#;:. o@@. %@#. @@# ",
+ " :oo, oxx. .x@@. %@@,. ;oo: :o:x%x ",
+ " %@o .;@@#: ,o@@x: ,x@. .::. ",
+ " .;##@@#x: .x#@@@@@: ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " xxxxxxxxxxxx:. ",
+ " .o#@@@@############o,. ",
+ " .:@@@@@@###########@@#%o, ",
+ " :o#@@################@@##%;. ",
+ " ,o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " :x%###x.;o%######%xo.o#####%;. ",
+ " .xx; :o%##x.x::######;,x.o####%;. ,xxo, ",
+ " o@%,,; ,;%##%%%%%#####%x%%###%x; :: ,x#x ",
+ " x@%, .,;x%###%;o;oo;oo####x;:, o@@. ",
+ " ;#@;. .:;;%###%%%%%%###x;;, o#@. ",
+ " .@@%, ,..,;;oxxxxxxxx;;:,.,. ,x@x. ",
+ " ,#@%;;;;oo;:::o%%ooxxxxxxxo;%%x.;;:;;;;;x%@;, ",
+ " :@@%#@@%xo:x#@oox##@@%##%oo%##:;x@@@%@@%. ",
+ " oooo#@#o o##@@@@####.x@##xoo, ",
+ " ,,;%#####@#x#:. o###;..@@##..:@x%@###%##x,,. ",
+ " .%@#;x;;ooo: o##@o @@##. :oxoo;xoo@@; ",
+ " ,@o. ,. o@@,. ,#@#. ..%@: ",
+ " .xxoo;. o@@. %@#. :: ,#@: ",
+ " ,,, .x@@. %@@. .;x%o, ",
+ " o; .,#@#; :x@#o, .o. ",
+ " %#%;x%@#;. .,#@@#:;x@, ",
+ " ,o%%; .%%%x ",
+ " "
+ ],
+ [
+ " ............. ",
+ " .:;@@@#########xo:, ",
+ " ;@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@@#################@##%;. ",
+ " ;%##########################;, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%oo%########%oo%######o, ",
+ " .;x###x.@o;######[email protected]####%o,. ",
+ " .. ,;x##x:::o######o:::x###%o: .. ",
+ " o%%o, ,;o%####%:#####oo#####xo: .;ox: ",
+ " @@: :;o%####:::::x###%x;:, .## ",
+ " x@#o,. ,,,xxx#######%xx;,,. .;%@% ",
+ " ,x@%;. :::;o;;oooooooo;o;;,:, .:#@@; ",
+ " .x@@x::::::o%,ox##oo%%##%%%%;%#%::ox;:::::o@#;. ",
+ " :%@##@@o::x%@@,o%##@@%###x,x##x;;@@@%@@x. ",
+ " .,:::::x##@#o o##@#%%@@##.o#@##%::::::, ",
+ " .;o#@@@@@@@%:;. o##@; @@##. .;:%@@@@#@@%x;, ",
+ " :#@#,.. x@@%. #@@#. .. . ,@@##,. ",
+ " x@, ., o@@: ;#@;, %@o ",
+ " ,o%xo: ,o@@x :@@;. o:.;##. ",
+ " ,o#@x, .:@@#; ;oo, ",
+ " ;:;o@@%:. ,;%@#xo ",
+ " .##%:,. .;x%##, ",
+ " ,,,: .. .. ",
+ " "
+ ],
+ [
+ " oooooooooooo:. ",
+ " .;x#@@@##########%%;. ",
+ " .,#@@@@@###########@@#x;, ",
+ " ,o%@@@###############@@##%: ",
+ " ,o%########################o,. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x,;x%######%x;,o#####%;, ",
+ " :x%##x.#::######;:#.o####%;. ",
+ " .:o##%xxx%######%xxx%###x;. ",
+ " ::: .:;x%###%:oxooo;o####%;:, .:::.",
+ " @x, .:oo####xxxxx%###%o;,. .,#@:",
+ " @@o, ,...;;o%%%%%%%x;;:..,. .:x@#:",
+ " ;#@#o, :;:::;xxooxxxxxxxo;xxo.;;;;. ;%@@o, ",
+ " .:#@#%%%%%%%##,x##xoo##@@%##%;x%#%:o##%%x%%%#@#x, ",
+ " :x%oo%x;:;#@#x o##@@@@###%.x@##x;x%x;%%o ",
+ " ,oxxxxx%##@o, o##@o::@@##.,o@###xxxxxxo. ",
+ " :%@#%##xx##%o ,%@@, %@@#. ;###%o#xx#@@%, ",
+ " ;#@;. .#@# o@@o, :;x@o, ",
+ " ##, ,, :x@@o ,@@#x, .: .;@x, ",
+ " :x%x;, .:x@@@#,. x%#@%o: ,;ox%o. ",
+ " .. ,x@@#;. .x@@#,. ... ",
+ " :@#o, ,:x@o ",
+ " :@x:, ,,:@o ",
+ " ;;: :;;. ",
+ " "
+ ],
+ [
+ " ..###%%%%%%%%%;:. ",
+ " ,x@@@@@############x,. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.xox######xox.o#####x:. ",
+ " :o%##x.o,:######;,o.o###%%; ",
+ " ,;%#####%x#####%x#####%o: ",
+ " .,;ox###%o;::::ox###%x;:. ",
+ " .:::%%%########%%o::. ",
+ "x%; ,,,,;;oxxxxxxxo;;:,.,. xx,",
+ "%@%;. ..oxx:;o%%oo%%%%%%%x;%%x.;oxx, .;#@;",
+ " x#####@@##@@xx%:%#@;ox##@@%##%o;x##.;%o@@#@@@####@#;.",
+ " .oooo;::;;.,o#@#; o##@@@@####.x@#xo, ;;:;;;oooo; ",
+ " .,;oxx#####@#%#: :x#@x, @@##,.,@x#@@##%@#%%%xo, ",
+ " ;%@@oxxx;;xxo;. ,;#@#; ,%@##; :oxo;;ooooo%@@o: ",
+ " @%:. ,o@@: :@@#x, ..;@# ",
+ " x%xo:. ,;x%@@o ,o@@@o;: ;oo#%; ",
+ " .,,. .:#@@@o:. .,o#@##;, ,,,, ",
+ " o@%, .o@# ",
+ " ;@%, .@# ",
+ " . .;;: ",
+ " ",
+ " "
+ ],
+ [
+ " .,###%%%%%%%%%o:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@############@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###o.%xx######xo%.o#####x:. ",
+ " :o%##x.;,:######;,;.o###%x;. ",
+ " ,;%#####%o#####xx#####%o: ",
+ " .,;ox###%x;::::ox###%o;:. ",
+ " .,::%%%########%%o::. ",
+ " :,,,;;oxxxxxxxo;;:,.,. ",
+ "ox: ...x%%:;x#%oo%%%%%%%x;%#x,:o%%,.. ox,",
+ "%#x,,,,::x#@@xx%:%@@;ox##@@%##%o;x##.;%o@@%:::,,,,,##:",
+ ":;;::::;;xx;:.,;%@#: o##@@@@####.x@#x: ::::;;:,,::;:.",
+ " ,x@%##%%x;,,x#@@o,,%@@@x, %@@##:,#@#%:,:;########:, ",
+ " @#o:;ooo#@@@@#o,:o%@@%: :x@#x; ;%@@@@@o;;ooooo@#,",
+ " @%o,. ..,::::%#@@x, .o@@@#:,::,,. .:o@#:",
+ " ,;;. :o@#@@@@x;: :;o@@@@#@%: :;;. ",
+ " %@x..... .....o#@ ",
+ " ;xx ;%@ ",
+ " . ... ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ..%%%xxxxxxxxx;,. ",
+ " ,x#@@@@############x,. ",
+ " .:@@@@@@###########@@#%o: ",
+ " :x#@@################@@##%;. ",
+ " :o%########################x:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%####################o, ",
+ " :x%###o.xxx######xxx.o#####%:. ",
+ " :o%##x.o,:######;,o.o####%;. ",
+ " ,;%#####%x#####%x#####%x: ",
+ " .,;o%###%o;;;;;ox####x;:. ",
+ " .:;;%%%#%%%%%##%%o;:. ",
+ " ,..,;;oxxxxxxxx;;:,.,. ",
+ " . .xxxx:;o%%ooxxxxxxxx;%%x.;o%x;, ,;:. ",
+ " x##:,;%%#@@@#%%,x#@oox##@@%##%oo%##,o#x@@#xx;,;%#@: ",
+ " ::::::ox;:::..:%@#; o##@@@@####.x@#x: ::;@x::;;;:. ",
+ " x##%#x,.....;x#@o,,%#@@x: .@@@#%;:@@#x.....,,;#%%@o:.",
+ " @#:.;%@@@#%@@#o::o%@@#; :%@#x; o#@@@@@@@#xo;:%@@:",
+ " .,::..,,:::::,,x#@@%:. ,x@@#%,,::::,,,. :oo,. ",
+ " x#@#@@@@%o: :ox@@@@#@#x ",
+ " ;o,.,,,. .,,,.,x@ ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " :::::::::::;,. ",
+ " ,;x@@@#########%xo: ",
+ " .,%@@@@@###########@@#x:. ",
+ " ,;%@@@##############@@@#%x: ",
+ " .;x#######################%o. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####x::x########%::x######o, ",
+ " :x###x.@;:######;:@.o####%;. ",
+ " .:o##%ooox######xooo%###%o, ",
+ " .:ox%###x:x%x%%o;####%o;: ",
+ " ::, ,:ox####ooooo%###%x;,. ::, ",
+ " .@#; ....oox%%%%%%#%oo:... .%@@ ",
+ " .##%o::::;:;xxo;oooooooo;xxo,;;:::;x#@% ",
+ " :x@@@@#.o%#%oo##@@%##%;%##x,x@@@@@o, ",
+ " .,. ..%@@#.o%#@@@####%.x@##;. .. ... ",
+ " o@o. ,o@x: o##@x;;@@##.:x@#x; :x##, ",
+ " ;#x, . :x@, x@@, @@##. .##%o. . ;%#; ",
+ " ,;% :;: o#@%. ;%@:. :;;.:%,. ",
+ " x#% #@%..,o@@x :@@%:.,o#@,;#%: ",
+ " ;%@@@@@o, o#@@@@@o. ",
+ " .,;::, .,::,, ",
+ " ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " .,###%%%%%%%%%;:.. ",
+ " ,%@@@@@############x:. ",
+ " ,;@@@@@@###########@@#%o: ",
+ " :x#@@#################@##%;. ",
+ " :x%########################%:. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%#####%%##########%%#######o, ",
+ " ,o%###x.%xx######xo%.o#####x:. ",
+ " :o%##x.;,:######;,;.o###%x;. ",
+ " ,;%#####%x#####%x#####%o; ",
+ " .,,,..,;ox###%x;::::ox###%o;:. .,, ",
+ " ;##xx, ,::%%%########%%o::. .xx#; ",
+ " %@#o.. :,,,;;oxxxxxxxo;;:,.,. ;x@o ",
+ " ;xo#@##,;x%%oo%%%%%%%x;%%x,;x#@@#xx. ",
+ " ;%%o. :;;;;%@@;ox##@@%##%o;x##;::;;, .xxx, ",
+ " ;#x, ;%#@%: o##@@@@####.x@###% .;%@, ",
+ " ,;:. ;%@x, o##@; @@##. ,%;%@x. .::. ",
+ " o@#, o#@@; @@##. ,:#@o. ",
+ " .;%,. ;oo. o@@, %@#.,oo;, .x%; ",
+ " ,x##: @#x .x@@. %@@,,;x@; xx%o ",
+ " @@%;@@#: ,x@@%x@@; ",
+ " ,%@@#;. ,#@@@, ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:;@@@#########xo;, ",
+ " .o@@@@@@############%;, ",
+ " .:x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;ox######o, ",
+ " .;x###x.@o;######[email protected]####%o. ",
+ " ,;x##%;;;o######o;;;x###%o: ",
+ " ,;o%####%:#####oo#####xo: ",
+ " .;%o%: :;o%####;::::x###%x;:. .xxo:. ",
+ " @@x #: .,,xxx#######%xx:,,. %o:@%; ",
+ " @@x.o, .:::;o;;oooooooo;oo;,;,. o:,%@% ",
+ " ,o;: x#@%;;ox.o%##oo##@@%%%%;%#%;,;x;;x@@%; ;;: ",
+ " :%%:x; ,,,@@%:x#@@,o%##@@%###x,x##%o;@@x,,. %oox%. ",
+ " ;; ,o#@%; o##@#%%@@##.;#@##%: ,x;. ",
+ " ;%@@:. o##@; @@##. .:,x@@o: . ",
+ " ,#@#: .: o#@#: #@@#... :@@o ",
+ " ,@@, :x% o@@. %@#.;x; ,::%x ",
+ " ,@#;. x@%.x@@. %@@,x@@ oxxx: ",
+ " ,,,. x#x#@#: ,o@@### .,. ",
+ " .;@%:. .%#%. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " .:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .. ,;o%####x:%####o;#####oo: ... ",
+ " ,;#x%@, :;o%####;::::x###%x;:. x%o%x; ",
+ " x@%,:@, .,,oox#######%oo:,,. xx ,%@, ",
+ " .o@x:,o. .:::oo;;oooooooo;oo;,;,. ,, .x@:... ",
+ " :,xoo@@%o;;ox.o%#%oo##@@%%%%;%#%;,;x;;;x@#o %%%, ",
+ " ,, ,,ox@@x:%#@@.o%##@@####%,o##%o;@@#%,. .., ",
+ " .,;;x#@%; o##@%xx@@##.;%@##%;;:, ",
+ " :o#@@@@:. o##@; @@##. .:,x@@@##o,. ",
+ " ;@@%. .,, o#@%: %@@#.., :#@#o ",
+ " @@%.. :xxx o@@. %@#.;%o. .@@o ",
+ " ;xxx, #@x,,%@@. %@@,.:@%; .%xx#: ",
+ " :@@x@@%: ,o@@#%@;. ;:: ",
+ " .;#x:. .x##. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .;xxx, ,;o%####x:%####o;#####o;: xxxx. ",
+ " ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:,,. ,. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@%: ",
+ " .,o@@%#@@;::%#@@,o%##@@####%,o##%o;@@#x@@%,.. ",
+ " .;;;;;%##@%; o##@#xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,,. o##@; @@##. .:,x@@@#%@#%%o, ",
+ " ;@%, o#@%: %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@x ",
+ " .xo: ;@, .x@@. %@@,. ,x# x;;o#; ",
+ " ;@@o;o@@%: ,o@@x;:#@% ,:: ",
+ " .x#@#x: .x#@#x:. ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ,,,,,,,,,,,,. ",
+ " ,:o@@@#########xo;, ",
+ " .o@@@@@@#############o,. ",
+ " ,;x@@@##############@@@#%o, ",
+ " :x#@##################@##%;. ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%##########################o, ",
+ " ;%####%;;%########%;;x######o, ",
+ " .;x###o.@o;######;;@.o####%o. ",
+ " ,;x##%;;;o######x;;;x###%o, ",
+ " .;xxx, ,;o%####x:%####o;#####o;: xxxx. ",
+ " ,o#;, o; :;o%####;::::x###%x;:. %:.:#x; ",
+ " o@#, .. ...oox#######%oo:,, .. %@@ ",
+ " ;@@x:. .:::oo;;oooooooo;oo;,;,. .#@@ ",
+ " .@@#x;;;;;;ox.o%#%oo##@@%%#%;%#%;,;x;;;;;;o#@x: ",
+ " .,o@@%#@@o::%#@@,o%##@@####%,o##%o;@@#x@@%,.. ",
+ " .;;;;;%##@%; o##@%xx@@##.;%@##%;;;;;;: ",
+ " :x#@@%@@x,,. o##@; @@##. .:,x@@@@%@#%%o, ",
+ " ;@%, o#@%, %@@#. ,%@x: ",
+ " o@::, .:x, o@@. %@#. .xx: @@x ",
+ " .xo: ;@, .%@@. %@@,. ,x# x;;x#; ",
+ " ;@@o;o@@%: ,o@@x;:#@# ,:: ",
+ " .x@@#x: .x#@#x:. ",
+ " ",
+ " "
+ ]
+ ],
+ "holds": [
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 40
+ ],
+ "source": "https://github.com/ferrebarrat/brrtfetch/blob/main/gifs/defaults/brrt.gif",
+ "note": "Source GIF converted before build; every second pose retained with combined original durations. No runtime image decoding."
+ },
+ {
+ "name": "Octopus / blocks",
+ "cols": 39,
+ "rows": 19,
+ "font": "block16",
+ "color": "c8a9f0",
+ "frames": [
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓█▓ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒░▒▒ ",
+ " ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░░░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒▓▓░ ",
+ " ░▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓▓▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▒█▒ ",
+ " ▒▓▒░ ░▒ ██ ▒█▒ ░▒░ ░ ▓▓░ ",
+ " ░░ ▓▓░░▒█▒ ░▓█▒░░▓▒ ░▒░ ",
+ " ░▒▓▓▒░ ░▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░░░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░░░▒▒ ",
+ " ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒▓▓░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░░ ██▓ ░██▒ ░░░░░░▒▓▒░ ",
+ " ▒▓▒░ ░░ ██ ▒█▒ ░░ ░ ░█▒ ",
+ " ░ ▒▓░ ░▒█▒ ░▓█▒ ▒▒ ░▒▒░ ",
+ " ▒▒▓▓▒░ ░▓▓▒▓░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒░░ ",
+ " ░██████████████▓▒ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ░▒▒ ▒▓██ ▓░████▓░▒▒██▓▒░ ░▒░ ",
+ " ░▓▒░ ░ ▒▓███▓▒███▓▒███▓▒░ ░░░▓▓░ ",
+ " ▒█▒ ░▒▓▓█▓▒▒▒▓██▓▒░ ▒█░ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▒▒░░░ ░█▒ ",
+ " ▒█▓▓▓▒▒▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▓▓▓▓▓░ ",
+ " ▒▒▒▒▓▓▓██▒ ▓█████▓▒▒██▓▓▓▒▒▒░░ ",
+ " ▒█▓▓▓▓▓░░░ ██▓ ░██▒ ░░▒▓▓▓▓▓▓▓░ ",
+ " █▒░░ ██▒ ░▓█▒ ░█▓ ",
+ " ▒▒ ██ ▒█▒ ▒░▒▓░ ",
+ " ░░ ░██ ▒█▓░ ░░░ ",
+ " ▓▓▒▒▓█▒ ░▓█▓▒▒▓░ ",
+ " ░░░░ ░░░ "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓█████████▓▓▓░ ",
+ " ░▒███████████████▓░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▒░ ░▓▓██░▓▓████▓▓▒▒███▓▒ ░▒░ ",
+ " ░▓▒ ░▒▓█░▒▒████▓▒▒▒██▓▒ ░░░▓▓░ ",
+ " ▓█░ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ▒█░ ",
+ " ░▓▓ ░▒▓▓▓▓▓▓▓▓▓▒░░ ░█▒ ",
+ " ░█▓░░░░░░░▒▒▒▓▒▒▒▒▒▒▒░░░░░░░▒▓▒ ",
+ " ░▒▓▓▒▒▒▓▓█▒▒▓▓█▓▓▓▒▓█▒▒▒▓▓▓▒ ",
+ " ▒▓▓▓▓▓█▓▓▓░░ ▓██▓▓█▓▒░▓▓▓▓█▓▓▓▓▓▒ ",
+ " ░█▓░░░░░░ ▓██ ░█▓▒ ░░░░░░▒█▒ ",
+ " ▒▒░ ██░ ▒█▒ ░ ▒█░",
+ " ██ ▒█▒ ▒▒░ ",
+ " ██ ▒█▒ ",
+ " ▓░ ░▒▓▓░ ▒▓▓▒ ▒░ ",
+ " ▒▓▓▓░ ░▓▓▒░ "
+ ],
+ [
+ " ▓▓▒▒▒▒▒▒▒░ ",
+ " ▒████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ░▒▒░ ░▒▓█▓ ▓▒████▓▒▒▒██▓▓░ ░▒░ ",
+ " ▓█░ ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ ▒█▒ ",
+ " ▒█▒ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ▓█░ ",
+ " ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▓█░ ",
+ " ▓█▓▓▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░░▒▒▒▓▓▓░ ",
+ " ░░░▒▒▒▒▒▓▓██░▓███▓█▓▒▒█▓▓▒▒▒▒▒░░░ ",
+ " ░▓▓▓▓▓▓▓▓░▒░ ▓██▒▓█▓▒ ░▒░▓▓▓▒▓▓█▓░ ",
+ " ▒▓░ ██▓ ░██▒ ░█▓",
+ " ██ ▒█▒ ░▒▒░",
+ " ██ ▒█▒ ",
+ " ██ ▒█▒ ",
+ " ░ ▒█▒ ░▓█░ ░░ ",
+ " ░▒▒▓█▓ ░▓█▓▒▓░ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ░░░ ▒▓██ ▓░████▓▒▒▒██▓▓░ ░ ",
+ " ▒▓░ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░▓░ ",
+ " ▒█▒ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░▒▓░ ",
+ " ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ ",
+ " ▒▓▒▒▒▒▒▒▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▒▒▓▒ ",
+ " ░░▒▓▓▓▓▓▓▓▓█▓▓░▓█████▓▒▒▓█▓▓▓▓▓▓▓▓▒░ ",
+ " ▒▓░░░░░░░░░░ ███░▒██▒ ░░░░░░░░░▒▓█▒",
+ " ░█▓░ ▒▓▓░ ░▒▒",
+ " ██ ▒█▒ ",
+ " ██ ▒█▒ ",
+ " ██ ░█▒ ",
+ " ░█▓ ░▓▓░ ",
+ " ▒▒▒█ ░▓▓▓░ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ░▒░ ▒▓██ ▓░████▓░▒▒██▓▓░ ░░ ",
+ " ▒▓░ ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ ▓░ ",
+ " ▒█▒ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░▓▓░ ",
+ " ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ ",
+ " ▒▒▒▒▒▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▒▒▓░ ",
+ " ░▒▓███▓██▓██▒▓░▓█████▓▒░▓██▓██▓█▓█▓▒░ ",
+ " ▒▓░ ░░ ░░ ███ ▒██▒ ░ ░ ▒█▓",
+ " ▓█▓ ░▓█▒ ░░",
+ " ██ ░█▒ ",
+ " ██ ░█▒ ",
+ " ██ ░█▒ ",
+ " ░█▒ ░▓▓░ ",
+ " ░▒▒█ ░▓▓▓▒ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ▒▓██ ▓░████▓░▒▒██▓▓░ ",
+ " ░░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░░ ",
+ " ▓▓░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░█▒",
+ " ▒█▓▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒▓▓░",
+ " ▒▓▒▒▒▒▒▒▒░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▒▒▒▒▒▓▓▓░ ",
+ " ░▓▓▒▒▒▓▓▓░▓█▓░▓█████▓▒▒█▓▒▒▓▒▒▒▒▒▓▒▒ ",
+ " ░░ ▒██▓█▓█▓░ ░██▒ ░██▓░▒▓▓█▓▓▓█▓░ ▒▒ ",
+ " ░░░░░ ▒█▓ ░▓█▒ ░░░░░ ",
+ " █░ ▓█▒ ",
+ " █░ ▒█▒ ",
+ " █ ▒█▒ ",
+ " ▓█ ░█▒ ",
+ " ▒▒ ░▒░ "
+ ],
+ [
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ",
+ " ▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░",
+ " ▓▓░░░░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░░░░░█▓",
+ " ░▒▒▓█▓▓▓▒░▒█▓░▓█████▓▒▒█▓░▒█▓▓███▓▒░ ",
+ " ░ ░█▓░▓██▓░▒██▓▒▓█▓░ ▒▓░ ",
+ " ▒▓▒░░▒▓▒▒██▓░ ▒██▓▒▓▓▒░▒▓▒ ",
+ " ░░░░░ ░█▒░ ░▓█▒ ░░░░ ",
+ " ▓█ ▓▓ ",
+ " ▒█░ ░█▒ ",
+ " ▒▒ ░▒░ ",
+ " "
+ ],
+ [
+ " ▒▒▒▒▒▒▒▒▒░ ",
+ " ░████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▒▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ░▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▒▒▒▓███▓▒▒▓██▓░ ",
+ " ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ ",
+ " ░░▓▓▓▓▓▓▓▓▓▒░░ ",
+ "░▓▒ ▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░ ▒▒",
+ " ▒▓▒▒▒▒▓██▒▒▒▓█▒▓███▓█▓▒▒█▒▒▒▓█▓▒▒▒▒▒█▒",
+ " ░░░▒▒░ ░█▓ ▒███▒▓██▓▒▓█▒░ ░▒▒▒▒▒ ",
+ " ▒▒▓██▓▒ ░▓██▓▒▒▒░ ",
+ " ░ ▓█▓░ ░▒▓██▓░ ",
+ " ░▓█░▓█░ ▓█░▒░ ",
+ " ▒▓▓ ▒▓▓░ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒░░ ",
+ " ░██████████████▓▒ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ▒▓██ ▓░████▓░▒▒██▓▒░ ",
+ " ▒▓███▓▒███▓▓███▓▒░ ",
+ " ░▒▓▓█▓▒▒▒▓██▓▒░ ",
+ " ░░░▒▒▓▓▓▓▓▒▒▒░░░ ",
+ " ▒░ ░▒▒▓█░▓█▓▒▓▓█▓▓▓▒▓▓░▓█▓▒░ ▒▒",
+ " ▒▓▓▒▓██▓▒ ▓█▓ ▓█████▓▒▒█▓▓░▒▒▓█▓▒▒▒▓▒",
+ " ░░ ▒▓░▒███░ ░▓██▒▒▓▓▒ ░░░░ ",
+ " ░▒▓█▓█░ ░▓██▓▒▒░ ",
+ " ▒█▒▒ ░▒▓█▓░ ",
+ " ░ ░▒▒ ░▒▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ",
+ " ░░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░ ",
+ " ▒▓▓▓░░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░░▓▓█░ ",
+ " ░░▓█▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓█▒░░ ",
+ " ░▒▓▓█▓▓░ ░██▓░▒██▒░▒▓▓▓▓▓▓▒ ",
+ " ▒█▒░▒░░ ░██▒ ▒█▓░ ░▒▒░░██░ ",
+ " ▒▓▒░▒█▒▓█▓░ ░▓█▒▒▓▒░░▓█░ ",
+ " ░░░ ▓▓▓░ ░▒▓▓░▒▒▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ",
+ " ▒▓▒░ ░░▒▒▓▓▓▓▓▓▒▒░░ ░▒▓░ ",
+ " ░▓█▓▓▒▒▒▒▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▒▒▓█▓░ ",
+ " ░░░░░▓▒▒▓██░▓███▓█▓▒▒█▓▒▓▒▒░░░░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓▓▓▓▓▓░ ",
+ " ▓█▒░░░ ██▒ ░██▒ ░░░░░▓█▒ ",
+ " ▒▓▒░ ▓▓▒ ░▓█░ ░██▒ ░▒▒░ ░░█▓░ ",
+ " ░░ ▓█▓▓█░ ▒██▓▓▓░ ▒▒▒ ",
+ " ░░░ ░░░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░░░ ",
+ " ▒█▒▓░ ░▒▓████░▓███▓▓▒░ ▒▒▓█░ ",
+ " ▓█▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█░ ",
+ " ░▒█████░▒▓▓▒▓▓▓▓▓▓▒▓▒░▓████▓▒░ ",
+ " ▒▒▒▓█▓░▓█████▓▒▒█▓▓▒░ ",
+ " ░▓██▓██▒▒▒░ ███░▒██▒ ▒▒▒███▓█▓▓▒ ",
+ " ▓█░ ██▓ ░██▒ ░█▓ ",
+ " ░▒▒░ ░░ ██ ▒█▒ ░ ░░░█▒ ",
+ " ▓▒ ░▓█▒ ░▓█▒ ░▒▓░ ░░ ",
+ " ▒▓▒▓▓▒░ ░▓▓▓█▓░ ",
+ " ░░ "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒▒░ ",
+ " ░██████████████▓▒ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▒▒▓█████▓▒▓████▒░ ",
+ " ░▒ ▒▓██ ▓░████▓░▒▒██▓▒░░▒░ ",
+ " ▓▓▒░ ▒▓▓█████▒▓█████▓▒░ ░▒█▒ ",
+ " ▓█░ ░▒▓▓▓██▒▓███▓▒░ ░█▒ ",
+ " ▒█▓▒▒▒░░░▒▒▓▓▓▓▓▒▒░░░▒▒▒▒▓▓░ ",
+ " ▓▓▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒░ ",
+ " ░▒▒▒▒▒▓▓█▓▒▒ ▓█████▓▒▒███▓▓▒▒▒▒░░ ",
+ " ░▓▓▒▒▒▒▒▒ ▓██ ░██▒ ░▒▒▒▒▒▒▓▓▒ ",
+ " ░▒▒░ ██▒ ░▓█▒ ▒█░",
+ " ██ ▒█▒ ░▒▒░ ",
+ " ░ ░██ ▒█▓ ░ ",
+ " ▓▓▒▒▓█▒ ░▓█▒░░▓▒ ",
+ " ░░░░ ░▒▒░ "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ▒▓████████▓▓▒░ ",
+ " ▒███████████████▓░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓▓██░▓▓████▓▓▒▒███▓▒ ",
+ " ░▓░░▓▓█░▒░████▓▒▒▒██▓▒░▒▒░ ",
+ " ▓█░ ░▒▓█████░▒████▓▓▒░ ▒█▒ ",
+ " ▓█░ ░░▒▓▓██▓▓█▓▓▓▒░ ▒█▒ ",
+ " ░▓▓▓▓▓░░▒▒▒▓▓▓▓▓▒▒▒░░▒▓▓▓▓▒ ",
+ " ░▒▒▒▓▓█▒▒▓██▓▓▓▒▓▓▒▒▒▒░ ",
+ " ░▓▓▓▓▓▓█▓▓▓░░ ▓███▓█▓▒░▓▓▓▓▓▓▓▓▓▓▒░ ",
+ " ▒▓▒░░░░░░ ▓██ ░█▓▒ ░░░░░░░▓█▓░",
+ " ░░░ ██░ ▒█▒ ░░▒█░",
+ " ██ ▒█▒ ░░ ",
+ " ░ ░██ ▒█▓ ",
+ " ▓▓▒▒▓█▒░ ▒█▓▒ ▒░ ",
+ " ░░░░ ░▓▓▓▒ "
+ ],
+ [
+ " ▒▒▒▒▒▒▒▒░░ ",
+ " ░████████████▓▒ ",
+ " ░▒███████████████▓▒ ",
+ " ░▒▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▒░░▒▓██ ▓▒████▓▓▒▒███▓▒ ░░ ",
+ " ▓█░ ░▒▓█▒▒▒████▓▒▒▓██▓▒ ░█▒ ",
+ " ▓█░ ░▒▓█████░▒████▓▒░ ▓▒ ",
+ " ▓█▒ ░░▓▓██▓██▓▓▒░░ ░█▒ ",
+ " ░▒█▓▒▒▒░░▓▓▒▒▒▒▒▒▒▒▓▒░░▒▓▓█▓░ ",
+ " ░ ░▒▒░▓▓█▒▒███▓█▓▒▒▓▓░░░░ ",
+ " ░▓▓▓▓▒░░▒▓██▓ ███▓▓██▒ ▒██▓▓▓▓▓▓▒▓▒ ",
+ " ░░ ▒▒▓▓░░ ▓██ ▒█▓░ ░░▒▒▒░░░░▒█░",
+ " ██ ▒█▒ ░▒░ ",
+ " ██ ▒█▒ ",
+ " ██ ▒█▒ ",
+ " ▓░░▒▓▓░ ░▓▓░ ",
+ " ▒▒░ ░▒▒▒ "
+ ],
+ [
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒███▓░ ",
+ " ▓▓░ ░▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▓▓░ ",
+ " ░█▒ ░▒▓████░▒███▓▓▒░ ▓█▒ ",
+ " ░█▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ░██░ ",
+ " ░▓█▓▓▓▓▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▓▓▓▓█▒ ",
+ " ░░░░░░▒▒▒▓██░▓███▓█▓▒▒█▓▒▒▒░░░ ",
+ " ▒▒▓▒░▒▓▓▓▒ ███▒▒██▓▒▓▓▓█▓▓▓██▓▓▓▒ ",
+ " ░▓▓▒░ ██▓ ░▒█▓░ ░░░░ ░ ▒█▓",
+ " ██ ▓█░ ░░░",
+ " ██ ▒█▒ ",
+ " ░██ ▒█░ ",
+ " ▒▒▒▓█▓░ ░█▓░ ",
+ " ░░░ "
+ ],
+ [
+ " ░░▓▓▓▓▓▓▓▓▓▒░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▓▓ ",
+ " ▓█▒ ░▒▓████░▒███▓▓▒░ ░▒▓▓ ",
+ " ▒█▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒▓▓░ ",
+ " ░▒██▓▓▓▒▒▒▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▓▓▓▓█▓▒ ",
+ " ░░░░▒▓███▓░▓█████▓▒▒█▓▒▒░░▒▒░░░░ ",
+ " ░▒▓▓▒░ ███░▒██▓▒▒▓▓▓▓▓█▓▓▓▓▓▓░",
+ " ▒█▒ ██▓ ▒██▒░░░░░░ ░▒▒",
+ " ▓█▒ ██ ▒▓█▒░ ",
+ " ▒▓▒░ ░██ ░▓█▒ ",
+ " ░ ░██ ▒▓▓░ ",
+ " ▒▒▒▓▒ ",
+ " "
+ ],
+ [
+ " ░▒██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▓░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓██▒▓▓▓▓▓█▓▒░ ",
+ " ░░ ░▒▓████▒▓███▓▒▒░ ▓▒",
+ " █▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒",
+ " ▒█▓▒▒▒▓██▒▒▒▓▓▓▒▓▓█▓▓▓▒▓▓░▓█████▓██▓░ ",
+ " ░▒▒▒▒▓██▓▓ ▓█████▓▒▒█▓▓░ ░▒▒▒▒▒░ ",
+ " ░▓█▓▓░ ███ ░▓█▓▒▒▒▓███▓▒▓▒▓▓█▒",
+ " ▒▓▒ ░██ ░▓█▓░ ░▒▒",
+ " ░▓▒░ ▒██ ░▓██▒ ",
+ " ░░ ██ ░▓▓ ",
+ " ▓█▓ ░▒▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ░▒████████▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓░▒▒██▓▒░ ",
+ " ▒▓█▓▓▓▒███▓▒▓██▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▒░░ ",
+ " ░░░▒▒▓▓▓▓▓▒▒░░░ ░░",
+ " ▓▓░░▒█▒▒▒▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓░░▓████▓░▒▓█▓",
+ " ░░░▒▓▒▓███▓█▒▓ ▓█████▓▒▒█▓▓▓▒▒▒▒▒▒▒░░ ",
+ " ▓▓▒░░ ██▒ ░██▒ ░▒▒▓▓▒▒▓▒▒▒▓▒ ",
+ " ▒▒░ ▓█▒ ░▓█▒ ▒▒ ",
+ " ██ ▒▓█▓▒░ ",
+ " ░▒█▓ ░▓▒ ",
+ " ▒▒▒ ",
+ " ",
+ " "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▓▒░ ",
+ " ░░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░░ ",
+ " ░▒▒▓█▓█▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▒░░▓█▓▓█▓▓▓░ ",
+ " ░▒▓██▓▓▒▒▓▓█▒▓░▓█████▓▒▒██▓▓▒▒▒▒▒░ ",
+ " ▓▒░░░░▓▒▓▓░░ ██▒░▒██▒ ░░▒▓▓▓▓▓▓▓▓▒░ ",
+ " ░█▓ ░▓█▒ ░█▒ ",
+ " ██ ▒█▓░░░░░ ",
+ " ▒▓▒ ▒▓▓▓▓░ ",
+ " █▓▓ ",
+ " ",
+ " "
+ ],
+ [
+ " ▒▒▒▒▒▒▒▒▒░ ",
+ " ░████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ░▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ ",
+ " ░▒▓▓█▓▒▒▒▒▒▓█▓▓▒░ ",
+ " ░░ ░░▓▓▓▓▓▓▓▓▓▒░░ ░░ ",
+ " ▒██▓▒▒▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▒▒▒▒▓█▓░ ",
+ " ░░▒▒▒▒▒▒▒▒█▓█░▓███▓█▓▒▒█▓▒▒▒▒▒▒░ ",
+ " ▒▓░▒▒▒█▓██▒▒ ███▒▓█▓▒░▒▒▓██▓████▓░ ",
+ " ░░ ░██ ░██▒ ▒█░ ",
+ " ░█▓ ▒█▓ ░ ░░░ ",
+ " ░▓▓░ ░▒▓▓▒▓█▒ ",
+ " █▓▒ ░▒▒░ ",
+ " ░░░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒▒░ ",
+ " ░██████████████▓▒░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒▓█████▓▒▒████▒░ ",
+ " ░▓██░▓░████▓░▒▒██▓▒░ ",
+ " ░▓▓██▓▒▓▓▓▓▒███▓▒░ ",
+ " ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ░▒░ ",
+ " ▒█▓░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▒█▒ ",
+ " ▒▓▓▓▓▓▓▓▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▓▓▓▓▓▓▓▒░ ",
+ " ░▒▓▓▒░▒▒░▒▓█▓ ▓█████▓▒▒██▓▒▒▒▒▒░ ",
+ " ▒█▒▒▓█████▓ ███ ░██▒ ░░▒▓▓▓▓▓▓▓▒ ",
+ " ░ ██ ░▓█▒ ░░▒█▓ ",
+ " ░░ ░██▒ ▒█▓░ ░▒▒ ░▒▒▒ ",
+ " ██▓█▒ ░▒█▓▓█▓ ",
+ " ▒▒ ░░░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ ",
+ " ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ ",
+ " ░▓▓▓▓░ ░▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓█▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ ",
+ " ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ ",
+ " ░▓▓▓▓░ ░▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒█▓▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ ",
+ " ░ █▓░░▒█▒ ░▓█▒░░▓▒ ░▒░ ",
+ " ░▒▓▓▓░ ░▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░▒▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒▒ ",
+ " ▒█▒ ░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░ ▒█░ ",
+ " ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█░ ",
+ " ▒█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▒ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░░ ██▓ ░██▒ ░░░░░░▒█▒░ ",
+ " ▒▓▒░ ░░ ██ ▒█▒ ░░ ░ ▓█░ ",
+ " ░ ▓▒ ░▒█▒ ░▓█▒ ░▓░ ░▒▒░ ",
+ " ▒▓▒▓▓▓░ ░▓▓▒▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ░░░ ▒▓██ ▓░████▓▒▒▒██▓▓░ ░░ ",
+ " ░▒▒░░▒ ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ░░░▒▒ ",
+ " ▒█▒ ░▒▓██▓▒▒▒▒▓█▓▓▒░ ▒█▒ ",
+ " ▓▓░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓▓░ ",
+ " ░▓█▓▒▒▒▒▒░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▒▒▒▒▒▓▒░ ",
+ " ░▒▒▓▓▒▒▓█▓░▓█████▓▒▒█▓▓▒▓▒▒▒░ ",
+ " ░▒██▓███▒▒ ███░▒██▒ ░▒▒███▓██▒▒ ",
+ " ▒▓░ ██▒ ░██▒ ░█▓░ ",
+ " ░▓▒░ ██ ▒█▒ ░░░▓▓░ ",
+ " ▒░ ░██ ░█▓░ ░▒░ ░▒░ ",
+ " ▓▓▒▓██▒ ░▒█▓▒▓▓░ ",
+ " ░░░░ ░░ "
+ ],
+ [
+ " ",
+ " ░▒████████▓▓▒░ ",
+ " ░██████████████▓▒░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒▓████▓▓▒▒███▓▒░ ",
+ " ▒▒░ ░▓██░▓░████▓░▒▒██▓▒░ ▒▒░ ",
+ " ▓▓░ ░▒▓██▓▒▓▓▓▓▒███▓▒░ ░█░ ",
+ " ░▓▓░ ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ▒▓▒ ",
+ " ░▓█▒░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▓█░ ",
+ " ░▓███▒▒▒▓█▓▒▓▓█▓▓▓▒▓▓▒░▓████▒░ ",
+ " ░▒▒▒▒▓██▒▒ ▓█████▓▒▒███▓▒▒▒▒▒░ ",
+ " ░▓▓▒▒▒▒▒░ ███ ░██▒ ░▒▒▒▒▒▒▓▓░ ",
+ " ░█▓░░ ██▒ ░▓█▒ ██░",
+ " ░░░░ ██ ▒█▒ ░▒▒▒░ ",
+ " ░ ██ ░█▓░ ",
+ " ▓▒░░▒█▓░ ░▒█▓▒▒▓▒ ",
+ " ░░░░░ ░▒░░ "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓█████████▓▓▓░ ",
+ " ░▒███████████████▓░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓▓██░▓▓████▓▓▒▒███▓▒ ",
+ " ░▓▓█░▒▒████▓▒▒▒██▓▒ ",
+ " ▒▓▒ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ░░ ",
+ " ▒█▒░ ░▒▓▓▓▓▓▓▓▓▓▒░░ ░▓█ ",
+ " ░▒▓▒░░░░░ ░░▒▒▒▓▓▓▓▓▒▒▒░░░░░░░░▒▓██░ ",
+ " ░▒▒▒▒▒▒▓▓██▒▒▓██▓▓▓▒▓█▓▓▓▒▒▒▒▒▒░ ",
+ " ░▓████▓▓▓░░░ ▓██▓▓█▓▒░░▒▓▓▓██▓█▓▓░ ",
+ " ░▓▓░ ██▓ ░██▒ ░▒▓▒",
+ " ▒▓░░ ▓█░ ░▓█░ ░▒▓▒",
+ " ░░ ▓█ ░█▓░ ░ ",
+ " ▓█ ░█▓░ ",
+ " ░░ ░█▒ ▒█▓░ ",
+ " ▒▒▓▓░ ░▒░ "
+ ],
+ [
+ " ▒▒▒▒▒▒▒▒▒░ ",
+ " ░████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓███████▓▓████▒░ ",
+ " ░▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▒▒▒▓███▓▒▒▓██▓░ ",
+ " ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ ",
+ " ▒█░ ░░▓▓▓▓▓▓▓▓▓▒░░ ",
+ " ░▒▓▓░░░▒▒░ ░▒▓▓▒▓▓▓▓▓▒▒▓▒░░░▒░░░▒▓█░ ",
+ " ░▒▒▒▒▒▒▒▓▓██▒▓███▓█▓▒▓███▓▒▒▒▒▒▒░ ",
+ " ░▓▓▒▒▒▓▒░▒ ███▒▓██▒ ░▒░▒▒▓▒▒▒▓█▒ ",
+ " ▒▓░ ░██▒ ░▓█▓ ░█▓",
+ " ░▓▒░ ▒█▓ ░█▓ ░▒░",
+ " ██ ▒█▒ ",
+ " ██ ▒█▒ ",
+ " ▓█ ▒█▓░ ",
+ " ░▒▓░ ▒▒░ "
+ ],
+ [
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ",
+ " ▒▓▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█░ ",
+ " ▒▓▒░▒░░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒▒▒▓▒░ ",
+ " ▒▓▓▓▓▓▓█▓▓▓░▓█████▓▒▒▓▓█▓▓▓▓▓▓▓▒░ ",
+ " ░▒▓▒░░░░░░░ ▒██▓░▒██▓░ ░░░░░░░░░▓▓▓░",
+ " ▓▓░ ░▓█▓░ ░▒█▓▒ ░▓▓",
+ " ▒▒░ ▒██░ ░▓█▓░ ░ ",
+ " ▓█░ ▒██▒ ",
+ " ▒█▓▒ ▒█▒ ",
+ " ░▒ ░▓░ ",
+ " ░▒░ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▒░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ ",
+ " ░░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░░ ",
+ " ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ ",
+ " ▒▒▒▒░▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▓░ ",
+ " ░▓████████▓▓ ▓█████▓▒░▓██████▓██▓▒ ",
+ " ▒▓▒░░ ░▓██▒ ░▓█▓▒ ▒█▒",
+ " ▒▓░ ░▓█▓░ ░▓█▓░ ░▓▒",
+ " ░░░ ░▓█▓░ ░██▒░ ",
+ " █▒ ░▓█▒ ",
+ " █▒░ ▒█░ ",
+ " ░▒░ ░▓▒ ",
+ " "
+ ],
+ [
+ " ░▒██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▒███▓▒▓▓█▓▒░ ",
+ " ░▒░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░▒░ ",
+ " ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ ",
+ " ▒▓▓▒▒░▓▓▓▒▓▓█▓▓▓▒▓▓▒▒▓█▓▓░ ",
+ " ░░░░░░░░░▓▓█▓ ▓█████▓▒▒██▓▓▒▒▓▓▓▓▓▓▒ ",
+ " ▒█▒▒▓▓▒▓▓▓▒▓░░▓██▒ ░▓█▓▒ ▒▓▓▒░░ ░ ▒▓▓",
+ " ░▒░ ░▓█▓░ ░▓█▓░ ",
+ " ░▒▓██▓ ░▓█▓▒░ ",
+ " ▓█░ ▒█▒ ",
+ " ░▒░ ▒▓░ ",
+ " ",
+ " "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░░░░ ░▒▓██▓▒▒▒▒▓█▓▓▒░ ░░░░ ",
+ " ▓█▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█▒ ",
+ " ░▒▓▓█▓░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▓▓▓▓▒ ",
+ " ░░░░ ░▒▒▓█▓░▓█████▓▒▒██▓▒▒▒░░▒▓▓▓▒ ",
+ " ▒█▒▒▓▓█▓███▓░░▓██▒░░██▓▒░░▒▓▓▓▓▒░░░▒▓▓",
+ " ░░ ░░░░░ ▓█▓░ ▒██▒░ ░ ",
+ " ░▓▓██▓░ ▒███▓▒ ",
+ " ▓▓░░ ░░░█▒ ",
+ " ░▒░ ▒▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ░▓▓▒▒▒▒▒▒▒░ ",
+ " ▒████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ░▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ ",
+ " ░▒▒▒░ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒▒░ ",
+ " ▓█░▒░ ░░▒▓▓▓▓▓▓▓▒▒░░ ▒░ ▒█░ ",
+ " ░▓▓▓▓▓▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▓▓▓▓▓░ ",
+ " ▒▓▓░ ░▒▒▒▒██░▓███▓█▓▒▒█▓▒▒▒▒░ ▒▓▓▓▒ ",
+ " ░▒▒▓▓▒▒░▒▓█▒ ▒███▒▒██▓▒▒▓██████▓▒ ▒▒ ",
+ " ░▒░▒▒▒ ░▒█▓░ ░▓█▓░░▒▒░ ",
+ " ░ ▓█▓▓██░ ▒██▓▓██░ ",
+ " ░▒░░ ░▒▒░░░ ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓▓████████▓▓▒░ ",
+ " ▒███████████████▓░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓▓██░▓▓████▓▓▒▒███▓▒ ",
+ " ░▓▓█░▒░████▓▒▒▒██▓▒ ",
+ " ░░░░ ░▒▓██▓▒▓▓▓▒▒██▓▓▒░ ▒▒▒░ ",
+ " ░█▓░░▒░ ░▒▓▓▓▓▓▓▓▓▓▒░░ ▒░░▓▓░ ",
+ " ▒█▓░ ░░░▒▒▒▓▓▓▓▓▒▒▒░░░ ▓█░ ",
+ " ░▒▓████▓▒░▓█▒▒▓██▓▓▓▒▓▓▒▒▓█▓▓█▓▓▒ ",
+ " ░░▒▓▓█▓░ ▓██▓▓█▓▒░██▓▒▒▒▒░ ",
+ " ░▓█▓▓░░ ██▓ ░██▒ ░▒▓▓██▓░ ",
+ " ▒█░ ▒▒░ ░██ ░█▓ ░▒░ ██░ ",
+ " ░▒▒░ █▓░▒█▒ ░▓█▒▒█▓░▓▓░ ",
+ " ░▓▓▓░ ░▓▓▒ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▓▒░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒░ ",
+ " ░▓▒ ░░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ░░ ▓▓░ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ▒█▓▒░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒▒░░░░▒█▓░ ",
+ " ░▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓██▓▓░ ███░▒██▒ ▒▓▓██▓▓▓░ ",
+ " ▓█▒░░░ ██▓ ░██▒ ░░░░▓█▒ ",
+ " ▒▓▒░ ░▓▓ ██ ▒█▓ ░▒▒ ░ ░█▓░ ",
+ " ░ ▒█▒▒██░ ▒█▓▒▓█░ ░▒░ ",
+ " ▒▒░ ▒▒░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░▒▒░ ▒▓█▓▓▓██▓▓▓▓▓▓█▓▓░ ░▒▒░ ",
+ " ▒█▒ ░ ░▒▓████░▒▓▓█▓▓▒░ ░ █▒ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒█░ ",
+ " ▒█▓░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▒ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ▒▓▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▓░░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒▒ ░ █▓ ",
+ " ░ █▓░░▓█▒ ░▓█▒░▒█▒ ░▒▒░ ",
+ " ▒▓▓▒ ░▓▓▒░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒▒░ ",
+ " ░██████████████▓▒░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒▓█████▓▒▓███▓▒░ ",
+ " ░▓██░▓░████▓░▒▒██▓▒░ ",
+ " ░▓▓█████▒▓█████▓▒░ ░ ",
+ " ▒▓░ ░▒▒▓▓██▒▓██▓▓▒░ ░▒▓░",
+ " ▓█▒ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ░▓█░",
+ " ▒▓█▒▒▒▒▒▒▒░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▒▒▒▒▒▓█▓▒ ",
+ " ▒▓▒▒▒▒▒██▒ ▓█████▓▒▒██▓▒▓▒▒▓▒ ",
+ " ░▓▓█▓███░▒ ███ ░██▒ ░▒▒███▓█▓▓▒░ ",
+ " ▓▓░░ ██▒ ░▓█▒ ░▓▓░ ",
+ " ░▒▒░ ██ ▒█▒ ░░░▓▓ ",
+ " ▓░ ▒██ ░█▓░ ░▒░ ░░░ ",
+ " ▒▓▓▓█▓░ ░▒▓█▓▓▓░ ",
+ " "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓██████████▓▓▒ ",
+ " ░▒███████████████▓░ ",
+ " ░▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓▓██░▓▒████▓▓▒▒███▓▒ ",
+ " ░▒▓█▒▒▒████▓▒▒▒██▓▒ ",
+ " ░▒▓█████░▒████▓▓▒░ ",
+ " ░░▓▓██▓▓█▓▓▒░░ ",
+ "░▓▒ ░░░░░▒▒▒▓▒▒▒▒▒▒▒░░░░░ ▓▓",
+ " ▒▓█▒▒▒▒▒▒▒▒▓▓█▒▒███▓▓▓▒▓▓▒▒▒▓▒▒▒░▒▓█▓▒",
+ " ░▒▓▓▓▓██▓▓▓░▒ ▓██▓▓██▒░▓▓▓▓█▓▓▓▓▓▓░ ",
+ " ▒█▓░░░░░░ ███ ░██▒ ░░░░░░▒▓▓░",
+ " ▓▓ ░░ ██ ▒█▒ ░ ░█▒",
+ " ░▒░ ██ ▒█▒ ░▒▒░ ",
+ " ░██ ▒█▒ ",
+ " ▓▒ ░▓█▓░ ▒▓▓▒░░▓░ ",
+ " ▒▓▓▒ ░▒▓▒░ "
+ ],
+ [
+ " ░▓▓▒▒▒▒▒▒▒░░ ",
+ " ▒████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▓▒▓██▓▓▓▒▒▓█▓▓░ ",
+ " ░░▒▓████░▒███▓▓▒░ ",
+ " ░░▒▒▓▓▓▓▓▓▒▒░░ ",
+ " ▒░ ░▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░░ ░░",
+ "░▓▒░▒▒▒▒▒▒▓▓███░▓███▓█▓▒▒██▓▒▒▒▒░░░░░█▓",
+ " ░▓█▓▓▓▓▓▓▒▒░ ███▒▒██▒ ▒▒▒▓▓▓▓▓▓▓█▒░",
+ " ▓▓░ ░██▒ ▒█▓░ █▓",
+ " ░▒░ ▓█ ▒█▒ ░▒░ ",
+ " ▓█ ▒█▒ ",
+ " ▓█░ ▒█▒ ",
+ " ░▓█░ ░█▓░ ",
+ " ▒▒▒▓▒ ░▓▓▓▒ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▒▒░ ",
+ " ░░░▒▒▓▓▓▓▓▓▒▒░░ ",
+ " ▒▒▒▒▓▓▒▓▓█▓▓▓▒▓▓▒▒▒░ ▒▒ ",
+ " ░▒▓▓█▓██▓██▓▓░▓█████▓▒▒▓██▓██▓█▓▓▓▒ ",
+ " ▒█▒░░░░░░ ░░ ██▒░░██▓░ ░░░░░░░░░░▒█▒",
+ " ▒▒░ ▒█▓ ▒▓▓░ ▒▓▒",
+ " ██ ▒█▒ ",
+ " ██ ▒█▒ ",
+ " ▓█ ▒█▒ ",
+ " ░█▓ ▒█▒ ",
+ " ░▒▒▓░ ░▓▒░ "
+ ],
+ [
+ " ░▒████████▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓░▒▒██▓▒░ ",
+ " ▒▓███▓▒███▓▓███▓▒░ ",
+ " ░▒▓██▓▒▒▒▒██▓▒░ ",
+ " ░▓▓░ ░░░▒▒▓▓▓▓▓▒▒░░░░ ░▓▓░ ",
+ " ░▒▓███▓░▓█▓▒▓▓█▓▓▓▒▓▓░▓███▓▓░ ",
+ " ░▒▓██▒▒▒▒▒▒▓█▓ ▓█████▓▒▒██▓▒▒▒▒▓▓██▓▒ ",
+ " ▒▒ ▒▒▒▒▒▒▒ ▒██▒ ░▓█▓▒ ░▓▓▓▒▒░ ░█▓",
+ " ▒█▒ ░▓█▓░ ",
+ " █▒ ▓▓░ ",
+ " █ ▒█▒ ",
+ " █▓ ▓▓░ ",
+ " ▒█ ▒▓░ ",
+ " ▒▓ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░░░ ░▒▓██▓▒▒▒▒▓█▓▒▒░ ░░▒░ ",
+ " ▓█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ░▒█▒ ",
+ " ▒▓██▓░▒▓▓▒▓▓█▓▓▓▒▓▓░▓███▓░ ",
+ " ░▒▒▓▓▒░▒▒▒▒▓█▓░▓█████▓▒▒█▓▓░░▒░░▒▓▓▒▒ ",
+ " ▒▓ ░▒▓▓▓▓▒▓░ ░██▒ ░██▓▒▒▓▓███▓▒░░░▒█▓",
+ " ░█▓░ ░▓█▓░ ░░░ ",
+ " █▓░ ▒▓▓░ ",
+ " █ ░█▒ ",
+ " █▓░ ▒█▓░ ",
+ " ▒▒ ",
+ " "
+ ],
+ [
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒███▓░ ",
+ " ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▒▒ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒░ ",
+ " ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ░▓█▒ ",
+ " ░▓▓▓▓▓░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▓▓▓█▒░ ",
+ " ▒▓▓▓▒░░░▒▒▓██░▓███▓█▓▒▒█▓▒▒▒░░░▒▓▒▒░ ",
+ " ░▒ ░▒▓█▓█▓▓▒ ▓██▓░▒██▓▒▓▓█▓▓▓▓▓▒░ ▒▓ ",
+ " ░░░ ░█▓░ ░▒██▒░░░░░░ ",
+ " ▓██░ ░▓▓▓▒ ",
+ " █▒░ ▒█▒ ",
+ " ▓▒▒ ░▒▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓██████████▓▓▒ ",
+ " ░▒███████████████▓░ ",
+ " ░▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓▓██░▓▒████▓▓▒▒███▓▒ ",
+ " ░▒▓█▒▒▒████▓▒▒▒██▓▒ ",
+ " ░░░ ░▒▓██▓▒▒▒▒▒▓██▓▒▒░░░░ ",
+ " ▓█░▓░ ░░▓▓█▓▓▓▓▓▓▒░░ ▒▒▒█░ ",
+ " ▒█▓▒▒░░░▒▓▒▒▒▒▒▒▒▒▒▒░▒░▒▓█▓░ ",
+ " ░▒▓▒ ░▒▓▒▒▓█▒▒███▓█▓▒▓▓▒▒▓▓▒░ ░▒▓▒ ",
+ " ░▒░▒█▓▒░▓▓█▓░░▓██▓▓█▓▓▒██▓▒░░░▒█▓░▒░ ",
+ " ░░▒▒▒░▒ ░▓█▓ ░██▒ ░▒▒▒▓▓░░ ",
+ " █▓▒░██ ░▓█▓▒▓█▒▓░ ",
+ " ▒▓▓▓▒ ▒▓▓▒░░ ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▒░░ ",
+ " ░██████████████▓▒ ",
+ " ░▓████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▒░ ",
+ " ▒▓██ ▓░████▓░▒▒██▓▒░ ",
+ " ▒▓██▓▓▒███▓▒▓██▓▒░ ",
+ " ▒▓▒▓░ ░▒▓▓█▓▒▒▒▓██▓▒░░ ▒▒▒▓▓░ ",
+ " ▓█░░░ ░░░▒▒▓▓▓▓▓▒▒░░░░ ░░ ▒█░ ",
+ " ░░▓▓███▓░▓█▓▒▓▓█▓▓▓▒▓▓░▓████▓░░▒░ ",
+ " ░▓▓░ ░░▒▓█▓ ▓█████▓▒▒█▓▓░░░░░▓▓░░ ",
+ " ▒▓████▓▓ ░██▒ ░██▒ ░▒▓█████▓░ ",
+ " ▒▒░ ▓█▒ ░▓█▒ ░▒▒░░▓▒ ",
+ " ██▒▒█▓░ ▒█▓▒▓▓░▒▓░ ",
+ " ░▒▓▓░ ▒▒▒░░░ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▒▒▒▒▓▒▒░░ ",
+ " ▒████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓▒████▓▒▒▒██▓▓░ ",
+ " ░░ ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒▒░▒░ ░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▓█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░░░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒░░░░░▒▓█░ ",
+ " ░▓▓▓▓█▒▒▒██░▓███▓█▓▒▒█▓▒▓█▓▓█▒░ ",
+ " ░▒▓▓▓█▓▓▒ ███░▒██▒░▓▓▓▓▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ ░█▓░ ",
+ " ░░ █▓░░▒█▓ ░▓█▒░▒▓▒ ░▒▒▒ ",
+ " ░▓▓▓▓░ ▒▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▓▒░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░▒▒▒░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░▒▒▒ ",
+ " ▒█▒ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒█░ ",
+ " ▒█▒ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▓█░ ",
+ " ▒█▓░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▓█▒ ",
+ " ▒▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒ ",
+ " ░▒▓▓▓▓█▓▓░ ▓██░▒██▒ ▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░░ ██▓ ░██▒ ░░░░░▒█▒░ ",
+ " ▒▓▒░ ░ ██ ▒█▒ ░ ░ ▓█░ ",
+ " ░ ▓▓ ░▒█▒ ░██▒ ░▓░ ░▒▒░ ",
+ " ░▓▓▓▓▓░ ▒▓▓▓▓▒░ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▒████████▓▓▒░ ",
+ " ░██████████████▓▒░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒▓████▓▓▒▒███▓▒░ ",
+ " ░▒░ ░▓██░▓░████▓░▒▒██▓▒░ ▒▒▒ ",
+ " ▒█▒ ░▒▓██▓▒▓▓▓▓▒███▓▒░ ░ ▓█░ ",
+ " ▒█▒ ░▒▒▓▓▓▒▒▒▓█▓▓▒░ ░▓▓ ",
+ " ▒█▓░ ░░░▒▒▓▓▓▓▓▒▒▒░░░ ▒█▒ ",
+ " ░▓████▓▓░▓█▓▒▓▓█▓▓▓▒▓▓▒▒▓████▓░ ",
+ " ▒▒▒▓█▒ ▓█████▓▒▒██▓▒▒░ ",
+ " ░▒▓█▓███▒▒ ▓██ ░█▓▒ ░▒▓██▓██▓▒░ ",
+ " ▓▓░ ██▒ ░▓█▒ ░▒▓▒ ",
+ " ░▒▒▒ ██ ▒█▒ ░░░█▒ ",
+ " ░ ▒█▓ ░██░ ░ ░▒ ",
+ " ▓▓▒▓▓▓░ ▒▓▓▓▒▓░ ",
+ " ░░░ ░░░░ "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ░▓█████████▓▓▓▒ ",
+ " ░▒███████████████▓░ ",
+ " ░▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓▓██░▓▒████▓▓▒▒███▓▒ ",
+ " ░ ░▒▓█▒▒▒████▓▒▒▒██▓▒ ░ ",
+ " ▒▓▒░ ░▒▓██▓▒▒▒▒▒▓██▓▒▒ ░▓▒ ",
+ " ▒█▓░ ░░▓▓█▓▓▓▓▓▓▒░░ ░█▓ ",
+ " ░▓█▒ ░░░▒▓▒▒▒▒▒▒▒▒▒▒░░░ ▒▓█▒ ",
+ " ░▓█▓██▒▒▒▓█▒▒███▓▓▓▒▓▓▒▒▓█▓▓█▓░ ",
+ " ░▒▒▒▒▓▓█▓░ ▓██▓▓██▒░██▓▓▒▒▒░░ ",
+ " ░▒▓▓▓▒▓▓▓░░ ▓█▓ ░█▓▒ ▒▓▓▒▓▓▓█▒░ ",
+ " ▒▓░░ ▒█▒ ░█▓░ ░░█▒ ",
+ " ░▒▒▒ ░▓█▒ ░█▓░ ▒░▒▓ ",
+ " ░░░▓█▓░ ░▓█▓░░ ░ ",
+ " ▓▓▒░░ ░░▓▓▓ ",
+ " "
+ ],
+ [
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒████████████▓▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓▒████▓▒▒▒██▓▓░ ",
+ " ░▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ▒▒░ ░░▒▓█▓▒▒▒▒▒▓█▓▓▒░ ░▒▒",
+ " ▓▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▓",
+ " ░▓█▓░░░░░▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒░░░░░▒▓█▒ ",
+ " ░░▓█▓██▒▒▓██░▓███▓█▓▒▒█▓▒▓█▓▓█▒▒░ ",
+ " ░▒▒▒▓▓▓▓█▒ ██▓▒▒█▓▒░▓▓▓▓▓▒▓▓░░░ ",
+ " ▒█▓▒▒░▒▒▒ ▒█▓ ▓█▓ ░▒▒░▒░▒▓▓▓░ ",
+ " ▒█░░ ░▓█░ ▒█▓░ ░ █▓ ",
+ " ░▒▒▒ ░▓█▓▓░ ░▒▓▓▓░ ░▒▒▒ ",
+ " ▒▓▓▒░ ░▒▓▓░ ",
+ " ▒▓▒ ░▒▓░ ",
+ " ░ ░ "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▓▒░ ",
+ " ▒░ ░░░▒▒▓▓▓▓▓▓▒▒░░ ▒░",
+ "░▓█▒░░░░░░▓▓░▒▓▓▒▓▓█▓▓▓▒▓▓░▒▓▒░░░░░░▒█▓",
+ " ░░▒▓▓▓▓▓▓░▒▓█▓░▓█████▓▒▒█▓▒░▒▓▓▓▓▓▓▓░ ",
+ " ░░▒▓▓▓▓▓▓▓▓░ ▒██▒░▒██▓░▒▓▓█▓▓▓▓▓▓▓░ ",
+ " ▒▓▓░░░░░░░ ▓█▓░ ░▓█▓░ ░░░░░░░░▒▓█░",
+ " ▒▓▒░ ░▒▒█▓░ ▒██▓░░ ░▒▓█░",
+ " ░ ▒█▓▓▒░ ░▒▓█▓░ ░░ ",
+ " █▓░ ▓▓ ",
+ " ░ ░▒░ ",
+ " "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓▒ ",
+ " ░▓████████████████▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▒▒░ ",
+ " ░░░▒▒▓▓▓▓▓▓▒▒░░ ",
+ "░▓░ ░░░▓█░▒▓▓▒▓▓█▓▓▓▒▓▓░▓█▒░░ ▒▒",
+ "░▓▓▒▒▒▒▓▓▓░░▓█▓░▓█████▓▒▒█▒░░▒▓▒▒▒░░▒▓▒",
+ " ░▒▓▓▓▓▓▒░▓██░░▓██▒ ░▓█▓▒▒██▒░▒▓▓▓▓▓▓▒ ",
+ " ▓▓░░░░▒▓▓▓░░▓██▒ ▒██▒░▒▓▓▓▒░░░░░█▓",
+ " ░▒░ ░▓▓███▓▒ ░▒▓███▓▒░ ▒▒░ ",
+ " ▓▓░ ░█▒ ",
+ " ░░ ░▒░ ",
+ " ",
+ " "
+ ],
+ [
+ " ░░██▓▓▓▓▓▓▓▒░ ",
+ " ░▓█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓█████████████████▓▒░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▒▒██████▓▒▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▒░ ",
+ " ░▒▓██▓▒▒▒▒▓█▓▓▒░ ",
+ " ░░░▒▒▓▓▓▓▓▓▒▒░░ ",
+ " ░░░ ░░░▓▓▓░▒▓▓▒▓▓▓▓▓▓▒▓▒░▓▓▓▒░ ▒▒░ ",
+ " ░▒▒▒▒▓▓▓▓░░▒█▓░▓█████▓▒▒█▓▒░▒▓█▓▒▒▓▓░ ",
+ " ░▓▓▓▒░░░░▒▓█▒░▓██▒░░██▓▒▒█▓▒░░░░▒▓▓▓▒░",
+ " ░▒░░▒▓▓▒▓▓░░▒██▒░ ▒██▒░▒▓▓▓▓▓▒░░▒▓▒",
+ " ▒▓▓███▓▒ ░▓▓██▓▓▓░ ",
+ " ░░ ░░ ░ ░▒░ ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ▒▒▒▒▒▒▒▒▒░ ",
+ " ░████████████▓▒░ ",
+ " ░▓███████████████▓▒ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ░▒▓██ ▓▒████▓▒▒▒███▓░ ",
+ " ░▒▓█▒▒▒▓███▓▒▒▓█▓▓░ ",
+ " ░▒▓▓█▓▒▒▒▒▒▓██▓▒░ ",
+ " ▓▓░ ░░▓▓▓▓▓▓▓▓▓▒░░ ▒█▒ ",
+ " ▒▓▓▒▒▒░▒▓▓▒▓▓▓▓▓▒▒▓▒░▒▒▒▓█▓░ ",
+ " ░▒▒▒▒██░▓███▓█▓▒▒█▓▒▒▒▒░ ",
+ " ▒▓░ ▒█▒ ███▒▓██▒░▓█▓░ ▒▓▓ ",
+ " ░▒░ ░ ░▒ ░██ ░▓█▒ ░▒▒░░░ ░▒░ ",
+ " ▒▓░█▓░ ░██ ▒█▓░ ▒█▒▒▓░ ",
+ " ░████▒ ░▒███▓░ ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " ░░░░░░░░░ ",
+ " ▒▓████████▓▓▒░ ",
+ " ░██████████████▓▒░ ",
+ " ▒▓████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███░▓▓████▓▓▒▒███▓▒░ ",
+ " ░▓▓█░▓░████▓░▒▒██▓▒░ ",
+ " ░▒▓██▓▒▓▓▓▓▒██▓▓▒░ ",
+ " ░▓▓▓░ ░░▒▓▓▓▓▓▓▓▓▓▓▒░ ▒▓░ ",
+ " ░█▓▒░░░░▒▒▒▓▓▓▓▓▒▒▒░░░░░▓█▒ ",
+ " ░▒░ ▒▓▓░▓█▓▒▓██▓▓▓▒▓▓▒▒▓▓░ ▒▒░ ",
+ " ▒▓▒ ▓██▒ ▓█████▓▒▒██▓░ ░▓▓ ",
+ " ░ ░▓▓▒ ███ ░██▒ ░░▒█▒░ ",
+ " ░▓▒ ░▒░ ██░ ▒█▒ ▒▒░ ▓▓░ ",
+ " ░▓▓░ █▓░░██ ░█▓░▒█▒░▒▒░ ",
+ " ▒███▒ ░▓██▓░ ",
+ " ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▒░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▓░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒░ ",
+ " ▓█░▓░ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒▒▓█░ ",
+ " ░░ ▒█▓▒░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░▒▓█░░░ ",
+ " ▓▒▒░ ░░▓▓▒▓██░▓█████▓▒▒█▓▒▓▓▒░ ▒▒▒▒ ",
+ " ░░ ▒█▓░ ▓██░▒██▒░▒▓▓▓░ ░░ ",
+ " ▒█▓░ ░ ██▓ ░██▒ ░▒█▓░ ",
+ " ▓█░ ▓▓ ██ ▒█▒░▓░ ▒▒▓░ ",
+ " ▒▒░ █▓▒█▓ ░██▓█░ ▒░░ ",
+ " ░▓▓░ ▒▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ",
+ " ░▒▒▓░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒░ ",
+ " ██░▒▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒▒ ▓▓ ",
+ " ░▒▓█▓▒░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░▒▓▒▒▒░ ",
+ " ░░░░▒▓▓▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▒░ ░░░ ",
+ " ░▓▓█▓░ ▓██░▒██▒░▒▓▓█▓▒░ ",
+ " ░▓█▒░░ ░ ██▓ ░██▒ ░░░▒█▓░ ",
+ " ▒█▒░ ▒▓▒ ██ ▒█▒░▓▒░ ░░▓█░ ",
+ " ░░░ ▒█▒▓█▒ ░▓█▒▓▓░ ▒▒▒░ ",
+ " ░▓▓░ ░▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▒░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒██░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ▓██░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▒█▒░░░ ██▓ ░██▒ ░░░░░░▒█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒▒ ░░ █▓░ ",
+ " ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ ",
+ " ░▒▓▓▓░ ░▓▓▓▒ ",
+ " "
+ ],
+ [
+ " ",
+ " ░▓▓▓▓▓▓▓▓▒░░ ",
+ " ▒█████████████▓░ ",
+ " ░▓███████████████▓▒░ ",
+ " ░▓▓████████████████▓▒ ",
+ " ░▓██████████████████▓░ ",
+ " ░▓███▓▓██████▓▓▓████▒░ ",
+ " ▒▓██ ▓░████▓▒▒▒██▓▓░ ",
+ " ░░ ▒▓█▓▓▓▓███▓▒▓▓█▓▓░ ░░ ",
+ " ░▒▒░░▒░ ░▒▓█▓▓▒▒▒▒▓█▓▓▒░ ▒▒▒▒▒ ",
+ " ▒█▒ ░░▒▒▓▓▓▓▓▓▒▒░░ ▒█▒ ",
+ " ░▓█▒░░░░░▒░▒▓▓▒▓▓▓▓▓▓▒▓▒░▒░░░░░▒█▓░ ",
+ " ░▓▓▓▓▓▒▒▓█▓░▓█████▓▒▒█▓▒▓▓▓▓▓▒░ ",
+ " ░▒▓▓▓█▓▓░ ███░▒██▒░▒▓▓█▓▓▓▓▒░ ",
+ " ▓█▒░░░ ██▓ ░██▒ ░░░░░░▓█▒ ",
+ " ▒▓▒░ ▒▒ ██ ▒█▒ ░▒░ ░ █▓░ ",
+ " ░░ █▓░░▒█▒ ░▓█▒░▒▓▒ ░▒▒ ",
+ " ░▒▓▓▓░ ░▓▓▓▒ ",
+ " "
+ ]
+ ],
+ "holds": [
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 100,
+ 60,
+ 100,
+ 70,
+ 100,
+ 70,
+ 40
+ ],
+ "source": "https://github.com/ferrebarrat/brrtfetch/blob/main/gifs/defaults/brrt.gif",
+ "note": "Same source motion and timing, Unicode shade/block glyphs."
+ },
+ {
+ "name": "Tiny cat",
+ "cols": 7,
+ "rows": 3,
+ "font": "ascii48",
+ "color": "d4edbe",
+ "frames": [
+ [
+ " /\\_/\\ ",
+ "( o.o )",
+ " > ^ < "
+ ],
+ [
+ " /\\_/\\ ",
+ "( -.- )",
+ " > ^ < "
+ ],
+ [
+ " /\\_/\\ ",
+ "( o.o )",
+ " > ^ < "
+ ],
+ [
+ " /\\_/\\ ",
+ "( o.O )",
+ " > ^ < "
+ ],
+ [
+ " /\\_/\\ ",
+ "( ^.^ )",
+ " > ^ < "
+ ],
+ [
+ " /\\_/\\ ",
+ "( o.o )",
+ " > ^ < "
+ ]
+ ],
+ "holds": [
+ 2300,
+ 120,
+ 2400,
+ 650,
+ 800,
+ 1500
+ ],
+ "source": "User-supplied three-line cat",
+ "note": "Original local blink, glance and pleased poses; no state or app wiring."
+ },
+ {
+ "name": "Party Parrot",
+ "cols": 48,
+ "rows": 18,
+ "font": "ascii14",
+ "color": "c6ef8c",
+ "frames": [
+ [
+ " .cccc;;cc;';c. ",
+ " .,:dkdc:;;:c:,:d:. ",
+ " .loc'.,cc::::::,..,:. ",
+ " .cl;....;dkdccc::,...c; ",
+ " .c:,';:'..ckc',;::;....;c. ",
+ " .c:'.,dkkoc:ok:;llllc,,c,';:. ",
+ " .;c,';okkkkkkkk:,lllll,:kd;.;:,. ",
+ " co..:kkkkkkkkkk:;llllc':kkc..oNc ",
+ " .cl;.,okkkkkkkkkkc,:cll;,okkc'.cO; ",
+ " ;k:..ckkkkkkkkkkkl..,;,.;xkko:',l' ",
+ " .,...';dkkkkkkkkkkd;.....ckkkl'.cO; ",
+ " .,,:,.;oo:ckkkkkkkkkkkdoc;;cdkkkc..cd, ",
+ " .cclo;,ccdkkl;llccdkkkkkkkkkkkkkkkd,.c; ",
+ " .lol:;;okkkkkxooc::loodkkkkkkkkkkkko'.oc ",
+ " .c:'..lkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.oc ",
+ " .lo;,ccdkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.c; ",
+ ",dx:..;lllllllllllllllllllllllllllllllloc'... ",
+ "cNO;........................................ "
+ ],
+ [
+ " .ckx;'........':c. ",
+ " .,:c:c:::oxxocoo::::,',. ",
+ " .odc'..:lkkoolllllo;..;d, ",
+ " ;c..:o:..;:..',;'.......;. ",
+ " ,c..:0Xx::o:.,cllc:,'::,.,c. ",
+ " ;c;lkXXXXXXl.;lllll;lXXOo;':c. ",
+ " ,dc.oXXXXXXXXl.,lllll;lXXXXx,c0: ",
+ " ;Oc.oXXXXXXXXo.':ll:;'oXXXXO;,l' ",
+ " 'l;;OXXXXXXXXd'.'::'..dXXXXO;,l' ",
+ " 'l;:0XXXXXXXX0x:...,:o0XXXXk,:x, ",
+ " 'l;;kXXXXXXKXXXkol;oXXXXXXXO;oNc ",
+ " ,c'..ckk2XXXXXXXXXX00XXXXXXX0:;o:. ",
+ " .':;..:dd::ooooOXXXXXXXXXXXXXXXo..c; ",
+ " .',',:co0XX0kkkxx0XXXXXXXXXXXXXXX0c..;l. ",
+ " .:;'..oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXko;';:. ",
+ ".cdc..:oOXXXXXXXXKXXXXXXXXXXXXXXXXXXXXXXo..oc ",
+ ":0o...:dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo,.:, ",
+ "cNo........................................;' "
+ ],
+ [
+ " .cc;. ... .;c. ",
+ " .,,cc:cc:lxxxl:ccc:;,. ",
+ " .lo;...lKKklllookl..cO; ",
+ " .cl;.,;'.okl;...'.;,..';:. ",
+ " .:o;;dkx,.ll..,cc::,..,'.;:,. ",
+ " co..lKKKkokl.':lllo;''ol..;dl. ",
+ " .,c;.,xKKKKKKo.':llll;.'oOxo,.cl,. ",
+ " cNo..lKKKKKKKo'';llll;;okKKKl..oNc ",
+ " cNo..lKKKKKKKko;':c:,'lKKKKKo'.oNc ",
+ " cNo..lKKKKKKKKKl.....'dKKKKKxc,l0: ",
+ " .c:'.lKKKKKKKKKk;....oKKKKKKo'.oNc ",
+ " ,:.,oxOKKKKKKKOxxxxOKKKKKKxc,;ol:. ",
+ " ;c..'':oookKKKKKKKKKKKKKKKKKk:.'clc. ",
+ " ,dl'.,oxo;'';oxOKKKKKKKKKKKKKKKOxxl::;,,. ",
+ " .dOc..lKKKkoooookKKKKKKKKKKKKKKKKKKKxl,;ol. ",
+ " cx,';okKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKl..;lc. ",
+ " co..:dddddddddddddddddddddddddddddddddl:;''::.",
+ " co...........................................\""
+ ],
+ [
+ " .ccccccc. ",
+ " .,,,;cooolccol;;,,. ",
+ " .dOx;..;lllll;..;xOd. ",
+ " .cdo,',loOXXXXXkll;';odc. ",
+ " ,oo:;c,':oko:cccccc,...ckl. ",
+ " ;c.;kXo..::..;c::'.......oc ",
+ ",dc..oXX0kk0o.':lll;..cxxc.,ld, ",
+ "kNo.'oXXXXXXo'':lll;..oXXOd;cOd. ",
+ "KOc;oOXXXXXXo.':lol,..dXXXXl';xc ",
+ "Ol,:k0XXXXXX0c.,clc'.:0XXXXx,.oc ",
+ "KOc;dOXXXXXXXl..';'..lXXXXXd..oc ",
+ "dNo..oXXXXXXXOx:..'lxOXXXXXk,.:; .. ",
+ "cNo..lXXXXXXXXXOolkXXXXXXXXXkl;..;:.;. ",
+ ".,;'.,dkkkkk0XXXXXXXXXXXXXXXXXOxxl;,;,;l:. ",
+ " ;c.;:''''':doOXXXXXXXXXXXXXXXXXXOdo;';clc. ",
+ " ;c.lOdood:'''oXXXXXXXXXXXXXXXXXXXXXk,..;ol. ",
+ " ';.:xxxxxocccoxxxxxxxxxxxxxxxxxxxxxxl::'.';;. ",
+ " ';........................................;l' "
+ ],
+ [
+ " .;:;;,.,;;::,. ",
+ " .;':;........'co:. ",
+ " .clc;'':cllllc::,.':c. ",
+ " .lo;;o:coxdlooollc;',::,,. ",
+ ".c:'.,cl,.'lc',,;;'......cO; ",
+ "do;';oxoc::l;;llllc'.';;'.';. ",
+ "c..ckkkkkkkd,;llllc'.:kkd;.':c. ",
+ "'.,okkkkkkkkc;llllc,.:kkkdl,cO; ",
+ "..;xkkkkkkkkc,ccll:,;okkkkk:,cl, ",
+ "..,dkkkkkkkkc..,;,'ckkkkkkkc;ll. ",
+ "..'okkkkkkkko,....'okkkkkkkc,:c. ",
+ "c..ckkkkkkkkkdl;,:okkkkkkkkd,.',';. ",
+ "d..':lxkkkkkkkkxxkkkkkkkkkkkdoc;,;'..'.,. ",
+ "o...'';llllldkkkkkkkkkkkkkkkkkkdll;..'cdo. ",
+ "o..,l;'''''';dkkkkkkkkkkkkkkkkkkkkdlc,..;lc. ",
+ "o..;lc;;;;;;,,;clllllllllllllllllllllc'..,:c. ",
+ "o..........................................;' ",
+ " "
+ ],
+ [
+ " .,,,,,,,,,. ",
+ " .ckKxodooxOOdcc. ",
+ " .cclooc'....';;cool. ",
+ " .loc;;;;clllllc;;;;;:;,. ",
+ " .c:'.,okd;;cdo:::::cl,..oc ",
+ " .:o;';okkx;';;,';::;'....,;,. ",
+ " co..ckkkkkddk:,cclll;.,c:,:o:. ",
+ " co..ckkkkkkkk:,cllll;.:kkd,.':c. ",
+ ".,:;.,okkkkkkkk:,cclll;.:kkkdl;;o:. ",
+ "cNo..ckkkkkkkkko,.;llc,.ckkkkkc..oc ",
+ ",dd;.:kkkkkkkkkx;..;:,.'lkkkkko,.:, ",
+ " ;c.ckkkkkkkkkkc.....;ldkkkkkk:.,' ",
+ ",dc..'okkkkkkkkkxoc;;cxkkkkkkkkc..,;,. ",
+ "kNo..':lllllldkkkkkkkkkkkkkkkkkdcc,.;l. ",
+ "KOc,l;''''''';lldkkkkkkkkkkkkkkkkkc..;lc. ",
+ "xx:':;;;;,.,,...,;;cllllllllllllllc;'.;oo, ",
+ "cNo.....................................oc ",
+ " "
+ ],
+ [
+ " .ccccccc. ",
+ " .ccckNKOOOOkdcc. ",
+ " .;;cc:ccccccc:,::::,,. ",
+ " .c;:;.,cccllxOOOxlllc,;ol. ",
+ " .lkc,coxo:;oOOxooooooo;..:, ",
+ " .cdc.,dOOOc..cOd,.',,;'....':c. ",
+ " cNx'.lOOOOxlldOl..;lll;.....cO; ",
+ " ,do;,:dOOOOOOOOOl'':lll;..:d:.'c, ",
+ " co..lOOOOOOOOOOOl'':lll;.'lOd,.cd. ",
+ " co.,dOOOOOOOOOOOo,.;llc,.,dOOc..dc ",
+ " co..lOOOOOOOOOOOOc.';:,..cOOOl..oc ",
+ " .,:;.'::lxOOOOOOOOOo:'...,:oOOOc..dc ",
+ " ;Oc..cl'':llxOOOOOOOOdcclxOOOOx,.cd. ",
+ " .:;';lxl''''':lldOOOOOOOOOOOOOOc..oc ",
+ ",dl,.'cooc:::,....,::coooooooooooc'.c: ",
+ "cNo.................................oc ",
+ " ",
+ " "
+ ],
+ [
+ " .cccccccc. ",
+ " .,,,;;cc:cccccc:;;,. ",
+ " .cdxo;..,::cccc::,..;l. ",
+ " ,oo:,,:c:cdxxdllll:;,';:,. ",
+ " .cl;.,oxxc'.,cc,.',;;'...oNc ",
+ " ;Oc..cxxxc'.,c;..;lll;...cO; ",
+ " .;;',:ldxxxdoldxc..;lll:'...'c, ",
+ " ;c..cxxxxkxxkxxxc'.;lll:'','.cdc. ",
+ " .c;.;odxxxxxxxxxxxd;.,cll;.,l:.'dNc ",
+ " .:,''ccoxkxxkxxxxxxx:..,:;'.:xc..oNc ",
+ " .lc,.'lc':dxxxkxxxxxxxdl,...',lx:..dNc ",
+ " .:,',coxoc;;ccccoxxxxxxxxo:::oxxo,.cdc. ",
+ " .;':;.'oxxxxxc''''';cccoxxxxxxxxxkxc..oc ",
+ ",do:'..,:llllll:;;;;;;,..,;:lllllllll;..oc ",
+ "cNo.....................................oc ",
+ " ",
+ " ",
+ " "
+ ],
+ [
+ " .ccccc. ",
+ " .cc;'coooxkl;. ",
+ " .:c:::c:,;,,,;c;;,.'. ",
+ " .clc,',:,..:xxocc;...c; ",
+ " .c:,';:ox:..:c,,,,,,...cd, ",
+ " .c:'.,oxxxxl::l:.;loll;..;ol. ",
+ " ;Oc..:xxxxxxxxx:.,llll,....oc ",
+ " .,;,',:loxxxxxxxxx:.,llll;.,;.'ld, ",
+ " .lo;..:xxxxxxxxxxxx:.'cllc,.:l:'cO; ",
+ " .:;...'cxxxxxxxxxxxxol;,::,..cdl;;l' ",
+ " .cl;':;'';oxxxxxxxxxxxxx:....,cooc,cO; ",
+ " .,,,::;,lxoc:,,:lxxxxxxxxxxxo:,,;lxxl;'oNc ",
+ " .cdxo;':lxxxxxxc'';cccccoxxxxxxxxxxxxo,.;lc. ",
+ " .loc'.'lxxxxxxxxocc;''''';ccoxxxxxxxxx:..oc ",
+ "occ'..',:cccccccccccc:;;;;;;;;:ccccccccc,.'c, ",
+ "Ol;......................................;l' ",
+ " ",
+ " "
+ ],
+ [
+ " ,ddoodd, ",
+ " .cc' ,ooccoo,'cc. ",
+ " .ccldo;....,,...;oxdc. ",
+ " .,,:cc;.''..;lol;;,'..lkl. ",
+ " .dkc';:ccl;..;dl,.''.....oc ",
+ " .,lc',cdddddlccld;.,;c::'..,cc:.",
+ " cNo..:ddddddddddd;':clll;,c,';xc",
+ " .lo;,clddddddddddd;':clll;:kc..;'",
+ " .,:;..:ddddddddddddd:';clll;;ll,.. ",
+ " ;Oc..';:ldddddddddddl,.,c:;';dd;.. ",
+ " .''',:lc,'cdddddddddddo:,'...'cdd;.. ",
+ " .cdc';lddd:';lddddddddddddd;.';lddl,.. ",
+ " .,;::;,cdddddol;;lllllodddddddlcodddd:.'l,",
+ " .dOc..,lddddddddlccc;'';cclddddddddddd;,ll.",
+ " .coc,;::ldddddddddddddl:ccc:ldddddddddlc,ck; ",
+ ",dl::,..,cccccccccccccccccccccccccccccccc:;':xx,",
+ "cNd.........................................;lOc",
+ " "
+ ]
+ ],
+ "holds": [
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100,
+ 100
+ ],
+ "source": "https://github.com/jmhobbs/terminal-parrot/blob/main/animations/parrot.animation",
+ "note": "Original ten printable-ASCII frames, monochrome playback."
+ },
+ {
+ "name": "Stone giant",
+ "cols": 38,
+ "rows": 20,
+ "font": "ascii16",
+ "color": "e6e1ca",
+ "frames": [
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " ' \\ |, <o> (. )| ",
+ " / , )'| (_\\ || ",
+ " / : /|||\\`Vvv' || ",
+ " (, : \\'|| `^^' _'|| ",
+ " ( : / |' _ -' \\'| ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`- ",
+ " //'/,-''`\\ ",
+ " _/, // __ \\\\ ",
+ " ' \\ |,<o> (. )| ",
+ " / , )'| (_\\ | ",
+ " / : /|||\\`Vvv' || ",
+ " (, : \\'|| `^^' _'|| ",
+ " ( : / |' _ -' \\'| ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,-' _ `- ",
+ " ///`'-''\\\\\\ ",
+ " _/,/ _ _ \\`\\ ",
+ " ' \\!|<o>|<o>|:| ",
+ " / , )' /_\\ ||| ",
+ " / : /||\\`vvv' !|| ",
+ " (, : \\'||`^^^' _'|| ",
+ " ( : / |' _ -' \\'| ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _// _ \\\\ :\\ ",
+ " ' \\| .) <o>\\:|| ",
+ " / , ) /_) ||| ",
+ " / : /| `vvV'/ !|| ",
+ " (, : \\|| `^^' _'| ",
+ " ( : /'|! _ -' \\' ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _// _ \\\\ :\\ ",
+ " ' \\| .) <o>\\:|| ",
+ " / , ) /_) ||| ",
+ " / : /| `vvV'' !|| ",
+ " (, : \\|| `' _'| ",
+ " ( : /'|! _ -' \\' ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//_ \\\\ :\\ ",
+ " ' \\|.) <o> \\:|| ",
+ " / , )/_) ||| ",
+ " / : /| `vvV'' !|| ",
+ " (, : \\|| _'| ",
+ " ( : /'|! _ -' \\' ",
+ " ( : | ' -' ' ( \\ ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//| \\\\ :\\ ",
+ " ' --+--<o> \\:|| ",
+ " / , )|_) ||| ",
+ " / : /| `vvV'' !|| ",
+ " (, : \\|| _'| ",
+ " ( : /'|! _ -' \\' ",
+ " ( : | ' -' ' ( \\ ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//_ \\\\ :\\ ",
+ " ' \\|+) <o> \\:|| ",
+ " / , )/_) ||| ",
+ " / : /| `vvV'' !|| ",
+ " (, : \\|| _'| ",
+ " ( : /'|! _ -' \\' ",
+ " ( : | ' -' ' ( \\ ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//_ \\\\ :\\ ",
+ " ' \\| ) <o> \\:|| ",
+ " / , )/_) ||| ",
+ " / : /| `vvV'' ||| ",
+ " (, : \\|| _'|| ",
+ " ( : /'|! _ -' \\'| ",
+ " ( : | ' ' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / _/|| ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//_ \\\\ :\\ ",
+ " ' \\|.) <o> \\:|| ",
+ " / , )/_) ||| ",
+ " / : /| `vvV'' ||| ",
+ " (, : \\|| _ ||| ",
+ " ( : /'|!_ -' \\'||' ",
+ " ( : |,-' ' ( \\'| ",
+ " \\ : ' ' ( \\' ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / ||\\ ",
+ " ( `- _ ( / / '' ",
+ " _| `- ---_/ / ( : \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _//_ \\\\ :\\ ",
+ " ' \\|.) <o> \\:|| ",
+ " / , )/_) ||| ",
+ " / : /| `vvV'' ||| ",
+ " (, : \\|| `' _ |||` ",
+ " ( : /'|!_ -' \\'||-' ",
+ " ( : |,-' ' ( \\'| ",
+ " \\ : ' ' ( \\' ",
+ " ) `-' ___ -`,)) ",
+ " ,( ' , ) /||\\ ",
+ " ( `- _ ( / / '' ",
+ " _| `- ---_/ / ( : \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " ______ ",
+ " --'_,`: :`: ",
+ " // `'- \\`\\\\ \\ \\\\ ",
+ " _|/_ \\\\ :\\ \\'\\ ",
+ " / '.).,o.o.ooo> | || ",
+ " | /_,_,__,_,'| | ||_ ",
+ " _ -'' `vvvvvvvvV\\ | |',`- ",
+ " -' \\ ,-,^\\\\`',''_ -' ",
+ " ^^'' ,' ",
+ " ( ,'| ",
+ " _, --- - , __ _ ( `-' ",
+ "'' ) `` ___`- \\ ",
+ " ,( ' , ) / ' ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " ' / `vvV'| |' \\ - _ ,`- ",
+ " / | \\ \\\\ / ' \\\\` --'_ -' ",
+ " _ '' ! \\^^' \\\\ / )' ",
+ "' / | \\\\\\` \\( ,' ",
+ " | \\ _/`\\\\\\_ /\\```- ",
+ " ! ) `` ___`- \\ ",
+ " ` ) ,( ' , ) / \\ ",
+ " ,___, -' ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " \\ | `vvV'| |' \\ - _ ,`- ",
+ " / |\\ \\\\ / ' \\\\` --'_ -' ",
+ " / ! \\^^' \\\\ / )' ",
+ " |_/ | \\\\\\` \\( ,' ",
+ " | | \\ _/`\\\\\\_ /\\```- ",
+ " , | ) `` ___`- \\ ",
+ " /(__)) ,( ' , ) / \\ ",
+ " `--' ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " \\ | `vvV'| |' \\ - _ ,`- ",
+ " / |\\ \\\\ / ' \\\\` --'_ -' ",
+ " / ! \\^^' \\\\ / )' ",
+ " |_/ | \\\\\\` \\( ,' ",
+ " | | \\ _/`\\\\\\_ /\\```- ",
+ " \\,| ) `` ___`- \\ ",
+ " /(__)),( ' , ) / \\ ",
+ " `--'( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " \\ | `vvV'/ |' \\ - _ ,`- ",
+ " / |\\ \\`^^' ' \\\\` --'_ -' ",
+ " / ! \\\\ \\\\ / )' ",
+ " |_/ | \\\\\\` \\( ,' ",
+ " | | \\ _/`\\\\\\_ /\\```- ",
+ " \\,| ) `` ___`- \\ ",
+ " /(__)),( ' , ) / \\ ",
+ " `--'( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " \\ | `vvV'/ |' \\ - _ ,`- ",
+ " / |\\ \\`^^' ' \\\\` --'_ -' ",
+ " / ! \\\\ \\\\ / )' ",
+ " |_/ | \\\\\\` \\( ,' ",
+ " | | \\ _/`\\\\\\_ /\\```- ",
+ " \\,\\ ) `` ___`- \\ ",
+ " /(__))( ' , ) / \\ ",
+ " `--( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/_ \\\\ :\\ ",
+ " / |.) <o> :| ||- ",
+ " | '/_) |||'| `- _ ",
+ " \\ | `vvV'/ |' \\ - _ ,`- ",
+ " / |\\ \\`^^' ' \\\\` --'_ -' ",
+ " | | \\\\ \\\\ / )' ",
+ " \\_| | \\\\\\` \\( ,' ",
+ " | | \\ _/`\\\\\\_ /\\```- ",
+ " \\,\\ ) `` ___`- \\ ",
+ " /(__)) ' , ) / \\ ",
+ " `--' `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " --'_,`: ",
+ " // `'- \\`\\\\ ",
+ " _|/__ \\\\ :\\ ",
+ " / | .) <o>:| ||- ",
+ " | ' /_) |||| `- _ ",
+ " \\ | `vvV'/ |' \\ - _ ,`- ",
+ " | |\\\\`^^' ' \\\\` --'_ -' ",
+ " / '\\\\\\\\ \\\\ / )' ",
+ " | ,- '\\\\\\` \\( ,' ",
+ " \\ /(__/,'\\\\\\_ /\\```- ",
+ " \\_ --/ `` ___`- \\ ",
+ " ' , ) / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,-' _ `- ",
+ " ///`'-''\\\\\\ ",
+ " _/,/ _ _ \\`\\ ",
+ " / |||<o>|<o>|:|- ",
+ " | ,|| /_\\ ||| `- _ ",
+ " \\ '||\\`vvv'/||' - _ ,`- ",
+ " | \\'\\\\`^^^' |\\\\` --'_ -' ",
+ " | ' '\\ \\\\\\/ )' ",
+ " / ,' ` '\\` \\( ,' ",
+ " \\ /( \\'\\\\_ /\\```- ",
+ " '-' '-\\\\ ` ___`- \\ ",
+ " ,( ' ' , ) / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`- ",
+ " //'/,-' \\` ",
+ " _/, // __ \\`\\ ",
+ " / ||,<o> (. )|| ",
+ " | ,|| (_\\ || `- _ ",
+ " \\ '||\\`Vvv' |'- _ ,`- ",
+ " : \\|\\ `^^' |\\\\` -' -' ",
+ " : |' ' \\ \\\\\\/ )' ",
+ " | ,' /( \\` \\( ,' ",
+ " \\ / ( \\\\_ /\\```- ",
+ " '-' , `,)) ___`- \\ ",
+ " ,( '' , ) / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _ \\`\\ ",
+ " / ||,<o> (. )|| ",
+ " ( ,'|| (_\\ ||`- _ ",
+ " \\ !||\\`Vvv' || _ ,`- ",
+ " : \\|\\ `^^' ||| -' -' ",
+ " : |' ' \\ ||/ )' ",
+ " : ,' /( \\ \\( ,' ",
+ " \\ ' ( \\ /\\```- ",
+ " '-', `,))__`- \\ ",
+ " ,( ' , ) / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " / ||, <o> (. )| ",
+ " ( ,'|| (_\\ ||`- _ ",
+ " \\ !||\\`Vvv' || _ ,`- ",
+ " : \\'\\ `^^' ||| -' -' ",
+ " : | ' _ ' \\ |/ )' ",
+ " : ',' '( \\\\( ,' ",
+ " \\ ' ( \\\\```- ",
+ " '-' `,))`- \\ ",
+ " ,( ' , ) / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " / ||, <o> (. )| ",
+ " ( )||| (_\\ ||- _ ",
+ " \\ \\'||\\`Vvv' ||_ ,`- ",
+ " : \\'\\ `^^'_ ||!-' -' ",
+ " : |'\\ _ ' \\||| )' ",
+ " ' \\,' '( \\\\\\' ",
+ " \\ ' ' ( \\\\\\ ",
+ " '-' _`,)) \\ ",
+ " ,( ' , ') / \\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " / \\||, <o> (. )| ",
+ " |, )|| (_\\ || ",
+ " : |'|\\`Vvv' ||_ ",
+ " : \\ | `^^' _|||,`- ",
+ " : \\' _ ' \\|| -' ",
+ " ' |,-' '( \\|' ",
+ " : ' ' ( \\ ",
+ " / `-' ___ `,)) ",
+ " ,( ' , ) '\\\\ ",
+ " ( `- _ ( / / \\ ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " / \\|, <o> (. )| ",
+ " \\, )| (_\\ || ",
+ " : |||\\`Vvv' || ",
+ " (: \\'| `^^' _|||- ",
+ " (: |'|'_ -' \\|||-' ",
+ " ( : |,-' ' ( \\| ",
+ " ): ' ' ( \\ ",
+ " / `-' ___ - `,)) ",
+ " ,( ' , ) -'' ",
+ " ( `- _ ( / / | ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " ( \\|, <o> (. )| ",
+ " /, )| (_\\ || ",
+ " / : /||\\`Vvv' || ",
+ " (, : \\|| `^^' _'|| ",
+ " ( : /'|! _ -' \\'|' ",
+ " ( : | ' ' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " / `-' ___`- `,)) ",
+ " ,( ' , ) /-'// ",
+ " ( `- _ ( / / ' | ",
+ " _| `- ---_/ / ( ' \\ ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ],
+ [
+ " _ ",
+ " ,:',_`-- ",
+ " //'/,-'' \\` ",
+ " _/, // _\\`\\ ",
+ " ' \\ |, <o> (. )| ",
+ " / , )'| (_\\ || ",
+ " / : /|||\\`Vvv' || ",
+ " (, : \\'|| `^^' _'|| ",
+ " ( : / |' _ -' \\'| ",
+ " ( : | ' -' ' ( \\' ",
+ " \\ : '' ' ( \\ ",
+ " ) `-' ___ - `,)) ",
+ " ,( ' , ) / -'// ",
+ " ( `- _ ( / / ' ",
+ " _| `- ---_/ / ( : || ",
+ " /_' ( (',,) , |'\\ ",
+ " ` ` ,- ),,)\\' ` ' `_`'- --,",
+ " ,- ''' \\ ",
+ " _' / ` `- ",
+ " `-' "
+ ]
+ ],
+ "holds": [
+ 850,
+ 110,
+ 80,
+ 120,
+ 100,
+ 80,
+ 110,
+ 200,
+ 190,
+ 110,
+ 80,
+ 110,
+ 100,
+ 80,
+ 310,
+ 180,
+ 110,
+ 80,
+ 110,
+ 80,
+ 100,
+ 110,
+ 80,
+ 110,
+ 80,
+ 100,
+ 110,
+ 840
+ ],
+ "source": "https://stonestoryrpg.com/",
+ "note": "Recovered text poses from the linked monster GIF. Punctuation was mapped to printable ASCII; timing retained; player outside giant crop omitted."
+ },
+ {
+ "name": "Stone spider",
+ "cols": 36,
+ "rows": 12,
+ "font": "ascii20",
+ "color": "c9dfbd",
+ "frames": [
+ [
+ " ",
+ " ",
+ " _ ",
+ " /,\\__ ",
+ " ,-o( /,\\\\ /| ",
+ " ,-o(/\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " _ /,\\__ ",
+ " ,\\`o,- \\\\ /| ",
+ " ''\\//\\\\\\/_'-- _ ",
+ " ,-o( //|// _ /\\ __` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " , _ ",
+ " |o,____ ",
+ " ,' `- \\\\ /| ",
+ " \\//\\\\\\/_'-- _ ",
+ " ,-o( //|// _ /\\ __` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " , ",
+ " /o, ",
+ " `'\\` _ ",
+ " ,-o(\\\\' \\\\ /| ",
+ " \\//|\\\\\\/_'-- _ ",
+ " ,-o( //\\|// _ /\\___` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-`- ) // //||/|| -'|| ",
+ " _/ (' '/'// // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ____ ",
+ " _ \\o-' ",
+ " /,\\ \\\\ ",
+ " ,-o(\\\\\\||| /| ",
+ " \\//|||\\/_'-- _ ",
+ " ,-o( //\\|// _ /\\___` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-`- ) // //||/|| -'|| ",
+ " _/ (' '/'// // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ____ ",
+ " _ _ \\o-' ",
+ " \\`o,- \\ \\\\ ",
+ " '' /\\\\\\||| /| ",
+ " ,;'\\//|||\\/_'-- _ ",
+ " ,-o( //\\|// _ /\\___` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-`- ) // //||/|| -'|| ",
+ " _/ (' '/'// // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " , ____ ",
+ " |o,___ \\o-' ",
+ " ' `- \\ )) ",
+ " /\\\\//|\\ /| ",
+ " ,;'\\ /||\\\\/_'-- _ ",
+ " ,-o( /||||/ _ /\\___` _ ",
+ " __/|| \\/ |/\\\\--(\\/ ",
+ " ,-`- )|| //||/|| -'|| ",
+ " _/ \\' '/'// // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " , ",
+ " 'o ' ",
+ " ' o \\ ",
+ " o '\\ ",
+ " |\\\\ /| ",
+ " / o | |//\\/_'-- _ ",
+ " / |\\/// _ /\\___` _ ",
+ " ' o ' \\/ |/\\\\--(\\/ ",
+ " : \\ //||/_\\\\-'`: ",
+ " ;-o' ` - '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " ____ ",
+ " \\o-' ",
+ " \\\\ ",
+ " || ",
+ " ,\\\\ ||| /| ",
+ " ||\\\\ |//\\/_'-- _ ",
+ " ,-o( \\\\/// _ /\\___` _ ",
+ " _ / \\/ |/\\\\--(\\/ ",
+ " , --- ,______ //||/_\\\\-'`: ",
+ " ,-o/ ` - -- '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " ____ ",
+ " \\o-' ",
+ " )) ",
+ " //_ ",
+ " ,\\\\ /||\\ /| ",
+ " ||\\||||\\\\/_'-- _ ",
+ " ,-o( ||||/ _ /\\___` _ ",
+ " _ / \\/ |/\\\\--(\\/ ",
+ " _, -- ----- //||/_\\\\-'`: ",
+ " ,-o/ '- '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " 'o ' ",
+ " ' o \\ ",
+ " o ' ",
+ " _ ",
+ " / o |\\ ||\\ /| ",
+ " / |\\\\ ||\\\\/_'-- _ ",
+ " ' o ,-o( \\\\||/ _ /\\___` _ ",
+ " : __ _\\/ \\/ |/\\\\--(\\/ ",
+ ";-o' _, ' - `' - //||/_\\\\-'`: ",
+ " ,-o/ _/`'\\- '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " _ ",
+ " ,\\\\ ||\\ /| ",
+ " ||\\\\ ||\\\\/_'-- _ ",
+ " ,-o( \\\\||/ _ /\\___` _ ",
+ " , --- - _ __/ \\/ |/\\\\--(\\/ ",
+ ",-o/ ,;'`` ,`'- //||/_\\\\-'`: ",
+ " ,-o/ _/ `'- '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " _ ",
+ " ,\\\\ ||\\ /| ",
+ " _ ||\\\\ ||\\\\/_'-- _ ",
+ " ,; -o( \\\\||/ _ /\\___` _ ",
+ " ,,-o( ,` ` _/ \\/ |/\\\\--(\\/ ",
+ ",-o/ `,-`` ` //||/_\\\\-'`: ",
+ " _/ `'- '/'|| || \\\\ ",
+ " || /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " _ ",
+ " _ /\\ ||\\ /| ",
+ " ,; \\ //\\\\ ||\\\\/_'-- _ ",
+ " ,-o( ,\\` \\\\||/ _ /\\ __` _ ",
+ " _, - ` \\ / \\/ |/\\\\--(\\/ ",
+ ",-o/ ,-o8\\` _ //||/_\\\\-'\\\\ ",
+ " _/ `'- '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " _ _ ",
+ " ,; \\ /\\ ||\\ /| ",
+ " ,-o( \\\\/\\\\ ||\\\\/_'-- _ ",
+ " ,-o\\\\ \\\\||/ _ /\\ __` _ ",
+ " _, ' - _\\\\/ \\/ |/\\\\--(\\/ ",
+ ",-o/ ,-o8 \\\\_ //||/_\\\\-'\\\\ ",
+ " _/ `- '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " ,; \\ _ ",
+ " ,-o( || ||\\ /| ",
+ " //:\\ ||\\\\/_'-- _ ",
+ " - _,-o( ||\\||/ _ /\\ __` _ ",
+ " ,;' ` __ : \\/ |/\\\\--(\\/ ",
+ " ,-o/ ,-o8 )|| //||/_\\\\-'\\\\ ",
+ " _/ '- '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " ,; | _ ",
+ " _ ,-o(\\||||\\ /| ",
+ " ,; \\||||\\\\/_'-- _ ",
+ " ,-o( ` `,-o( ||||/ _ /\\ __` _ ",
+ " __ || \\/ |/\\\\--(\\/ ",
+ " ,-o8 )|| //||/_\\\\-'\\\\ ",
+ " _/ \\` '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " _ _ _ ",
+ " ,; \\ //,\\||\\ /| ",
+ " ,-o( \\` ,-o(\\\\\\|\\\\/_'-- _ ",
+ " ,- \\|||/ _ /\\ __` _ ",
+ " ___/|' \\/ |/\\\\--(\\/ ",
+ " ,-o8 ),: //||/_\\\\-'\\\\ ",
+ " _/ \\` '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " ,; \\ __ ",
+ " ,-o( \\\\ /\\ /,\\\\ /| ",
+ " \\\\/,-o(|\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " ___/ //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " _ ",
+ " ,; \\ ",
+ " ,-o( || __ ",
+ " :/\\ /,\\\\ /| ",
+ " |,-o(|\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " __|/ //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " _ ",
+ " ,; | ",
+ " ,-o( || __ ",
+ " || /,\\\\ /| ",
+ " /,-o(|\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " __|/ //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " /,\\ __ ",
+ " ,-o(/\\\\/,\\\\ /| ",
+ " ,-o(|\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " __:/ //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ],
+ [
+ " ",
+ " ",
+ " _ ",
+ " /,\\__ ",
+ " ,-o( /,\\\\ /| ",
+ " ,-o(/\\\\\\/_'-- _ ",
+ " ,-o( |// _ /\\ __` _ ",
+ " __// //\\/ |/\\\\--(\\/ ",
+ " ,-o8 ) // //||/_\\\\-'\\\\ ",
+ " _/ (' '/'|| // \\\\ ",
+ " // /o- )o-",
+ " /o- "
+ ]
+ ],
+ "holds": [
+ 490,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 100,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30,
+ 70,
+ 30
+ ],
+ "source": "https://stonestoryrpg.com/",
+ "note": "Recovered text poses from the linked spider GIF. Punctuation was mapped to printable ASCII; timing retained; player outside giant crop omitted."
+ },
+ {
+ "name": "Stark dragon",
+ "cols": 35,
+ "rows": 20,
+ "font": "ascii16",
+ "color": "e8ca91",
+ "frames": [
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " } / :} {: \\ { ",
+ " / { } { } \\ ",
+ " } } ) } { ( { { ",
+ " / { /|\\}!{/|\\ } \\ ",
+ " } } ( (.\"^\".) ) { { ",
+ " / { (d\\ /b) } \\ ",
+ " } } |\\~ ~/| { { ",
+ " / / | ) ( | \\ \\ ",
+ " { { _)(, ,)(_ } } ",
+ " } } // `\";\"` \\\\ { { ",
+ " / / // ( \\\\ \\ \\ ",
+ "{ { {( -=) )} } }",
+ " \\ \\ /) -=(=- (\\ / / ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " } / :} {: \\ { ",
+ " / { } { } \\ ",
+ " } } ) } { ( { { ",
+ " / { /|\\}!{/|\\ } \\ ",
+ " } } ( (.\"^\".) ) { { ",
+ " / { (-\\ /-) } \\ ",
+ " } } |\\~ ~/| { { ",
+ " / / | ) ( | \\ \\ ",
+ " { { _)(, ,)(_ } } ",
+ " } } // `\";\"` \\\\ { { ",
+ " / / // ( \\\\ \\ \\ ",
+ "{ { {( -=) )} } }",
+ " \\ \\ /) -=(=- (\\ / / ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " } / :} {: \\ { ",
+ " / { } { } \\ ",
+ " } } ) } { ( { { ",
+ " / { /|\\}!{/|\\ } \\ ",
+ " } } ( (.\"^\".) ) { { ",
+ " / { (d\\ /b) } \\ ",
+ " } } |\\~ ~/| { { ",
+ " / / | ) ( | \\ \\ ",
+ " { { _)(, ,)(_ } } ",
+ " } } // `\";\"` \\\\ { { ",
+ " / / // ( \\\\ \\ \\ ",
+ "{ { {( -=) )} } }",
+ " \\ \\ /) -=(=- (\\ / / ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " }/ :} {: \\{ ",
+ " /{ } { }\\ ",
+ " }} ) } { ( {{ ",
+ " /{ /|\\}!{/|\\ }\\ ",
+ " }} ( (.\"^\".) ) {{ ",
+ " /{ (d\\ /b) }\\ ",
+ " }} |\\~ ~/| {{ ",
+ " // | ) ( | \\\\ ",
+ " {{ _)(, ,)(_ }} ",
+ " }} // `\";\"` \\\\ {{ ",
+ " // // ( \\\\ \\\\ ",
+ " {{ {( -=) )} }} ",
+ " \\\\ /) -=(=- (\\ // ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " } / :} {: \\ { ",
+ " / { } { } \\ ",
+ " } } ) } { ( { { ",
+ " / { /|\\}!{/|\\ } \\ ",
+ " } } ( (.\"^\".) ) { { ",
+ " / { (d\\ /b) } \\ ",
+ " } } |\\~ ~/| { { ",
+ " / / | ) ( | \\ \\ ",
+ " { { _)(, ,)(_ } } ",
+ " } } // `\";\"` \\\\ { { ",
+ " / / // ( \\\\ \\ \\ ",
+ "{ { {( -=) )} } }",
+ " \\ \\ /) -=(=- (\\ / / ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " }/ :} {: \\{ ",
+ " /{ } { }\\ ",
+ " }} ) } { ( {{ ",
+ " /{ /|\\}!{/|\\ }\\ ",
+ " }} ( (.\"^\".) ) {{ ",
+ " /{ (d\\ /b) }\\ ",
+ " }} |\\~ ~/| {{ ",
+ " // | ) ( | \\\\ ",
+ " {{ _)(, ,)(_ }} ",
+ " }} // `\";\"` \\\\ {{ ",
+ " // // ( \\\\ \\\\ ",
+ " {{ {( -=) )} }} ",
+ " \\\\ /) -=(=- (\\ // ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ],
+ [
+ " \\(______ ______)/ ",
+ " /`.----.\\ /.----.`\\ ",
+ " } / :} {: \\ { ",
+ " / { } { } \\ ",
+ " } } ) } { ( { { ",
+ " / { /|\\}!{/|\\ } \\ ",
+ " } } ( (.\"^\".) ) { { ",
+ " / { (d\\ /b) } \\ ",
+ " } } |\\~ ~/| { { ",
+ " / / | ) ( | \\ \\ ",
+ " { { _)(, ,)(_ } } ",
+ " } } // `\";\"` \\\\ { { ",
+ " / / // ( \\\\ \\ \\ ",
+ "{ { {( -=) )} } }",
+ " \\ \\ /) -=(=- (\\ / / ",
+ " `\\\\ /'/ /-=|\\-\\ \\`\\ //' ",
+ " `\\{ | ( -===- ) | }/' ",
+ " ` _\\ \\-===-/ /_ ' ",
+ " jgs (_(_(_)'-=-'(_)_)_) ",
+ " `\"`\"`\" \"`\"`\"` "
+ ]
+ ],
+ "holds": [
+ 2200,
+ 140,
+ 1800,
+ 350,
+ 400,
+ 350,
+ 1300
+ ],
+ "source": "https://www.asciiart.eu/mythology/dragons",
+ "note": "Joan G. Stark signed front-facing dragon; original jgs initials retained. Blink and wing-tip poses are new study animation, not an original artist animation."
+ },
+ {
+ "name": "Turning face",
+ "cols": 11,
+ "rows": 6,
+ "font": "ascii48",
+ "color": "deddd1",
+ "frames": [
+ [
+ " .---. ",
+ " ( ) ",
+ " [ -|- ] ",
+ " \\ _ / ",
+ " |`-'| ",
+ "_.-' '-._"
+ ],
+ [
+ " .---. ",
+ " ( / ",
+ " [ -| ",
+ " \\ > ",
+ " |`-J ",
+ "_.-' '-._"
+ ],
+ [
+ " .---. ",
+ " / ) ",
+ " | [ | ",
+ " \\ > ",
+ " | J ",
+ "_.-' '-._"
+ ],
+ [
+ " .---. ",
+ " ( ) ",
+ " [ ] ",
+ " L J ",
+ " / \\ ",
+ "_.- -._"
+ ],
+ [
+ " .---. ",
+ " ( \\ ",
+ " | ] | ",
+ " < / ",
+ " L | ",
+ "_.-' '-._"
+ ],
+ [
+ " .---. ",
+ " \\ ) ",
+ " |- ] ",
+ " < / ",
+ " L-`| ",
+ "_.-' '-._"
+ ],
+ [
+ " .---. ",
+ " ( ) ",
+ " [ -|- ] ",
+ " \\ _ / ",
+ " |`-'| ",
+ "_.-' '-._"
+ ]
+ ],
+ "holds": [
+ 1600,
+ 400,
+ 700,
+ 1000,
+ 700,
+ 400,
+ 900
+ ],
+ "source": "https://adelfaure.net/docs/lures/ascii_faces.gif",
+ "note": "New ASCII poses inspired by Face Study; not a transcription of the artist's frames."
+ },
+ {
+ "name": "Nyan / blocks",
+ "cols": 31,
+ "rows": 20,
+ "font": "block_square",
+ "color": "b6dceb",
+ "frames": [
+ [
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ ",
+ " ███ █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ ",
+ " ░░██ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █░░███▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " ██░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ ",
+ " ██░░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ ",
+ " ████▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " ██▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒█░░░██████░░█ ",
+ " ███▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░░███████████████████ ",
+ " █░░██ █░█ █░█ █░░█ ",
+ " ████ ██ ██ ██ ",
+ " "
+ ],
+ [
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █ █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █░█ █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " █░████▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " ░░░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " ██░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " ███▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░████████████████████ ",
+ " █░░█ █░█ ░░█ █░░█ ",
+ " ███ ██ ███ ███ ",
+ " "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " ██▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " █████▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " █░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " ███ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░████████████████████ ",
+ " █░░█ ░░█ ░░█ █░░█ ",
+ " ███ ███ ███ ███ "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " ███▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " ██░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " ░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " █░█ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █ █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░████████████████████ ",
+ " █░░█ █░█ █░█ █░░█ ",
+ " ███ ██ ██ ███ "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ ",
+ " █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ ",
+ " ███ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ "█░░████▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ "█░░░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ ",
+ " ████░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ ",
+ " ███▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " █▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " ██▓▓▓▒▒▒▒▒▒█░░░██████░░█ ",
+ " ████▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░░████████████████████ ",
+ " █░░█ █░░ █░░ █░░█ ",
+ " ███ ██ ██ ███ "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒██▒▒▒▓▓█ ██ ",
+ " █▓▒▒▓▒▒▒▒▒█░░█▓▒▒▓██░░█ ",
+ " █▓▒▒▒▒▒▒▒▒█░░░▒▒▒▓█░░░█ ",
+ " █ █▓▒▒▒▒▒▓▒▒█░░░████░░░░█ ",
+ " █░█ █▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " █░████▓▒▒▒▒▒▒▒█░░░░░░░░░░░░░█ ",
+ " ░░░░█▓▒▒▒▒▒▒▓█░░░██░░░░██░░█ ",
+ " ██░░█▓▒▓▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " ███▓▒▒▒▒▒▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " █▓▓▒▒▒▓▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▒▒▒▒▒▒▒█░░░░░░░░░█ ",
+ " █░██▓▓▓▓▓▓▓▓▓▓█████████ ",
+ " █░░░████████████████░█ ",
+ " █░░█ █░░ █░░ █░░█ ",
+ " ███ ███ ███ ███ "
+ ],
+ [
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ ",
+ " ███ █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ ",
+ " █░██ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █░░███▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " █░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ ",
+ " ██░░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ ",
+ " ████▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " ██▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒█░░░██████░░█ ",
+ " ███▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░░███████████████████ ",
+ " █░░██ █░█ █░░ █░░█ ",
+ " ████ ██ ██ ██ ",
+ " "
+ ],
+ [
+ " █ ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █ █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █░█ █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " █░████▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " ░░░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " ██░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " ███▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░████████████████████ ",
+ " █░░█ █░█ ░░█ █░░█ ",
+ " ███ ██ ███ ███ █ ",
+ " "
+ ],
+ [
+ " █ ",
+ " █ ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " ██▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " █████▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " █░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " ███ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░████████████████████ ",
+ " █░░█ ░░█ ░░███░░█ ",
+ " ███ ███ ███ ███ "
+ ],
+ [
+ " █ ",
+ " █ ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒▒██▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░█▒▒▓█ █░░█ ",
+ " █▓▒▒▒▒▒▓▒▒▒█░░░▒▒▓██░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ " █▓▒▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " ███▓▒▒▒▒▒▒▓▒█░░░░░░░░░░░░░█",
+ " ██░░█▓▒▓▒▒▒▒▒▒█░░░██░░░░██░░█",
+ " ░░░░█▓▒▒▒▒▒▒▒▒█░░░██░░█░██░░█",
+ " █░█ █▓▓▒▒▒▓▒▒▒█░▓▓░░░░░░░░▓▓█",
+ " █ █▓▓▓▒▒▒▒▒▒▒█░░░██████░░█ ",
+ " ██▓▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░████████████████████ ",
+ " █░░█ █░█ ██ █░░█ █░░█ ",
+ " ███ ██ █ ███ ███ "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒▓▒▒▒▒▓▓█ ",
+ " █▓▒▒▓▒▒▒▒▒▒██▒▓▒▒▓█ ██ ",
+ " █▓▒▒▒▒▒▒▒▒█░░█▒▒▒▓██░░█ ",
+ " █▓▒▒▒▒▒▓▒▒█░░░▒▒▒▓█░░░█ ",
+ " ███ █▓▒▒▒▒▒▒▒▒█░░░████░░░░█ ",
+ "█░░████▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ "█░░░░██▓▒▒▒▒▒▒▓█░░░░░░░░░░░░░█ ",
+ " ████░█▓▒▓▒▒▒▒▒█░░░██░░░░██░░█ ",
+ " ███▓▒▒▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " █▓▓▒▒▒▓▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " ██▓▓▓▒▒▒▒▒▒█░░░██████░░█ ",
+ " ████▓▓▓▓▓▓▓▓▓█░░░░░░░░░█ ",
+ " █░░░████████████████████ ",
+ " █░░███░░██ █░░██░░█ ",
+ " ███ ██ ███ ███ "
+ ],
+ [
+ " ",
+ " ",
+ " ███████████████ ",
+ " █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ",
+ " █▓▓▓▒▒▒▒▒▒▒▒▒▒▒▓▓▓█ ",
+ " █▓▓▒▒▒▒▒▓▒▒██▒▒▒▓▓█ ██ ",
+ " █▓▒▒▓▒▒▒▒▒█░░█▓▒▒▓██░░█ ",
+ " █▓▒▒▒▒▒▒▒▒█░░░▒▒▒▓█░░░█ ",
+ " █ █▓▒▒▒▒▒▓▒▒█░░░████░░░░█ ",
+ " █░█ █▓▒▒▒▒▒▒▒▒█░░░░░░░░░░░█ ",
+ " █░████▓▒▒▒▒▒▒▒█░░░░░░░░░░░░░█ ",
+ " ░░░░█▓▒▒▒▒▒▒▓█░░░██░░░░██░░█ ",
+ " ██░░█▓▒▓▒▒▒▒▒█░░░██░░█░██░░█ ",
+ " ███▓▒▒▒▒▒▒▒█░▓▓░░░░░░░░▓▓█ ",
+ " █▓▓▒▒▒▓▒▒▒█░░░██████░░█ ",
+ " █ ██▓▓▓▒▒▒▒▒▒▒█░░░░░░░░░█ ",
+ " ██░██▓▓▓▓▓▓▓▓▓▓█████████ ",
+ " █░░░████████████████░█ ",
+ " █░░█ █░░ █░░██░░█ ",
+ " ███ ███ ███ ███ "
+ ]
+ ],
+ "holds": [
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90,
+ 90
+ ],
+ "source": "https://github.com/klange/nyancat/blob/master/src/animation.c",
+ "note": "Original cycle cropped to the cat. ANSI colors represented by Unicode shade blocks in monochrome; original animation credited to prguitarman."
+ },
+ {
+ "name": "Desk companion",
+ "cols": 28,
+ "rows": 30,
+ "font": "block_square",
+ "color": "c4b8f2",
+ "frames": [
+ [
+ " ",
+ " ",
+ " ░ ░░░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▒░ ░░ ",
+ " ░▒░░░░▓▓▓▓▓▓▓▓░ ",
+ " ░▒░▒▒░░░░░░░░░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓░ ",
+ " ░░░▒▓████████▓▒█░ ",
+ " ░░█▒▓██▓█████▓ █░ ",
+ " ░▓▒▓██ ▒████▓▓█▒▒▒░ ",
+ " ░▒▒▓██▓▓███████████░ ",
+ " ░▒▒▓███████████▒ ",
+ " ▒▒▓██░░░░░░▒▒░ ",
+ " ▒▓██▒▒▒▒▒▒▒▒▒ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓░░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒░",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ],
+ [
+ " ░ ░░ ",
+ " ░░░░░ ",
+ " ░ ░▒▓▓▒ ",
+ " ░░░ ░▒▒▒░▒░ ",
+ " ░▒░░░░▒▒▒▒▒▒▒▒░ ",
+ " ░▒░▒▒▒▒▒▒▒▒▒▒▒░ ▓░ ",
+ " ░░▒▓▓▓▓▓▓▓▓▓▓▓▓░ ▒▒▒",
+ " ░░░▒▓███████████░ ░░",
+ " ░░█▒▓████████▓▓█░░░ ",
+ " ░▒▒▓██▒▓███████▒▒▒▒ ",
+ " ░▒▒▓███████████████░ ",
+ " ░▒▒▓███████████░ ░▓▓",
+ " ░▒▒▓██ ░░ ▓░ ",
+ " ▒▒▓██ ░ ",
+ " ▒▓██▒▒▒▒▒▒▒▒▒ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ▒▒▒ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓ ░ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░█████▒░",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░░░░░▒░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ░ ░░░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▒░ ░░ ▓░ ",
+ " ░▒░░░░▓▓▓▓▓▓▓▓░ ▓░ ",
+ " ░▒░▒▒░░░░░░░░░ ▒▒░",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓░ ░ ",
+ " ░░░▒▓█████████▓█░ ",
+ " ░░█▒▓█████████ █░ ",
+ " ░▓▒▓██▒▓████▓▓█▒▒▒░ ",
+ " ░▒▒▓██▓▓███████████░ ░▒ ",
+ " ░▒▒▓███████████▒ ░░░ ",
+ " ▒▒▓██░░░░░░▒▒░ ░ ",
+ " ▒▓██▒▒▒▒▒▒▒▒▒ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░ ██▓░░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒░",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " ░ ░ ",
+ " ░▒▓▓▒ ░▒░ ",
+ " ░░░ ░▒▓▒ ░░ ▓ ",
+ " ░░░░░░▒▒▒▓▒▒▒▓░ ",
+ " ░▒░▒░░░░▒▒▒▒▒▒░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
+ " ░░░▒▓█████████▓█░ ",
+ " ░░▓▒▓████████▒ █░ ",
+ " ░▓▒▓██ ▒████▓▓█▒▒▒░ ",
+ " ▒▒▓██▒▓███████████░ ░ ",
+ " ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ ",
+ " ▒▓██▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ ",
+ " ░ ░ ▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ ",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " ░ ░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▓▒ ░░ ",
+ " ░░░░░░▒▒▒▓▒▒▒▓░ ",
+ " ░▒░▒░░░░▒▒▒▒▒▒░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
+ " ░░░▒▓█████████▓█░ ",
+ " ░░▓▒▓████████▒ █░ ",
+ " ░▓▒▓██ ▒████▓▓█▒▒▒░ ",
+ " ▒▒▓██▒▓███████████░ ",
+ " ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ ",
+ " ▒▓██▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ ",
+ " ░ ░ ▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ ",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒▒░░░ ░░░░░░░░░░",
+ "░░ ▓████▓▓░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▓░▒░░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " ░ ░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▓▒ ░░ ",
+ " ░░░░░░▒▒▒▓▒▒▒▓░ ",
+ " ░▒░▒░░░░▒▒▒▒▒▒░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
+ " ░░░▒▓█████████▓█░ ",
+ " ░░▓▒▓████████▒ █░ ",
+ " ░▓▒▓██ ▒████▓▓█▒▒▒░ ",
+ " ▒▒▓██▒▓███████████░ ",
+ " ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ ",
+ " ▒▓██▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ ",
+ " ░ ░ ▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ ",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " ░ ░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▓▒ ░░ ",
+ " ░░░░░░▒▒▒▓▒▒▒▓░ ",
+ " ░▒░▒░░░░▒▒▒▒▒▒░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
+ " ░░░▒▓███████████░ ",
+ " ░░▓▒▓████████▓▓█░ ",
+ " ░▓▒▓██▓▓███████▒▒▒░ ",
+ " ▒▒▓███████████████░ ",
+ " ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ ",
+ " ▒▓██▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ ",
+ " ░ ░ ▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ ",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒▒░░░ ░░░░░░░░░░",
+ "░░ ▓████▓▓░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▓░▒░░░░░░░░░░░░░ "
+ ],
+ [
+ " ",
+ " ",
+ " ",
+ " ░ ░ ",
+ " ░▒▓▓▒ ",
+ " ░░░ ░▒▓▒ ░░ ",
+ " ░░░░░░▒▒▒▓▒▒▒▓░ ",
+ " ░▒░▒░░░░▒▒▒▒▒▒░ ",
+ " ░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
+ " ░░░▒▓█████████▓█░ ",
+ " ░░▓▒▓████████▒ █░ ",
+ " ░▓▒▓██ ▒████▓▓█▒▒▒░ ",
+ " ▒▒▓██▒▓███████████░ ",
+ " ▒▒▓██▓▓▓▓▓▓▓▓▓▒░░░ ",
+ " ▒▓██▓▓▓▓▓▓▓▓▓░ ",
+ " ░ ▒▓▓▓▓▓▓▓▓▓▓▓░ ░░ ",
+ " ░ ░ ▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░▒▒ ░░▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ▓▓▒ ░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ██▓▒▒░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░▓▓▓▓▓░ ",
+ " ░▒▒▒░▒▒▒▒▒▒▒▒▒░ ░░▒▒▒▒▒▒ ",
+ " ░▒▒▒ ░▒▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒▒ ",
+ " ░░ ░▒▒▒▒▒▒▒▒░ ░░░▒▒▒▒░░",
+ " ░░░ ░▒▒▒▒▒▒▒▒░░ ░░░░░░░░ ",
+ " ░░░▒▒▒▒▒▒▒▒▒▒░ ░░░░░░░░░░ ",
+ " ░ ▓▓▒▒▒▒░░░░ ░░░░░░░░░░",
+ "░░ ▓████▒ ░░░░░░░░░░░░░░",
+ "░░░ ░ ▒▒▒▒▒▒ ░░░░░░░░░░░░ "
+ ]
+ ],
+ "holds": [
+ 140,
+ 140,
+ 140,
+ 140,
+ 140,
+ 140,
+ 140,
+ 140
+ ],
+ "source": "https://adelfaure.net/docs/lures/POLYDUCKS-BUTTON_PRESSER.GIF",
+ "note": "Polyducks, Button Presser (2021), PETSCII. Cropped to companion, offline conversion to monochrome Unicode shade blocks; encoded holds retained."
+ }
+]
diff --git a/devices/harness-device/prototype/habitat/assets/creature-references/parrot.animation b/devices/harness-device/prototype/habitat/assets/creature-references/parrot.animation
new file mode 100644
index 000000000..b11625458
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/assets/creature-references/parrot.animation
@@ -0,0 +1,191 @@
+description: The classic Party Parrot.
+!--FRAME--!
+ .cccc;;cc;';c.
+ .,:dkdc:;;:c:,:d:.
+ .loc'.,cc::::::,..,:.
+ .cl;....;dkdccc::,...c;
+ .c:,';:'..ckc',;::;....;c.
+ .c:'.,dkkoc:ok:;llllc,,c,';:.
+ .;c,';okkkkkkkk:,lllll,:kd;.;:,.
+ co..:kkkkkkkkkk:;llllc':kkc..oNc
+ .cl;.,okkkkkkkkkkc,:cll;,okkc'.cO;
+ ;k:..ckkkkkkkkkkkl..,;,.;xkko:',l'
+ .,...';dkkkkkkkkkkd;.....ckkkl'.cO;
+ .,,:,.;oo:ckkkkkkkkkkkdoc;;cdkkkc..cd,
+ .cclo;,ccdkkl;llccdkkkkkkkkkkkkkkkd,.c;
+ .lol:;;okkkkkxooc::loodkkkkkkkkkkkko'.oc
+ .c:'..lkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.oc
+ .lo;,ccdkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkd,.c;
+,dx:..;lllllllllllllllllllllllllllllllloc'...
+cNO;........................................
+!--FRAME--!
+ .ckx;'........':c.
+ .,:c:c:::oxxocoo::::,',.
+ .odc'..:lkkoolllllo;..;d,
+ ;c..:o:..;:..',;'.......;.
+ ,c..:0Xx::o:.,cllc:,'::,.,c.
+ ;c;lkXXXXXXl.;lllll;lXXOo;':c.
+ ,dc.oXXXXXXXXl.,lllll;lXXXXx,c0:
+ ;Oc.oXXXXXXXXo.':ll:;'oXXXXO;,l'
+ 'l;;OXXXXXXXXd'.'::'..dXXXXO;,l'
+ 'l;:0XXXXXXXX0x:...,:o0XXXXk,:x,
+ 'l;;kXXXXXXKXXXkol;oXXXXXXXO;oNc
+ ,c'..ckk2XXXXXXXXXX00XXXXXXX0:;o:.
+ .':;..:dd::ooooOXXXXXXXXXXXXXXXo..c;
+ .',',:co0XX0kkkxx0XXXXXXXXXXXXXXX0c..;l.
+ .:;'..oXXXXXXXXXXXXXXXXXXXXXXXXXXXXXko;';:.
+.cdc..:oOXXXXXXXXKXXXXXXXXXXXXXXXXXXXXXXo..oc
+:0o...:dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo,.:,
+cNo........................................;'
+!--FRAME--!
+ .cc;. ... .;c.
+ .,,cc:cc:lxxxl:ccc:;,.
+ .lo;...lKKklllookl..cO;
+ .cl;.,;'.okl;...'.;,..';:.
+ .:o;;dkx,.ll..,cc::,..,'.;:,.
+ co..lKKKkokl.':lllo;''ol..;dl.
+ .,c;.,xKKKKKKo.':llll;.'oOxo,.cl,.
+ cNo..lKKKKKKKo'';llll;;okKKKl..oNc
+ cNo..lKKKKKKKko;':c:,'lKKKKKo'.oNc
+ cNo..lKKKKKKKKKl.....'dKKKKKxc,l0:
+ .c:'.lKKKKKKKKKk;....oKKKKKKo'.oNc
+ ,:.,oxOKKKKKKKOxxxxOKKKKKKxc,;ol:.
+ ;c..'':oookKKKKKKKKKKKKKKKKKk:.'clc.
+ ,dl'.,oxo;'';oxOKKKKKKKKKKKKKKKOxxl::;,,.
+ .dOc..lKKKkoooookKKKKKKKKKKKKKKKKKKKxl,;ol.
+ cx,';okKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKl..;lc.
+ co..:dddddddddddddddddddddddddddddddddl:;''::.
+ co..........................................."
+!--FRAME--!
+ .ccccccc.
+ .,,,;cooolccol;;,,.
+ .dOx;..;lllll;..;xOd.
+ .cdo,',loOXXXXXkll;';odc.
+ ,oo:;c,':oko:cccccc,...ckl.
+ ;c.;kXo..::..;c::'.......oc
+,dc..oXX0kk0o.':lll;..cxxc.,ld,
+kNo.'oXXXXXXo'':lll;..oXXOd;cOd.
+KOc;oOXXXXXXo.':lol,..dXXXXl';xc
+Ol,:k0XXXXXX0c.,clc'.:0XXXXx,.oc
+KOc;dOXXXXXXXl..';'..lXXXXXd..oc
+dNo..oXXXXXXXOx:..'lxOXXXXXk,.:; ..
+cNo..lXXXXXXXXXOolkXXXXXXXXXkl;..;:.;.
+.,;'.,dkkkkk0XXXXXXXXXXXXXXXXXOxxl;,;,;l:.
+ ;c.;:''''':doOXXXXXXXXXXXXXXXXXXOdo;';clc.
+ ;c.lOdood:'''oXXXXXXXXXXXXXXXXXXXXXk,..;ol.
+ ';.:xxxxxocccoxxxxxxxxxxxxxxxxxxxxxxl::'.';;.
+ ';........................................;l'
+!--FRAME--!
+
+ .;:;;,.,;;::,.
+ .;':;........'co:.
+ .clc;'':cllllc::,.':c.
+ .lo;;o:coxdlooollc;',::,,.
+.c:'.,cl,.'lc',,;;'......cO;
+do;';oxoc::l;;llllc'.';;'.';.
+c..ckkkkkkkd,;llllc'.:kkd;.':c.
+'.,okkkkkkkkc;llllc,.:kkkdl,cO;
+..;xkkkkkkkkc,ccll:,;okkkkk:,cl,
+..,dkkkkkkkkc..,;,'ckkkkkkkc;ll.
+..'okkkkkkkko,....'okkkkkkkc,:c.
+c..ckkkkkkkkkdl;,:okkkkkkkkd,.',';.
+d..':lxkkkkkkkkxxkkkkkkkkkkkdoc;,;'..'.,.
+o...'';llllldkkkkkkkkkkkkkkkkkkdll;..'cdo.
+o..,l;'''''';dkkkkkkkkkkkkkkkkkkkkdlc,..;lc.
+o..;lc;;;;;;,,;clllllllllllllllllllllc'..,:c.
+o..........................................;'
+!--FRAME--!
+
+ .,,,,,,,,,.
+ .ckKxodooxOOdcc.
+ .cclooc'....';;cool.
+ .loc;;;;clllllc;;;;;:;,.
+ .c:'.,okd;;cdo:::::cl,..oc
+ .:o;';okkx;';;,';::;'....,;,.
+ co..ckkkkkddk:,cclll;.,c:,:o:.
+ co..ckkkkkkkk:,cllll;.:kkd,.':c.
+.,:;.,okkkkkkkk:,cclll;.:kkkdl;;o:.
+cNo..ckkkkkkkkko,.;llc,.ckkkkkc..oc
+,dd;.:kkkkkkkkkx;..;:,.'lkkkkko,.:,
+ ;c.ckkkkkkkkkkc.....;ldkkkkkk:.,'
+,dc..'okkkkkkkkkxoc;;cxkkkkkkkkc..,;,.
+kNo..':lllllldkkkkkkkkkkkkkkkkkdcc,.;l.
+KOc,l;''''''';lldkkkkkkkkkkkkkkkkkc..;lc.
+xx:':;;;;,.,,...,;;cllllllllllllllc;'.;oo,
+cNo.....................................oc
+!--FRAME--!
+
+
+ .ccccccc.
+ .ccckNKOOOOkdcc.
+ .;;cc:ccccccc:,::::,,.
+ .c;:;.,cccllxOOOxlllc,;ol.
+ .lkc,coxo:;oOOxooooooo;..:,
+ .cdc.,dOOOc..cOd,.',,;'....':c.
+ cNx'.lOOOOxlldOl..;lll;.....cO;
+ ,do;,:dOOOOOOOOOl'':lll;..:d:.'c,
+ co..lOOOOOOOOOOOl'':lll;.'lOd,.cd.
+ co.,dOOOOOOOOOOOo,.;llc,.,dOOc..dc
+ co..lOOOOOOOOOOOOc.';:,..cOOOl..oc
+ .,:;.'::lxOOOOOOOOOo:'...,:oOOOc..dc
+ ;Oc..cl'':llxOOOOOOOOdcclxOOOOx,.cd.
+ .:;';lxl''''':lldOOOOOOOOOOOOOOc..oc
+,dl,.'cooc:::,....,::coooooooooooc'.c:
+cNo.................................oc
+!--FRAME--!
+
+
+
+ .cccccccc.
+ .,,,;;cc:cccccc:;;,.
+ .cdxo;..,::cccc::,..;l.
+ ,oo:,,:c:cdxxdllll:;,';:,.
+ .cl;.,oxxc'.,cc,.',;;'...oNc
+ ;Oc..cxxxc'.,c;..;lll;...cO;
+ .;;',:ldxxxdoldxc..;lll:'...'c,
+ ;c..cxxxxkxxkxxxc'.;lll:'','.cdc.
+ .c;.;odxxxxxxxxxxxd;.,cll;.,l:.'dNc
+ .:,''ccoxkxxkxxxxxxx:..,:;'.:xc..oNc
+ .lc,.'lc':dxxxkxxxxxxxdl,...',lx:..dNc
+ .:,',coxoc;;ccccoxxxxxxxxo:::oxxo,.cdc.
+ .;':;.'oxxxxxc''''';cccoxxxxxxxxxkxc..oc
+,do:'..,:llllll:;;;;;;,..,;:lllllllll;..oc
+cNo.....................................oc
+!--FRAME--!
+
+
+ .ccccc.
+ .cc;'coooxkl;.
+ .:c:::c:,;,,,;c;;,.'.
+ .clc,',:,..:xxocc;...c;
+ .c:,';:ox:..:c,,,,,,...cd,
+ .c:'.,oxxxxl::l:.;loll;..;ol.
+ ;Oc..:xxxxxxxxx:.,llll,....oc
+ .,;,',:loxxxxxxxxx:.,llll;.,;.'ld,
+ .lo;..:xxxxxxxxxxxx:.'cllc,.:l:'cO;
+ .:;...'cxxxxxxxxxxxxol;,::,..cdl;;l'
+ .cl;':;'';oxxxxxxxxxxxxx:....,cooc,cO;
+ .,,,::;,lxoc:,,:lxxxxxxxxxxxo:,,;lxxl;'oNc
+ .cdxo;':lxxxxxxc'';cccccoxxxxxxxxxxxxo,.;lc.
+ .loc'.'lxxxxxxxxocc;''''';ccoxxxxxxxxx:..oc
+occ'..',:cccccccccccc:;;;;;;;;:ccccccccc,.'c,
+Ol;......................................;l'
+!--FRAME--!
+
+ ,ddoodd,
+ .cc' ,ooccoo,'cc.
+ .ccldo;....,,...;oxdc.
+ .,,:cc;.''..;lol;;,'..lkl.
+ .dkc';:ccl;..;dl,.''.....oc
+ .,lc',cdddddlccld;.,;c::'..,cc:.
+ cNo..:ddddddddddd;':clll;,c,';xc
+ .lo;,clddddddddddd;':clll;:kc..;'
+ .,:;..:ddddddddddddd:';clll;;ll,..
+ ;Oc..';:ldddddddddddl,.,c:;';dd;..
+ .''',:lc,'cdddddddddddo:,'...'cdd;..
+ .cdc';lddd:';lddddddddddddd;.';lddl,..
+ .,;::;,cdddddol;;lllllodddddddlcodddd:.'l,
+ .dOc..,lddddddddlccc;'';cclddddddddddd;,ll.
+ .coc,;::ldddddddddddddl:ccc:ldddddddddlc,ck;
+,dl::,..,cccccccccccccccccccccccccccccccc:;':xx,
+cNd.........................................;lOc
diff --git a/devices/harness-device/prototype/habitat/assets/creature-references/stark-dragon.txt b/devices/harness-device/prototype/habitat/assets/creature-references/stark-dragon.txt
new file mode 100644
index 000000000..4342a089d
--- /dev/null
+++ b/devices/harness-device/prototype/habitat/assets/creature-references/stark-dragon.txt
@@ -0,0 +1,20 @@
+ \(______ ______)/
+ /`.----.\ /.----.`\
+ } / :} {: \ {
+ / { } { } \
+ } } ) } { ( { {
+ / { /|\}!{/|\ } \
+ } } ( (."^".) ) { {
+ / { (d\ /b) } \
+ } } |\~ ~/| { {
+ / / | ) ( | \ \
+ { { _)(, ,)(_ } }
+ } } // `";"` \\ { {
+ / / // ( \\ \ \
+{ { {( -=) )} } }
+ \ \ /) -=(=- (\ / /
+ `\\ /'/ /-=|\-\ \`\ //'
+ `\{ | ( -===- ) | }/'
+ ` _\ \-===-/ /_ '
+ jgs (_(_(_)'-=-'(_)_)_)
+ `"`"`" "`"`"`
diff --git a/devices/harness-device/prototype/habitat/assets/unscii-8.ttf b/devices/harness-device/prototype/habitat/assets/unscii-8.ttf
new file mode 100644
index 000000000..cea4a04d1
Binary files /dev/null and b/devices/harness-device/prototype/habitat/assets/unscii-8.ttf differ
diff --git a/devices/harness-device/prototype/habitat/images/bridge-codex-working.png b/devices/harness-device/prototype/habitat/images/bridge-codex-working.png
new file mode 100644
index 000000000..c5c04b12f
Binary files /dev/null and b/devices/harness-device/prototype/habitat/images/bridge-codex-working.png differ
diff --git a/devices/harness-device/prototype/habitat/images/bridge-completed.png b/devices/harness-device/prototype/habitat/images/bridge-completed.png
new file mode 100644
index 000000000..d0f523150
Binary files /dev/null and b/devices/harness-device/prototype/habitat/images/bridge-completed.png differ