SLOPSHOPPER

usage-meter

5시간/주간/대화 사용량을 프롬프트 위에 보여줍니다. /flame1 은 파란 불꽃 사용량 밴드, /terry 는 입력·응답에 반응하는 베들링턴 테리어와 이번 요청의 시간·토큰 카드. 80%/90%에서 알립니다

v1.2.26no licenseupdated 2026-10-22d3nims/d3nim-claude-mods/plugins/usage-meter
A shopper browsing a rack in a slop shop
Preview could not run: TypeError: undefined is not an object (evaluating 'SETS.run.frames') at anonymous (file:///inner.js:431:18) at run (inner.js:982:9) at /home/runner/work/slopshopper/slopshopper/scripts/har
README

d3nim-claude-mods

d3nim 팀이 같이 쓰는 Claude Code mods 모음입니다.

설치

Claude Code 안에서:

/plugin marketplace add d3nims/d3nim-claude-mods
/plugin install usage-meter@d3nim-claude-mods
/plugin install auto-model@d3nim-claude-mods
/reload-plugins

터미널에서 해도 됩니다:

claude plugin marketplace add d3nims/d3nim-claude-mods
claude plugin install usage-meter@d3nim-claude-mods

공개 저장소라 GitHub 로그인 없이 받을 수 있습니다.

업데이트

/plugin marketplace update d3nim-claude-mods
/reload-plugins

usage-meter

프롬프트 위에 5시간 · 주간 · 대화 사용량을 보여 주고, 80% · 90% 에서 알려 줍니다.

/terry

입력하는 동안 꼬리를 흔들고, 엔터를 치면 응답이 끝날 때까지 달리고, 끝나면 헥헥거리다 조는 테리

추론 강도에 따라 달리기가 달라져요

응답하는 동안 테리는 지금 추론 강도(/effort)에 맞춰 움직입니다. max 에선 빨간 망토를 휘날리며 날아요. /terry run max 처럼 강도를 붙이면 20초 동안 미리 볼 수 있어요.

low 걷기, medium 빨리 걷기, high 달리기, xhigh 전력 질주, max 망토 달고 날기

Claude 가 하는 일에 따라 움직여요

파일을 읽거나 찾을 땐 킁킁거리고, 명령을 실행하거나 파일을 고칠 땐 땅을 파고(오래 팔수록 뒤에 흙더미가 쌓여요), 웹에서 가져올 땐 막대기를 물어 와요. 허락을 기다리면 말풍선에 ? 를 띄우고, 요청이 실패하거나 멈추면 고개를 떨구고 시무룩해져요. /terry sniff · dig · fetch · ask · sad 로 미리 볼 수 있어요.

읽기·검색 킁킁, 실행·수정 땅 파기, 웹 물어 오기, 허락 대기 말풍선, 실패 시무룩

이럴 때도 반응해요

  • 테스트가 통과하면 뛰어올라 원반을 물고, 실패하면 고개를 떨구고 꼬리를 말아요.
  • 5시간 한도를 다 쓰면 문 앞에서 기다리다가, 풀리는 순간 짖으며 알려 줘요.
  • 하루 첫 입력엔 기지개를 켜며 하품하고, 저녁 6시~7시 반엔 가끔 밥을 먹고, 고개를 들어 코를 핥아요.
  • /terry pet 하면 좋아해요. 쓰다듬은 횟수는 /terry stats 에 남아요.
  • 설날·추석엔 복주머니와 송편이, 설치한 지 1년 되는 날엔 케이크가 놓여요.
  • /terry catch · droop · door · stretch · eat 로 미리 볼 수 있어요.

/flame1

5시간 · 주간 · 대화 사용량을 파란 불꽃 높이로 보여 주는 밴드

명령내용
/flame1파란 불꽃 사용량 밴드 + 모델 카드
/terry입력·응답에 반응하는 베들링턴 테리어, 이번 요청의 시간·토큰 카드, 사용량 표
/terry run20초 동안 달리는 모습 미리보기 (sit wag bark happy sleep, stop 으로 끝내기)
/terry run max추론 강도별 달리기 미리보기 (low medium high xhigh max, middle · 중간 도 됨)
/terry dig도구별 동작 미리보기 (sniff dig fetch ask sad)
/terry catch상황별 동작 미리보기 (catch 테스트 통과, droop 테스트 실패, door 한도 대기, stretch 하루 첫 입력, eat 저녁)
/terry pet테리 쓰다듬기
/terry pane테리를 옆 창에 따로 크게 띄우기
/terry stats오늘의 기록: 요청 수, 토큰, 가장 오래 걸린 요청, 테리가 달린 거리, 쓰다듬은 횟수
/terry mem메모리: 전체·남은 양·Claude 가 쓰는 양·많이 쓰는 프로그램, 더 차면 생기는 일. 남은 양이 15% 아래면 카드에도 한 줄 (8% 아래 빨강)
/terry mem clean꺼도 되는 것 목록 (쉬는 Claude 세션·주인 잃은 도우미, (추천) 표시)과 여러 개 고르는 창. /terry mem clean 1 3, 추천 으로도
/terry braille · /terry quad그림 방식 바꾸기 (/flame1 도 같음). 테리는 점자(braille)가 기본이고 점 하나하나 다듬은 그림이에요. quad · fine 은 같은 그림을 블록으로 그리고, 칸마다 색이 둘뿐이라 회색을 조금 밝혀 얼룩지지 않게 해요
/runner테리 대신 가방 멘 런너가 사다리를 오르고 줄을 건너요. 해골 수도승이 뒤쫓아 오고, 땅을 팔 땐 레이저를 쏴요. /terry 명령을 그대로 쓰고, /terry 로 돌아와요
/monk테리 대신 해골 수도승이 사다리를 올라요
/terry font터미널 픽셀로 아주 곱게 (Lode Cells 글꼴 필요, 아래 '더 곱게')
/terry help사용법

테리는 평소엔 앉아서 숨 쉬며 꼬리를 살랑이다가, 입력하는 동안 혀를 내밀고 꼬리를 흔들고, 엔터를 치면 응답이 끝날 때까지 달리고, 다 끝나면 헥헥거리고, 3분 동안 조용하면 꾸벅꾸벅 졸아요. 쉬는 동안엔 몸통이 숨을 쉬고, 뛰거나 짖으면 귀가 한 박자 늦게 따라와요. 하늘은 실제 시계를 따라 낮엔 해, 밤엔 둥근 초승달과 별이 뜨고, 날짜를 따라 봄엔 꽃잎, 여름밤엔 반딧불, 가을엔 낙엽, 겨울엔 눈이 내려요. 12/31 과 1/1 밤엔 불꽃놀이도 터져요.

더 곱게: /terry font (WaveTerm)

터미널 칸 하나하나를 글꼴 조각으로 채워서, 테리를 화면 픽셀 그대로 그려요. 점자보다 훨씬 매끈하고, 칸마다 세 가지 색까지 써요. 우리가 만든 Lode Cells 글꼴이 있어야 보여요.

  1. Windows PowerShell 에서 한 줄 실행 (글꼴 설치, 내 계정에만 등록, WaveTerm 글꼴 목록에 추가): ``powershell irm https://raw.githubusercontent.com/d3nims/d3nim-claude-mods/main/plugins/usage-meter/fonts/install-font.ps1 | iex ``
  2. WaveTerm 을 완전히 껐다 켜요: 창을 모두 닫고 작업 관리자에 Wave 가 안 남았는지 확인 (열린 터미널은 같이 닫혀요). 켜 둔 채로는 새 글꼴을 못 봐요.
  3. Claude Code 에서 /terry font (/runner font · /monk font 도 돼요). 답에 나오는 시험 글자가 흰 가로 막대면 OK, 빈 네모면 글꼴이 안 잡힌 거라 /terry braille 로 돌아가요.

글꼴은 화면을 보여 주는 PC 에 깔아야 해요. 다른 PC 에서 SSH·tmux 로 붙어 보면, 그 PC 에 깔아야 해요.

그림은 WaveTerm 기본 글꼴(Hack) 14 크기, 화면 배율 100% 에 맞춰 잘랐어요. 다른 글꼴·크기에선 틈이 보일 수 있어요. 점자보다 CPU 를 조금 더 써요.

글자가 테리 조각으로 깨져 보이면(내장 그래픽 노트북에서 WaveTerm 화면 엔진의 버그), 그 터미널 블록을 닫았다 열면 돌아와요. 1.2.24 부터는 거의 안 생기게 줄였어요.

Claude 창을 여러 개 띄우면 지금 쓰는 창의 카드만 움직이고, 나머지 창의 카드는 지금 상태의 한 장에서 어둡게 멈추고 한가운데 PAUSE || 글씨가 떠요(1.2.25, 글씨는 1.2.26). 쉬는 창도 일이 끝나거나 실패하면 그 자세로 바뀌어요. 지금 쓰는 창은 마지막으로 입력한 창이고, tmux 안에서 set -g focus-events on 을 켜 두면 마지막으로 클릭한 창도 쳐요. WaveTerm 창들이 글자 그림 저장소를 함께 써서, 카드가 여러 개 움직이면 깨짐이 빨리 왔어요.

색이 이상하게 보이면

테리가 청록색이나 보라색으로 보이거나 흙길이 회색이면, 터미널이 트루컬러를 알리지 않아 256색으로 줄여 그려진 것입니다. 셸 설정(~/.bashrc 등)에 아래 줄을 넣고 Claude Code 를 다시 켜 주세요.

export COLORTERM=truecolor

Claude 밖에서 테리 보기

node docs/preview/terry-view.mjs   # ←→ 동작, e 강도, m 그림 방식, w 너비, t 시각, s 계절, y 명절, space 느리게, q 끝내기

auto-model

요청마다 맞는 모델이 처리해요. 메인(Opus)은 그대로 두고 단순한 일은 Sonnet·Haiku 일꾼에게 맡겨서, 기억을 안 깨고 사용료를 아껴요. 팀장을 바꾸는 게 아니라 일마다 맞는 팀원에게 배정하는 셈이에요. 메인 모델을 바꾸지 않는 이유: 캐시는 모델마다 따로이고 마지막 호출 뒤 1시간이 지나면 식어서, 긴 대화에서 함부로 모델을 바꾸면 대화 전체를 다시 저장하느라 오히려 비싸집니다. usage-meter 와 같이 쓰면 테리 카드에 표시됩니다.

  • 쉰 뒤 압축 제안: 1시간 넘게 쉬었고 대화가 15만 토큰 이상이면, 다음 요청이 대화 전체를 다시 쓴다는 걸 알리고 압축을 제안합니다 ([압축] [계속]). 이때 [압축] 은 Sonnet 이 요약합니다(시험에서 Opus 와 같은 품질에 절반 값).
  • 작업 중 압축 알림: 대화가 85% 차면 "지금은 기억이 살아 있어서 싸게 압축돼요" 를 띄웁니다 ([압축] [나중에], 나중에는 5%p 더 찰 때까지 안 물음). 이때는 원래 모델이 압축합니다.
  • 압축 요약의 승인 인용: 쉬고 와서 카드의 [압축] 으로 Sonnet 이 요약할 때는 승인·금지를 사용자 말 그대로 짧게 인용하게 해서 범위가 흐려지지 않게 합니다. 이 요약은 화면에 그대로 보입니다. 작업 중 압축·직접 친 /compact·자동 압축은 원래 모델이 하고 화면엔 한 줄만 남습니다.
  • 모델 고르기: 요청마다 판단하되, 바꾸는 쪽이 확실히 쌀 때만 바꿉니다. 맞장구는 그대로, "ㅇㅋ 진행해" 같은 승인·진행 지시는 무거운 일로 봅니다. 기억을 묻는 짧은 질문의 전환은 지금은 "켰다면"만 기록합니다 (/auto-model light on 으로 켜기).
  • 서브에이전트: 모델을 지정하지 않은 검색·탐색 서브에이전트는 Haiku 로 보냅니다.
  • 최신 모델: 메인이든 서브에이전트든 옛 버전 모델(예: 에이전트 파일에 적힌 claude-opus-4-7)은 같은 종류의 최신 버전으로 돌립니다. 종류(Opus·Sonnet·Haiku)는 그대로예요.
  • 일꾼: 판단이 필요 없는 일(목적지와 내용이 분명한 쓰기는 Sonnet, 찾기·읽기는 Haiku)은 Opus 를 부르지 않고 일꾼 서브에이전트가 최근 몇 턴만 받아 처리합니다. 일꾼의 답이 대화 끝에 붙어서 Opus 의 캐시는 그대로입니다. 기본은 기록만(shadow), /auto-model worker on 으로 켜기. @@ 요청(Sonnet) · @@h 요청(Haiku) 은 손으로 바로 일꾼에게.
  • 얼마나 아꼈나: 일꾼·Sonnet 압축이 처리하면 답 끝이나 토스트에 "실제 약 $A · Opus였다면 약 $B → 약 $C 절약" 이 붙고, 새로 아낀 뒤 두 턴 동안 카드 아래에 이 대화 약 N% 아낌 (= 이 대화에서 아낀 값 ÷ (이 대화가 실제 쓴 값 + 아낀 값)) 이 보입니다. /auto-model 상세에는 이 PC 합계(오늘·7일)와 5시간·주간 게이지로 환산한 값도 참고로 나옵니다. 모두 이 컴퓨터의 숫자만 씁니다: 다른 PC 의 비용은 합칠 수 없어서 PC 별 표시이고, 같은 계정을 다른 사람·다른 PC 와 같이 쓰면 게이지 환산은 어림값입니다 (내 사용량 대비 % 는 그래도 정확).
  • 늘 보이게: 카드 모델 줄에 🔄 (바꿔서 씀) 📌 (고정) ✋ (/model 로 직접 골라 멈춤). 프롬프트 앞에 ~ 를 붙이면 그 요청은 건너뜁니다.
/plugin install auto-model@d3nim-claude-mods
명령내용
/auto-model지금 상태
/auto-model off · on전부 끄고 켜기
/auto-model pin opus · unpin모델 고정 / 풀기
/auto-model worker on · shadow · off일꾼 (기본 shadow: 기록만)
/auto-model compact · /terry compact카드의 [압축] 과 같음 (마우스 클릭이 안 될 때; 쉬고 온 뒤면 Sonnet 요약)
/auto-model log최근 판단 기록 (요청 앞부분, 이유, 대화 크기, 캐시, 사용량, shadow 손익, 놓친 일꾼 후보)
/auto-model word · word add heavy 국장규칙이 놓친 요청에 자주 나온 낱말 후보 보기, 골라서 넣기 (heavy 무거운 일 · search 찾기 일꾼 · write 쓰기 일꾼, 자동으로는 안 넣어요) · remove 로 빼기
/auto-model logdir <폴더> · noprompt · off요청마다 판단을 파일에 한 줄씩 남겨요 (<폴더>/auto-model/<날짜>/<wsl·win>-<세션>.jsonl, 나중에 잘 돌았는지 분석용). noprompt 는 프롬프트 문구를 빼고 숫자만. 기본은 꺼짐
/auto-model preview압축 제안 미리 보기 1분
/auto-model warn 85 · off작업 중 압축 알림 기준(%)

jev

입력이 "기존 화면처럼 해 달라"(G-1)나 "직전 결과가 틀렸다"(G-3)인지 로컬 판정기로 0.1초에 가려, Claude 가 기준을 바꾸거나 추측으로 재시도하지 않게 짧은 알림을 넣습니다. Ollama(bge-m3)가 필요하고, 처음엔 기록만 하는 shadow 모드로 동작합니다.

/plugin install jev@d3nim-claude-mods

준비·모드·로그는 plugins/jev/README.md.

도구

  • tools/paste-hotkey: SSH 로 붙어 쓰는 Claude Code 에 Alt+V 로 캡처 이미지를 붙여넣기 (SSH 를 여는 쪽 Windows PC 에 설치)
Source 10 files
hooks/register.js 1652 lines
1// usage-meter: 5시간 / 주간 / 대화 사용량을 프롬프트 위 한 줄 밴드로 보여줍니다.
2// /flame1 : 칸마다 파란 불꽃이 타오르는 밴드 (사용량이 늘수록 커지고 80% 넘으면 주황으로 바뀜)
3// /terry  : 베들링턴 테리어가 5시간 사용량 위치까지 달리는 큰 화면
4// 뒤에 quad 또는 braille 을 붙이면 그림 방식을 바꿉니다 (예: /terry braille)
5//
6// 그림 그리는 계산은 render.js, 스프라이트 데이터는 terrier-data.js 에 있습니다.
7import { BAND_GAP, BAND_NAMES, RUN_STYLES, runStyle, holidayOf, TERRY_COLS, TERRY_MIN_COLS, TERRY_ROWS, makeBand, stateColor, terryCells, terryCellList, packCells } from './render.js'
8import { lodeCells, lodeCellList } from './lode.js'
9import { pausedCells, PAUSE_MS } from './pause.js'
10
11const FLAME_ROWS = 3 // 불꽃 줄 수 (게이지 줄과 이름 줄은 따로)
12const FRAME_MS = 30 // 달리기 한 장(60ms)이 딱 두 번 그려지게 (40ms면 2번·1번 번갈아 그려져 박자가 고르지 않다. 45ms 땐 장이 빠져 몸 흔들림 박자가 튀었다)
13
14const startedAt = Date.now()
15const nowMs = () => Date.now() - startedAt
16// 지금 동작이 얼마나 이어졌는지 (땅 파기는 오래 팔수록 흙더미가 쌓인다)
17let shownMood = null
18let shownSince = 0
19const today = () => {
20  const d = new Date()
21  const m = mood()
22  if (m !== shownMood) {
23    shownMood = m
24    shownSince = Date.now()
25  }
26  const month = d.getMonth() + 1, day = d.getDate()
27  const anniversary = !!installedOn && installedOn.slice(5) === String(month).padStart(2, '0') + '-' + String(day).padStart(2, '0') && Number(installedOn.slice(0, 4)) < d.getFullYear()
28  return { month, day, moodMs: Date.now() - shownSince, holiday: holidayOf(d.getFullYear(), month, day), anniversary, style: look }
29}
30let hourOverride = null // TERRY_HOUR=21 이면 그 시각으로 고정 (밤하늘 미리보기, 테스트)
31const localHour = () => {
32  if (hourOverride !== null) return hourOverride
33  const d = new Date()
34  return d.getHours() + d.getMinutes() / 60
35}
36
37let usage = null // $.session.usage() 의 마지막 결과
38let modelId = null // 지금 모델 (/model 이 보여주는 것)
39let lastStepEffort = '(아직 요청 없음)'
40let stepCalls = 0
41let stepChunks = 0
42let countedChunks = 0
43let effortFrom = '없음' // 추론 강도를 어디서 읽었는지 (/terry debug)
44let effort = null // 추론 강도: 요청마다 turn.step 에서 읽는다. 첫 요청 전이거나 강도가 없는 모델이면 null
45let style = 'flame1' // 'flame1' (불꽃 밴드) | 'terry' (강아지 카드)
46let character = 'terry' // 카드의 주인공: 'terry' (강아지, /terry) | 'runner' (가방 멘 런너, /runner) | 'monk' (해골 수도승, /monk)
47let look = 'classic' // 테리 그림체: 'classic' (기본) | 'real' (참고 그림에서 따온 자세, 보류 중: /terry real 로만 켜짐)
48let mode = null // 고른 그림 방식: 'quad' (사분블록) | 'fine' (사분블록 + ▂▄▆, 가로 경계가 4단계로 매끈) | 'braille' (점자)
49// | 'font' (Lode Cells 글꼴: 터미널 픽셀로 그림, 카드만. 글꼴을 깔고 터미널 글꼴 목록에 넣어야 보임)
50// 안 골랐으면 테리는 점자(점 하나하나 점자에 맞춰 그림), 불꽃 밴드는 사분블록
51// 고른 방식이 없으면: 테리는 점자(점 하나하나 다듬은 그림), 런너·해골 수도승은 블록(옷·벽돌이 옛 게임처럼 또렷)
52// 글꼴 방식은 카드 그림에만 있어서 불꽃 밴드는 블록으로 그린다
53const drawMode = () => (mode === 'font' && style !== 'terry' ? 'quad' : mode ?? (style === 'terry' && character === 'terry' ? 'braille' : 'quad'))
54
55// 임계치 알림: 같은 단계는 한 번만
56const lastTier = new Map()
57let lastContextTier = 0
58
59// 움직이는 그림을 다시 그리는 타이머
60const anims = new Map() // 그림(Raster key)마다 따로 도는 애니메이션: 프롬프트 위의 테리와 옆 창의 테리가 함께 움직인다
61let denies = 0
62const PANE = 'terry' // 테리를 따로 크게 보는 옆 창 (/terry pane)
63
64// 테리의 기분: 지금 무슨 일이 일어나는지에 따라 바뀐다
65const SLEEP_AFTER = 3 * 60 * 1000 // 이만큼 조용하면 존다
66let working = false // Claude 가 응답 중
67let lastActivity = Date.now()
68let lastEdit = 0
69let barkUntil = 0
70let typingUntil = 0
71let happyUntil = 0
72// 응답 중에 Claude 가 쓰는 도구에 따라: 읽기·찾기는 킁킁, 실행·고치기는 땅 파기, 웹은 물어 오기
73const activeTools = new Map() // tool_use_id → 동작
74let activityKind = null
75let activityUntil = 0 // 빨리 끝나는 도구도 잠깐은 보이게
76const ACTIVITY_MS = 2000
77const asking = new Set() // 허락을 기다리는 도구 호출
78// 테스트 결과: 통과하면 원반을 받고, 실패하면 귀가 처진다
79let testUntil = 0
80let testMood = null
81const TEST_CMD = /\b(npm|pnpm|yarn|bun)\s+(run\s+)?test\b|\b(jest|vitest|pytest|mocha|ava|phpunit|rspec)\b|\bgo test\b|\bcargo test\b|\bdotnet test\b|\b(gradlew?|mvn)\b.*\btest\b|\bplugin test\b|\bnode --test\b|\bdeno test\b|\bmake test\b/
82const TEST_FAIL = /\b[1-9]\d*\s+(failed|failing|failures?)\b|^FAIL\b|\bFAILED\b|Tests?:\s+[1-9]\d* failed|\bAssertionError\b|test result: FAILED/im
83const TEST_PASS = /\b\d+\s+(passed|passing|pass)\b|\ball tests passed\b|^OK\b|test result: ok\b|^ok\s/im
84// 하루 일과: 그날 첫 입력에 기지개, 저녁 6~7시 반엔 밥, 새벽 1~5시엔 금방 존다
85let stretchUntil = 0
86let stretchDay = null
87const dateKey = () => {
88  const d = new Date()
89  return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0')
90}
91let installedOn = null // 테리를 처음 만난 날: 해마다 그날엔 케이크
92// 쓰다듬기
93let petUntil = 0
94let compacting = null // 카드에서 시작한 압축이 도는 중: { since, kind, started } (끝나면 null)
95let cardAsk = null // 카드 버튼이 부탁한 일: 'compact' | 'dismiss' (1초 타이머가 처리)
96let askSeen = 0 // auto-model 이 /auto-model compact 로 부탁한 마지막 id
97// 5시간 한도를 다 쓰면 문 앞에서 기다리다가, 풀리는 순간 짖는다
98let limitWaitUntil = 0
99let limitNotified = 0
100let lastLayout = 'beside' // 테리 옆에 카드가 안 들어가면 스피너에 테리 소식을 붙인다
101let sadUntil = 0 // 요청이 실패하거나 멈추면 잠시 시무룩
102let sadReason = null
103function toolKind(tool) {
104  if (/^(Read|Grep|Glob|LS|NotebookRead|ToolSearch|ListMcpResourcesTool|ReadMcpResource)/.test(tool)) return 'sniff'
105  if (/^(Bash|Edit|Write|MultiEdit|NotebookEdit|PowerShell)/.test(tool)) return 'dig'
106  if (/^(WebFetch|WebSearch)$/.test(tool) || /^mcp__/.test(tool)) return 'fetch'
107  return null // Agent, Task 같은 것: 계속 달린다
108}
109let drawnMood = null
110// /terry run 처럼 동작을 골라 잠깐 보여 주는 미리보기 (응답 중이 아니어도 볼 수 있게)
111let previewMood = null
112let previewEffort = null // /terry run max: 미리보기 동안만 그 강도로 달린다
113let previewUntil = 0
114const PREVIEW_MS = 20000
115const previewing = () => previewMood !== null && Date.now() < previewUntil
116const PREVIEW_ARGS = {
117  run: 'run', 달리기: 'run', 뛰기: 'run',
118  sit: 'sit', 앉기: 'sit',
119  wag: 'wag', 꼬리: 'wag',
120  bark: 'bark', 짖기: 'bark',
121  happy: 'happy', 헥헥: 'happy',
122  sleep: 'sleep', 잠: 'sleep', 졸기: 'sleep',
123  sniff: 'sniff', 킁킁: 'sniff', 냄새: 'sniff',
124  dig: 'dig', 파기: 'dig', 땅파기: 'dig',
125  fetch: 'fetch', 물어오기: 'fetch', 막대기: 'fetch',
126  ask: 'ask', 허락: 'ask', 손: 'ask',
127  sad: 'sad', 시무룩: 'sad', 실패: 'sad',
128  door: 'door', 문: 'door', 한도: 'door',
129  catch: 'catch', 원반: 'catch', 통과: 'catch',
130  droop: 'droop', 테스트실패: 'droop',
131  stretch: 'stretch', 기지개: 'stretch',
132  eat: 'eat', 밥: 'eat',
133}
134
135function mood() {
136  const now = Date.now()
137  if (previewing()) return previewMood
138  if (now < petUntil) return 'pet'
139  if (working) {
140    if (asking.size) return 'ask'
141    if (now < testUntil) return testMood
142    const current = [...activeTools.values()].pop()
143    if (current) return current
144    if (activityKind && now < activityUntil) return activityKind
145    return 'run'
146  }
147  if (now < sadUntil) return 'sad'
148  if (now < testUntil) return testMood
149  if (now < stretchUntil) return 'stretch'
150  if (now < barkUntil) return 'bark'
151  if (now < typingUntil) return 'wag'
152  if (now < happyUntil) return 'happy'
153  if (limitWaitUntil > now) return 'door'
154  const h = localHour()
155  if (now - lastActivity > (h >= 1 && h < 5 ? 30000 : SLEEP_AFTER)) return 'sleep'
156  if (h >= 18 && h < 19.5 && Math.floor(now / 60000) % 5 < 2) return 'eat' // dinner: two minutes in every five
157  return 'sit'
158}
159const MOOD_SHORT = {
160  sit: '기다리는 중', wag: '보고 있어요', bark: '멍! 멍!', run: '달리는 중', happy: '다 했어요!', sleep: '졸고 있어요',
161  sniff: '킁킁', dig: '파는 중', fetch: '물어 오는 중', ask: '허락 대기', sad: '시무룩',
162  door: '문 앞 대기', catch: '원반 캐치!', droop: '테스트 실패', stretch: '기지개', eat: '밥 먹는 중', pet: '좋아요!',
163}
164// 달리기는 추론 강도에 따라: low 걷기, medium 빨리 걷기, high 달리기, xhigh 전력 질주, max 날기
165const RUN_TEXT = { low: '걷는 중', medium: '빨리 걷는 중', high: '달리는 중', xhigh: '전력 질주 중', max: '날아가는 중!' }
166// /terry run <강도> 에 쓸 수 있는 이름: 정식 이름 말고도 middle · 중간 같은 말도 받는다
167const EFFORT_ALIASES = {
168  low: 'low', l: 'low', 낮음: 'low', 낮게: 'low', 하: 'low',
169  medium: 'medium', med: 'medium', mid: 'medium', middle: 'medium', m: 'medium', 중간: 'medium', 보통: 'medium', 중: 'medium',
170  high: 'high', h: 'high', 높음: 'high', 높게: 'high', 상: 'high',
171  xhigh: 'xhigh', 'x-high': 'xhigh', xh: 'xhigh', x: 'xhigh', 매우높음: 'xhigh', 아주: 'xhigh',
172  max: 'max', 최대: 'max', 최고: 'max', 끝까지: 'max',
173}
174const runEffort = () => (previewing() && previewEffort ? previewEffort : effort)
175const HOLIDAY_TEXT = { seollal: ['설날 · 새해 복 많이 받으세요', '새해 복!'], chuseok: ['추석 · 보름달이 떴어요', '추석!'] }
176const moodLabel = (m, short) =>
177  character !== 'terry' && m === 'run' ? LODE_RUN[runEffort()] ?? LODE_RUN.high
178  : character !== 'terry' && m === 'sad' && !short ? (sadReason === 'aborted' ? '멈췄어요, 구멍에 빠짐' : LODE_TEXT.sad)
179  : character !== 'terry' && lodeSays(m, short) ? lodeSays(m, short)
180  : m === 'sit' && today().anniversary ? (short ? '1주년!' : '테리와 만난 지 ' + (new Date().getFullYear() - Number(installedOn.slice(0, 4))) + '년!')
181  : m === 'sit' && today().holiday ? HOLIDAY_TEXT[today().holiday][short ? 1 : 0]
182  : m === 'run' ? RUN_TEXT[runEffort()] ?? RUN_TEXT.high
183  : m === 'sad' && !short ? (sadReason === 'aborted' ? '멈췄어요, 시무룩' : '앗, 실패했어요')
184  : short ? MOOD_SHORT[m] : MOOD_TEXT[m]
185// 카드 그림: 테리 또는 해골 수도승 (카드·사용량 표·반응은 같다)
186const heroCells = (m, ms, drawWith, hour, cols, eff, date) =>
187  character === 'terry' ? terryCells(m, ms, drawWith, hour, cols, eff, date) : lodeCells(character, m, ms, drawWith, cols, eff)
188// 여러 Claude 창: 카드는 지금 쓰는 창 하나만 움직이고, 나머지 창의 카드는 지금 기분의 한 장에서 멈춰 어두워진다
189// (pause.js). 지금 쓰는 창은 둘 중 더 최근 것: 마지막으로 입력한 창, 또는 마지막으로 클릭한 창(tmux 가 알려 줄 때:
190// focus-events 를 켠 tmux 는 터미널이 보내는 선택/해제 신호로 어느 창이 선택됐는지 안다. 윈도우 SSH 를 거쳐 보면 그 신호가
191// 오지 않아 입력만 남는다). 모든 창이 함께 읽는 파일 하나에 적는다: Windows 사용자 폴더의 .claude 안. WSL 의 Claude 도
192// Windows 의 Claude 도 한 WaveTerm 창에 같이 뜨고(글자 그림 저장소를 나눠 씀), 서로의 설정 폴더는 다르다.
193const LIVE_FILE = 'usage-meter-live.json'
194const liveKey = startedAt.toString(36) + '-' + Math.floor(Math.random() * 1e9).toString(36) // 이 창
195let livePath // 아직 안 찾음: undefined, 둘 곳이 없음: null
196let live = { owner: null, at: 0, focus: null } // 마지막으로 입력한 창(owner, at), 마지막으로 클릭한 창의 폴더(focus: { path, at })
197let lastClaim = 0
198let myPath = null // 이 창의 작업 폴더 (클릭한 창과 맞춰 볼 때: /mnt/c/... 소문자로)
199let tmuxSeen = null // tmux 가 선택됐다고 한 창들 (바뀐 것만 알린다)
200const samePath = p => String(p || '').replace(/^([a-zA-Z]):[\\/]/, (_, d) => '/mnt/' + d.toLowerCase() + '/').replace(/\\/g, '/').replace(/\/+$/, '').toLowerCase()
201async function liveFile($) {
202  if (livePath !== undefined) return livePath
203  livePath = null
204  // ($.env.get 은 이름을 글자 그대로 써야 한다: 모듈이 읽는 변수를 엔진이 미리 셀 수 있게)
205  const wsl = await $.env.get('WSL_DISTRO_NAME').catch(() => '')
206  const win = await $.env.get('USERPROFILE').catch(() => '')
207  const home = await $.env.get('HOME').catch(() => '')
208  try {
209    if (wsl) {
210      // WSL: Windows 쪽 사용자 폴더 (C:\Users\이름 → /mnt/c/Users/이름)
211      const { stdout } = await $.process.run(['cmd.exe', '/c', 'echo %USERPROFILE%'], { timeoutMs: 5000 })
212      const m = stdout.trim().match(/^([A-Za-z]):\\(.+)$/)
213      const dir = m && '/mnt/' + m[1].toLowerCase() + '/' + m[2].replace(/\\/g, '/') + '/.claude'
214      if (dir && (await $.fs.exists(dir))) return (livePath = dir + '/' + LIVE_FILE)
215    }
216  } catch {}
217  if (win) return (livePath = win.replace(/[\\/]+$/, '') + '\\.claude\\' + LIVE_FILE)
218  if (home) livePath = home.replace(/\/+$/, '') + '/.claude/' + LIVE_FILE
219  return livePath
220}
221async function writeLive($) {
222  const f = await liveFile($)
223  if (f) await $.fs.write(f, JSON.stringify(live)).catch(() => {})
224}
225// 이 창이 움직인다고 적는다 (입력할 때. 같은 창이면 몇 초에 한 번만)
226async function claimLive($) {
227  const now = Date.now()
228  if (live.owner === liveKey && now - lastClaim < 5000) return
229  lastClaim = now
230  const was = paused()
231  live = { ...live, owner: liveKey, at: now }
232  if (was) $.ui.invalidate('ui.render')
233  await writeLive($)
234}
235async function readLive($) {
236  const f = await liveFile($)
237  if (!f) return
238  const was = paused()
239  try {
240    const v = JSON.parse(await $.fs.read(f))
241    live = { owner: v.owner ?? null, at: Number(v.at) || 0, focus: v.focus && v.focus.path ? { path: String(v.focus.path), at: Number(v.focus.at) || 0 } : null }
242  } catch {
243    return // 아직 없거나 쓰는 중: 그대로
244  }
245  if (paused() !== was) $.ui.invalidate('ui.render')
246}
247// tmux 안이면: 새로 선택된 창이 있는지 묻는다 (선택된 게 하나도 없으면, 곧 WaveTerm 밖을 보는 중이면, 마지막 것 그대로)
248async function watchTmux($) {
249  if (!(await $.env.get('TMUX').catch(() => ''))) return
250  let out
251  try {
252    out = (await $.process.run(['tmux', 'list-clients', '-F', '#{client_name}\t#{client_flags}\t#{pane_current_path}'], { timeoutMs: 3000 })).stdout
253  } catch {
254    return
255  }
256  const focused = new Map()
257  for (const line of out.split('\n')) {
258    const [name, flags, path] = line.split('\t')
259    if (name && /(^|,)focused(,|$)/.test(flags || '')) focused.set(name, path)
260  }
261  const before = tmuxSeen
262  tmuxSeen = focused
263  if (!before) return // 처음 본 것은 기준일 뿐 (신호를 안 받는 터미널은 늘 '선택됨'으로 남아 있다)
264  const fresh = [...focused].filter(([n]) => !before.has(n))
265  if (fresh.length !== 1) return
266  const path = samePath(fresh[0][1])
267  if (live.focus?.path === path && live.focus.at > live.at) return
268  const was = paused()
269  live = { ...live, focus: { path, at: Date.now() } }
270  if (paused() !== was) $.ui.invalidate('ui.render')
271  await writeLive($)
272}
273// 쉬는 창인가: 더 최근 것이 클릭이면 그 폴더의 창만, 입력이면 그 창만 움직인다 (아무 기록이 없으면 멈추지 않는다)
274const paused = () => {
275  if (style !== 'terry') return false
276  if (live.focus && live.focus.at > live.at) return myPath !== null && live.focus.path !== myPath
277  return live.owner !== null && live.owner !== liveKey
278}
279// 멈춘 카드 한 장 (블록·점자): 지금 기분의 첫 장을 어둡게
280const pausedPicture = (m, cols) => {
281  const cells = character === 'terry'
282    ? terryCellList(m, PAUSE_MS, drawMode() === 'font' ? 'braille' : drawMode(), localHour(), cols, runEffort(), today())
283    : lodeCellList(character, m, PAUSE_MS, drawMode() === 'font' ? 'braille' : drawMode(), cols, runEffort())
284  return packCells(pausedCells(cells, cols, TERRY_ROWS))
285}
286// 카드 그림 한 장: 글꼴 방식은 hero-font.js 가 Lode Cells 글리프로(Raster 가 못 받는 글자라 글 줄로, 자기 칸만 다시 그림),
287// 나머지는 Raster 로
288const heroPicture = (elements, key, m, cols) => {
289  if ((drawMode() !== 'font' || !elements.Client) && paused())
290    return elements.Raster({ key, columns: cols, rows: TERRY_ROWS, cells: pausedPicture(m, cols) })
291  if (drawMode() !== 'font' || !elements.Client)
292    return elements.Raster({ key, columns: cols, rows: TERRY_ROWS, cells: heroCells(m, nowMs(), drawMode() === 'font' ? 'braille' : drawMode(), localHour(), cols, runEffort(), today()) })
293  const { moodMs, ...date } = today()
294  return elements.Client({
295    key,
296    module: './hero-font.js',
297    props: { hero: character, mood: m, effort: runEffort(), hour: localHour(), cols, startedAt, date: { ...date, moodSince: Date.now() - moodMs }, paused: paused() },
298    width: cols,
299    height: TERRY_ROWS,
300  })
301}
302// 사다리 카드(런너·해골 수도승)의 말: 강아지에게만 맞는 말(멍멍, 꼬리, 킁킁, 원반, 밥)만 바꾼다
303const LODE_SHORT = { wag: '보고 있어요', bark: '알림!', sniff: '살피는 중', fetch: '가져오는 중', catch: '금괴 찾았다!', droop: '구멍에 빠짐', sad: '구멍에 빠짐', stretch: '몸 푸는 중', eat: '쉬는 중', door: '문 앞 대기', run: '달리는 중' }
304const LODE_TEXT = {
305  sit: '서서 기다리는 중', wag: '입력하는 걸 보고 있어요', bark: '알림이 왔어요!', sniff: '파일을 살피는 중', fetch: '웹에서 가져오는 중',
306  sad: '앗, 구멍에 빠졌어요', catch: '테스트 통과! 금괴 찾았다', droop: '테스트 실패… 구멍에 빠졌어요', stretch: '몸 푸는 중',
307  eat: '잠깐 쉬는 중', pet: '쓰다듬어 줘서 좋아요!',
308}
309const MONK_SAYS = { short: { bark: '덜그럭!' }, long: { bark: '덜그럭 덜그럭!' } }
310const RUNNER_SAYS = { short: { dig: '레이저 발사' }, long: { dig: '레이저로 파는 중', sniff: '레이저로 살피는 중' } }
311const LODE_RUN = { low: '걷는 중', medium: '빨리 걷는 중', high: '사다리 오르는 중', xhigh: '전력 질주 중', max: '쏜살같이 오르는 중!' }
312const lodeSays = (m, short) => {
313  const own = (character === 'monk' ? MONK_SAYS : RUNNER_SAYS)[short ? 'short' : 'long'][m]
314  return own ?? (short ? LODE_SHORT : LODE_TEXT)[m]
315}
316const MOOD_TEXT = {
317  sit: '앉아서 기다리는 중', wag: '입력하는 걸 보고 있어요', bark: '멍! 멍!', run: '달리는 중', happy: '다 했어요!', sleep: '졸고 있어요 zZ',
318  sniff: '파일을 킁킁 살피는 중', dig: '열심히 파는 중', fetch: '웹에서 물어 오는 중', ask: '허락을 기다려요!', sad: '앗, 실패했어요',
319  door: '한도가 풀리길 기다리는 중', catch: '테스트 통과! 원반 잡았다', droop: '테스트 실패… 시무룩', stretch: '기지개 켜는 중',
320  eat: '밥 먹는 시간이에요', pet: '쓰다듬어 줘서 좋아요!',
321}
322
323// 이번 요청(턴)의 숫자: 걸린 시간, 토큰, 초당 토큰
324const blankTurn = () => ({ start: 0, genStart: 0, input: 0, output: 0, cacheRead: 0, cacheWrite: 0, liveChars: 0, end: 0, reason: null })
325let turn = blankTurn()
326let lastTurn = null
327// 응답이 흘러오는 동안의 추정 토큰 (요청이 끝나면 API 가 준 정확한 값으로 바뀐다): 영문 4글자, 한글 1글자 = 1토큰 정도
328const estimate = chars => Math.round(chars / 3)
329// 백만부터는 M ('캐시 15046k' 처럼 자릿수가 길어져 읽기 어려웠다)
330const fmtTokens = n => (n >= 1e6 ? (n / 1e6).toFixed(n >= 1e7 ? 0 : 1) + 'M' : n >= 1000 ? (n / 1000).toFixed(n >= 10000 ? 0 : 1) + 'k' : String(n))
331function turnLine(t, live) {
332  const end = live ? Date.now() : t.end
333  const secs = Math.max(0, (end - t.start) / 1000)
334  const out = t.output + estimate(t.liveChars)
335  const genSecs = t.genStart ? Math.max(0.5, (end - t.genStart) / 1000) : 0
336  const tps = genSecs ? Math.round(out / genSecs) : 0
337  // 응답 중에는 지금까지 쓴 출력 토큰 (계속 는다). 속도는 끝난 뒤에만: 생각하거나 도구를 돌리는 동안엔 보이는 답이
338  // 늘지 않아 시간만 흘러, 응답 중의 tok/s 는 점점 떨어져 보였다
339  const tail = live ? (out ? ' · 출력 ' + fmtTokens(out) : '') : tps ? ' · ' + tps + ' tok/s' : ''
340  const clock = secs < 60 ? secs.toFixed(1) + '초' : Math.floor(secs / 60) + '분 ' + Math.round(secs % 60) + '초'
341  return {
342    time: clock + tail,
343    clock, // 응답 중 출력은 토큰 줄에도 있다: 토큰 줄이 보이면 시간 줄엔 시간만 (출력이 두 번 찍혔다)
344    tokens: '입력 ' + fmtTokens(t.input) + ' · 출력 ' + fmtTokens(out) + ' · 캐시 ' + fmtTokens(t.cacheRead),
345  }
346}
347function startTurn() {
348  if (working) return
349  working = true
350  turn = blankTurn()
351  turn.start = Date.now()
352  lastActivity = turn.start
353}
354function endTurn(reason) {
355  if (!working) return
356  // no model answer came in (a slash command also flips the band's 'working' flag): forget it, keep the last real one
357  const hadAnswer = turn.genStart || turn.input || turn.output || turn.liveChars
358  if (!hadAnswer) {
359    working = false
360    return
361  }
362  working = false
363  activeTools.clear()
364  asking.clear()
365  activityUntil = 0
366  turn.end = Date.now()
367  turn.reason = reason
368  lastTurn = turn
369  lastActivity = turn.end
370  if (reason === 'answer') happyUntil = turn.end + 3500
371  if (reason === 'error' || reason === 'aborted') {
372    sadUntil = turn.end + 6000
373    sadReason = reason
374  }
375  pendingStats = turn
376}
377
378// 오늘의 기록: 날짜별로 저장소에 쌓는다 (요청 수, 토큰, 가장 오래 걸린 요청, 테리가 달린 거리)
379let pendingStats = null
380const dayKey = () => {
381  const d = new Date()
382  return 'stats:' + d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0')
383}
384const METERS_PER_SUBPIXEL = 0.25 // high 로 달리면 초속 8.5m 쯤
385async function flushStats($) {
386  const t = pendingStats
387  if (!t) return
388  pendingStats = null
389  try {
390    const key = dayKey()
391    const day = (await $.store.get(key)) || { requests: 0, input: 0, output: 0, longest: 0, meters: 0, pets: 0 }
392    const secs = Math.max(0, (t.end - t.start) / 1000)
393    day.requests += 1
394    day.input += t.input + t.cacheRead + t.cacheWrite
395    day.output += t.output + estimate(t.liveChars)
396    day.longest = Math.max(day.longest, secs)
397    day.meters += secs * runStyle(effort).ground * METERS_PER_SUBPIXEL
398    await $.store.set(key, day)
399  } catch (err) {}
400}
401async function addPet($, ms = 3000) {
402  petUntil = Date.now() + ms
403  lastActivity = Date.now()
404  try {
405    const key = dayKey()
406    const day = (await $.store.get(key)) || { requests: 0, input: 0, output: 0, longest: 0, meters: 0, pets: 0 }
407    day.pets = (day.pets || 0) + 1
408    await $.store.set(key, day)
409  } catch (err) {}
410  $.ui.invalidate('ui.render')
411}
412async function statsText($) {
413  const d = new Date()
414  let day = null
415  try {
416    day = await $.store.get(dayKey())
417  } catch (err) {}
418  const head = '오늘의 테리 (' + (d.getMonth() + 1) + '/' + d.getDate() + ')'
419  if (!day || (!day.requests && !day.pets)) return head + '\n아직 오늘 요청이 없어요. 테리가 쉬는 중이에요.'
420  const dur = s => (s < 60 ? s.toFixed(1) + '초' : Math.floor(s / 60) + '분 ' + Math.round(s % 60) + '초')
421  const dist = m => (m < 1000 ? Math.round(m) + 'm' : (m / 1000).toFixed(1) + 'km')
422  return [
423    head,
424    '요청 ' + day.requests + '번 · 토큰 입력 ' + fmtTokens(day.input) + ' / 출력 ' + fmtTokens(day.output),
425    '가장 오래 걸린 요청 ' + dur(day.longest),
426    '테리가 달린 거리 ' + dist(day.meters),
427    ...(day.pets ? ['쓰다듬은 횟수 ' + day.pets + '번'] : []),
428  ].join('\n')
429}
430
431// 사용법 안내 (/terry help, /flame1 help). 명령 하나당 한 줄. 알림창은 줄바꿈을 못 그려서 여기에 쓰지 않는다.
432const guide = () =>
433  [
434    'usage-meter 사용법 (지금: ' + (style !== 'terry' ? '불꽃 밴드' : character === 'monk' ? '해골 수도승' : character === 'runner' ? '런너' : '강아지') + ', ' + drawMode() + ')',
435    '/flame1 quad    : 파란 불꽃 밴드, 꽉 찬 블록으로 그림',
436    '/flame1 braille : 파란 불꽃 밴드, 점자로 그림 (더 곱지만 알알이 보일 수 있음)',
437    '/terry braille  : 달리는 강아지, 점자로 그림 (기본, 점 하나하나 다듬은 그림)',
438    '/terry quad     : 달리는 강아지, 꽉 찬 블록으로 그림 (블록용으로 그렸던 1.0.2 그림)',
439    '/terry pane     : 테리를 옆 창에 따로 띄우기',
440    '/terry fine     : 달리는 강아지, 촘촘한 블록으로 그림 (등선·배·머리 윤곽이 더 매끈)',
441    '/terry font     : 터미널 픽셀로 아주 곱게 그림 (Lode Cells 글꼴을 깔고 터미널 글꼴 목록에 넣어야 보임, 네모가 보이면 /terry braille)',
442    '/terry run      : 20초 동안 달리는 모습 미리보기 (sit · wag · bark · happy · sleep 도 됨, stop 으로 끝내기)',
443    '/terry run max  : 추론 강도별 달리기 미리보기 (low 걷기 · medium 빨리 걷기 · high 달리기 · xhigh 전력 질주 · max 날기)',
444    '/terry sniff    : 도구별 동작 미리보기 (sniff 읽기 · dig 실행·고치기 · fetch 웹 · ask 허락 대기 · sad 실패)',
445    '/terry catch    : 상황별 동작 미리보기 (catch 테스트 통과 · droop 테스트 실패 · door 한도 대기 · stretch 하루 첫 입력 · eat 저녁)',
446    '/terry stats    : 오늘의 기록 (요청 수 · 토큰 · 가장 오래 걸린 요청 · 테리가 달린 거리 · 쓰다듬은 횟수)',
447    '/terry pet      : 쓰다듬기',
448    '/terry mem      : 메모리 자세히 (전체 · 남은 양 · Claude 가 쓰는 양 · 많이 쓰는 프로그램 · 더 차면 생기는 일). 15% 아래로 남으면 카드에도 한 줄 (8% 아래면 빨강)',
449    '/terry mem clean: 꺼도 되는 것 목록 (쉬는 Claude 세션 · 남은 도우미, 추천 표시). /terry mem clean 1 3 으로 여러 개, 추천 으로 추천만 끄기',
450    '/terry compact  : 카드의 [압축] 과 같음 (마우스가 안 될 때, auto-model 과 같이 쓸 때)',
451    '/runner         : 테리 대신 가방 멘 런너 (오른쪽으로 걷다 사다리를 오르고 줄을 건넘, 해골 몽크가 뒤쫓아 옴, 레이저로 바닥을 팜). /runner run max 처럼 /terry 명령을 그대로 씀, /terry 로 돌아오기',
452    '/monk           : 테리 대신 해골 수도승이 사다리를 오름',
453  ].join('\n')
454
455const LABELS = { five_hour: '5시간', seven_day: '주간', spend_limit: '지출' }
456const labelFor = kind => LABELS[kind] ?? kind
457
458// 엔진이 주는 값은 0~100 이고, context.percent 는 비어 있을 수 있다
459const tierFor = value => (value >= 90 ? 2 : value >= 80 ? 1 : 0)
460const limitPct = kind => {
461  const limit = usage?.rateLimits.find(l => l.kind === kind)
462  return limit ? limit.percentUsed : null
463}
464const values = () => [limitPct('five_hour'), limitPct('seven_day'), usage?.context.percent ?? null]
465const show = v => (v == null ? '--' : Math.round(v) + '%')
466
467// 초기화 시각: 한도 정보의 resetsAt (ISO). 5시간은 '2시간 13분 뒤', 주간은 '10/9(목) 14시'.
468const WEEKDAYS = ['일', '월', '화', '수', '목', '금', '토']
469const limitReset = kind => {
470  const at = usage?.rateLimits.find(l => l.kind === kind)?.resetsAt
471  const t = at ? Date.parse(at) : NaN
472  return Number.isFinite(t) ? t : null
473}
474function resetText(i) {
475  if (i === 0) {
476    const t = limitReset('five_hour')
477    if (t == null) return null
478    const left = Math.max(0, t - Date.now())
479    const h = Math.floor(left / 3600000)
480    const m = Math.floor((left % 3600000) / 60000)
481    return left < 60000 ? '곧' : h > 0 ? h + '시간 ' + m + '분 뒤' : m + '분 뒤'
482  }
483  if (i === 1) {
484    const t = limitReset('seven_day')
485    if (t == null) return null
486    const d = new Date(t)
487    return d.getMonth() + 1 + '/' + d.getDate() + '(' + WEEKDAYS[d.getDay()] + ') ' + d.getHours() + '시'
488  }
489  return null
490}
491
492// 'claude-opus-5-5' -> 'Opus 5.5', 'claude-haiku-4-5-20251001' -> 'Haiku 4.5'
493function prettyModel(id) {
494  if (!id) return null
495  const parts = id.replace(/^claude-/, '').replace(/\[.*\]$/, '').split('-')
496  const family = parts[0].charAt(0).toUpperCase() + parts[0].slice(1)
497  const version = parts.slice(1).filter(p => /^\d{1,2}$/.test(p)).join('.')
498  return version ? family + ' ' + version : family
499}
500// 밴드 아래 줄이나 강아지 화면 아래에 붙는 짧은 표기. 예: 'Opus 5.5 · high'
501// 모델은 연보라, 추론 강도는 단계별 색 (경고에 쓰는 노랑·주황·빨강은 피했다)
502const MODEL_COLOR = '#b4a0ff'
503const EFFORT_COLORS = { low: '#8a8f98', medium: '#7fb2ff', high: '#c792ea', xhigh: '#ff9ecd', max: '#ff6fae' }
504const effortColor = level => EFFORT_COLORS[level] ?? '#c792ea'
505function modelTexts(Text, prefix, lead) {
506  const name = prettyModel(modelId)
507  if (!name) return []
508  const parts = [Text({ key: prefix + 'm', color: MODEL_COLOR, bold: true, children: [lead + name] })]
509  if (effort) {
510    parts.push(Text({ key: prefix + 'sep', dimColor: true, children: [' · '] }))
511    parts.push(Text({ key: prefix + 'e', color: effortColor(effort), children: [effort] }))
512  }
513  return parts
514}
515// 모델 카드: 둥근 테두리 안에 두 줄 (모델 / 추론). 테두리까지 4줄이라 불꽃 밴드 높이와 같다.
516const CARD_BORDER = '#5a5f73'
517function modelCard(Box, Text, key) {
518  const name = prettyModel(modelId)
519  if (!name) return null
520  return Box({
521    key,
522    flexDirection: 'column',
523    borderStyle: 'round',
524    borderColor: CARD_BORDER,
525    paddingX: 1,
526    children: [
527      Text({ key: key + '-m', color: MODEL_COLOR, bold: true, children: [name] }),
528      Box({
529        key: key + '-e',
530        flexDirection: 'row',
531        children: [
532          Text({ key: key + '-ek', dimColor: true, children: [effort ? '' : '추론 '] }),
533          Text({ key: key + '-ev', color: effort ? effortColor(effort) : undefined, dimColor: !effort, children: [effort ?? '--'] }),
534        ],
535      }),
536    ],
537  })
538}
539// 카드가 차지하는 폭 (테두리 2 + 안쪽 여백 2 + 글자)
540const cardWidth = () => {
541  const name = prettyModel(modelId)
542  return name ? Math.max(visible(name), visible(effort ?? '추론 --')) + 4 : 0
543}
544const modelLine = () => {
545  const name = prettyModel(modelId)
546  if (!name) return null
547  return effort ? name + ' · ' + effort : name
548}
549
550// 한글은 두 칸을 차지한다
551const visible = s => [...s].reduce((n, ch) => n + (ch.charCodeAt(0) >= 0xac00 && ch.charCodeAt(0) <= 0xd7a3 ? 2 : 1), 0)
552
553// /model 이나 /effort 로 바꾸면 다음 요청을 기다리지 않고 카드에 바로 반영한다: 2초마다 지금 모델과 설정의 effortLevel 을 본다
554let seenSettingsEffort
555async function syncModel($) {
556  let changed = false
557  try {
558    const m = await $.session.model()
559    if (m && m !== modelId) {
560      modelId = m
561      changed = true
562    }
563  } catch (err) {}
564  try {
565    const level = (await $.settings.read()).effortLevel
566    if (typeof level === 'string' && level && level !== seenSettingsEffort) {
567      const first = seenSettingsEffort === undefined
568      seenSettingsEffort = level
569      // 처음 읽은 값은 요청에서 받은 강도가 없을 때만 쓴다; 그 뒤로 설정이 바뀌면 그것이 새 강도다
570      if ((!first || !effort) && level !== effort) {
571        effort = level
572        effortFrom = '설정 effortLevel'
573        changed = true
574      }
575    }
576  } catch (err) {}
577  return changed
578}
579
580async function refresh($) {
581  const fresh = await $.session.usage()
582  // 한도 정보가 없는 응답(서브에이전트 결과 등) 뒤에는 '5시간 --' 로 비지 않게 지난 값을 둔다
583  if (usage && (!fresh.rateLimits || !fresh.rateLimits.length) && usage.rateLimits && usage.rateLimits.length) fresh.rateLimits = usage.rateLimits
584  usage = fresh
585  try {
586    modelId = await $.session.model()
587  } catch (err) {
588    // 모델 이름은 없어도 밴드는 그린다
589  }
590  // 추론 강도는 요청마다 turn.step 에서 받지만, 불러온 직후(첫 요청 전)에는 환경 변수와 설정에서 먼저 읽어 둔다
591  if (!effort) {
592    try {
593      effort = (await $.env.get('CLAUDE_EFFORT')) || null
594      if (effort) effortFrom = 'CLAUDE_EFFORT 환경 변수'
595    } catch (err) {}
596  }
597  if (!effort) {
598    try {
599      const dir = (await $.env.get('CLAUDE_CONFIG_DIR')) || (await $.env.get('HOME')) + '/.claude'
600      const level = JSON.parse(await $.fs.read(dir + '/settings.json')).effortLevel
601      if (typeof level === 'string' && level) {
602        effort = level
603        effortFrom = '설정 파일 effortLevel'
604      }
605    } catch (err) {}
606  }
607  if (!effort) {
608    try {
609      const row = (await $.config.list()).find(r => /effort/i.test(r.key))
610      if (row && typeof row.value === 'string' && row.value) {
611        effort = row.value
612        effortFrom = '설정 ' + row.key
613      }
614    } catch (err) {}
615  }
616
617  // 5시간 한도를 다 썼으면 풀리는 시각까지 문 앞에서 기다린다
618  const five = usage.rateLimits.find(l => l.kind === 'five_hour')
619  const fiveReset = five && Date.parse(five.resetsAt)
620  if (five && five.percentUsed >= 100 && fiveReset > Date.now() + 1000 && fiveReset !== limitNotified) limitWaitUntil = fiveReset
621  for (const limit of usage.rateLimits) {
622    const tier = tierFor(limit.percentUsed)
623    const prevTier = lastTier.get(limit.kind) ?? 0
624    if (tier > prevTier) {
625      if (tier === 1) {
626        await $.ui.toast(labelFor(limit.kind) + ' 사용량 80% 넘었어요 — 슬슬 아껴 쓰세요')
627      } else if (tier === 2) {
628        await $.ui.toast(labelFor(limit.kind) + ' 사용량 90% 넘었어요 — 하던 것만 마무리하고 멈추는 걸 추천해요')
629      }
630    }
631    lastTier.set(limit.kind, tier)
632  }
633
634  const ctx = usage.context.percent ?? 0
635  const contextTier = tierFor(ctx)
636  if (contextTier > lastContextTier && ctx >= 85) {
637    await $.ui.toast('대화가 길어졌어요 — /compact 로 정리할까요?')
638  }
639  lastContextTier = contextTier
640
641  $.ui.invalidate('ui.render')
642}
643
644function stopAnim(key) {
645  for (const [k, a] of anims) {
646    if (key !== undefined && k !== key) continue
647    a.timer.cancel()
648    anims.delete(k)
649  }
650}
651const openPane = $ => $.ui.open({ id: PANE, title: '테리' })
652
653// 같은 그림이면 그대로 두고, 바뀌었으면 타이머를 새로 건다. blit 이 거절되면(아직 안 그려졌을 수 있음) 몇 번 다시 시도한다.
654function runAnim($, requestId, key, columns, rows, build) {
655  if (drawMode() === 'font') return stopAnim(key) // hero-font.js 가 스스로 움직인다
656  if (paused()) return stopAnim(key) // 다른 창이 움직이는 중: 멈춘 한 장 (heroPicture)
657  const id = [requestId, key, columns, rows, drawMode()].join('|')
658  if (anims.get(key)?.id === id) return
659  stopAnim(key)
660  const timer = $.clock.every(FRAME_MS, () => {
661    let cells
662    try {
663      cells = build()
664    } catch (err) {
665      return
666    }
667    void $.ui.blit({ requestId, key, cells }).then(result => {
668      if (!result.deny) { denies = 0; return }
669      denies += 1
670      if (anims.get(key)?.timer === timer) { timer.cancel(); anims.delete(key) }
671      if (denies <= 4) $.ui.invalidate('ui.render')
672    }, () => {})
673  })
674  anims.set(key, { id, timer })
675}
676
677// 폭이 바뀌면 밴드를 새로 만든다
678let bandCache = null
679function bandFor(cols) {
680  if (!bandCache || bandCache.cols !== cols || bandCache.mode !== drawMode()) {
681    bandCache = { cols, mode: drawMode(), band: makeBand(cols, FLAME_ROWS, drawMode()) }
682  }
683  return bandCache.band
684}
685
686// auto-model 플러그인의 제안 (한참 쉬어 캐시가 식었는데 대화가 길 때): 테리 카드나 불꽃 밴드 아래 한 줄.
687// auto-model 이 없으면 값이 없어 아무것도 안 그린다. 버튼은 auto-model 의 명령을 부른다.
688const AUTO_HINT = { plugin: 'auto-model', key: 'hint' }
689async function autoHint($) {
690  try {
691    const { value } = await $.state.get(AUTO_HINT)
692    return value || null
693  } catch {
694    return null
695  }
696}
697// auto-model 의 자동 전환 상태: 카드 모델 줄에 표시 (🔄 바꿔서 씀 · 📌 고정 · ✋ /model 로 직접 골라 멈춤)
698const AUTO_ROUTE = { plugin: 'auto-model', key: 'route' }
699async function autoRoute($) {
700  try {
701    const { value } = await $.state.get(AUTO_ROUTE)
702    return value && value.mode !== 'off' ? value : null
703  } catch {
704    return null
705  }
706}
707// auto-model 의 절약: 이 대화에서 몇 % 아꼈는지 (이 대화 비용이 아직 $1 미만이면 달러). 새로 아낀 뒤 두 턴만 카드 아래 한 줄
708// (auto-model 이 sessionShow 로 알려 준다. 그 값이 없는 예전 auto-model 이면 계속).
709// PC 합계와 게이지 % 환산은 /auto-model 상세에 둔다
710const AUTO_SAVING = { plugin: 'auto-model', key: 'saving' }
711async function autoSaving($) {
712  try {
713    const { value } = await $.state.get(AUTO_SAVING)
714    return value && value.sessionUsd > 0.005 && value.sessionShow !== false ? value : null
715  } catch {
716    return null
717  }
718}
719function savingRow(sv, Text, width) {
720  if (!sv) return null
721  const pct = sv.sessionPct != null ? sv.sessionPct.toFixed(sv.sessionPct < 10 ? 1 : 0) + '%' : null
722  const usd = '$' + sv.sessionUsd.toFixed(2)
723  // 💰 대신 초록 굵은 글씨로 눈에 띄게: Windows 에서 이모지 폭이 어긋나 '약 4349 아낌' 처럼 기호가 빠지고 지난 숫자가 남았다
724  // (진행 줄과 같은 문제)
725  const text = [pct ? `이 대화 약 ${pct} 아낌` : `이 대화 약 ${usd} 아낌`, pct ? `약 ${pct} 아낌` : `약 ${usd} 아낌`].find(t => visible(t) <= width)
726  return text ? Text({ key: 'auto-saving', color: '#9be08a', bold: true, children: [text] }) : null
727}
728// 옆자리도 없을 만큼 좁을 때 테리 밑 한 줄: '5h ━── 42%  주간 ━── 30%  대화 ━── 12%' (38칸). 그보다 좁으면 막대를 빼고,
729// 그래도 넘치면 이름을 더 줄인다 (5h · 주 · 대)
730const LINE_BAR = 3
731function usageLine(Box, Text, vals, width) {
732  const pcts = BAND_NAMES.map((_, i) => show(vals[i]))
733  const fit = (names, bar) => names.reduce((a, n, i) => a + visible(n) + 1 + (bar ? bar + 1 : 0) + visible(pcts[i]), 0) + 2 * (names.length - 1)
734  const short = ['5h', '주간', '대화']
735  const bar = fit(short, LINE_BAR) <= width ? LINE_BAR : 0
736  const names = bar || fit(short, 0) <= width ? short : ['5h', '주', '대']
737  return Box({
738    key: 'terry-usage-line',
739    flexDirection: 'row',
740    children: names.flatMap((nm, i) => {
741      const v = vals[i] ?? 0
742      const filled = v <= 0 || !bar ? 0 : Math.max(1, Math.round((Math.min(100, v) / 100) * bar))
743      return [
744        Text({ key: 'ul-n' + i, dimColor: true, children: [(i ? '  ' : '') + nm + ' '] }),
745        ...(bar
746          ? [Text({ key: 'ul-f' + i, color: stateColor(v), children: ['━'.repeat(filled)] }), Text({ key: 'ul-e' + i, dimColor: true, children: ['─'.repeat(bar - filled) + ' '] })]
747          : []),
748        Text({ key: 'ul-v' + i, color: stateColor(v), bold: true, children: [pcts[i]] }),
749      ]
750    }),
751  })
752}
753// 메모리: 8GB 노트북에서 Claude 를 오래 돌리다 메모리가 차서 꺼진다는 건의 (2026-10-13). 30초마다 읽어, 남은 양이 15% 아래일
754// 때만 카드에 한 줄 (늘 띄우면 자리만 차지한다: 사용자 결정). 언제든 /terry mem 으로 자세히.
755// WSL·Linux 는 /proc/meminfo (MemAvailable: 캐시처럼 바로 내줄 수 있는 것까지), Windows 는 PowerShell 한 번 (0.6초 안팎:
756// Get-CimInstance 는 1초가 넘고 처음엔 10초까지 걸려서 VisualBasic ComputerInfo 를 쓴다). Mac 은 아직 못 읽는다 (줄 없음).
757// Claude 는 이 PC 에 떠 있는 Claude Code 프로세스 합계 (Windows 의 Claude 데스크톱 앱은 경로로 뺀다)
758let mem = null // { total, avail, claude, count, wsl } (바이트)
759let memSource // undefined 아직 모름 · 'proc' · 'win' · null 못 읽음
760const WIN_MEM = [
761  'Add-Type -AssemblyName Microsoft.VisualBasic',
762  '$c = New-Object Microsoft.VisualBasic.Devices.ComputerInfo',
763  "$p = @(Get-Process claude -ErrorAction SilentlyContinue | Where-Object { $_.Path -like '*claude-code*' -or $_.Path -like '*\\.local\\bin\\*' })",
764  '"$($c.TotalPhysicalMemory) $($c.AvailablePhysicalMemory) $([long]($p | Measure-Object WorkingSet64 -Sum).Sum) $($p.Count)"',
765].join('; ')
766const powershell = command => ['powershell.exe', '-NoProfile', '-NonInteractive', '-Command', command]
767async function readMem($) {
768  if (memSource === null) return
769  if (memSource !== 'win') {
770    try {
771      const info = await $.fs.read('/proc/meminfo')
772      const kb = k => Number((info.match(new RegExp('^' + k + ':\\s+(\\d+)', 'm')) || [])[1] || 0) * 1024
773      let claude = 0
774      let count = 0
775      try {
776        const { stdout } = await $.process.run(['ps', '-C', 'claude', '-o', 'rss='], { timeoutMs: 5000 })
777        for (const l of stdout.split('\n')) if (l.trim()) (claude += Number(l) * 1024), count++
778      } catch {}
779      if (memSource === undefined) memSource = 'proc'
780      let wsl = false
781      try {
782        wsl = !!(await $.env.get('WSL_DISTRO_NAME'))
783      } catch {}
784      mem = kb('MemTotal') ? { total: kb('MemTotal'), avail: kb('MemAvailable'), claude, count, wsl } : null
785      return
786    } catch {
787      if (memSource === 'proc') return void (mem = null)
788    }
789  }
790  try {
791    const { exitCode, stdout } = await $.process.run(powershell(WIN_MEM), { timeoutMs: 15000 })
792    const [total, avail, claude, count] = stdout.trim().split(/\s+/).map(Number)
793    if (exitCode !== 0 || !(total > 0)) throw new Error('no reading')
794    memSource = 'win'
795    mem = { total, avail, claude: claude || 0, count: count || 0, wsl: false }
796  } catch {
797    if (memSource === undefined) memSource = null // 이 PC 에선 못 읽는다: 다시 시도하지 않는다
798    mem = null
799  }
800}
801const gb = n => {
802  const g = n / 2 ** 30
803  return g >= 10 ? String(Math.round(g)) : g.toFixed(1)
804}
805const MEM_SHOW = 0.15 // 이 비율보다 적게 남으면 카드에 띄운다 (노랑), 8% 아래면 빨강
806const memColor = m => (m.avail / m.total < 0.08 ? '#ff6b6b' : '#ffd166')
807// 폭에 맞는 가장 긴 표기. 30초마다 숫자만 바뀌며 다시 그리는 줄이라 이모지와 · 는 쓰지 않는다 (Windows 에서 글자가 밀림)
808function memText(m, width) {
809  const where = m.wsl ? 'WSL ' : ''
810  const who = m.count ? '  Claude ' + (m.count > 1 ? m.count + '개 ' : '') + gb(m.claude) + 'GB' : ''
811  const pct = Math.round((m.avail / m.total) * 100) + '%'
812  return [
813    `${where}메모리 ${gb(m.avail)}/${gb(m.total)}GB 남음 (${pct})${who}`,
814    `${where}메모리 ${gb(m.avail)}/${gb(m.total)}GB 남음 (${pct})`,
815    `메모리 ${gb(m.avail)}GB 남음 (${pct})`,
816    `램 ${gb(m.avail)}G ${pct}`,
817    `램 ${pct}`,
818  ].find(t => visible(t) <= width) ?? null
819}
820function memRow(Text, width, key) {
821  if (!mem || mem.avail / mem.total >= MEM_SHOW) return null
822  const text = memText(mem, width)
823  return text ? Text({ key, color: memColor(mem), children: [text] }) : null
824}
825// 많이 쓰는 프로그램: raw 는 큰 프로세스 순 [이름, 바이트], groups 는 같은 이름끼리 합친 다섯 [이름, 바이트, 개수]
826// (claude 가 세션마다 하나씩 떠서 'claude 0.5GB, claude 0.5GB, …' 로 늘어서던 것을 'claude 4개 1.9GB' 로. 0.05GB 안 되는 건 뺀다)
827const WIN_TOP = 'Get-Process | Sort-Object WorkingSet64 -Descending | Select-Object -First 30 | ForEach-Object { "$($_.ProcessName) $($_.WorkingSet64)" }'
828async function topProcs($) {
829  let raw = []
830  try {
831    if (memSource === 'win') {
832      const out = (await $.process.run(powershell(WIN_TOP), { timeoutMs: 15000 })).stdout
833      raw = out.trim().split(/\r?\n/).map(l => l.trim().split(/\s+/)).filter(x => x.length === 2).map(([n, b]) => [n, Number(b)])
834    } else {
835      const out = (await $.process.run(['ps', '-eo', 'comm=,rss=', '--sort=-rss'], { timeoutMs: 5000 })).stdout
836      raw = out.trim().split('\n').slice(0, 30).map(l => l.trim().split(/\s+/)).map(([n, k]) => [n, Number(k) * 1024])
837    }
838  } catch {}
839  const sums = new Map()
840  for (const [n, b] of raw) {
841    const key = n.replace(/\.exe$/i, '')
842    const g = sums.get(key.toLowerCase()) || [key, 0, 0]
843    sums.set(key.toLowerCase(), [g[0], g[1] + b, g[2] + 1])
844  }
845  const groups = [...sums.values()].filter(g => g[1] >= 0.05 * 2 ** 30).sort((a, b) => b[1] - a[1]).slice(0, 5)
846  return { raw, groups }
847}
848const groupText = ([n, b, k]) => `${n} ${k > 1 ? k + '개 ' : ''}${gb(b)}GB`
849// 남은 비율별로 더 차면 무슨 일이 생기는지: Linux(WSL 포함)는 바닥나면 커널이 가장 큰 프로세스를 강제로 끄고,
850// Windows 는 '메모리 부족' 경고 뒤 메모리를 더 달라는 프로그램이 꺼진다 (대개 가장 크게 불어나는 것)
851function memForecast(pct, biggest) {
852  const big = biggest ? `가장 큰 ${biggest[0]} (${gb(biggest[1])}GB)` : '가장 큰 프로그램'
853  const kill = memSource === 'win' ? `'메모리 부족' 경고가 뜨고 메모리를 더 달라는 프로그램이 꺼질 수 있어요 (대개 ${big}).` : `리눅스가 ${big}부터 강제로 꺼요${mem.wsl ? ' (WSL 안에서)' : ''}.`
854  if (pct >= 25) return ['여유 있어요.', '15% 아래로 남으면 카드에 표시돼요.']
855  if (pct >= 15) return ['아직 괜찮아요.', '15% 아래로 남으면 느려지기 시작하고 카드에 표시돼요.', '5% 아래로 남으면 ' + kill]
856  if (pct >= 8) return ['빠듯해요. 더 차면 느려져요.', '5% 아래로 남으면 ' + kill, '/terry mem clean 으로 정리해 보세요.']
857  return ['위험해요. 곧 ' + kill, '지금 /terry mem clean 으로 정리하세요.']
858}
859async function memDetail($) {
860  await readMem($)
861  if (!mem) return memSource === null ? '이 PC 에선 메모리를 읽지 못해요 (WSL·Linux·Windows 만 돼요)' : '메모리를 읽지 못했어요'
862  const pct = Math.round((mem.avail / mem.total) * 100)
863  const { raw, groups } = await topProcs($)
864  // 터미널 폭이 좁아도 읽히게: 주제마다 제목 한 줄, 내용은 들여 쓴 짧은 줄, 주제 사이는 한 줄 비움
865  const lines = [
866    `메모리${mem.wsl ? ' (WSL)' : memSource === 'win' ? ' (Windows)' : ''}`,
867    `  남음 ${gb(mem.avail)}GB / 전체 ${gb(mem.total)}GB (${pct}% 남음)`,
868    `  사용 ${gb(mem.total - mem.avail)}GB${mem.count ? `, 그중 Claude Code ${mem.count}개 ${gb(mem.claude)}GB` : ''}`,
869  ]
870  if (groups.length) lines.push('', '많이 쓰는 프로그램', ...groups.map(g => '  ' + groupText(g)))
871  lines.push('', '앞으로', ...memForecast(pct, raw[0]).map(l => '  ' + l))
872  if (mem.wsl) lines.push('', '참고', '  WSL 에 배정된 몫이에요 (기본은 PC 메모리의 절반).', '  Windows 전체는 더 빠듯할 수 있어요.')
873  return lines.join('\n')
874}
875
876// /terry mem clean: 꺼도 되는 것을 번호와 함께 보여 주고, 고른 것만 끈다 (알아서 끄지 않는다).
877// 후보: 다른 Claude 세션 (~/.claude/sessions/<pid>.json 의 이름·상태: 쉬는 중/작업 중), 띄운 세션이 이미 꺼진 MCP 도우미.
878// 추천: 30분 넘게 쉰 세션, 같은 대화가 두 번 떠 있는 쪽 중 쉬는 것, 주인 잃은 도우미. 작업 중인 세션은 추천하지 않는다.
879// 지금 이 세션은 넣지 않는다. 브라우저 같은 다른 프로그램은 크기만 보여 준다.
880const WIN_CLEAN = [
881  '$all = @(Get-CimInstance Win32_Process)',
882  '$ids = @{}; foreach ($q in $all) { $ids[[int]$q.ProcessId] = 1 }',
883  "foreach ($q in $all) { $cc = $q.Name -eq 'claude.exe' -and ($q.ExecutablePath -like '*claude-code*' -or $q.ExecutablePath -like '*\\.local\\bin\\*'); $orphan = $q.CommandLine -match 'mcp' -and -not $ids.ContainsKey([int]$q.ParentProcessId); if ($cc -or $orphan) { \"$($q.ProcessId)`t$($q.ParentProcessId)`t$($q.WorkingSetSize)`t$(if ($cc) { 'claude' } else { 'helper' })`t$($q.CommandLine)\" } }",
884].join('; ')
885let cleanList = [] // 마지막으로 보여 준 후보 (번호로 고를 때 같은 프로세스인지 다시 확인)
886async function procsForClean($) {
887  if (memSource === 'win') {
888    const out = (await $.process.run(powershell(WIN_CLEAN), { timeoutMs: 20000 })).stdout
889    return out.trim().split(/\r?\n/).filter(Boolean).map(l => {
890      const [pid, ppid, bytes, kind, ...cmd] = l.split('\t')
891      return { pid: Number(pid), ppid: Number(ppid), bytes: Number(bytes), kind, cmd: cmd.join('\t') }
892    })
893  }
894  const out = (await $.process.run(['ps', '-eo', 'pid=,ppid=,rss=,comm=,args='], { timeoutMs: 5000 })).stdout
895  return out.trim().split('\n').map(l => l.trim().split(/\s+/)).map(([pid, ppid, rss, comm, ...args]) => ({ pid: Number(pid), ppid: Number(ppid), bytes: Number(rss) * 1024, comm, cmd: args.join(' ') }))
896    .map(p => ({ ...p, kind: p.comm === 'claude' ? 'claude' : p.ppid === 1 && p.comm !== 'tmux' && /mcp/i.test(p.cmd) ? 'helper' : null }))
897    .filter(p => p.kind)
898}
899async function configDir($) {
900  const read = async name => {
901    try {
902      return (name === 'dir' ? await $.env.get('CLAUDE_CONFIG_DIR') : name === 'win' ? await $.env.get('USERPROFILE') : await $.env.get('HOME')) || ''
903    } catch {
904      return ''
905    }
906  }
907  const dir = await read('dir')
908  if (dir) return dir.replace(/[\\/]+$/, '')
909  const home = await read(memSource === 'win' ? 'win' : 'home')
910  return home ? home.replace(/[\\/]+$/, '') + (memSource === 'win' ? '\\.claude' : '/.claude') : null
911}
912const agoText = ms => {
913  const m = Math.max(0, Math.floor(ms / 60000))
914  return m >= 60 ? Math.floor(m / 60) + '시간' + (m % 60 ? ' ' + (m % 60) + '분' : '') : m + '분'
915}
916async function cleanCandidates($) {
917  await readMem($)
918  if (!mem) return null
919  const procs = await procsForClean($)
920  const dir = await configDir($)
921  const sep = memSource === 'win' ? '\\' : '/'
922  let myId = null
923  let myPid = null
924  try {
925    myId = await $.session.id()
926  } catch {}
927  if (memSource !== 'win') {
928    try {
929      myPid = Number((await $.fs.read('/proc/self/stat')).split(' ')[0]) || null
930    } catch {}
931  }
932  const now = Date.now()
933  const list = []
934  for (const p of procs) {
935    if (p.kind === 'helper') {
936      const name = (p.cmd.match(/[\w@.\/-]*mcp[\w.-]*/i) || [p.comm || 'mcp'])[0].split(/[\\/]/).pop()
937      list.push({ pid: p.pid, kind: 'helper', bytes: p.bytes, label: `Claude 가 남긴 도우미 ${name}`, note: '띄운 세션이 이미 꺼짐', rec: true })
938      continue
939    }
940    let info = null
941    try {
942      if (dir) info = JSON.parse(await $.fs.read(dir + sep + 'sessions' + sep + p.pid + '.json'))
943    } catch {}
944    if (!info || info.pid !== p.pid) continue // 세션 기록이 없는 claude (claude -p, 다른 도구): 건드리지 않는다
945    if (myPid ? p.pid === myPid : info.sessionId === myId) continue
946    const idle = info.status === 'idle' ? now - (info.statusUpdatedAt || info.updatedAt || now) : 0
947    const where = String(info.cwd || '').split(/[\\/]/).filter(Boolean).pop() || ''
948    list.push({
949      pid: p.pid,
950      kind: 'claude',
951      sessionId: info.sessionId,
952      bytes: p.bytes,
953      label: `Claude 세션 ${info.name ? `'${info.name}'` : where}`,
954      where: info.name ? where : '',
955      busy: info.status === 'busy',
956      idle,
957    })
958  }
959  // 같은 대화가 둘 이상 떠 있으면 (이 세션과 같은 대화 포함) 쉬는 쪽은 5분만 지나도 추천
960  for (const c of list) {
961    if (c.kind !== 'claude') continue
962    const twin = c.sessionId === myId || list.filter(o => o.sessionId === c.sessionId).length > 1
963    c.note = c.busy ? '작업 중이라 끄면 하던 일이 멈춰요' : (twin ? '같은 대화가 또 떠 있음, ' : '') + `쉰 지 ${agoText(c.idle)}`
964    c.rec = !c.busy && (c.idle >= 30 * 60000 || (twin && c.idle >= 5 * 60000))
965  }
966  list.sort((a, b) => Number(b.rec) - Number(a.rec) || b.bytes - a.bytes)
967  return list
968}
969function cleanText(list, top) {
970  const pct = Math.round((mem.avail / mem.total) * 100)
971  const lines = [`메모리 정리 (남은 ${gb(mem.avail)}/${gb(mem.total)}GB, ${pct}%)`, '']
972  if (!list.length) lines.push('  끌 만한 것이 없어요 (다른 Claude 세션도, 남은 도우미도 없음)')
973  list.forEach((c, i) => lines.push(`${i + 1}. ${c.label}${c.rec ? ' (추천)' : ''}`, `   ${[c.where, gb(c.bytes) + 'GB', c.note].filter(Boolean).join(', ')}`))
974  const others = top.groups.filter(([n]) => !/^claude$/i.test(n) && n.toLowerCase() !== 'node').slice(0, 3)
975  if (others.length) lines.push('', '크기만 참고 (여기서 끄지 않아요)', ...others.map(g => '  ' + groupText(g)))
976  if (list.length) {
977    lines.push('', '끄는 법', '  /terry mem clean 1 3    여러 개는 띄어 쓰거나 쉼표로')
978    if (list.some(c => c.rec)) lines.push('  /terry mem clean 추천   추천만')
979  }
980  const notes = []
981  if (list.some(c => c.kind === 'claude')) notes.push('  Claude 세션은 꺼도 대화가 저장돼 있어요.', '  그 폴더에서 claude --resume 으로 이어가요.')
982  if (mem.wsl) notes.push('  WSL 에서 끈 만큼 Windows 쪽엔 천천히 돌아가요.', '  (.wslconfig 에 autoMemoryReclaim=gradual 이면 더 빨리)')
983  if (notes.length) lines.push('', '참고', ...notes)
984  return lines.join('\n')
985}
986// 고른 번호를 끈다: 보여 준 뒤 바뀌었을 수 있으니 같은 pid·같은 대화인지 다시 확인한다
987async function cleanPick($, picks) {
988  const fresh = await cleanCandidates($)
989  if (!fresh) return '메모리를 읽지 못했어요'
990  const done = []
991  const skipped = []
992  for (const c of picks) {
993    const now = fresh.find(f => f.pid === c.pid && f.kind === c.kind && f.sessionId === c.sessionId)
994    if (!now) {
995      skipped.push(c.label + ' (이미 꺼졌거나 바뀌었어요)')
996      continue
997    }
998    try {
999      const r = memSource === 'win'
1000        ? await $.process.run(['taskkill.exe', '/PID', String(c.pid), '/F'], { timeoutMs: 10000 })
1001        : await $.process.run(['kill', String(c.pid)], { timeoutMs: 5000 })
1002      if (r.exitCode === 0) done.push(`${c.label}${c.where ? ' (' + c.where + ')' : ''} ${gb(c.bytes)}GB`)
1003      else skipped.push(c.label + ' (끄지 못했어요)')
1004    } catch {
1005      skipped.push(c.label + ' (끄지 못했어요)')
1006    }
1007  }
1008  await readMem($)
1009  cleanList = []
1010  $.ui.invalidate('ui.render')
1011  return [
1012    ...(done.length ? ['껐어요', ...done.map(d => '  ' + d)] : ['끈 것이 없어요']),
1013    ...(skipped.length ? ['', '못 끈 것', ...skipped.map(d => '  ' + d)] : []),
1014    ...(mem ? ['', `지금 남은 ${gb(mem.avail)}/${gb(mem.total)}GB (${Math.round((mem.avail / mem.total) * 100)}%)`] : []),
1015  ].join('\n')
1016}
1017async function memClean($, args) {
1018  const words = args.split(/[\s,]+/).filter(Boolean)
1019  if (words.length) {
1020    if (!cleanList.length) return '먼저 /terry mem clean 으로 목록을 보세요'
1021    const picks = words.includes('추천') || words.includes('rec')
1022      ? cleanList.filter(c => c.rec)
1023      : words.map(w => cleanList[Number(w) - 1]).filter(Boolean)
1024    if (!picks.length) return '고른 번호가 목록에 없어요 (예: /terry mem clean 1 3)'
1025    return cleanPick($, picks)
1026  }
1027  const list = await cleanCandidates($)
1028  if (!list) return memSource === null ? '이 PC 에선 메모리를 읽지 못해요 (WSL·Linux·Windows 만 돼요)' : '메모리를 읽지 못했어요'
1029  cleanList = list
1030  if (list.length) void askClean($, list)
1031  return cleanText(list, await topProcs($))
1032}
1033// 목록을 보여 준 뒤 여러 개 고르는 창도 띄운다 (창은 4개까지: 추천부터. 나머지는 번호로).
1034// 명령이 끝난 뒤에 띄운다: 명령 안에서 다른 창을 기다리면 Windows 에서 매달린 적이 있다 (카드 버튼, 1.2.7)
1035async function askClean($, list) {
1036  try {
1037    await $.clock.sleep(500)
1038    const shown = list.slice(0, 4)
1039    const labels = shown.map((c, i) => `${i + 1}. ${c.label.replace(/,/g, ' ')} ${gb(c.bytes)}GB${c.rec ? ' (추천)' : ''}`)
1040    // 후보가 하나면 (Windows 에서 세션 둘만 띄운 경우 등) 끌지 말지 고르는 창: 창은 선택지가 둘 이상이어야 한다
1041    const answer = shown.length === 1
1042      ? await $.ui.ask(`${shown[0].label} 를 끌까요?`, { options: [labels[0] + ' 끄기', '그대로 두기'], header: '메모리 정리' })
1043      : await $.ui.ask('메모리를 비우려면 끌 것을 고르세요 (여러 개 가능)?', { options: labels, header: '메모리 정리', multiSelect: true })
1044    if (cleanList !== list) return // 그 사이 번호로 이미 골랐다
1045    const nums = [...String(answer).matchAll(/(?:^|,)\s*(\d+)\./g)].map(m => Number(m[1]))
1046    const picks = nums.map(n => shown[n - 1]).filter(Boolean)
1047    if (!picks.length) return
1048    const result = await cleanPick($, picks)
1049    await $.ui.toast('usage-meter: ' + result.split('\n').filter(Boolean).map(l => l.trim()).join(' / '), { timeoutMs: 10000 })
1050  } catch {} // 창을 닫으면 아무것도 끄지 않는다
1051}
1052const familyName = id => String(id || '').replace(/^claude-/, '').split('-')[0]
1053const manTokens = n => (n >= 10000 ? Math.round(n / 10000) + '만' : Math.round(n / 1000) + '천')
1054function hintRow($, hint, Box, Text, Button, width) {
1055  if (compacting) {
1056    // 누른 뒤 끝날 때까지: 버튼 대신 진행 줄 (큰 대화의 요약은 몇 분 걸린다)
1057    const sec = Math.max(0, Math.floor((Date.now() - compacting.since) / 1000))
1058    const who = compacting.kind === 'cold' ? 'Sonnet 요약' : '원래 모델이 요약'
1059    // 이모지와 폭이 애매한 기호(…, ·)는 빼고 폭이 확실한 글자만: 1초마다 다시 그리는 줄이라, 이모지 폭을 터미널과 다르게 세는 화면(Windows)에서
1060    // '📦압축9중…' 처럼 앞 글자가 밀리고 지난 숫자가 남았다. 초는 두 자리로 맞춰 줄 길이도 흔들리지 않게
1061    const t = String(sec).padStart(2, ' ') + '초'
1062    const text = [`압축 중 (${who} - ${t} - 큰 대화는 몇 분 걸려요)`, `압축 중 (${who} - ${t})`, `압축 중 ${t}`].find(t => visible(t) <= width)
1063    return text ? Text({ key: 'auto-hint', color: '#ffd166', children: [text] }) : null
1064  }
1065  if (!hint) return null
1066  // 이모지와 · 없이: 분이 바뀔 때만 몇 칸 다시 그리는 줄이라, 폭을 터미널과 다르게 세는 화면(Windows, SSH 너머 ConPTY)에서
1067  // '⏰14시간 341 쉬어' 처럼 글자가 밀리고 지난 글자가 남았다 (마우스를 움직여 통째로 다시 그리면 바로잡힘)
1068  let long, mid, short, later
1069  if (hint.kind === 'warm') {
1070    // 작업 중 대화가 많이 참: 지금은 캐시가 살아 있어 원래 모델이 싸게 압축한다
1071    long = `대화 ${hint.percent}% 찼어요 - 지금은 기억이 살아 있어서 싸게 압축돼요 `
1072    mid = `대화 ${hint.percent}% - 지금 압축하면 싸요 `
1073    short = `대화 ${hint.percent}% - 압축? `
1074    later = '나중에'
1075  } else {
1076    const idle = hint.idleMinutes >= 60 ? Math.floor(hint.idleMinutes / 60) + '시간' + (hint.idleMinutes % 60 ? ' ' + (hint.idleMinutes % 60) + '분' : '') : hint.idleMinutes + '분'
1077    const usd = '$' + (hint.rewriteUsd >= 10 ? Math.round(hint.rewriteUsd) : hint.rewriteUsd.toFixed(1))
1078    long = `${idle} 쉬어서 캐시가 식었어요 - 다음 요청이 대화 ${manTokens(hint.tokens)} 토큰을 다시 써요 (API 환산 약 ${usd}) - 압축하면 그 뒤 요청이 가벼워져요 `
1079    mid = `${idle} 쉬어 캐시 식음 - 다음 요청에 ${manTokens(hint.tokens)} 토큰 다시 씀 (약 ${usd}) `
1080    short = `캐시 식음 - ${manTokens(hint.tokens)} 토큰 다시 씀 `
1081    later = '계속'
1082  }
1083  const room = width - (Button ? 16 : 0)
1084  const text = visible(long) <= room ? long : visible(mid) <= room ? mid : short
1085  return Box({
1086    key: 'auto-hint',
1087    flexDirection: 'row',
1088    children: [
1089      Text({ key: 'ah-t', color: '#ffd166', children: [text] }),
1090      ...(Button
1091        ? [
1092            Button({ key: 'ah-compact', label: '압축', onPress: () => pressCompact($, hint.kind === 'warm' ? 'warm' : 'cold') }),
1093            Text({ key: 'ah-sp', children: [' '] }),
1094            Button({ key: 'ah-skip', label: later, dimColor: true, onPress: () => void (cardAsk = 'dismiss') }),
1095          ]
1096        : []),
1097    ],
1098  })
1099}
1100// [압축]: 누르면 바로 '압축 중' 줄로 바꾸고 돌아온다. 실제 시작은 1초 타이머가 한다: 클릭 핸들러 안에서 다른 플러그인의 명령을
1101// 기다리면 Windows(2.1.296)에서 응답 없이 매달려 카드가 멈췄다. auto-model 은 자기가 시작한 압축은 가로챌 수 없어서(자기 훅이
1102// 안 돈다) 여기서 시작하고, auto-model 이 그 압축을 보고 종류(쉬고 옴 → Sonnet 요약 / 작업 중)를 스스로 판단한다
1103function pressCompact($, kind) {
1104  if (compacting) return
1105  compacting = { since: Date.now(), kind, started: false }
1106  cardAsk = 'compact'
1107  $.ui.invalidate('ui.render')
1108}
1109// 1초마다: 버튼이나 /auto-model compact 가 부탁한 일을 처리한다 (기다리지 않고 떼어 낸다)
1110async function runAsks($) {
1111  if (cardAsk === 'dismiss') {
1112    cardAsk = null
1113    void withTimeout($, $command($, 'dismiss'), 5000)
1114  }
1115  if (!compacting || !compacting.started) {
1116    try {
1117      const { value } = await $.state.get(AUTO_ASK)
1118      if (value && value.id > askSeen) {
1119        askSeen = value.id
1120        if (Date.now() - value.at < 60000 && !compacting) {
1121          const hint = await autoHint($)
1122          compacting = { since: Date.now(), kind: hint && hint.kind === 'warm' ? 'warm' : 'cold', started: false }
1123          cardAsk = 'compact'
1124        }
1125      }
1126    } catch {}
1127  }
1128  if (cardAsk === 'compact' && compacting && !compacting.started) {
1129    cardAsk = null
1130    compacting.started = true
1131    void compactFromCard($)
1132  }
1133  // 오래 매달린 압축은 표시만이라도 풀어 준다 (압축 자체의 제한은 15분)
1134  if (compacting && Date.now() - compacting.since > 20 * 60000) {
1135    compacting = null
1136    $.ui.toast('📦 압축이 20분 넘게 끝나지 않아요 · /compact 를 직접 입력해 주세요')
1137    $.ui.invalidate('ui.render')
1138  }
1139}
1140const withTimeout = ($, p, ms) => Promise.race([p, $.clock.sleep(ms).then(() => ({ timedOut: true }))])
1141async function compactFromCard($) {
1142  const mine = compacting
1143  $.ui.toast(mine && mine.kind === 'cold' ? '📦 압축 시작 · 쉬고 와서 Sonnet 이 요약해요 (큰 대화는 몇 분 걸려요)' : '📦 압축 시작 · 원래 모델이 요약해요 (1~2분)')
1144  try {
1145    const r = await $.session.compact()
1146    if (r && r.skip) return void $.ui.toast('압축하지 않았어요: ' + r.skip)
1147    const fmt = n => (n >= 10000 ? Math.round(n / 10000) + '만' : Math.round(n / 1000) + '천') + ' 토큰'
1148    $.ui.toast('압축했어요' + (r && r.tokensBefore && r.tokensAfter ? ` (${fmt(r.tokensBefore)} → ${fmt(r.tokensAfter)})` : ''))
1149  } catch (err) {
1150    $.ui.toast('압축을 못 했어요 (' + String((err && err.message) || err).slice(0, 100) + ') · /compact 를 직접 입력해 주세요')
1151  } finally {
1152    if (compacting === mine) compacting = null
1153    $.ui.invalidate('ui.render')
1154  }
1155}
1156const AUTO_ASK = { plugin: 'auto-model', key: 'ask' }
1157const $command = ($, args) => $.command.run({ command: 'auto-model', args }).catch(() => {})
1158
1159export function register(on) {
1160  on('session.start', async ($, e, next) => {
1161    await $.command.register({ name: 'flame1', description: '사용량을 파란 불꽃 밴드로 보여요 (뒤에 quad 또는 braille 을 붙이면 그림 방식 변경)' })
1162    await $.command.register({ name: 'terry', description: '사용량을 베들링턴 테리어가 달리는 화면으로 보여요 (뒤에 quad 또는 braille 을 붙이면 그림 방식 변경)' })
1163    await $.command.register({ name: 'runner', description: '테리 대신 가방 멘 런너가 사다리를 오르는 화면 (로드런너 레전드 리턴즈처럼, 해골 몽크가 뒤쫓아 옴. /terry 의 명령을 그대로 씀)' })
1164    await $.command.register({ name: 'monk', description: '테리 대신 해골 수도승이 사다리를 오르는 화면 (로드런너의 매드 몽크처럼, /terry 의 명령을 그대로 씀)' })
1165    style = (await $.store.get('style')) === 'terry' ? 'terry' : 'flame1'
1166    const savedHero = await $.store.get('character')
1167    character = savedHero === 'monk' || savedHero === 'runner' ? savedHero : 'terry'
1168    const savedMode = await $.store.get('mode')
1169    mode = savedMode === 'braille' || savedMode === 'fine' || savedMode === 'quad' || savedMode === 'font' ? savedMode : null
1170    look = (await $.store.get('look')) === 'real' ? 'real' : 'classic'
1171    try {
1172      stretchDay = (await $.store.get('stretchDay')) ?? null
1173      installedOn = (await $.store.get('installedOn')) ?? null
1174      if (!installedOn) {
1175        installedOn = dateKey()
1176        await $.store.set('installedOn', installedOn)
1177      }
1178    } catch (err) {}
1179    await refresh($)
1180    $.clock.every(30000, () => refresh($))
1181    // 메모리는 테리 화면일 때만 읽는다 (Windows 는 PowerShell 을 띄우니 안 보일 땐 아낀다)
1182    const memTick = async () => {
1183      if (style !== 'terry') return
1184      await readMem($)
1185      $.ui.invalidate('ui.render')
1186    }
1187    void memTick()
1188    $.clock.every(30000, () => void memTick())
1189    // 새로 연 창이 움직인다
1190    myPath = samePath(await $.session.root().catch(() => ''))
1191    void claimLive($)
1192    $.clock.every(1000, () => {
1193      void runAsks($)
1194      if (style === 'terry') void readLive($).then(() => watchTmux($))
1195      // 한도가 풀리는 순간: 문 앞에서 벌떡 일어나 짖고 알린다
1196      if (limitWaitUntil && Date.now() >= limitWaitUntil) {
1197        limitNotified = limitWaitUntil
1198        limitWaitUntil = 0
1199        barkUntil = Date.now() + 4000
1200        lastActivity = Date.now()
hooks/render.js 1154 lines
1// Pure drawing code for the usage meter: no engine calls here, so it can be tried with plain node.
2//
3// Everything is drawn on a grid of 2 x 4 square sub-pixels per terminal cell. A cell can show two colours, so each cell
4// is turned into one glyph (quadrant blocks or braille) with a foreground and a background, then packed for `Raster`.
5
6import SPRITE from './terrier-data.js'
7
8const DEFAULT = 0x01000000 // Raster's "terminal default colour"
9const BAR_H = 2 // thickness of the glowing gauge line, in sub-pixels
10
11// ---- Packing for Raster ---------------------------------------------------------------------------
12const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
13function base64(bytes) {
14  let out = ''
15  for (let i = 0; i < bytes.length; i += 3) {
16    const b0 = bytes[i]
17    const b1 = i + 1 < bytes.length ? bytes[i + 1] : 0
18    const b2 = i + 2 < bytes.length ? bytes[i + 2] : 0
19    out += B64[b0 >> 2] + B64[((b0 & 3) << 4) | (b1 >> 4)]
20    out += i + 1 < bytes.length ? B64[((b1 & 15) << 2) | (b2 >> 6)] : '='
21    out += i + 2 < bytes.length ? B64[b2 & 63] : '='
22  }
23  return out
24}
25
26const rgbInt = c => (c[0] << 16) | (c[1] << 8) | c[2]
27
28/** cells: array of [codePoint, foreground, background] -> the base64 string Raster takes. */
29export function packCells(cells) {
30  const words = new Uint32Array(cells.length * 3)
31  for (let i = 0; i < cells.length; i++) {
32    words[i * 3] = cells[i][0]
33    words[i * 3 + 1] = cells[i][1]
34    words[i * 3 + 2] = cells[i][2]
35  }
36  return base64(new Uint8Array(words.buffer))
37}
38
39// ---- Cells: at most two colours each, then the glyph that draws them -----------------------------------
40const BRAILLE_BIT = [[0x01, 0x08], [0x02, 0x10], [0x04, 0x20], [0x40, 0x80]]
41const QUAD = ' ▘▝▀▖▌▞▛▗▚▐▜▄▙▟█'
42const dist = (a, b) => (a === null && b === null ? 0 : a === null || b === null ? 1e9 : (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2)
43
44// Near-black: the terrier's eye and nose. Tiny, so a cell would otherwise give its two colours to the fur around them.
45const lum = c => 0.3 * c[0] + 0.59 * c[1] + 0.11 * c[2]
46const isFeature = c => c !== null && lum(c) < 30
47
48// the darkest coat grey in braille: below this a dot on a dark background looks missing, and a shaded patch (the ear,
49// the belly, the far legs) reads as a hole or a dent in him
50const BR_GREY_LO = 168
51function cellOf(units, mode) {
52  // braille: dots only, never a filled cell or a coloured background, so the whole picture reads as one dot texture.
53  // A dot covers little of its cell, so colours are lifted (gamma) to keep them from looking faded. An eye or nose
54  // pixel is left as a gap in the dots rather than lighting the whole cell dark, so the eye stays its real size.
55  if (mode === 'braille') {
56    // Every pixel of the dog lights its dot; the shading is told by the cell's colour alone. (Shading by dot density,
57    // dropping dots where the coat is dark, left holes on a dark background: a dent in the back, a leg one dot thin.)
58    // An eye or nose is left as a gap, its real size; the outline is left out (it showed as dark specks).
59    // A cell holds one colour, so where white fur meets a colour (the open mouth, the tongue, the ear's pink inside)
60    // the cell takes one side, not their average: averaged, the pink spread out pale over the muzzle. The colour
61    // wins with two or more of its dots (or when there is little fur), and the other side's dots stay dark.
62    let featureBits = 0
63    const grey = [], tint = []
64    for (const u of units) {
65      const c = u.color
66      if (!c) continue
67      if (isFeature(c)) {
68        featureBits |= u.bit
69        continue
70      }
71      if (OUTLINE.has(c.join(','))) continue
72      ;(Math.max(c[0], c[1], c[2]) - Math.min(c[0], c[1], c[2]) < 14 ? grey : tint).push(u)
73    }
74    // (only his own reds win so: the tongue, the mouth, a pink ear. A blade of grass or a leaf sharing a cell with him
75    // went the same way and wiped out his dots there: the end of his tail vanished into the grass)
76    const reddish = tint.filter(u => u.color[0] > u.color[1] * 1.25)
77    // (a cell without any of him, the sun or the earth, keeps all its dots)
78    // (and then only when they outnumber his coat in the cell: a cell holds one colour, so the side with more dots
79    // keeps them; on a tie the red wins, a mouth being smaller than the fur around it)
80    const lit = !grey.length ? tint : reddish.length && reddish.length >= grey.length ? reddish : grey
81    let bits = 0
82    let r = 0, g = 0, b = 0, n = 0
83    for (const u of lit) {
84      bits |= u.bit
85      r += u.color[0]; g += u.color[1]; b += u.color[2]; n++
86    }
87    if (!bits && !featureBits) return [0x20, DEFAULT, DEFAULT]
88    if (!bits) return [0x2800 + featureBits, rgbInt([90, 90, 98]), DEFAULT] // only an eye or nose here: a dim outline
89    const mean = [r / n, g / n, b / n]
90    // (a dim fill behind full cells to hide the font's gap between braille rows was tried: it shows as dark blocks)
91    const greyCell = Math.max(...mean) - Math.min(...mean) < 14
92    if (greyCell) {
93      // the coat's greys are squeezed into a lighter range: the darkest shade still reads as fur, not as a hole in it,
94      // while light and shade stay apart (the volume)
95      const v = Math.round(BR_GREY_LO + (255 - BR_GREY_LO) * (mean[0] / 255))
96      return [0x2800 + bits, rgbInt([v, v, Math.min(255, v + 4)]), DEFAULT]
97    }
98    return [0x2800 + bits, rgbInt(mean.map(v => Math.round(255 * Math.pow(v / 255, 0.7)))), DEFAULT]
99  }
100  const counts = new Map()
101  for (const u of units) {
102    const k = u.color ? u.color.join(',') : 'none'
103    counts.set(k, (counts.get(k) || 0) + 1)
104  }
105  const ranked = [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([k]) => (k === 'none' ? null : k.split(',').map(Number)))
106  // an eye or nose pixel always gets one of the two colours of its cell
107  const feature = ranked.findIndex(isFeature)
108  if (feature > 1) ranked.splice(1, 0, ranked.splice(feature, 1)[0])
109  if (ranked.length === 1) return ranked[0] === null ? [0x20, DEFAULT, DEFAULT] : [0x2588, rgbInt(ranked[0]), DEFAULT]
110  const [A, B] = ranked
111  let bitsA = 0
112  let bitsB = 0
113  for (const u of units) {
114    if (dist(u.color, B) < dist(u.color, A)) bitsB |= u.bit
115    else bitsA |= u.bit
116  }
117  const code = bits => (mode === 'braille' ? 0x2800 + bits : QUAD[bits].codePointAt(0))
118  if (A === null) return [code(bitsB), rgbInt(B), DEFAULT] // B on the terminal background
119  if (B === null) return [code(bitsA), rgbInt(A), DEFAULT]
120  return [code(bitsB), rgbInt(B), rgbInt(A)]
121}
122
123// fine: the full 2 x 4 sub-pixels of a cell, fitted chafa-style. Besides the 2 x 2 quadrants, the lower quarter and
124// three-quarter blocks (▂ ▆, and ▄) give horizontal edges a 4-step precision, and with the colours swapped the upper
125// ones too. Terminals on xterm.js WebGL (WaveTerm) draw all of these themselves, so they tile without seams.
126const FINE_MASKS = (() => {
127  const bit = (dy, dx) => 1 << (dy * 2 + dx)
128  const list = []
129  for (let q = 1; q < 15; q++) {
130    let m = 0
131    if (q & 1) m |= bit(0, 0) | bit(1, 0)
132    if (q & 2) m |= bit(0, 1) | bit(1, 1)
133    if (q & 4) m |= bit(2, 0) | bit(3, 0)
134    if (q & 8) m |= bit(2, 1) | bit(3, 1)
135    list.push([m, QUAD[q].codePointAt(0)])
136  }
137  list.push([bit(3, 0) | bit(3, 1), 0x2582]) // ▂ lower quarter
138  list.push([bit(1, 0) | bit(1, 1) | bit(2, 0) | bit(2, 1) | bit(3, 0) | bit(3, 1), 0x2586]) // ▆ lower three quarters
139  return list
140})()
141const MISS = 200000 // the cost of colouring a pixel that should be empty, or emptying one that should be coloured
142const cost = (a, b) => (a === null && b === null ? 0 : a === null || b === null ? MISS : (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 + (a[2] - b[2]) ** 2)
143function cellOfFine(units) {
144  const counts = new Map()
145  for (const u of units) {
146    const k = u.color ? u.color.join(',') : 'none'
147    counts.set(k, (counts.get(k) || 0) + 1)
148  }
149  const ranked = [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([k]) => (k === 'none' ? null : k.split(',').map(Number)))
150  const feature = ranked.findIndex(isFeature)
151  if (feature > 1) ranked.splice(1, 0, ranked.splice(feature, 1)[0])
152  if (ranked.length === 1) return ranked[0] === null ? [0x20, DEFAULT, DEFAULT] : [0x2588, rgbInt(ranked[0]), DEFAULT]
153  const top = ranked.slice(0, 3)
154  const pairs = []
155  for (let i = 0; i < top.length; i++) for (let j = i + 1; j < top.length; j++) pairs.push([top[i], top[j]])
156  if (feature >= 0) pairs.splice(1) // an eye or nose keeps its place in the first pair
157  let best = null
158  for (const [P, Q] of pairs) {
159    for (const [fg, bg] of [[P, Q], [Q, P]]) {
160      if (fg === null) continue // the foreground must be a colour; an empty background is the terminal's
161      for (const [mask, code] of FINE_MASKS) {
162        let err = 0
163        for (const u of units) err += cost(u.color, mask & u.bit ? fg : bg)
164        if (!best || err < best.err) best = { err, code, fg, bg }
165      }
166    }
167  }
168  return [best.code, rgbInt(best.fg), best.bg === null ? DEFAULT : rgbInt(best.bg)]
169}
170
171/** canvas: rows*4 lines of cols*2 colours (or null). Returns the packed cells for a rows x cols Raster. */
172export function canvasToCells(canvas, cols, rows, mode) {
173  return packCells(canvasToCellList(canvas, cols, rows, mode))
174}
175
176/** As canvasToCells, but the [codePoint, fg, bg] list itself, so text can be written over some cells first. */
177export function canvasToCellList(canvas, cols, rows, mode) {
178  const cells = []
179  for (let r = 0; r < rows; r++) {
180    for (let cx = 0; cx < cols; cx++) {
181      const x = cx * 2
182      const units = []
183      if (mode === 'fine') {
184        for (let dy = 0; dy < 4; dy++) for (let dx = 0; dx < 2; dx++) units.push({ bit: 1 << (dy * 2 + dx), color: canvas[r * 4 + dy]?.[x + dx] ?? null })
185        cells.push(cellOfFine(units))
186        continue
187      }
188      if (mode === 'braille') {
189        for (let dy = 0; dy < 4; dy++) for (let dx = 0; dx < 2; dx++) units.push({ bit: BRAILLE_BIT[dy][dx], color: canvas[r * 4 + dy]?.[x + dx] ?? null, dy, dx })
190      } else {
191        for (let qy = 0; qy < 2; qy++) {
192          for (let dx = 0; dx < 2; dx++) {
193            const a = canvas[r * 4 + qy * 2]?.[x + dx] ?? null
194            const b = canvas[r * 4 + qy * 2 + 1]?.[x + dx] ?? null
195            // a quarter block covers two sub-pixel rows: an eye or nose pixel wins, else the inner row (keeps edges tidy)
196            const pickRow = isFeature(a) ? a : isFeature(b) ? b : a && b ? (qy === 0 ? b : a) : a || b
197            units.push({ bit: 1 << (qy * 2 + dx), color: pickRow })
198          }
199        }
200      }
201      cells.push(cellOf(units, mode))
202    }
203  }
204  return cells
205}
206
207/** Writes ASCII `text` into a cell list (cols wide) at cell x, row y: each character keeps its cell's colour behind it. */
208export function writeText(cells, cols, x, y, text, fg) {
209  for (let i = 0; i < text.length; i++) {
210    const cx = x + i
211    if (cx < 0 || cx >= cols) continue
212    const cell = cells[y * cols + cx]
213    const behind = cell[0] === 0x2588 ? cell[1] : cell[2] // a full block's colour is its foreground
214    cells[y * cols + cx] = [text.charCodeAt(i), fg, behind]
215  }
216}
217
218// ---- Noise and colours ------------------------------------------------------------------------------
219function hash(ix, iy) {
220  let h = (Math.imul(ix, 374761393) + Math.imul(iy, 668265263)) | 0
221  h = Math.imul(h ^ (h >>> 13), 1274126177)
222  return ((h ^ (h >>> 16)) >>> 0) / 4294967295
223}
224function vnoise(x, y) {
225  const ix = Math.floor(x)
226  const iy = Math.floor(y)
227  const fx = x - ix
228  const fy = y - iy
229  const u = fx * fx * (3 - 2 * fx)
230  const v = fy * fy * (3 - 2 * fy)
231  const a = hash(ix, iy)
232  const b = hash(ix + 1, iy)
233  const c = hash(ix, iy + 1)
234  const d = hash(ix + 1, iy + 1)
235  return a + (b - a) * u + (c - a) * v + (a - b - c + d) * u * v
236}
237const BAYER = [[0, 8, 2, 10], [12, 4, 14, 6], [3, 11, 1, 9], [15, 7, 13, 5]]
238
239const mix = (a, b, t) => a.map((v, i) => Math.round(v + (b[i] - v) * t))
240const BLUE = [[10, 4, 40], [18, 12, 100], [14, 40, 200], [20, 100, 255], [60, 175, 255], [150, 232, 255], [215, 248, 255], [255, 255, 255]]
241const HOT = [[30, 6, 4], [100, 16, 8], [200, 44, 16], [250, 104, 24], [255, 168, 48], [255, 214, 100], [255, 240, 170], [255, 255, 240]]
242function ramp(stops, h) {
243  const p = Math.min(0.9999, Math.max(0, h)) * (stops.length - 1)
244  const i = Math.floor(p)
245  return mix(stops[i], stops[i + 1], p - i)
246}
247// Stays blue until about 74%, then turns to the hot palette quickly, so no muddy middle colour lingers
248// The colours are snapped to a few steps on purpose: Raster only keeps about 1000 distinct colour pairs exact, so a flame
249// whose colour drifts a little every frame would use them all up and turn everything else (the terrier) a wrong colour.
250const HEAT_STEPS = 10
251const HOT_STEPS = 4
252const palette = (pct, h) => {
253  const hot = Math.round(Math.min(1, Math.max(0, (pct - 74) / 16)) * HOT_STEPS) / HOT_STEPS
254  return mix(ramp(BLUE, Math.round(Math.min(1, Math.max(0, h)) * HEAT_STEPS) / HEAT_STEPS), ramp(HOT, Math.round(Math.min(1, Math.max(0, h)) * HEAT_STEPS) / HEAT_STEPS), hot)
255}
256
257/** The colour of a percentage in text (hex string): blue, amber from 70%, deep orange from 85% (auto-model's warning line). */
258export function stateColor(pct) {
259  return pct >= 85 ? '#ff783c' : pct >= 70 ? '#ffbe50' : '#50aaff'
260}
261
262// ---- One fire per gauge ----------------------------------------------------------------------------------
263class Fire {
264  constructor(cols, rows) {
265    this.W = cols * 2
266    this.rows = rows
267    this.H = rows * 4
268    this.FH = this.H - BAR_H
269    this.heat = Array.from({ length: this.FH }, () => new Float32Array(this.W))
270    this.sparks = []
271    this.seed = Math.random() * 100 // so the flames do not move in lockstep
272  }
273
274  step(pct, t0) {
275    const { heat, W, FH } = this
276    const t = t0 + this.seed
277    const filled = pct <= 0 ? 0 : Math.max(2, Math.round((Math.min(100, pct) / 100) * W))
278    const f = 0.46 + 0.52 * (Math.min(100, pct) / 100)
279    for (let x = 0; x < W; x++) {
280      const end = Math.min(1, x / 3, (filled - 1 - x) / 3 + 0.35)
281      const fuel = 0.4 + 0.95 * Math.pow(vnoise(x * 0.3, t * 2.6), 1.3)
282      heat[FH - 1][x] = x < filled ? Math.max(0, Math.min(1.15, fuel * end)) : 0
283    }
284    for (let y = FH - 2; y >= 0; y--) {
285      const rise = (FH - 1 - y) / FH
286      for (let x = 0; x < W; x++) {
287        const wind = (vnoise(x * 0.12, y * 0.13 - t * 2.1) - 0.5) * 2.6 * (0.4 + 1.5 * rise)
288        const src = Math.min(W - 1, Math.max(0, Math.round(x + wind)))
289        const tongue = Math.pow(vnoise(x * 0.33, y * 0.1 - t * 3.4), 1.6)
290        const edge = 1 + 2.6 * Math.max(0, 1 - x / 7) // the first columns cool fast: no thin spike at the left end
291        const cool = (1 / (FH * f)) * (0.18 + 2.1 * tongue) * edge
292        heat[y][x] = Math.max(0, heat[y + 1][src] - cool + (Math.random() - 0.5) * 0.025)
293      }
294    }
295    if (Math.random() < 0.08 + 0.3 * (pct / 100) && filled > 6) {
296      this.sparks.push({ x: Math.random() * filled, y: FH * (0.35 + Math.random() * 0.2), vy: 0.35 + Math.random() * 0.55, vx: (Math.random() - 0.5) * 0.4, life: 1, trail: [] })
297    }
298    for (const s of this.sparks) {
299      s.trail.push([s.x, s.y])
300      if (s.trail.length > 3) s.trail.shift()
301      s.y -= s.vy
302      s.x += s.vx + (vnoise(s.x * 0.2, t * 2) - 0.5) * 0.5
303      s.life -= 0.04
304    }
305    this.sparks = this.sparks.filter(s => s.life > 0 && s.y > -1)
306    return filled
307  }
308
309  paint(canvas, ox, pct, filled, t0) {
310    const { heat, W, FH, H } = this
311    const t = t0 + this.seed
312    const put = (x, y, c) => { if (canvas[y] && x + ox < canvas[y].length) canvas[y][x + ox] = c }
313    const has = (x, y) => canvas[y] && canvas[y][x + ox]
314    for (let y = 0; y < FH; y++) {
315      for (let x = 0; x < W; x++) {
316        const v = heat[y][x]
317        if (v < 0.05) continue
318        if (v < 0.24 && v * 4.1 < (BAYER[y & 3][x & 3] + 0.5) / 16) continue // dither the thin fringe
319        put(x, y, palette(pct, Math.min(1, v * 0.92)))
320      }
321    }
322    for (const s of this.sparks) {
323      s.trail.forEach(([tx, ty], i) => {
324        const x = Math.round(tx)
325        const y = Math.round(ty)
326        if (x >= 0 && x < W && y >= 0 && y < FH && !has(x, y)) put(x, y, palette(pct, 0.3 + 0.25 * (i / 3) * s.life))
327      })
328      const x = Math.round(s.x)
329      const y = Math.round(s.y)
330      if (x >= 0 && x < W && y >= 0 && y < FH) put(x, y, palette(pct, 0.6 + 0.4 * s.life))
331    }
332    for (let k = 0; k < BAR_H; k++) {
333      const y = H - BAR_H + k
334      for (let x = 0; x < W; x++) {
335        if (x < filled) {
336          const near = x / Math.max(1, filled - 1)
337          const flick = vnoise(x * 0.45, t * 5 + k * 3)
338          const lead = Math.max(0, 1 - (filled - 1 - x) / 6)
339          const glow = 0.34 + 0.34 * near + 0.3 * flick + 0.3 * lead - k * 0.14
340          put(x, y, palette(pct, Math.min(1, Math.max(0.12, glow))))
341        } else if (k === 0 && x % 4 < 2) {
342          put(x, y, [54, 56, 70])
343        }
344      }
345    }
346  }
347}
348
349// ---- The band: three flames side by side -----------------------------------------------------------------
350export const BAND_GAP = 3
351export const BAND_NAMES = ['5시간', '주간', '대화']
352
353/** Widths of the three cells (terminal columns) for a band at most `cols` wide, and the band's total width. */
354export function bandLayout(cols) {
355  const usable = Math.max(36, Math.min(100, cols))
356  const w5 = Math.max(14, Math.floor((usable - 2 * BAND_GAP) * 0.4))
357  const w2 = Math.max(10, Math.floor((usable - 2 * BAND_GAP - w5) / 2))
358  const widths = [w5, w2, w2]
359  return { widths, total: w5 + 2 * w2 + 2 * BAND_GAP }
360}
361
362export function makeBand(cols, flameRows, mode) {
363  const { widths, total } = bandLayout(cols)
364  const rows = flameRows + 1 // flame rows plus the gauge row
365  const fires = widths.map(w => new Fire(w, rows))
366  return {
367    columns: total,
368    rows,
369    widths,
370    /** values: [five_hour, seven_day, context] percentages or null; t: seconds. Returns packed Raster cells. */
371    cells(values, t) {
372      const canvas = Array.from({ length: rows * 4 }, () => Array(total * 2).fill(null))
373      let x0 = 0
374      widths.forEach((w, i) => {
375        const pct = values[i] ?? 0
376        const filled = fires[i].step(pct, t)
377        fires[i].paint(canvas, x0 * 2, pct, filled, t)
378        x0 += w + BAND_GAP
379      })
380      return canvasToCells(canvas, total, rows, mode)
381    },
382  }
383}
384
385// ---- The terrier ------------------------------------------------------------------------------------------
386const hex = h => [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)]
387const PAL = SPRITE.palette.map(hex)
388const decode = rows => rows.map(row => [...row].map(c => (c === '.' ? null : PAL[SPRITE.alphabet.indexOf(c)])))
389// two styles: 'classic' (drawn here, the default) and 'real' (poses traced from a drawn reference sheet; on hold)
390const SETS = {}
391for (const name of Object.keys(SPRITE.sets)) SETS[name] = { ...SPRITE.sets[name], frames: SPRITE.sets[name].frames.map(decode) }
392// Breathing while he rests (the motion rules, docs/preview/motion/): only the trunk swells and settles, the head and
393// legs stay put. The build's patch per frame gives the other half of the breath (breathed out for the sitting poses,
394// which are drawn full-backed; breathed in for the lying and standing ones).
395for (const set of Object.values(SETS)) {
396  const b = set.breath
397  if (!b) continue
398  set.breathFrames = set.frames.map((frame, i) => {
399    const out = frame.slice()
400    const [first, ...rows] = b.patch[i]
401    decode(rows).forEach((row, k) => { out[first + k] = row })
402    return out
403  })
404}
405const REAL = {}
406for (const name of Object.keys(SPRITE.real || {})) REAL[name] = { ...SPRITE.real[name], frames: SPRITE.real[name].frames.map(decode) }
407const SW = SETS.run.frames[0][0].length // sub-pixel width of the sprite
408// the sprite's soft outline colours: braille leaves them out (as dots they read as dark specks)
409const OUTLINE = new Set((SPRITE.outline || []).map(i => SPRITE.palette[i]).map(h => [0, 2, 4].map(k => parseInt(h.slice(k, k + 2), 16)).join(',')))
410let ground = 0
411for (const set of [...Object.values(SETS), ...Object.values(REAL)]) for (const f of set.frames) f.forEach((row, y) => { if (row.some(c => c)) ground = Math.max(ground, y) })
412// every pose stands on the grass: a set whose lowest row ends above the ground line is drawn that much lower
413// (the motion inside a set, a bounce or a leap, is kept)
414for (const set of [...Object.values(SETS), ...Object.values(REAL)]) {
415  let bottom = 0
416  for (const f of set.frames) f.forEach((row, y) => { if (row.some(c => c)) bottom = Math.max(bottom, y) })
417  set.drop = ground - bottom
418}
419// Blocks (quad, fine) draw the same frames as braille, their greys lifted: raw, the hand-laid shading breaks into
420// two-colour patches cell by cell. Lifted to 150 (as 1.2.x lifted the moods the 1.0.2 block frames lacked) the
421// patches went but so did the volume; 110 keeps the leg shading and still reads clean (user pick, 2026-10-14).
422const BLOCK_GREY_LO = 110
423const liftBlock = c => {
424  if (!c || isFeature(c) || OUTLINE.has(c.join(',')) || Math.max(...c) - Math.min(...c) >= 14) return c
425  const v = Math.round(BLOCK_GREY_LO + (255 - BLOCK_GREY_LO) * (c[0] / 255))
426  return [v, v, Math.min(255, v + 4)]
427}
428const QUAD_SETS = {}
429const lifted = frames => frames && frames.map(f => f.map(row => row.map(liftBlock)))
430for (const name of Object.keys(SETS)) QUAD_SETS[name] = { ...SETS[name], frames: lifted(SETS[name].frames), breathFrames: lifted(SETS[name].breathFrames) }
431const setsFor = mode => (mode === 'braille' ? SETS : QUAD_SETS)
432export const DOG_ROWS = Math.ceil((ground + 1) / 4)
433export const DOG_COLS = Math.ceil(SW / 2)
434
435// a frame moved down (or up) onto the grass by its set's drop
436function shifted(set, frame) {
437  if (set.drop > 0) return [...Array.from({ length: set.drop }, () => Array(SW).fill(null)), ...frame.slice(0, frame.length - set.drop)]
438  if (set.drop < 0) return [...frame.slice(-set.drop), ...Array.from({ length: -set.drop }, () => Array(SW).fill(null))]
439  return frame
440}
441// the frame at a point (0-1) of one pass through a set, by its frames' own durations (the catch: one pass per throw)
442function frameAt(set, phase) {
443  const total = set.durations.reduce((a, b) => a + b, 0)
444  let t = phase * total
445  for (let i = 0; i < set.durations.length; i++) { if (t < set.durations[i]) return i; t -= set.durations[i] }
446  return set.durations.length - 1
447}
448// where (0-1) in that pass a frame begins
449const frameStart = (set, i) => set.durations.slice(0, i).reduce((a, b) => a + b, 0) / set.durations.reduce((a, b) => a + b, 0)
450function pick(set, ms) {
451  const total = set.durations.reduce((a, b) => a + b, 0)
452  let m = ms % total
453  for (let i = 0; i < set.durations.length; i++) {
454    if (m < set.durations[i]) return i
455    m -= set.durations[i]
456  }
457  return 0
458}
459
460/** The terrier on a gauge `columns` wide at `pct`, ms since start. Under 80% he runs, then pants, then sleeps. */
461export function dogCells(columns, pct, ms, mode) {
462  const TW = columns * 2
463  const canvas = Array.from({ length: DOG_ROWS * 4 }, () => Array(TW).fill(null))
464  const t = ms / 1000
465  const S = setsFor(mode)
466  const set = pct >= 97 ? S.sleep : pct >= 80 ? S.pant : S.run
467  const frame = shifted(set, set.frames[pick(set, ms)])
468  // The fire is the gauge: exactly pct of the width, nothing at 0%. Terry stands with his front paws at its end.
469  const lit = pct <= 0 ? 0 : Math.max(1, Math.round((Math.min(100, pct) / 100) * TW))
470  const front = lit - 1
471  const dogX = Math.max(0, Math.min(TW - SW, lit - Math.round(SW * 0.8)))
472  for (let x = 0; x < TW; x++) {
473    if (x > front) { if (x % 4 < 2) canvas[ground][x] = [58, 58, 70]; continue }
474    const near = 1 - (front - x) / Math.max(16, front)
475    const tall = Math.round(1 + 5 * (0.5 + 0.28 * Math.sin(x * 0.95 + t * 7.3) + 0.14 * Math.sin(x * 0.35 - t * 4.1)) * (0.5 + 0.7 * near))
476    for (let k = 0; k < tall && ground - k >= 0; k++) {
477      const heat = Math.max(0.12, Math.min(1, (0.35 + 0.6 * near) * (1 - k / (tall + 0.6)) + 0.08 * Math.sin(x * 2.9 + t * 11)))
478      canvas[ground - k][x] = palette(pct, heat)
479    }
480  }
481  for (let y = 0; y < frame.length; y++) {
482    for (let x = 0; x < SW; x++) {
483      const c = frame[y][x]
484      if (c && dogX + x >= 0 && dogX + x < TW) canvas[y][dogX + x] = c
485    }
486  }
487  return canvasToCells(canvas, columns, DOG_ROWS, mode)
488}
489
490// ---- Terry reacting to the session ------------------------------------------------------------------------
491// mood -> which frames: sit (idle), wag (you are typing), bark (you just started typing), run (Claude is working),
492// happy (the answer just landed), sleep (nothing for a while)
493const MOOD_FRAMES = {
494  sit: 'sit', wag: 'wag', bark: 'bark', run: 'run', happy: 'pant', sleep: 'sleep',
495  sniff: 'sniff', dig: 'dig', fetch: 'run', ask: 'ask', sad: 'sad',
496  door: 'door', catch: 'jump', droop: 'droop', stretch: 'stretch', eat: 'eat', pet: 'pet',
497}
498// Little things drawn beside him, on square pixels (2 x 2 sub-pixels in quad mode). Each letter is a colour of `colors`.
499const PROPS = {
500  door: { art: ['dddddd', 'dwwwwd', 'dwppwd', 'dwppwd', 'dwwwwd', 'dwppwd', 'dwppwd', 'dwwwkd', 'dwwwwd', 'dwppwd', 'dwppwd', 'dwwwwd'],
501    colors: { d: [92, 60, 36], w: [152, 102, 62], p: [126, 82, 48], k: [242, 204, 84] } },
502  bowl: { art: ['.fffff.', 'bbbbbbb', '.bbbbb.'], colors: { f: [190, 124, 72], b: [206, 66, 66] } },
503  // (`dots`: the art used in braille, where a prop pixel is one dot and the 2 x 2 art came out too small to see)
504  frisbee: { art: ['.rr.', 'rrrr'], dots: ['..rrrr..', '.rwwwwr.', 'rrrrrrrr', '.rrrrrr.'], colors: { r: [236, 72, 64], w: [255, 150, 140] } },
505  heart: { art: ['h.h', 'hhh', '.h.'], colors: { h: [255, 120, 160] } },
506  pouch: { art: ['.g.g.', '..r..', '.rrr.', 'rrrrr', '.rrr.'], colors: { g: [246, 206, 90], r: [214, 46, 60] } },
507  songpyeon: { art: ['.a..b..c.', 'aaabbbccc'], colors: { a: [250, 196, 210], b: [246, 244, 236], c: [170, 214, 150] } },
508  cake: { art: ['..y..', '..w..', 'ppppp', 'ccccc', 'ccccc'], colors: { y: [255, 200, 80], w: [240, 240, 246], p: [255, 170, 200], c: [214, 160, 110] } },
509}
510// Seollal and Chuseok by the solar date they fall on (the day before to the day after count)
511const HOLIDAYS = {
512  seollal: ['2026-02-17', '2027-02-06', '2028-01-26', '2029-02-13', '2030-02-03'],
513  chuseok: ['2026-09-25', '2027-09-15', '2028-10-03', '2029-09-22', '2030-09-12'],
514}
515export function holidayOf(year, month, day) {
516  const t = Date.UTC(year, month - 1, day)
517  for (const [name, dates] of Object.entries(HOLIDAYS)) {
518    for (const d of dates) if (Math.abs(Date.parse(d + 'T00:00:00Z') - t) <= 86400000) return name
519  }
520  return null
521}
522// How he runs follows the effort level: a walk, a brisk trot, the gallop, a flat-out sprint, and at max he takes off.
523// speed plays the frames faster, ground is how fast the ground slides past (sub-pixels a second).
524export const RUN_STYLES = {
525  low: { set: 'walk', speed: 0.6, ground: 9, lines: 0, len: 0, dust: false },
526  medium: { set: 'walk', speed: 1.5, ground: 22, lines: 0, len: 0, dust: true }, // the same clean walk as low, brisker (the old trot tangled its steps)
527  high: { set: 'run', speed: 1, ground: 34, lines: 3, len: 7, dust: true },
528  xhigh: { set: 'run', speed: 1.5, ground: 52, lines: 4, len: 10, dust: true },
529  max: { set: 'run', speed: 2.2, ground: 85, lines: 0, len: 0, dust: false, fly: true },
530}
531export const runStyle = effort => RUN_STYLES[effort] || RUN_STYLES.high
532const CAPE_X = 27 // the flight pose's shoulders (sub-pixels from his left), where the cape starts
533const CAPE_BACK = 19 // how far back along his back it lies before it streams off behind
534const FLY_FRAME = 6 // in a run set without its own flyFrame: the pose stretched flat out in the air (the build sets it)
535const SKY_COLS = 12 // room to the right of Terry for the sun, the moon and the stars
536const TRAIL_COLS = 5 // room to the left of Terry for speed lines and dust while he runs
537const SOIL_ROWS = 3 // sub-pixel rows of earth under the grass
538export const TERRY_COLS = DOG_COLS + SKY_COLS + TRAIL_COLS
539// The ground repeats every this many sub-pixels (the widest card, so no repeat shows at once). Endless ground made a new
540// pattern under every cell as he ran, and the Lode Cells card (terry-fine.js) a new glyph and colour pair each time:
541// tens of thousands an hour, which overflows the terminal's glyph cache (xterm.js WebGL on a laptop GPU with 16
542// texture units garbles all text once its pages merge, fixed upstream after addon-webgl 0.19). Repeating, the
543// ground's glyphs stop at a few hundred. A multiple of 4: the pebbles and soil step every 4 and 2.
544const GROUND_PERIOD = 84
545export const TERRY_ROWS = Math.ceil((ground + 1 + SOIL_ROWS) / 4)
546export const TERRY_MIN_COLS = DOG_COLS + 3 // a narrow window gives up the sky first, then most of the room behind him
547
548// Fixed colours (no gradients), so Raster's ~1000 exact colour pairs are never used up
549const GRASS = [[98, 164, 74], [74, 130, 58]]
550const SOIL = [[110, 80, 50], [88, 63, 39], [128, 94, 60]]
551const PEBBLE = [150, 146, 136]
552// the sun in four tones: a pale highlight, the body, a deeper rim, and its rays (one sun pixel is half a cell, so
553// every cell holds at most two of them and the shading comes through whole)
554const SUN_DAWN = { hi: [255, 236, 222], core: [255, 192, 168], rim: [238, 124, 140], ray: [246, 138, 156] }
555const SUN_DAY = { hi: [255, 252, 214], core: [255, 226, 92], rim: [255, 168, 46], ray: [255, 204, 84] }
556const SUN_DUSK = { hi: [255, 222, 164], core: [255, 162, 80], rim: [226, 88, 48], ray: [240, 112, 62] }
557export const MOON = { core: [240, 236, 214], rim: [204, 199, 176] }
558const STAR = [[226, 230, 255], [150, 160, 210]]
559// The sun and the moon, drawn by hand on square pixels: a terminal cell is twice as tall as it is wide, so in quad
560// mode one art pixel is 2 x 2 sub-pixels (a whole quarter-block pair), in braille 1 x 1 dot.
561// c: the body, s: its shaded edge, r / R: the sun's rays, two sets that take turns twinkling
562const SUN_ART = [
563  '....r....',
564  '.R.....R.',
565  '...ooo...',
566  '..ohyyo..',
567  'r.oyyyo.r',
568  '..oyyoo..',
569  '...ooo...',
570  '.R.....R.',
571  '....r....',
572]
573const SUN_SMALL = ['R.r.R', '.hyo.', 'ryyor', '.yoo.', 'R.r.R']
574// The crescent moon is cut from two true circles at twice the sun's horizontal resolution: one moon pixel is one
575// sub-pixel wide and two tall (a single quarter block, half a cell wide), which a round shape this small needs
576// tilted a little (the opening turned 18 degrees up), s: a thin shade along the inner curve, close to the body's colour
577// so a cell that holds both still reads as one
578const MOON_ART = [
579  '...cccss.....',
580  '..cccs.......',
581  '.cccs........',
582  'ccccs........',
583  '.ccccs.......',
584  '..ccccss.....',
585  '...ccccccccss',
586]
587// Chuseok's full moon: a true circle at the moon's resolution, with a few soft craters
588const MOON_FULL = (() => {
589  const R = 6.5, W = 14, Hq = 7, cx = W / 2, cy = Hq
590  const craters = [[5.2, 4.6, 1.4], [9.0, 8.4, 1.6], [6.4, 10.2, 1.0]]
591  const rows = []
592  for (let qy = 0; qy < Hq; qy++) {
593    let r = ''
594    for (let x = 0; x < W; x++) {
595      const px = x + 0.5, py = qy * 2 + 1
596      if (Math.hypot(px - cx, py - cy) > R) { r += '.'; continue }
597      r += craters.some(([ax, ay, ar]) => Math.hypot(px - ax, py - ay) <= ar) ? 's' : 'c'
598    }
599    rows.push(r)
600  }
601  return rows
602})()
603const MOON_SMALL = [
604  '..ccs...',
605  '.ccs....',
606  'cccs....',
607  '.cccs...',
608  '..cccccc',
609]
610
611// The moon cut from true circles, W x H pixels of a dot (braille) or half a dot (terry-fine.js): the crescent two
612// circles, the inner one set off toward the opening and turned 18 degrees up, with a thin shade along its curve; the
613// full moon a circle with a few soft craters. 0 sky, 1 the body, 2 the shade. (The art above, in pixels one dot wide
614// and two tall, stays for the quad card, whose quarter blocks are that shape.)
615export function moonShape(kind, W, H) {
616  const out = new Uint8Array(W * H), cx = W / 2, cy = H / 2
617  const k = kind === 'full' ? W / 28 : W / 26
618  const R = 12.6 * k, d = 7 * k, r = 11.4 * k, shade = 1.3 * Math.max(k, 0.77), a = (18 * Math.PI) / 180
619  const ix = cx + d * Math.cos(a), iy = cy - d * Math.sin(a)
620  const craters = [[10.4, 9.2, 2.8], [18, 16.8, 3.2], [12.8, 20.4, 2]].map(c => c.map(v => v * k))
621  for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
622    const px = x + 0.5, py = y + 0.5
623    if (kind === 'full') {
624      if (Math.hypot(px - cx, py - cy) <= 13 * k) out[y * W + x] = craters.some(([ax, ay, ar]) => Math.hypot(px - ax, py - ay) <= ar) ? 2 : 1
625      continue
626    }
627    const inner = Math.hypot(px - ix, py - iy)
628    if (Math.hypot(px - cx, py - cy) <= R && inner > r) out[y * W + x] = inner < r + shade ? 2 : 1
629  }
630  return out
631}
632
633// Breathing: one breath every `ms`, the breath in shorter than the breath out and the pause after it; the other half
634// of the breath shows while `from` <= its phase < `to`.
635function breathFrame(set, index, ms) {
636  const b = set.breath
637  if (!b || !set.breathFrames) return set.frames[index]
638  const phase = (ms % b.ms) / b.ms
639  return phase >= b.from && phase < b.to ? set.breathFrames[index] : set.frames[index]
640}
641
642// Blinking: about every 4.2 s the eye shuts for 140 ms, and every third time twice in a row. Asleep, it stays shut.
643const BLINK_EVERY = 4200
644function isBlinking(ms) {
645  const m = ms % BLINK_EVERY
646  return m < 140 || (Math.floor(ms / BLINK_EVERY) % 3 === 0 && m > 300 && m < 440)
647}
648const EYE = [24, 24, 24] // the eye's colour in the sprite (the nose is a different near-black)
649const isEye = c => c !== null && c[0] === EYE[0] && c[1] === EYE[1] && c[2] === EYE[2]
650const LID = [28, 28, 28] // near-black, so a cell always keeps it (see isFeature): a thin closed-eye line
651const FACE = [226, 226, 226]
652/** The frame with the eye shut: the eye becomes face colour with a lid line along its bottom, a pixel longer at each
653 * end, so on a terminal cell it reads as a dash rather than a dot. */
654function closeEyes(frame, shut) {
655  if (!shut) return frame
656  let lowest = -1
657  let minX = Infinity
658  let maxX = -1
659  frame.forEach((row, y) => row.forEach((c, x) => {
660    if (!isEye(c)) return
661    lowest = Math.max(lowest, y)
662    minX = Math.min(minX, x)
663    maxX = Math.max(maxX, x)
664  }))
665  if (lowest < 0) return frame
666  return frame.map((row, y) => {
667    if (y !== lowest && !row.some(isEye)) return row
668    return row.map((c, x) => (y === lowest && x >= minX - 1 && x <= maxX + 1 && c ? LID : isEye(c) ? FACE : c))
669  })
670}
671
672/**
673 * Terry in `mood` at local `hour` (0-24, fractions allowed), ms since start.
674 *  - the sky to his right follows the clock: the sun rises at 6 and sets at 18 (pink at dawn, orange at dusk), then
675 *    the moon crosses with stars twinkling around
676 *  - he stands on grass over earth, which slides past while he runs
677 *  - a mark by his head: ! when he barks, * when he is pleased, z Z Z when he sleeps
678 */
679/** Terry's whole picture as sub-pixel colours (canvas: rows*4 lines of columns*2 [r,g,b] or null) plus the text marks
680 *  drawn over it (! * ? z) in cell coordinates. The terminal turns it into cells; the web view draws it directly. */
681export function terryScene(mood, ms, mode, hour = 12, columns = TERRY_COLS, effort = 'high', date = null, opts = {}) {
682
683  const TW = columns * 2
684  const H = TERRY_ROWS * 4
685  const canvas = Array.from({ length: H }, () => Array(TW).fill(null))
686  // (opts.track: mark what is drawn over Terry, so terry-fine.js can lay a finer Terry under it; opts.noDog: leave
687  // him out, for what is behind him)
688  const over = opts.track ? new Uint8Array(TW * H) : null
689  let afterDog = false
690  const put = (x, y, c) => { if (x >= 0 && x < TW && y >= 0 && y < H) { canvas[y][x] = c; if (afterDog && over) over[y * TW + x] = 1 } }
691  const PX = mode === 'braille' ? 1 : 2
692  // a prop from PROPS with its bottom-left pixel at (left, bottom)
693  const prop = (name, left, bottom) => {
694    const { colors } = PROPS[name]
695    const art = (mode === 'braille' && PROPS[name].dots) || PROPS[name].art
696    const top = bottom - art.length * PX + 1
697    art.forEach((row, y) => [...row].forEach((ch, x) => {
698      if (ch === '.') return
699      for (let i = 0; i < PX; i++) for (let k = 0; k < PX; k++) put(left + x * PX + i, top + y * PX + k, colors[ch])
700    }))
701  }
702  const t = ms / 1000
703  const style = runStyle(effort)
704  const running = mood === 'run'
705  const sets = mode !== 'braille' ? QUAD_SETS : date && date.style === 'real' ? { ...SETS, ...REAL } : SETS
706  const flying = running && style.fly
707  const setName = (flying && sets.fly && 'fly') || (running ? (sets[style.set] && style.set) : (sets[MOOD_FRAMES[mood]] && MOOD_FRAMES[mood])) || 'sit'
708  const set = sets[setName]
709  // flying, he holds the flight pose (the build's own Superman frame, legs stretched fore and aft; without one, the
710  // gallop's stretched-out frame) instead of striding
711  // catching: crouch while the frisbee comes, leap for it, land with it (the frame follows the throw, not a timer)
712  const throwPhase = mood === 'catch' ? (ms / 1600) % 1 : 0
713  const index = flying ? (sets.fly ? 0 : set.flyFrame ?? FLY_FRAME)
714    // (four frames: watching it come, a crouch, the leap held at the top, landed; the older three-frame set has no crouch)
715    : mood === 'catch' && set.catchAt != null ? frameAt(set, throwPhase)
716    : mood === 'catch' ? (set.frames.length >= 4 ? (throwPhase < 0.36 ? 0 : throwPhase < 0.44 ? 1 : throwPhase < 0.82 ? 2 : 3) : throwPhase < 0.42 ? 0 : throwPhase < 0.82 ? 1 : 2)
717    : mood === 'stretch' ? pick(set, date && date.moodMs != null ? date.moodMs : ms) // from the start of the stretch
718    : pick(set, running ? ms * style.speed : ms)
719  const yawning = mood === 'stretch' && index >= 5 && index <= 7 // eyes shut through the yawn
720  let frame = closeEyes(breathFrame(set, index, ms), mood === 'sleep' || yawning || isBlinking(ms))
721  // fetching: he runs off to the right, then comes back the other way with a stick in his mouth
722  const fetchPhase = mood === 'fetch' ? (ms / 3200) % 1 : 0
723  const fetchBack = mood === 'fetch' && fetchPhase >= 0.5
724  if (fetchBack) frame = frame.map(row => row.slice().reverse())
725  const mouthAt = set.mouth && set.mouth[index] ? [set.mouth[index][0], set.mouth[index][1] + Math.max(0, set.drop)] : null
726  frame = shifted(set, frame)
727  const trail = Math.max(1, Math.min(TRAIL_COLS, columns - DOG_COLS - 1))
728  const homeX = trail * 2
729  const away = TW - homeX + 6
730  const dogX = mood !== 'fetch' ? homeX
731    : fetchPhase < 0.5 ? homeX + Math.round((fetchPhase / 0.5) * away)
732    : homeX + Math.round((1 - (fetchPhase - 0.5) / 0.5) * away)
733
734  // the sky, right of his nose (where he stands at home: fetching, he runs past the sun, it doesn't follow him)
735  const skyX0 = homeX + SW + 1
736  const skyW = TW - skyX0 - 3
737  const isDay = hour >= 6 && hour < 18
738  const p = isDay ? (hour - 6) / 12 : ((hour - 18 + 24) % 24) / 12
739  const bx = Math.round(skyX0 + 2 + p * (skyW - 4))
740  const by = Math.round(ground - 9 - (ground - 15) * Math.sin(Math.PI * p))
741  if (!isDay) {
742    for (let i = 0; i < 14; i++) {
743      const x = Math.floor(hash(i, 701) * TW)
744      const y = Math.floor(hash(i, 702) * (ground - 8))
745      if (Math.abs(x - bx) < 4 && Math.abs(y - by) < 4) continue
746      const twinkle = Math.sin(t * (1.2 + hash(i, 703) * 2) + i * 2)
747      if (twinkle > -0.4) put(x, y, STAR[twinkle > 0.5 ? 0 : 1])
748    }
749  }
750  const look = !isDay ? MOON : hour < 7.5 ? SUN_DAWN : hour >= 16.5 ? SUN_DUSK : SUN_DAY
751  // the season, from the real date: snow in winter, petals in spring, fireflies on summer nights, leaves in autumn,
752  // fireworks on New Year's Eve and New Year's night
753  if (date) {
754    const { month, day } = date
755    const drift = running ? t * style.ground * 0.4 : 0
756    const wrap = v => ((v % TW) + TW) % TW
757    const shape = (x, y, dots, c) => { for (const [dx, dy] of dots) put(x + dx, y + dy, c) }
758    if (mode === 'braille') {
759      // In braille every dot is a pixel, so the season gets shapes: tumbling leaves, star-shaped flakes, spinning
760      // petals, glowing fireflies — the near ones larger and brighter, the far ones single dim dots.
761      const near = i => hash(i, 861) < 0.4
762      const dim = (c, k) => c.map(v => Math.round(v * k))
763      if (month === 12 || month <= 2) {
764        for (let i = 0; i < 26; i++) {
765          const close = near(i)
766          const y = Math.floor((hash(i, 802) * ground + t * (close ? 6 : 3) * (1 + hash(i, 803))) % (ground - 1))
767          const x = Math.floor(wrap(hash(i, 801) * TW + Math.sin(t * 1.3 + i) * 2.5 - drift * (close ? 1.4 : 0.7)))
768          if (close) shape(x, y, [[0, 0], [1, 0], [-1, 0], [0, 1], [0, -1]], [240, 244, 252])
769          else put(x, y, [180, 186, 200])
770        }
771      } else if (month <= 5) {
772        const PETAL_SPIN = [[[0, 0], [1, 0]], [[0, 0], [1, 1]], [[0, 0], [0, 1]], [[1, 0], [0, 1]]]
773        for (let i = 0; i < 16; i++) {
774          const close = near(i)
775          const y = Math.floor((hash(i, 812) * ground + t * (close ? 4.5 : 2.5)) % (ground - 1))
776          const x = Math.floor(wrap(hash(i, 811) * TW - t * 5 + Math.sin(t * 2 + i) * 3 - drift))
777          const c = i % 3 ? [255, 183, 205] : [255, 214, 226]
778          if (close) shape(x, y, PETAL_SPIN[Math.floor(t * 3 + i) % 4], c)
779          else put(x, y, dim(c, 0.75))
780        }
781      } else if (month <= 8) {
782        if (!isDay) {
783          for (let i = 0; i < 9; i++) {
784            const glow = Math.sin(t * (1.5 + hash(i, 823)) + i * 1.7)
785            if (glow < 0) continue
786            const x = Math.floor(wrap(hash(i, 821) * TW + Math.sin(t * 0.7 + i) * 6 - drift))
787            const y = Math.floor(ground - 4 - hash(i, 822) * (ground - 10) + Math.sin(t + i) * 2)
788            put(x, y, [214, 244, 96])
789            if (glow > 0.6) shape(x, y, [[1, 0], [-1, 0], [0, 1], [0, -1]], [96, 120, 50]) // the glow around it
790          }
791        }
792      } else {
793        // autumn: leaves tumbling as they fall (the shape turns), swaying side to side; a few already on the grass
794        const LEAVES = [[214, 120, 40], [196, 70, 38], [232, 182, 62], [168, 96, 44]]
795        const SPIN = [
796          [[0, 0], [1, 0], [0, 1], [1, 1], [2, 1]],
797          [[0, 0], [1, 0], [1, 1], [2, 1]],
798          [[1, 0], [0, 1], [1, 1], [0, 2]],
799          [[0, 0], [1, 1], [2, 1], [1, 2]],
800        ]
801        for (let i = 0; i < 14; i++) {
802          const close = near(i)
803          const y = Math.floor((hash(i, 832) * ground + t * (close ? 4 : 2.2) * (1 + hash(i, 833) * 0.6)) % (ground - 2))
804          const x = Math.floor(wrap(hash(i, 831) * TW + Math.sin(t * 1.6 + i * 2) * (close ? 5 : 3) - drift * (close ? 1.3 : 0.7)))
805          const c = LEAVES[i % 4]
806          if (close) shape(x, y, SPIN[Math.floor(t * 2.5 + i) % 4], c)
807          else shape(x, y, (Math.floor(t * 2 + i) % 2) ? [[0, 0], [1, 0]] : [[0, 0], [0, 1]], dim(c, 0.7))
808        }
809      }
810    } else {
811      if (month === 12 || month <= 2) {
812        for (let i = 0; i < 22; i++) {
813          const y = Math.floor((hash(i, 802) * ground + t * (3 + hash(i, 803) * 4)) % (ground - 1))
814          put(Math.floor(wrap(hash(i, 801) * TW + Math.sin(t * 1.3 + i) * 2.5 - drift)), y, [236, 240, 250])
815        }
816      } else if (month <= 5) {
817        for (let i = 0; i < 12; i++) {
818          const y = Math.floor((hash(i, 812) * ground + t * (3 + hash(i, 813) * 2)) % (ground - 1))
819          put(Math.floor(wrap(hash(i, 811) * TW - t * 5 + Math.sin(t * 2 + i) * 3 - drift)), y, i % 3 ? [255, 183, 205] : [255, 214, 226])
820        }
821      } else if (month <= 8) {
822        if (!isDay) {
823          for (let i = 0; i < 7; i++) {
824            if (Math.sin(t * (1.5 + hash(i, 823)) + i * 1.7) < 0.2) continue
825            const x = Math.floor(wrap(hash(i, 821) * TW + Math.sin(t * 0.7 + i) * 6 - drift))
826            put(x, Math.floor(ground - 4 - hash(i, 822) * (ground - 10) + Math.sin(t + i) * 2), [214, 244, 96])
827          }
828        }
829      } else {
830        const LEAVES = [[214, 120, 40], [196, 70, 38], [232, 182, 62]]
831        for (let i = 0; i < 9; i++) {
832          const y = Math.floor((hash(i, 832) * ground + t * (2.5 + hash(i, 833) * 2)) % (ground - 1))
833          const x = Math.floor(wrap(hash(i, 831) * TW + Math.sin(t * 1.6 + i * 2) * 4 - drift))
834          put(x, y, LEAVES[i % 3])
835          if (i % 2) put(x + 1, y, LEAVES[i % 3])
836        }
837      }
838    }
839    const newYear = (month === 12 && day === 31) || (month === 1 && day === 1)
840    if (newYear && !isDay) {
841      const FIRE = [[255, 120, 120], [255, 214, 102], [140, 200, 255], [190, 150, 255]]
842      for (let b = 0; b < 2; b++) {
843        const cycle = Math.floor(t / 1.6 + b * 0.5)
844        const age = (t / 1.6 + b * 0.5) % 1
845        const cx = Math.floor(skyX0 + hash(cycle, 841 + b) * Math.max(4, skyW)), cy = 4 + Math.floor(hash(cycle, 851 + b) * 8)
846        const r = age * 7
847        for (let k = 0; k < 8; k++) {
848          const a = (k / 8) * Math.PI * 2
849          if (age < 0.85) put(Math.round(cx + Math.cos(a) * r), Math.round(cy + Math.sin(a) * r * 0.8), FIRE[(cycle + b) % 4])
850        }
851      }
852    }
853  }
854
855  // the sun or the moon, over the season's petals, leaves and snow (none in a narrow window; the stars stay)
856  // (not while the '?' bubble is up: it sits in the same patch of sky)
857  let moon = null
858  if (skyW >= 10 && mood !== 'ask' && mood !== 'door') {
859    const px = mode === 'braille' ? 1 : 2 // one sun pixel, in sub-pixels each way
860    const big = skyW >= SUN_ART[0].length * px + 2
861    let art = isDay ? (big ? SUN_ART : SUN_SMALL) : date && date.holiday === 'chuseok' ? MOON_FULL : big ? MOON_ART : MOON_SMALL
862    let pw = isDay ? px : 1 // the moon's pixels are finer: one sub-pixel wide,
863    let ph = isDay ? px : 2 // two tall
864    const w = art[0].length * pw
865    let left = Math.min(TW - 1 - w, Math.max(skyX0, bx - Math.floor(w / 2)))
866    let top = Math.max(0, by - Math.floor((art.length * ph) / 2))
867    left -= left % pw // on whole quarter blocks, so no art pixel is split across two
868    top -= top % ph
869    const twinkle = Math.floor(t * 1.6) % 2
870    // (where the moon is, for terry-fine.js to draw it again at its own finer pixels)
871    if (!isDay) moon = { left, top, w, h: art.length * ph, kind: art === MOON_FULL ? 'full' : art === MOON_ART ? 'crescent' : 'small' }
872    if (!isDay && mode === 'braille') { // a dot is square: the moon at a dot a pixel
873      const shape = moonShape(moon.kind, w, moon.h)
874      art = Array.from({ length: moon.h }, (_, y) => [...shape.slice(y * w, (y + 1) * w)].map(v => '.cs'[v]).join(''))
875      pw = ph = 1
876    }
877    // (opts.track: what each moon pixel covered, so terry-fine.js can lay its finer moon without drawing the sky again)
878    if (moon && opts.track) moon.under = new Map()
879    art.forEach((row, y) => [...row].forEach((ch, x) => {
880      if (ch === '.' || ch === ' ') return
881      if ((ch === 'r' && twinkle) || (ch === 'R' && !twinkle)) return
882      const c = ch === 'h' ? look.hi : ch === 'c' || ch === 'y' ? look.core : ch === 'r' || ch === 'R' ? look.ray || look.rim : look.rim
883      for (let i = 0; i < pw; i++) for (let k = 0; k < ph; k++) {
884        const X = left + x * pw + i, Y = top + y * ph + k
885        if (moon?.under && canvas[Y] && X >= 0 && X < TW) moon.under.set(Y * TW + X, [canvas[Y][X], c])
886        put(X, Y, c)
887      }
888    }))
889  }
890
891  // the ground: a grassy edge on earth with a few pebbles; it slides past while he runs
892  const off = running ? Math.floor(t * style.ground) : mood === 'sniff' ? Math.floor(t * 6) : 0 // the ground slides by as fast as he goes
893  for (let x = 0; x < TW; x++) {
894    const wx = (x + off) % GROUND_PERIOD
895    for (let k = 1; k <= SOIL_ROWS; k++) {
896      const y = ground + k
897      put(x, y, hash(wx >> 2, y + 41) < 0.06 ? PEBBLE : k === 1 ? SOIL[2] : SOIL[hash(wx >> 1, y) < 0.3 ? 1 : 0])
898    }
899    put(x, ground, GRASS[(wx >> 1) & 1])
900    if (hash(wx, 7) < 0.4) put(x, ground - 1, GRASS[wx & 1])
901    if (hash(wx, 8) < 0.12) put(x, ground - 2, GRASS[1])
902  }  // braille: what the season leaves on the grass — settled snow, fallen leaves (they slide by with the ground)
903  if (date && mode === 'braille') {
904    const slide = running ? Math.floor(t * style.ground) : 0
905    const { month } = date
906    if (month === 12 || month <= 2) for (let x = 0; x < TW; x++) { if (hash((x + slide) % GROUND_PERIOD, 871) < 0.4) put(x, ground - 1, [226, 230, 240]) }
907    else if (month >= 9 && month <= 11) {
908      const FALLEN = [[214, 120, 40], [196, 70, 38], [232, 182, 62], [168, 96, 44]]
909      for (let x = 0; x < TW; x++) { const wx = (x + slide) % GROUND_PERIOD; if (hash(wx, 881) < 0.08) put(x, ground - 1, FALLEN[wx % 4]) }
910    }
911  }
912
913
914  // running: speed lines streaking back past him and puffs of dust kicked up behind (how many follows the effort)
915  if (running && style.lines) {
916    const rowsY = [ground - 17, ground - 12, ground - 7, ground - 21, ground - 3]
917    for (let n = 0; n < style.lines; n++) {
918      const y = rowsY[n] - (style.fly ? 4 : 0)
919      const span = dogX + 4
920      const head = dogX + 3 - Math.floor(((t * 4.5 * style.speed + n * 0.37) % 1) * span)
921      for (let k = 0; k < style.len; k++) put(head - k, y, k < 3 ? [232, 236, 246] : k < 8 ? [150, 154, 170] : [96, 100, 116])
922    }
923  }
924  if (running && style.dust) {
925    for (let i = 0; i < 3; i++) {
926      const age = (t * 3 * style.speed + i / 3) % 1 // each puff drifts back and fades
927      const x = Math.round(dogX + 2 - age * 10 - i)
928      const y = ground - 1 - Math.round(age * 2)
929      const c = age < 0.5 ? [176, 150, 118] : [120, 104, 86]
930      put(x, y, c)
931      if (age < 0.6) put(x - 1, y, c)
932    }
933  }
934  // max: he flies like a superhero — lifted over his shadow, a red cape streaming back from his shoulders,
935  // wind rushing past above and below and clouds racing by
936  // a test passed: a frisbee sails in from the right, he leaps for it and lands with it in his mouth
937  const catchPhase = mood === 'catch' ? (ms / 1600) % 1 : 0
938  // (the traced leap is already drawn in the air, up to the top of the picture: it gets no extra hop)
939  const hop = mood === 'catch' && !set.mouth && set.catchAt == null && catchPhase >= 0.42 && catchPhase < 0.82 ? Math.round(Math.sin((Math.PI * (catchPhase - 0.42)) / 0.4) * 1) : 0 // (the leap pose is already up in the air: lifted more, his head went off the top)
940  const lift = running && style.fly ? 5 + Math.round(Math.sin(t * 6)) : hop
941  // the cape's run along his back, from the shoulders to the rump: a straight line between the top of his coat at each
942  // end (a tuft standing above it is covered too), as [x, top, bottom] on the canvas. Its bottom ends on a cell's last
943  // row, so no cell is shared by the red and his coat (a cell shows one colour: shared, the cape broke into pieces). One
944  // bottom for the whole cape: following the slope it dropped a whole cell (4 dots) at once and notched his body
945  const capeBack = [], capeTail = []
946  const [capeX, capeLen] = set.cape || [CAPE_X, CAPE_BACK] // the flight set's own shoulders and back length
947  if (running && style.fly) {
948    const topAt = x => { let y = 6; while (y < frame.length && !frame[y][x]) y++; return y }
949    const y0 = topAt(capeX), y1 = topAt(capeX - capeLen)
950    const lineAt = u => Math.round(y0 + ((y1 - y0) * u) / capeLen) - lift
951    const bottom = (Math.max(lineAt(0), lineAt(capeLen)) + 2) | 3
952    for (let u = 0; u <= capeLen; u++) {
953      const x = capeX - u
954      capeBack.push([dogX + x, Math.min(topAt(x) - lift, lineAt(u)), bottom])
955    }
956  }
957  if (lift && running && style.fly) {
958    for (let x = dogX + 10; x < dogX + SW - 12; x++) put(x, ground, [34, 70, 34]) // his shadow on the grass
959    // clouds racing by in the sky
960    for (let i = 0; i < 3; i++) {
961      const cx = TW + 8 - Math.floor(((t * 1.6 + i / 3) % 1) * (TW + 16))
962      const cy = 3 + i * 4
963      const cloud = isDay ? [226, 232, 244] : [74, 78, 98]
964      for (let dx = -3; dx <= 3; dx++) put(cx + dx, cy, cloud)
965      for (let dx = -1; dx <= 2; dx++) put(cx + dx, cy - 1, cloud)
966    }
967    // the cape: lying on his back from the shoulders to the rump, then streaming back over his tail as a ribbon, waving
968    // harder toward its free end (both drawn over him, below: behind him, his tail cut the ribbon off from his back)
969    const ax = dogX + capeX
970    const ay = capeBack[capeBack.length - 1][1]
971    const L = 30
972    for (let u = 0; u <= L; u++) {
973      const k = u / L
974      const wave = Math.sin(u * 0.38 - t * 16) * (0.4 + 2.6 * k)
975      const slope = Math.cos(u * 0.38 - t * 16)
976      const top = Math.round(ay - u * 0.1 + wave * Math.min(1, u / 4))
977      const thick = Math.round(4 + 3 * k)
978      for (let w = 0; w < thick; w++) {
979        const c = w === 0 ? [244, 92, 96] : slope < -0.3 ? [150, 22, 34] : [214, 38, 48]
980        capeTail.push([ax - capeLen - u, top + w, c])
981      }
982    }
983  }
984  // wind streaks rushing past at max, the full width of the picture
985  if (running && style.fly) {
986    const rowsY = [ground - 25, ground - 22, ground - 4, ground - 8, ground - 14]
987    for (let n = 0; n < rowsY.length; n++) {
988      const len = 8 + (n % 3) * 3
989      const head = TW + len - Math.floor(((t * (2.4 + n * 0.3) + n * 0.29) % 1) * (TW + 2 * len))
990      for (let k = 0; k < len; k++) put(head + k, rowsY[n], k < 2 ? [236, 240, 250] : k < 6 ? [170, 180, 205] : [104, 110, 134])
991    }
992  }
993
994  // sniffing: little wisps of scent rising from the ground in front of his nose
995  if (mood === 'sniff') {
996    for (let i = 0; i < 3; i++) {
997      const age = (t * 1.2 + i / 3) % 1
998      put(dogX + 46 + Math.round(Math.sin(age * 6 + i) * 1.5), Math.round(ground - 2 - age * 7), [176, 190, 168])
999    }
1000  }
1001  // digging: a dark hole at his front paws, dirt flung back under him and over his rump, and a heap behind him that
1002  // grows the longer he digs (two soil colours only: each terminal cell holds two)
1003  if (mood === 'dig') {
1004    const SOIL_LIGHT = [140, 100, 62], SOIL_DARK = [104, 74, 46]
1005    for (let x = dogX + 27; x <= dogX + 35; x++) put(x, ground, [46, 32, 20])
1006    const since = (date && date.moodMs) || ms
1007    const heap = Math.min(7, 2 + Math.floor(since / 1500))
1008    const hx0 = dogX + 2
1009    for (let dx = -heap - 1; dx <= heap + 1; dx++) {
1010      const h = Math.floor(Math.max(0, heap - Math.abs(dx) * 0.9))
1011      for (let k = 0; k <= h; k++) put(hx0 + dx, ground - k, k === h ? SOIL_LIGHT : SOIL_DARK)
1012    }
1013    for (let i = 0; i < 5; i++) {
1014      const age = (t * 2.2 + i / 5) % 1
1015      const x = Math.round(dogX + 30 - age * 28)
1016      const y = Math.round(ground - 3 - Math.sin(Math.PI * age) * 14 + age * 2)
1017      put(x, y, SOIL_LIGHT)
1018    }
1019  }
1020
1021  // props beside him: the door he waits at, his dinner bowl, holiday things, the anniversary cake
1022  const right = dogX + SW + 1
1023  if (mood === 'door') prop('door', right, ground)
1024  if (mood === 'eat') {
1025    // the bowl under his nose: the front-most of his pixels in the rows just above the ground
1026    let nose = 30
1027    frame.forEach((row, y) => { if (y >= ground - 10) row.forEach((c, x) => { if (c && x > nose) nose = x }) })
1028    prop('bowl', dogX + nose - (mode === 'braille' ? 6 : 8), ground)
1029  }
1030  const idle = mood === 'sit' || mood === 'wag' || mood === 'bark' || mood === 'sleep' || mood === 'happy' || mood === 'pet'
1031  if (date && idle) {
1032    if (date.anniversary) prop('cake', right, ground)
1033    else if (date.holiday === 'seollal') prop('pouch', right, ground)
1034    else if (date.holiday === 'chuseok') prop('songpyeon', right, ground)
1035  }
1036
1037  // Terry on top
1038  if (!opts.noDog) for (let y = 0; y < frame.length; y++) {
1039    for (let x = 0; x < SW; x++) {
1040      const c = frame[y][x]
1041      if (c) put(dogX + x, y - lift, c)
1042    }
1043  }
1044  afterDog = true
1045  // the cape over his back, its upper edge lit
1046  for (const [x, top, bottom] of capeBack) for (let y = top; y <= bottom; y++) put(x, y, y === top ? [244, 92, 96] : [214, 38, 48])
1047  for (const [x, y, c] of capeTail) put(x, y, c)
1048  // the request failed: a tear rolling down from his eye and a little rain cloud just above his drooping head
1049  if (mood === 'sad' || mood === 'droop') {
1050    let ex = -1, ey = -1
1051    frame.forEach((row, y) => row.forEach((c, x) => { if (ey < 0 && c && c[0] === 24 && c[1] === 24 && c[2] === 24) { ex = x; ey = y } }))
1052    if (ey >= 0) {
1053      const fall = Math.floor(((t * 1.4) % 1) * 6)
1054      put(dogX + ex, ey + 2 + fall, [110, 170, 245])
1055      if (fall < 5) put(dogX + ex, ey + 3 + fall, [70, 130, 225])
1056    }
1057    let top = frame.findIndex(row => row.some(c => c))
1058    if (top < 0) top = 8
1059    const cy = Math.max(2, top - 4)
1060    const cx = dogX + 36
1061    for (let dx = -5; dx <= 5; dx++) put(cx + dx, cy, [104, 108, 126])
1062    for (let dx = -3; dx <= 3; dx++) put(cx + dx, cy - 1, [124, 128, 146])
1063    for (let dx = -1; dx <= 1; dx++) put(cx + dx, cy - 2, [124, 128, 146])
1064    for (let i = 0; i < 3; i++) {
1065      const age = (t * 1.8 + i / 3) % 1
1066      put(cx - 4 + i * 4, cy + 1 + Math.floor(age * 3), [120, 166, 236])
1067    }
1068  }
1069  // waiting for a permission: a rounded white speech bubble beside his head, lined up on whole cells so a real '?' fits
1070  // in its middle; to the right of his head when there is room, otherwise over his back
1071  const BW = 5 // cells
1072  const rightCol = Math.ceil((dogX + SW) / 2)
1073  const bubbleCol = rightCol + BW <= columns ? rightCol : Math.max(0, Math.floor(dogX / 2) + 2)
1074  const bubbleLeft = bubbleCol < rightCol
1075  if (mood === 'ask') {
1076    const bx0 = bubbleCol * 2, W = BW * 2, Hb = 16
1077    const inset = y => (y === 0 || y === Hb - 1 ? 2 : y === 1 || y === Hb - 2 ? 1 : 0) // rounded corners
1078    const inside = (x, y) => y >= 0 && y < Hb && x >= inset(y) && x < W - inset(y)
1079    if (mode === 'braille') {
1080      // in dots a filled bubble can't hold a letter (a cell is dots or text), so the bubble is drawn as its outline
1081      // and the '?' in dots inside it
1082      for (let y = 0; y < Hb; y++) for (let x = 0; x < W; x++) {
1083        const edge = !(inside(x - 1, y) && inside(x + 1, y) && inside(x, y - 1) && inside(x, y + 1))
1084        if (inside(x, y)) put(bx0 + x, y, edge ? [240, 240, 246] : null) // (inside it, no snow or petals)
1085      }
1086      // a bold '?', two dots thick, so it still reads through the font's gaps between braille rows; it fills the two
1087      // middle cell rows exactly, so no cell holds both the '?' and the outline (a cell has one colour: the outline's
1088      // white took over the '?' where they shared one)
1089      const Q = ['.####.', '##..##', '....##', '...##.', '..##..', '..##..', '......', '..##..']
1090      if (Math.floor(ms / 600) % 4 !== 3) Q.forEach((row, y) => [...row].forEach((c, x) => { if (c === '#') put(bx0 + 2 + x, 4 + y, [255, 214, 102]) }))
1091    } else for (let y = 0; y < Hb; y++) for (let x = inset(y); x < W - inset(y); x++) put(bx0 + x, y, [240, 240, 246])
1092    // the tail, a little hook toward his head
1093    const tail = bubbleLeft ? [[W - 2, Hb], [W - 1, Hb], [W, Hb + 1], [W + 1, Hb + 2]] : [[1, Hb], [0, Hb], [-1, Hb + 1], [-2, Hb + 2]]
1094    for (const [x, y] of tail) put(bx0 + x, y, [240, 240, 246])
1095  }
1096  // the frisbee: flying in along an arc, then held in his mouth (found as his rightmost pixel in the head rows)
1097  if (mood === 'catch') {
1098    // his mouth: the open mouth (its red tongue and inside) when he leaps, otherwise the tip of his nose
1099    // (a traced pose carries where its mouth is; for the others it is found)
1100    let [mx, my] = mouthAt || [-1, -1]
1101    if (mx < 0) frame.forEach((row, y) => row.forEach((c, x) => { if (c && c[0] > 90 && c[0] > c[1] * 1.6 && c[0] > c[2] * 1.4 && x > mx) { mx = x; my = y } }))
1102    if (mx < 0) {
1103      mx = 40; my = 14
1104      for (let y = 0; y < 24; y++) for (let x = SW - 1; x >= 0; x--) if (frame[y] && frame[y][x]) { if (x > mx) { mx = x; my = y } break }
1105    }
1106    const fArt = (mode === 'braille' && PROPS.frisbee.dots) || PROPS.frisbee.art
1107    const fw = fArt[0].length * PX
1108    // held across the jaws: its back edge in his mouth, the rest sticking out in front, its middle at mouth height
1109    const hx = dogX + mx - Math.floor(fw / 4), hy = my - lift + Math.ceil(fArt.length * PX / 2) - 1
1110    const caughtAt = set.catchAt != null ? frameStart(set, set.catchAt) : 0.5 // caught at the top of the leap
1111    const k = Math.min(1, catchPhase / caughtAt)
1112    const fx = Math.round(TW + 4 + (hx - TW - 4) * k), fy = Math.round(3 + (hy - 3) * k - Math.sin(Math.PI * k) * 6)
1113    prop('frisbee', catchPhase < caughtAt ? fx : hx, Math.max(fArt.length * PX - 1, catchPhase < caughtAt ? fy : hy))
1114  }
1115  // petted: hearts floating up from his head
1116  if (mood === 'pet') {
1117    for (let i = 0; i < 2; i++) {
1118      const age = (t * 0.9 + i / 2) % 1
1119      prop('heart', dogX + 40 + i * 7 + Math.round(Math.sin(age * 6 + i) * 2), Math.round(10 - age * 10)) // (ahead of his face, not over it)
1120    }
1121  }
1122  // the stick he brings back, held across his mouth
1123  if (fetchBack) {
1124    const [sx, sy] = mouthAt ? [SW - 1 - mouthAt[0], mouthAt[1] - lift] : [0, 15] // (the frame is turned round: so is the mouth)
1125    for (let k = -6; k <= 5; k++) { put(dogX + sx + k, sy, [156, 108, 62]); if (k > -5 && k < 4) put(dogX + sx + k, sy + 1, [118, 80, 44]) }
1126  }
1127  const marks = []
1128  const mark = (x, y, text, color) => marks.push({ x, y, text, color })
1129  const markX = Math.ceil((dogX + SW) / 2)
1130  if (mood === 'bark' && Math.floor(ms / 340) % 2 === 0) mark(markX, 1, '!', 0xffd166)
1131  if (mood === 'happy' && Math.floor(ms / 300) % 2 === 0) mark(markX, 0, '*', 0xffd166)
1132  if (mood === 'ask' && mode !== 'braille' && Math.floor(ms / 600) % 4 !== 3) mark(bubbleCol + 2, 1, '?', 0x2a2a36)
1133  if (mood === 'sleep') {
1134    const phase = Math.floor(ms / 700) % 3
1135    mark(markX - 3, 3, 'z', 0x9aa4c8)
1136    if (phase >= 1) mark(markX - 2, 2, 'Z', 0x9aa4c8)
1137    if (phase >= 2) mark(markX - 1, 1, 'Z', 0xb8c0e0)
1138  }
1139  // where he is and which frame: the frame as drawn (eyes shut, breathing, turned round) and the set's own
1140  const dog = { set: setName, index, x: dogX, y: -lift, flipped: fetchBack, drop: set.drop, frame, raw: set.frames[index] }
1141  return { canvas, columns, marks, dog, over, moon }
1142}
1143
1144export function terryCells(mood, ms, mode, hour = 12, columns = TERRY_COLS, effort = 'high', date = null) {
1145  return packCells(terryCellList(mood, ms, mode, hour, columns, effort, date))
1146}
1147/** the same as a list of [char, fg, bg] (a paused card dims it first: pause.js) */
1148export function terryCellList(mood, ms, mode, hour = 12, columns = TERRY_COLS, effort = 'high', date = null) {
1149  const { canvas, marks } = terryScene(mood, ms, mode, hour, columns, effort, date)
1150  const cells = canvasToCellList(canvas, columns, TERRY_ROWS, mode)
1151  for (const m of marks) writeText(cells, columns, m.x, m.y, m.text, m.color)
1152  return cells
1153}
1154
hooks/lode.js 240 lines
1// The ladder card's picture, after Lode Runner: The Legend Returns (1994, MS-DOS): thick lime turf ledges, white
2// ladders, bars to go hand over hand along, golden skulls to collect, and the hero (docs/preview/lode/rig.py, drawn
3// afresh): the runner (/runner, white suit, backpack, a laser that digs) with a red-robed skeleton monk on his heels,
4// or the monk himself (/monk). While Claude works the hero walks right, climbs the next ladder up a storey, crosses
5// breaks in the ledge on a bar, and walks on; the picture follows him, sliding left and down. At rest he stands, looks
6// out, dozes, digs (the runner with his laser), or holds up a golden skull.
7import LODE from './lode-data.js'
8import { TERRY_ROWS, canvasToCellList, packCells, writeText } from './render.js'
9
10const hex = h => [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)]
11const KEY = Object.fromEntries(Object.entries(LODE.keys).map(([k, v]) => [k, hex(v)]))
12const [SW, SH_SPR] = LODE.size // a frame's width and height (sub-pixels)
13
14const STOREY = 38 // from one ledge's top to the next one's: he is 32 tall, the ledge above shows as a band at the top
15const LEDGE = 5 // the turf's thickness
16const LADDER_W = 7
17const FLOOR = 36 // the canvas row of the top of the ledge he stands on (his feet on the row above)
18const BAR_H = SH_SPR - 3 // the bar's height over the ledge: at his raised hands
19
20// the turf: a bright top, lime, and darker green flecks lower down (the game's first world, Moss Caverns)
21const TURF_TOP = [170, 255, 80]
22const TURF = [104, 214, 40]
23const TURF_MID = [72, 176, 28]
24const TURF_DARK = [40, 120, 18]
25const RAIL = [214, 218, 224]
26const RAIL_SHADE = [150, 156, 166]
27const RUNG = [240, 242, 246]
28const BAR = [236, 236, 228]
29const GOLD = [245, 197, 66]
30const GOLD_DARK = [184, 134, 11]
31const GLINT = [255, 250, 220]
32const BEAM = [255, 106, 60]
33const BEAM_HOT = [255, 214, 122]
34const CHASE_SECS = 1.4 // how far behind the runner the monk comes, on the same route
35
36// the speeds (sub-pixels a second) at each effort, as Terry's run follows it
37const PACE = { low: 0.55, medium: 0.8, high: 1, xhigh: 1.5, max: 2.2 }
38const STRIDE = 2 // sub-pixels walked per frame of the eight-frame step
39
40const rnd = (k, salt) => {
41  let h = (k * 374761393 + salt * 668265263) | 0
42  h = Math.imul(h ^ (h >>> 13), 1274126177)
43  return ((h ^ (h >>> 16)) >>> 0) / 4294967296
44}
45
46/** the route, its lengths and speeds times `scale` (1 for the dots and blocks, 3 for the cell font), storeys `storeyH`
47 * apart: storeys 0..5 laid out once, storey k is storey k % 6 moved right and up by whole rounds */
48export function onRouteOf(scale = 1, storeyH = STOREY * scale) {
49  const ROUND = 6
50  const WALK_V = 18 * scale, CLIMB_V = 13 * scale, HANG_V = 11 * scale
51  const storeys = []
52  let x0 = 0
53  for (let k = 0; k < ROUND; k++) {
54    const walk1 = (44 + Math.floor(rnd(k, 1) * 24)) * scale
55    const gap = rnd(k, 2) < 0.55 ? (26 + Math.floor(rnd(k, 3) * 8)) * scale : 0
56    const walk2 = gap ? (18 + Math.floor(rnd(k, 4) * 14)) * scale : 0
57    const ladder = x0 + walk1 + gap + walk2 // the hero's centre when he reaches it
58    storeys.push({ x0, walk1, gap, walk2, ladder, gold: x0 + Math.round(walk1 * 0.6) })
59    x0 = ladder
60  }
61  const width = x0
62  const storey = k => {
63    const r = Math.floor(k / ROUND)
64    const b = storeys[((k % ROUND) + ROUND) % ROUND]
65    const dx = r * width
66    return { x0: b.x0 + dx, gap: b.gap, ladder: b.ladder + dx, gold: b.gold + dx, gapFrom: b.x0 + dx + b.walk1, gapTo: b.x0 + dx + b.walk1 + b.gap }
67  }
68  const legs = []
69  for (let k = 0; k < ROUND; k++) {
70    const s = storeys[k]
71    legs.push({ k, kind: 'walk', from: s.x0, len: s.walk1, v: WALK_V })
72    if (s.gap) {
73      legs.push({ k, kind: 'hang', from: s.x0 + s.walk1, len: s.gap, v: HANG_V })
74      legs.push({ k, kind: 'walk', from: s.x0 + s.walk1 + s.gap, len: s.walk2, v: WALK_V })
75    }
76    legs.push({ k, kind: 'climb', from: s.ladder, len: storeyH, v: CLIMB_V })
77  }
78  const roundSecs = legs.reduce((a, l) => a + l.len / l.v, 0)
79  // where the hero is after `secs` on the route (at pace 1): storey, centre x, height over the storey's ledge, doing what
80  const onRoute = secs => {
81    const round = Math.floor(secs / roundSecs)
82    let t = secs - round * roundSecs
83    let walked = 0
84    for (const leg of legs) {
85      const dur = leg.len / leg.v
86      if (t < dur) {
87        const d = t * leg.v
88        const k = leg.k + round * ROUND
89        const from = leg.from + round * width
90        if (leg.kind === 'climb') return { k, x: from, up: d, kind: 'climb', step: d }
91        return { k, x: from + d, up: 0, kind: leg.kind, step: walked + d }
92      }
93      t -= dur
94      if (leg.kind !== 'climb') walked += leg.len
95    }
96    return { k: (round + 1) * ROUND, x: storey((round + 1) * ROUND).x0, up: 0, kind: 'walk', step: 0 }
97  }
98  return { PACE, CHASE_SECS, onRoute, storey, roundSecs }
99}
100const { onRoute, storey } = onRouteOf(1)
101
102export function lodeScene(hero, mood, ms, mode, columns, effort = 'high') {
103  const F = LODE.frames[hero] || LODE.frames.runner
104  const TW = columns * 2
105  const H = TERRY_ROWS * 4
106  const canvas = Array.from({ length: H }, () => Array(TW).fill(null))
107  const put = (x, y, c) => { if (x >= 0 && x < TW && y >= 0 && y < H) canvas[y][x] = c }
108  const clear = (x, y) => { if (x >= 0 && x < TW && y >= 0 && y < H) canvas[y][x] = null }
109  const sprite = (rows, left, bottom) => rows.forEach((row, y) => [...row].forEach((k, x) => {
110    if (k !== '.') put(left + x, bottom - rows.length + 1 + y, KEY[k])
111  }))
112  const marks = []
113  const t = ms / 1000
114  const running = mood === 'run' || mood === 'fetch'
115  const pace = PACE[effort] ?? 1
116  const here = running ? onRoute(t * pace) : { k: 0, x: storey(0).x0 + 14, up: 0, kind: 'stand', step: 0 }
117  const MX = Math.round(TW * (hero === 'runner' && running ? 0.5 : 0.36)) // his centre on the canvas (room behind him for the monk)
118  // blocks pair the rows two by two into one colour: the picture moves in whole pairs, so the turf's bright top
119  // stays its own pair instead of blinking as he climbs
120  const pair = mode === 'braille' ? 1 : 2
121  const camUp = Math.floor((here.k * STOREY + here.up) / pair) * pair
122  const lift = here.k * STOREY + here.up - camUp
123  const sx = x => MX + Math.round(x - here.x)
124  const sy = (k, h) => FLOOR - Math.round(k * STOREY + h - camUp)
125
126  for (let k = here.k - 1; k <= here.k + 1; k++) {
127    const st = storey(k), prev = storey(k - 1)
128    const top = sy(k, 0)
129    // the ledge: from a little behind where the last ladder came up to a little past this storey's ladder
130    for (let x = Math.max(0, sx(prev.ladder - 30)); x <= Math.min(TW - 1, sx(st.ladder + LADDER_W + 10)); x++) {
131      if (st.gap && x >= sx(st.gapFrom + 2) && x <= sx(st.gapTo - 2)) continue // the break, inside the bar's reach
132      const wx = x - sx(0)
133      for (let r = 0; r < LEDGE; r++) {
134        const fleck = (wx * 7 + r * 13 + k * 5) % 9
135        put(x, top + r, r < pair ? TURF_TOP : fleck === 0 ? TURF_DARK : fleck < 3 ? TURF_MID : TURF)
136      }
137      // tufts hanging off the underside
138      if ((wx * 5 + k) % 7 === 0) put(x, top + LEDGE, TURF_DARK)
139    }
140    if (st.gap) for (let x = sx(st.gapFrom - 12); x <= sx(st.gapTo + 12); x++) put(x, sy(k, BAR_H), BAR)
141    // the ladder up to the next storey, through the ledge above to its top
142    const lx = sx(st.ladder) - Math.floor(LADDER_W / 2)
143    for (let h = 0; h <= STOREY; h++) {
144      const y = sy(k, h)
145      put(lx, y, RAIL)
146      put(lx + LADDER_W - 1, y, RAIL_SHADE)
147      if (h % 4 === 1) for (let x = lx + 1; x < lx + LADDER_W - 1; x++) put(x, y, RUNG)
148    }
149    // the golden skull on the ledge, there until he walks past it
150    const gone = k < here.k || (k === here.k && running && here.x > st.gold)
151    if (!gone) {
152      const gx = sx(st.gold) - 3, gy = sy(k, 0) - 1
153      const skull = ['.GGG.', 'GYGGG', 'GgGgG', 'GGGGG', '.GgG.']
154      skull.forEach((row, y) => [...row].forEach((c, x) => {
155        if (c !== '.') put(gx + x, gy - 4 + y, c === 'G' ? GOLD : c === 'g' ? GOLD_DARK : GLINT)
156      }))
157      if (Math.floor(t * 2 + k) % 3 === 0) put(gx + 4, gy - 5, GLINT)
158    }
159  }
160
161  // speed lines behind him when he hurries
162  if (running && pace >= 1.5 && here.kind === 'walk') {
163    for (let n = 0; n < 3; n++) {
164      const y = FLOOR - 8 - n * 8
165      const head = MX - SW / 2 - 1 - Math.floor(((t * 3 + n * 0.37) % 1) * 12)
166      for (let k = 0; k < 6; k++) put(head - k, y, k < 2 ? [232, 236, 246] : [130, 134, 150])
167    }
168  }
169
170  const left = MX - SW / 2
171  const feet = FLOOR - 1 - Math.round(lift)
172  const cellX = Math.floor((left + SW) / 2)
173  const pose = (G, at) => {
174    const frames = at.kind === 'climb' ? G.climb : at.kind === 'hang' ? G.hang : G.walk
175    const per = at.kind === 'walk' ? STRIDE : 4
176    return frames[Math.floor(at.step / per) % frames.length]
177  }
178  if (running) {
179    // the runner has a monk on his heels: the same route, CHASE_SECS behind (drawn first, so the runner is in front)
180    if (hero === 'runner' && t * pace > CHASE_SECS) {
181      const m = onRoute(t * pace - CHASE_SECS)
182      const mleft = sx(m.x) - SW / 2
183      if (mleft > -SW && mleft < TW) sprite(pose(LODE.frames.monk, m), mleft, sy(m.k, m.up) - 1)
184    }
185    sprite(pose(F, here), left, feet)
186  } else if (mood === 'sad' || mood === 'droop') {
187    // fallen into a hole in the turf: in it to the waist, waving
188    for (let x = left + 2; x < left + SW - 2; x++) for (let r = 0; r < LEDGE; r++) clear(x, FLOOR + r)
189    sprite(F.stuck[Math.floor(t * 4) % 2], left, FLOOR + LEDGE - 1)
190  } else if (mood === 'sleep') {
191    sprite(F.sleep[Math.floor(t / 1.2) % 2], left, feet)
192    const p = Math.floor(t / 0.7) % 3
193    marks.push([cellX, 3, 'z'])
194    if (p >= 1) marks.push([cellX + 1, 2, 'Z'])
195    if (p >= 2) marks.push([cellX + 2, 1, 'Z'])
196  } else if (mood === 'happy' || mood === 'catch' || mood === 'pet' || mood === 'bark') {
197    const hop = Math.floor(t / 0.25) % 2
198    sprite(F.happy[hop], left, feet)
199    if (mood === 'bark' && Math.floor(t / 0.34) % 2 === 0) marks.push([cellX, 0, '!', 0xffd166])
200    if (mood !== 'bark' && Math.floor(t / 0.3) % 2 === 0) marks.push([cellX, 0, '*', 0xffd166])
201  } else if ((mood === 'dig' || mood === 'sniff') && hero === 'runner') {
202    // the laser: a beam from the gun down to the turf in front of him, which melts away into a hole and grows back
203    const cycle = (t % 2.4) / 2.4
204    const firing = cycle < 0.45
205    sprite(F.dig[firing ? 1 : 0], left, feet)
206    const [mx, my] = LODE.muzzle.runner[firing ? 1 : 0]
207    const gx = left + mx, gy = feet - SH_SPR + 1 + my
208    const hx = left + SW + 1
209    const depth = Math.floor(Math.min(cycle, 0.45) / 0.45 * LEDGE)
210    if (firing) {
211      const span = Math.max(1, FLOOR + depth - gy)
212      for (let k = 0; k < span; k++) put(gx + Math.round(k * (hx + 3 - gx) / span), gy + k, k % 2 ? BEAM : BEAM_HOT)
213    }
214    const open = cycle < 0.85 ? Math.max(depth, cycle >= 0.45 ? LEDGE : 0) : 0 // stays open a while, then grows back
215    for (let x = hx; x < hx + 8; x++) for (let r = 0; r < open; r++) clear(x, FLOOR + r)
216    if (firing) for (const [dx, dy] of [[1, -1], [4, -2], [6, -1]]) put(hx + dx, FLOOR + dy, Math.floor(t * 10) % 2 ? BEAM_HOT : TURF_TOP)
217  } else if (mood === 'dig' || mood === 'sniff') {
218    const strike = Math.floor(t / 0.35) % 2
219    sprite(F.dig[strike], left, feet)
220    if (strike) for (const [dx, dy] of [[SW, -2], [SW + 2, -3], [SW + 1, -4]]) put(left + dx, FLOOR + dy, TURF_DARK)
221  } else {
222    // waiting: looks ahead, now and then turns to look out at you (all the time while you type)
223    const out = mood === 'wag' || mood === 'ask' || Math.floor(t / 1.5) % 4 === 3
224    sprite(F.idle[out ? 1 : 0], left, feet)
225    if (mood === 'ask' && Math.floor(t / 0.6) % 4 !== 3) marks.push([cellX, 0, '?', 0xffd166])
226  }
227  return { canvas, marks }
228}
229
230export function lodeCells(hero, mood, ms, mode, columns, effort = 'high') {
231  return packCells(lodeCellList(hero, mood, ms, mode, columns, effort))
232}
233/** the same as a list of [char, fg, bg] (a paused card dims it first: pause.js) */
234export function lodeCellList(hero, mood, ms, mode, columns, effort = 'high') {
235  const { canvas, marks } = lodeScene(hero, mood, ms, mode, columns, effort)
236  const cells = canvasToCellList(canvas, columns, TERRY_ROWS, mode)
237  for (const [x, y, text, color] of marks) writeText(cells, columns, x, y, text, color ?? 0x9aa4c8)
238  return cells
239}
240
hooks/pause.js 24 lines
1// 쉬는 창의 카드: 여러 Claude 창을 띄우면 마지막으로 입력한 창의 카드만 움직이고, 나머지는 지금 기분의 한 장에서 멈춰
2// 어두워지고 그림 한가운데에 'PAUSE ||' 글씨가 뜬다. 기분이 바뀌면(끝남·실패·졸기) 그 한 장으로 바뀐다.
3// 왜: WaveTerm 은 글꼴·크기·색이 같은 터미널끼리 글자 그림 저장소(xterm 의 texture atlas) 하나를 나눠 쓴다. 창마다 카드가
4// 저마다 움직이면 그 저장소가 창 수만큼 빨리 차서 글자가 깨졌다 (2026-10-21, 네 창에서). 멈춘 한 장은 더 늘지 않는다.
5// cells: [글자, 글자색, 바탕색] 목록 (render.js 의 칸 목록). 터미널 기본색(TERM_DEFAULT)은 그대로 둔다.
6
7export const TERM_DEFAULT = 0x01000000
8const DIM = 0.42 // 어둡게: 색마다 이만큼만 남긴다
9const INK = 0xf0f0f4 // 'PAUSE ||' 글씨
10const BAND = 0x18181e // 글씨 뒤 띠
11const LABEL = '  PAUSE ||  ' // 양 끝 빈칸: 글꼴 방식에선 옆 칸 글리프가 넘쳐 들어와 글씨를 덮지 않게
12const dim = c => (c === TERM_DEFAULT || c < 0 ? c : (Math.round(((c >> 16) & 255) * DIM) << 16) | (Math.round(((c >> 8) & 255) * DIM) << 8) | Math.round((c & 255) * DIM))
13
14// 멈춘 장의 시각: 첫 장(0ms)은 앉은 테리가 눈을 감고 있어 졸린 듯 보였다
15export const PAUSE_MS = 1200
16
17/** 멈춘 카드 한 장: 칸 목록을 어둡게 하고, 그림 한가운데 줄에 'PAUSE ||' 글씨를 어두운 띠 위에 쓴다. 새 목록을 돌려준다 */
18export function pausedCells(cells, cols, rows) {
19  const out = cells.map(([cp, fg, bg]) => [cp, dim(fg), dim(bg)])
20  const y = Math.floor(rows / 2), x0 = Math.max(0, Math.floor((cols - LABEL.length) / 2))
21  for (let i = 0; i < LABEL.length && x0 + i < cols; i++) out[y * cols + x0 + i] = [LABEL.charCodeAt(i), INK, BAND]
22  return out
23}
24
hooks/hero-font.js 72 lines
1// 글꼴(font) 방식의 카드 그림: Lode Cells 글꼴의 글리프로 터미널 픽셀 그대로 그린다 (register.js 의 Client 가 띄움).
2// Raster 는 BMP 글자만 받아 U+100000 위의 글리프를 못 그려서, 줄마다 글(Text)로 그린다. Raster 와 달리 blit 이 없어
3// 장마다 다시 그려야 하는데, 이 모듈이 자기 칸만 다시 그리므로 카드 전체(사용량 표·카드)를 다시 그리지 않는다.
4// props: { hero, mood, effort, hour, cols, startedAt, date (moodSince 는 그 동작이 시작된 시각),
5//   paused (다른 창이 움직이는 중: 지금 기분의 첫 장을 어둡게, 일시정지 막대와 함께 멈춰 둔다. pause.js) }
6import { terryFineCellList } from './terry-fine.js'
7import { fineCellList } from './lode-fine.js'
8import { TERRY_ROWS } from './render.js'
9import { pausedCells, PAUSE_MS } from './pause.js'
10
11const FRAME_MS = 60 // 달리기 한 장(60ms)에 한 번. 그림이 그대로면 다시 그리지 않는다
12const TERM_DEFAULT = 0x01000000 // 칸 목록의 '터미널 기본색'
13const hexColor = c => (c === TERM_DEFAULT ? undefined : '#' + c.toString(16).padStart(6, '0'))
14
15const cellsFor = p => {
16  const now = Date.now()
17  const date = p.date && { ...p.date, moodMs: p.paused ? 0 : now - p.date.moodSince }
18  const ms = p.paused ? PAUSE_MS : now - p.startedAt
19  const cells = p.hero === 'terry'
20    ? terryFineCellList(p.mood, ms, p.hour, p.cols, p.effort, date)
21    : fineCellList(p.hero, p.mood, ms, p.cols, p.effort)
22  return p.paused ? pausedCells(cells, p.cols, TERRY_ROWS) : cells
23}
24
25// 칸 목록을 줄마다 글 하나로: 색이 같은 칸끼리 묶는다. 빈칸은 글자색이 안 보이니 앞 칸의 글자색에 붙인다.
26// 글리프가 오른쪽 칸 위로 넘쳐 그려져(칸당 3색) 줄은 칸 그대로 이어 써야 한다(잘리거나 줄바꿈되면 안 됨)
27function picture(Box, Text, cells, cols) {
28  const lines = []
29  for (let y = 0; y < TERRY_ROWS; y++) {
30    const runs = []
31    for (let x = 0; x < cols; x++) {
32      const [cp, fg, bg] = cells[y * cols + x]
33      const last = runs[runs.length - 1]
34      if (last && last.bg === bg && (last.fg === fg || cp === 0x20)) last.text += String.fromCodePoint(cp)
35      else runs.push({ fg, bg, text: String.fromCodePoint(cp) })
36    }
37    lines.push(Text({
38      key: 'r' + y,
39      wrap: 'truncate',
40      children: runs.map((r, i) => Text({ key: 'r' + y + '-' + i, color: hexColor(r.fg), backgroundColor: hexColor(r.bg), children: [r.text] })),
41    }))
42  }
43  return Box({ flexDirection: 'column', width: cols, height: TERRY_ROWS, children: lines })
44}
45
46// 인스턴스마다 가장 최근 props (타이머가 읽는다; 같은 인스턴스엔 같은 surface 가 온다)
47const latest = new WeakMap()
48const ticking = new WeakSet()
49
50export default function HeroFont(props, surface) {
51  const { Box, Text } = surface.elements
52  const changed = latest.get(surface) !== props
53  latest.set(surface, props)
54  if (!ticking.has(surface)) {
55    ticking.add(surface)
56    surface.every(FRAME_MS, () => {
57      if (latest.get(surface).paused) return // 멈춘 장: props 가 바뀔 때만 다시 그린다
58      let cells
59      try {
60        cells = cellsFor(latest.get(surface))
61      } catch (err) {
62        return
63      }
64      const sig = cells.join()
65      if (surface.state?.sig !== sig) surface.setState({ cells, sig })
66    })
67  }
68  // 새 props(동작·폭이 바뀜)면 바로 새 장, 아니면 타이머가 그려 둔 장
69  const cells = !changed && !props.paused && surface.state?.cells.length === props.cols * TERRY_ROWS ? surface.state.cells : cellsFor(props)
70  return picture(Box, Text, cells, props.cols)
71}
72
hooks/lode-data.js 3 lines
1// Generated by docs/preview/lode/build-lode.py; do not edit by hand.
2export default {"keys":{"A":"2e2018","a":"5a4030","K":"f0bc92","k":"c88e66","E":"141414","U":"f2f4f8","u":"c4cad4","q":"8e96a4","V":"262630","v":"50505e","N":"9a6636","n":"64401e","O":"3a2614","M":"707888","m":"3e4450","L":"ff8a3c","R":"d03030","r":"8a1a1a","Z":"560c0c","B":"f2ecd8","b":"bcb096","G":"f5c542","g":"b8860b","Y":"fff2a8"},"size":[24,32],"frames":{"runner":{"walk":[["........................","........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuuUU.........","........nNuUuUU.........","........nNuUuUu.........","........nNuUuU..........","........nNuUuUUUU.......","........nuUuUuuuKK......",".........quUUq..........",".........uuUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUu...........","....UUUUUUUUu...........","...VVuuuuuuu............","....V.....qu............","....V.....qu............","..........uq............",".........qu.............",".........qu.............",".........mmmm...........","..........mmm..........."],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuUuU.........","........nNuuUUU.........","........nNuUuUuu.uuk....","........nNuUUUquuuqk....","........nNuUUUqqq.......","........nuUuuU..........",".........quUuKK.........",".........uuUUKK.........",".........quuUU..........",".........uuuuU..........","........quu.uUU.........","........quq.uuU.........",".......quu...uUU........",".......uu.....uU........","......quq.....uU........",".....quq......uU........",".....uq.......uUu.......","....uu.........uU.......","...qu..........uU.......","...mm..........uU.......","....mm.........VVVV.....","................V.......","........................","........................"],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuUuU.........","........nNuUuUUu..ukk...","........nNUUUUuuuuuq....","........nuUUUU.quq......","........nNuUUU..........","........nuuuUU..........",".........quuKq..........",".........uuuKU..........",".........uuuUU..........","u.......quq.uUU.........","muu....quu...uUU........","qqquuuquuq...uuUU.......","...qqquuq.....uuU.......",".....qqq.......uUU......","................uU......","................uUU.....",".................uU.....",".................uUU....","..................uVVV..","..................uVV...","........................","........................","........................","........................"],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuUuU.........","........nNuuUUU.........","........nNuUuUuu.uuk....","........nNuUUUquuuqk....","........nNuUUUqqq.......","........nuUuuU..........",".........quUuKK.........","...m.....uuUUKK.........","..mmu....quuUU..........",".mmquu...uuuuU..........","....quu.quu.uUU.........",".....quuquq.uuU.........","......quuu...uUU........","......qqu.....uU........",".......qq.....uU........","..............uUu.......","...............uU.......","...............uU.......","...............uU.......","...............uU.V.....","................VVVV....","................V.......","........................","........................"],["........................","........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuuUU.........","........nNuUuUU.........","........nNuUuUu.........","........nNuUuU..........","........nNuUuUUUU.......","........nuUuUuuuKK......",".........quUUq..........",".........uuUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uuu...........","....uuuuuuuUu...........","...mmqqqqquU............","....m.....uU............","....m.....uU............","..........Uu............",".........uU.............",".........uU.............",".........VVVV...........","..........VVV..........."],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuuUU.........","........nNuUUuU.........","........nNuUUuUU.UUK....","........nNuUUUuUUUuK....","........nNuUUUuuu.......","........nuUuUU..........",".........quUUqk.........",".........uUUukk.........",".........uUUuu..........",".........UUuqu..........","........uUU.quu.........","........uUu.qqu.........",".......uUU...quu........",".......UU.....qu........","......uUu.....qu........",".....uUu......qu........",".....Uu.......quq.......","....UU.........qu.......","...uU..........qu.......","...VV..........qu.......","....VV.........mmmm.....","................m.......","........................","........................"],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuuuU.........","........nNuUUuUU..UKK...","........nNuUUUuUUUUu....","........nNuUUU.uUu......","........nNuUUU..........","........nuUuUU..........",".........quUUq..........",".........uUUuu..........",".........UUuuu..........","U.......uUu.quu.........","VUU....uUU...quu........","uuuUUUuUUu...qquu.......","...uuuUUu.....qqu.......",".....uuu.......quu......","................qu......","................quu.....",".................qu.....",".................quu....","..................qmmm..","..................qmm...","........................","........................","........................","........................"],["........................","............AAA.........","...........AAAAK........","...........AAAKK........","...........AAAKE........","...........uAAKK........","...........uUkkk........",".........n.uuUU.........","........nNuuuUU.........","........nNuUUuU.........","........nNuUUuUU.UUK....","........nNuUUUuUUUuK....","........nNuUUUuuu.......","........nuUuUU..........",".........quUUqk.........","...V.....uUUukk.........","..VVU....uUUuu..........",".VVuUU...UUuqu..........","....uUU.uUU.quu.........",".....uUUuUu.qqu.........","......uUUU...quu........","......uuU.....qu........",".......uu.....qu........","..............quq.......","...............qu.......","...............qu.......","...............qu.......","...............qu.m.....","................mmmm....","................m.......","........................","........................"]],"climb":[["........................","........................","........................","........K......K........",".......uU..AA..uU.......",".......uU.AAAA.uU.......",".......UU.AAAA.uU.......",".......Uu.AAAA.uUU......","......uuU.ukku.uuu......",".......uUuUkkUuUu.......","........uuNNNNNu........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........unnnnn.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUUuUU.........",".........uUuuUU.........",".........uUuuUU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........VVVVVV.........",".........VVVVVV........."],["...............K........","...............uU.......","...............uU.......","...............uU.......","...........AA..uU.......","..........AAAA.uU.......","........K.AAAA..Uu......",".......uK.AAAA.uu.......",".......UU.ukkuuUu.......","......uUuuUkkUuU........",".......uuuNNNNNu........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........unnnnn.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUUuUU.........",".........uUU.uU.........",".........uUu.uU.........",".........uUu.uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU.VVV.........",".........uU.VVV.........",".........uU.............",".........uU............."],["........................","........................","........................","........K......K........",".......uU..AA..uU.......",".......uU.AAAA.uU.......",".......UU.AAAA.uU.......",".......Uu.AAAA.uUU......","......uuU.ukku.uuu......",".......uUuUkkUuUu.......","........uuNNNNNu........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........unnnnn.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUUuUU.........",".........uUuuUU.........",".........uUuuUU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........VVVVVV.........",".........VVVVVV........."],["........K...............","........U...............",".......uU...............",".......uU...............",".......UU..AA...........",".......Uu.AAAA..........","......uUU.AAAA.K........",".......uU.AAAA.KU.......",".......uUUukku.uU.......","........uuUkkUuuUU......","........uuNNNNNUu.......",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........uNNNNN.........",".........unnnnn.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUuuUU.........",".........uU.uUU.........",".........uU.uUU.........",".........uU.uUU.........",".........uU..UU.........",".........uU..uU.........",".........uU..uU.........",".........uU..uU.........",".........VVV.uU.........",".........VVV.uU.........",".............uU.........",".............uU........."]],"hang":[["............kK..........","...........quU..........","..........AAuU..........","..........AAUU..........",".........AAuuKK.........","..........AuUKE.........",".........uAuUK..........",".........uUUuk..........",".......nnuuUUu..........",".......NNuUuUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nn.uUuUu..........",".........quUUq..........",".........uuUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uuu...........","..........uUu...........","..........uU............","..........UU............",".........uUu............",".........uU.............",".........Uu.............","........uU..............","........VVVV............","..........VV............"],["..........qk..KK........","..........qu.uU.........","..........AAAUU.........","..........AAuU..........",".........AAAuUK.........","..........AAUuE.........",".........uAuUK..........",".........uUUUk..........",".......nnuuUuu..........",".......NNuUuUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nn.uUuUu..........",".........quUUq..........",".........uuUU...........","..........uuU...........",".........quuUU..........",".........quuUU..........",".........quuuU..........",".........uu.uU..........","........quq.uUu.........","........uuq.uUu.........",".......quq..uUu.........","......quq...uUu.........","......uu....uU..........",".....quq....uU..........","....qmq.....uU..........","....mmm.....uU..........","......mm....VVVV........","........................"],["............kK..........","...........quU..........","..........AAuU..........","..........AAUU..........",".........AAuuKK.........","..........AuUKE.........",".........uAuUK..........",".........uUUuk..........",".......nnuuUUu..........",".......NNuUuUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nn.uUuUu..........",".........quUUq..........",".........uuUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uUU...........","..........uuu...........","..........uUu...........","..........uU............","..........UU............",".........uUu............",".........uU.............",".........Uu.............","........uU..............","........VVVV............","..........VV............"],["...........uKkk.........","...........uUu..........","..........AuUu..........","..........AuUA..........",".........AAuuKK.........","..........AUUKE.........",".........uAUuK..........",".........uuUkk..........",".......nnuuUUu..........",".......NNuUuUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nNNuUUUu..........","......nn.uUuUu..........",".........quUUq..........",".........uuUu...........","..........UUu...........",".........uUUuu..........",".........uUuuu..........",".........uUuqu..........",".........UU.qu..........","........uUu.quq.........","........UUu.quq.........",".......uUu..quq.........","......uUu...quq.........","......UU....qu..........",".....uUu....qu..........","....uVu.....qu..........","....VVV.....qu..........","......VV....mmmm........","........................"]],"idle":[["........................","........................","...........AAK..........","..........AAAAK.........","..........AAAKK.........","..........AAAKE.........","..........AAkKK.........",".........uukkk..........",".......nnuuUUU..........",".......nNuuuUU..........",".......nNuUuUU..........",".......NNuUuUU..........","......nNNuUuUu..........","......nNNuUuUu..........","......nnnuUuuU..........",".........quUuU..........",".........uuUuU..........","..........uUUMMMm.......","..........uUU...........","..........uUU...........","..........uUU...........","..........quU...........","..........quU...........","..........quU...........","..........quU...........","..........quU...........","..........quU...........","..........uuU...........","..........uuU...........","..........uuU...........",".........qmVVVV.........","..........mVVV.........."],["........................","........................","........................","........................","..........AAAA..........","..........AAAA..........","..........KKKK..........","..........KEKE..........","..........ukku..........",".........uUkkUu.........","........uuOUUOuU........","........uuOUUOuU........","........uuOUUOuU........","........uuOUUOuU........","........UuOUUOuU........","........UuUUUUuU........","........UuUUUUuU........","........UqqqqqqU........","........KuuUUuUM........","........KuuuuuUM........",".........uUUuUUM........",".........uUUuUuM........",".........uUUuUu.........",".........uUUuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........","..........U..U..........",".........VVVVVV.........",".........VVVVVV........."]],"happy":[["..........GGGG..........","..........GYGG..........",".........GGGGGG.........",".......KK.GgGg.KK.......",".......uU..GGG.uU.......",".......UU.AAgA.uU.......",".......Uu.AAAA.uU.......",".......U..KKKK..UU......",".......uU.KEKE.uu.......",".......uU.ukku.UU.......","........uuUkkUuU........","........uuOUUOuU........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uUUUUu.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUUuUU.........",".........uUUuUu.........",".........uUUuUu.........",".........uUUuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........","..........U..U..........",".........VVVVVV........."],["..........GYGG..........",".........GGGGGG.........",".......KK.GgGg.KK.......",".......uU..GGG.uU.......",".......UU.AAgA.uU.......",".......Uu.AAAA.uU.......",".......U..KKKK..UU......",".......uU.KEKE.uu.......",".......uU.ukku.UU.......","........uuUkkUuU........","........uuOUUOuU........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uUUUUu.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU.........",".........uuuuuU.........",".........uUUuUU.........",".........uUUuUu.........",".........uUUuUu.........",".........uUUuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........",".........uUuuUu.........","..........U..U..........",".........VVVVVV.........",".........VVVVVV........."]],"sleep":[["........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","..........A.............",".........AAAK...........","........AAAAK...........","........AAAAKE..........","........uAkAK...........","......n.uuUkk...........",".....nNNuuuUU...........",".....nNNuuuuU...........",".....nNN.uUuUUUUUK......",".....nNN.uUUuuuuuk......",".....nNn.uUUUqqqkuuu....",".....nn..uUuUUUUUUuU....",".........quUUUUUuuuU....",".........uuuuuuu..uU....","..........uu......uU....","..................uU....","..................uU...."],["........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................",".........AAA............","........AAAAA...........","........AAAAK...........","........AAkAKE..........","......n.uuUkK...........",".....nNNuuuUk...........",".....nNNuuuuU...........",".....nNN.uUuUUUUUK......",".....nNN.uUUuuuuuk......",".....nNn.uUUUqqqkuuu....",".....nn..uUuUUUUUUuU....",".........quUUUUUuuuU....",".........uuuuuuu..uU....","..........uu......uU....","..................uU....","..................uU...."]],"stuck":[["........................",".......KK......KK.......",".......uU......uU.......",".......UU.AAAA.uU.......",".......Uu.AAAA.uU.......",".......U..KKKK..UU......",".......uU.KEKE.uu.......",".......uU.ukku.UU.......","........uuUkkUuU........","........uuOUUOuU........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uUUUUu.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU........."],["........................","......KK......KK........","......uU......uU........","......UU.AAAA.uU........","......Uu.AAAA.uU........",".......U..KKKK..UU......",".......uU.KEKE.uu.......",".......uU.ukku.UU.......","........uuUkkUuU........","........uuOUUOuU........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uOUUOu.........",".........uUUUUu.........",".........uUUUUu.........",".........qqqqqq.........",".........uuUUuU........."]],"dig":[["........................","........................","........................",".............AA.........","............AAAA........","...........AAAAKK.......","............AAAKE.......","............AAAK........","...........uUkkk........","...........uuUUu........",".........NNuuuUU........",".........NuuUUuUU.......","........nNuUUUUuuU......","........nNuUUUu.uuU.....","........nNuUUU...uuU....","........nuUuUUu....KM...",".........quUUquu....MM..",".........uuUU.qk.....MM.","..........uuUU.k......m.",".........quuUU..........",".........ququU..........",".........ququUU.........",".........uu..uU.........","........quq..uUU........","........uuq..uUu........",".......quq...uU.........","......quq....UU.........",".....quq....uUu.........",".....uq.....uU..........","....mm......uU..........","....mmm.....VV..........","......m.....VVV........."],["........................","........................","........................","........................",".............AA.........","............AAAA........","...........AAAAKK.......","............AAAKE.......","............AAAK........","...........uUkkk........","...........uuUUu........",".........NNuuuUU........",".........NuuUUuuUU......","........nNuUUUU.uUUU....","........nNuUUUu..uuUU...","........nNuUUU.....uMM..","........nuUuUUu......MM.",".........quUUquu.......m",".........uuUU.qk........","..........uuUU.k........",".........quuUU..........",".........ququU..........",".........ququUU.........",".........uu..uU.........","........quq..uUU........","........uuq..uUu........",".......quq...uU.........","......quq....UU.........",".....quq....uUu.........",".....uq.....uU..........","....mm......uU..........","....mmm.....VV.........."]]},"monk":{"walk":[["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","...........rRRRRRZE.....","...........rrRRRRR......","...........rrRRRRRRRRR..","..........rrrRRRRRRRRBB.","..........rrRRRRRrrrRR.B",".........rrrRRRRR..rbb..",".........rrrRRRRR.....b.","........rrrRRRRRR.......","........rrrRRRRRR.......","........rrrRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrZBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","............RRRRRZE.....","...........rrRRRRRR.....","...........rrRRRRRRRRBB.","..........rrrRRRRRRRRBBB","..........rrRRRRRrrrbb..","..........rrRRRRR...rbb.",".........rrrRRRRR.......",".........rrrRRRRRR......","........rrrRRRRRRR......","........rrrRRRRRRR......",".......rrrrRRRRRRR......",".......rrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrZZZBBBBZ......",".....rrbbbbZZZBBBZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","............RRRRRZE.....","...........rrRRRRRRR....","...........rrRRRRRRRRBB.","..........rrrRRRRRRRRB.B","..........rrRRRRRrrrbbb.","..........rrRRRRR...rbb.",".........rrrRRRRRR......",".........rrrRRRRRR......","........rrrRRRRRRR......","........rrrRRRRRRR......","........rrrRRRRRRR......",".......rrrrRRRRRRR......",".......rrrRRRRRRRR......","......rrrrZZZZZZZZ......","......bbbbZZZZBBBB......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","............RRRRRZE.....","...........rrRRRRRR.....","...........rrRRRRRRRRBB.","..........rrrRRRRRRRRBBB","..........rrRRRRRrrrbb..","..........rrRRRRR...rbb.",".........rrrRRRRR.......",".........rrrRRRRRR......","........rrrRRRRRRR......","........rrrRRRRRRR......",".......rrrrRRRRRRR......",".......rrrRRRRRRRR......","......rrrrRRRRRRRR......","......rbbbbZZZZZZZ......",".....rrrbbbZZBBBBZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","...........rRRRRRZE.....","...........rrRRRRR......","...........rrRRRRRRRRR..","..........rrrRRRRRRRRBB.","..........rrRRRRRrrrRR.B",".........rrrRRRRR..rbb..",".........rrrRRRRR.....b.","........rrrRRRRRR.......","........rrrRRRRRR.......","........rrrRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrZbbbbZZZZ......",".....rrrrZBBBBZZZZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","...........rRRRRRZE.....","...........rrRRRR.......","...........rrRRRRRRR....","..........rrRRRRRRRRRBB.","..........rrRRRRrrRRRBB.",".........rrrRRRRR.rrbb.B",".........rrRRRRRR..rb.b.","........rrrRRRRRR.......","........rrrRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrRRRRRRRR.......",".....rrrrZZZbbbbZ.......",".....rBBBBZZZbbbZ.......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","...........rRRRRRZE.....","...........rrRRRR.......","...........rrRRRRRRR....","..........rrRRRRRRRRRB..","..........rrRRRRrrRRBBB.",".........rrrRRRRR.rrbb.B",".........rrRRRRRR..rbbb.","........rrrRRRRRR.......","........rrrRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrRRRRRRRR.......",".....rrrrZZZZZZZZ.......","....rBBBBZZZZbbbb.......","................b......."],["........................","........................","........................","........................","........................","........................","........................","........................","........................",".............rRRR.......","............rrRRRRR.....","...........rrrRRRRR.....","...........rrrRRZZZR....","...........rrrRRZbbR....","...........rrrRRZbEZ....","............rrRRZbb.....","...........rRRRRRZE.....","...........rrRRRR.......","...........rrRRRRRRR....","..........rrRRRRRRRRRBB.","..........rrRRRRrrRRRBB.",".........rrrRRRRR.rrbb.B",".........rrRRRRRR..rb.b.","........rrrRRRRRR.......","........rrrRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrRRRRRRRR.......",".....rBBBBZZZZZZZ.......",".....rrBBBZZbbbbZ.......","........................"]],"climb":[["........................","........................","........................",".......B..rRRR..B.......","......BB.rrrrRR.BB......","......rBrrrrrRRRBR......","......rrrrrrrRRRRR......",".......rrrrrrRRRR.......",".......rrrrrrRRRR.......",".......rRrrrRRRRR.......",".......rrRRRRRRRR.......",".......rrrRRRRRRR.......","........rrrRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrZZZZZZZZ......","......rrrrZZZZZZZZ......",".........b....b.........","........................"],["................BB......","................BB......","...............RRR......","..........rRRR.RRR......",".........rrrrRRRR.......","........rrrrrRRRR.......","........rrrrrRRRR.......","......BBrrrrrRRRR.......","......BBrrrrrRRRR.......",".......rRrrrRRRRR.......",".......rrRRRRRRRR.......",".......rrrRRRRRR........","........rrrRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrZZZZZZZZ......","......rrrrZZZZZZZZ......",".........b..............",".........bb............."],["........................","........................","........................",".......B..rRRR..B.......","......BB.rrrrRR.BB......","......rBrrrrrRRRBR......","......rrrrrrrRRRRR......",".......rrrrrrRRRR.......",".......rrrrrrRRRR.......",".......rRrrrRRRRR.......",".......rrRRRRRRRR.......",".......rrrRRRRRRR.......","........rrrRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrZZZZZZZZ......","......rrrrZZZZZZZZ......",".........b....b.........","........................"],["......BB................","......BB................","......rrr...............","......rrr.rRRR..........",".......rrrrrrRR.........",".......rrrrrrRRR........",".......rrrrrrRRR........",".......rrrrrrRRRBB......",".......rrrrrrRRRBB......",".......rRrrrRRRRR.......",".......rrRRRRRRRR.......","........rrRRRRRRR.......","........rrrRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrZZZZZZZZ......","......rrrrZZZZZZZZ......","..............b.........",".............bb........."]],"hang":[["...........BBBB.........","...........BBBB.........","...........rrRR.........","...........rrRR.........","...........rRRR.........","...........rRR..........","...........rRR..........","...........rRR..........","...........rRR..........",".........rRRRRR.........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRZbZ........","........rrRRZZbE........","........rrRRZZbb........",".........rRRRZbE........",".........rRRRRR.........","........rrrRRRR.........","........rrRrRRR.........","........rrRRRRR.........","........rrRRRRR.........","........rrRRRRR.........",".......rrrRRRRRR........",".......rrrRRRRRR........",".......rrrRRRRRR........",".......rrrRRRRRR........","......rrrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrRRRRRRRR.......",".....rrrrZBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"],["...........BBBB.........","...........BBBB.........","...........rrRR.........","...........rrRR.........","...........rRRR.........","...........rRR..........","...........rRR..........","...........rRR..........","...........rRR..........",".........rRRRRR.........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRZbZ........","........rrRRZZbE........","........rrRRZZbb........",".........rRRRZbE........",".........rRRRRR.........",".........rrRRRR.........","........rrrrRRR.........","........rrRRRRR.........","........rrRRRRR.........","........rrRRRRRR........","........rrRRRRRR........",".......rrrRRRRRR........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrZZZZZZZZ......","......bbbbZZZZBBBB......","........................"],["...........BBBB.........","...........BBBB.........","...........rrRR.........","...........rrRR.........","...........rRRR.........","...........rRR..........","...........rRR..........","...........rRR..........","...........rRR..........",".........rRRRRR.........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRZbZ........","........rrRRZZbE........","........rrRRZZbb........",".........rRRRZbE........",".........rRRRRR.........","........rrrRRRR.........","........rrRrRRR.........","........rrRRRRR.........","........rrRRRRR.........","........rrRRRRR.........",".......rrrRRRRRR........",".......rrrRRRRRR........",".......rrrRRRRRR........",".......rrrRRRRRR........","......rrrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrRRRRRRRR.......",".....rrrrZbbbbZZZZ......",".....rrrrZBBBBZZZZ......","........................"],["...........BBBB.........","...........BBBB.........","...........rrRR.........","...........rrRR.........","...........rRRR.........","...........rRR..........","...........rRR..........","...........rRR..........","...........rRR..........",".........rRRRRR.........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRZbZ........","........rrRRZZbE........","........rrRRZZbb........",".........rRRRZbE........","........rrRRRRR.........","........rrrRRR..........","........rrRrRRR.........","........rrRRRRR.........","........rrRRRRR.........",".......rrrRRRRR.........",".......rrrRRRRR.........",".......rrrRRRRRR........","......rrrRRRRRRR........","......rrrRRRRRRR........","......rrrRRRRRRR........","......rrrRRRRRRR........",".....rrrrRRRRRRRR.......",".....rrrrZZZZZZZZ.......",".....BBBBZZZZbbbb.......","................b......."]],"idle":[["........................","........................","........................","........................","........................","........................","........................","........................","........................","...........rRRRR........","..........rrRRRRR.......",".........rrrRRRRRR......",".........rrrRRZZbR......","..........rrRRZbbE......","..........rrRRZbbb......","..........RrRRZZE.......","..........rRRRRR........","..........rrRRRR........",".........rrrRRRRR.......",".........rrRRRRRRRR.....",".........rrRRRrrRRBBB...","........rrrRRRRrrrRB.B..","........rrrRRRRR.bbb....","........rrrRRRRRR..b....",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrrRRRRRRR.......",".....rrrrZBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"],["........................","........................","........................",".........RRRRRR.........","........RRRRRRRR........","........RRBBBBRR........","........RBBBBBBR........",".......RRBBBBBBRR.......","........RBEEBEER........","........RBBBEBBR........","........RRBBBBRR........",".........RRbEbR.........",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......","......rrrrRRRRRRRR......",".....rrrrrRRRRRRRRR.....",".....rrrrRRRRRRRRRR.....",".....BBrrRRRRRRRRBB.....",".....BBrrRRRRRRRRBB.....",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrZZZZZZZZZ......","......rrrZZZZZZZZZ......","........bbb..bbb........","........................"]],"happy":[["..........GGGG..........",".........GGYGGG.........",".........GGgGgG.........",".......B..GGGG..B.......","......BBBRRGgGRBBB......","......rBRRRRRRRRBR......",".......rRRBBBBRRR.......",".......rRBBBBBBRR.......",".......RRBBBBBBRR.......",".......rRBEEBEERR.......",".......rRBBBEBBRR.......",".......rRRBBBBRRR.......",".......rrRRbEbRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrZZZZZZZZZ......","......rrrZZZZZZZZZ......","........bbb..bbb........"],[".........GGYGGG.........",".........GGgGgG.........",".......B..GGGG..B.......","......BBBRRGgGRBBB......","......rBRRRRRRRRBR......",".......rRRBBBBRRR.......",".......rRBBBBBBRR.......",".......RRBBBBBBRR.......",".......rRBEEBEERR.......",".......rRBBBEBBRR.......",".......rRRBBBBRRR.......",".......rrRRbEbRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......",".......rrRRRRRRRR.......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrRRRRRRRRR......","......rrrZZZZZZZZZ......","......rrrZZZZZZZZZ......","........bbb..bbb........","........................"]],"sleep":[["........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................",".................rRRRR..","................rrRRRRR.","................rrRRRRRR","................rrRRRZZZ","................rrRRZZbb","................rrRRZZbE","................rrRRRZbE","...............rrRRRRRR.","..............rrRRRRR...","..............rrRRRRRR..",".............rrRRRRRRRR.","............rrRRRRRRrRRR","...........rrrRRRRR..rRR","..........rrrRRRRRR..rrR",".........rrrRRRRRRR...rb","........rrrrRRRRRRR.....","........rrrRRRRRRR......",".......rrrRRRRRRRR......","......rrrrBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","....................RR..","..................rRRRRR",".................rrRRRRR",".................rrRRRZZ",".................rrRRZZb",".................rrRRZbb",".................rrRRZZb","................rrRRRRZb","................rrRRRRR.","...............rrRRRRRR.","..............rrRRRRRRRR",".............rrRRRRRrRRR","............rrRRRRRR.rRR","...........rrrRRRRRR..rR","..........rrrRRRRRR...rr",".........rrrRRRRRRR....r","........rrrRRRRRRRR.....",".......rrrrRRRRRRR......","......rrrrBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"]],"stuck":[["........................",".......B........B.......","......BBBRRRRRRBBB......","......rBRRRRRRRRBR......",".......rRRBBBBRRR.......",".......rRBBBBBBRR.......",".......RRBBBBBBRR.......",".......rRBEEBEERR.......",".......rRBBBEBBRR.......",".......rRRBBBBRRR.......",".......rrRRbEbRRR.......",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........","........rrRRRRRR........"],["........................","......B........B........",".....BBBRRRRRRBBB.......",".....rBRRRRRRRRBR.......","......rRRBBBBRRR........","......rRBBBBBBRR........","......RRBBBBBBRR........","......rRBEEBEERR........","......rRBBBEBBRR........","......rRRBBBBRRR........","......rrRRbEbRRR........","......rrrRRRRRRR........","......rrrRRRRRRR........",".......rrRRRRRR.........",".......rrRRRRRR.........",".......rrRRRRRR.........",".......rrRRRRRR.........",".......rrRRRRRR........."]],"dig":[["........................","........................","........................","........................","........................","........................","........................","........................","........................","..........rrRRRR........",".........rrrRRRRR.......",".........rrrRRRRR.......",".........rrrRRZbZ.......",".........rrrRZZbE.......",".........rrrRZZbb.......","..........rrRRZbE.......","..........rRRRRR........",".........rrRRRR.........",".........rrRRRRR........",".........rrRRRRR........","........rrrRrRRR........","........rrrRRrRRR.......","........rrrRRrrRBB......","........rrRRRRbRBB......",".......rrrRRRRbbb.B.....",".......rrrRRRRRRR.......",".......rrrRRRRRRR.......","......rrrrRRRRRRR.......","......rrrrRRRRRRR.......",".....rrrrZBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"],["........................","........................","........................","........................","........................","........................","........................","........................","........................","........................","...............rRRRR....","..............rrRRRRR...","..............rrRRRRRR..","..............rrRRRZZZ..","..............rrRRZZbb..","..............rrRRZZbERB","..............rrRRRZbERB","..............rRRRRRRRRb",".............rrRRRRRRRrb","............rrrRRRRRrr..","............rrRRRRR.....","...........rrrRRRRR.....","..........rrrRRRRRR.....","..........rrrRRRRR......",".........rrrRRRRRR......","........rrrrRRRRRR......","........rrrRRRRRRR......",".......rrrrRRRRRRR......","......rrrrRRRRRRRR......","......rrrrBBBBZZZZ......",".....rrrrZbbbbZZZZ......","........................"]]}},"muzzle":{"runner":[[22,18],[23,17]]}};
3
hooks/terry-fine.js 104 lines
1// Terry drawn with the terminal's own pixels, through the Lode Cells font (see lode-fine.js): his card's picture
2// (terryScene's braille dots: the editor's art, one dot a pixel of it) with its pixels halved by Scale2x, so every
3// step of an outline becomes two smaller ones, then 8 x 16 screen pixels to a cell. A cell is two to three colours
4// (lode-fine's cellsOf) and one of the font's glyphs gathered from this scene (docs/preview/lode/harvest-terry.mjs).
5// A frame touched up by hand at twice the dots (the 2x dot editor, terry-2x-data.js) takes the place of his Scale2x.
6import GLYPHS from './terry-glyphs.js'
7import FINE2X from './terry-2x-data.js'
8import SPRITE from './terrier-data.js'
9import { terryScene, TERRY_ROWS, writeText, MOON, moonShape } from './render.js'
10import { CW, CH, cellsOf, cellList, glyphTable, unpackKeys } from './lode-fine.js'
11
12export const TERRY_GLYPH_BASE = 0x10a000 // after the ladder card's glyphs, in the same font
13let table = null // unpacked on first use (see lode-fine.js)
14const glyph = (mask, over) => (table ??= glyphTable(unpackKeys(GLYPHS), TERRY_GLYPH_BASE))(mask, over)
15const rgbInt = c => (c ? (c[0] << 16) | (c[1] << 8) | c[2] : -1)
16
17// Scale2x (EPX): each pixel becomes 2 x 2, a corner taking its two neighbours' colour where they agree (and the
18// other two differ), which rounds a stair step off without inventing colours
19function scale2x(g, w, h) {
20  const o = new Int32Array(w * 2 * h * 2), W2 = w * 2
21  const at = (x, y) => g[Math.min(h - 1, Math.max(0, y)) * w + Math.min(w - 1, Math.max(0, x))]
22  for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
23    const E = at(x, y), B = at(x, y - 1), D = at(x - 1, y), F = at(x + 1, y), H = at(x, y + 1)
24    let e0 = E, e1 = E, e2 = E, e3 = E
25    if (B !== H && D !== F) {
26      if (D === B) e0 = D
27      if (B === F) e1 = F
28      if (D === H) e2 = D
29      if (H === F) e3 = F
30    }
31    const i = y * 2 * W2 + x * 2
32    o[i] = e0; o[i + 1] = e1; o[i + W2] = e2; o[i + W2 + 1] = e3
33  }
34  return o
35}
36
37const KEY = Object.fromEntries(SPRITE.palette.map((hex, i) => [SPRITE.alphabet[i], parseInt(hex, 16)]))
38const flat = (canvas, w, h) => {
39  const g = new Int32Array(w * h)
40  for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) g[y * w + x] = rgbInt(canvas[y][x])
41  return g
42}
43
44// His hand-drawn 2x frame laid into the 2x picture: what is drawn over him (a cape, a frisbee) stays on top, and where
45// the frame he is showing differs from the set's own (an eye shut, a breath) the Scale2x of it stays, so those keep
46// moving; where the finer frame leaves out a pixel he had, what is behind him shows.
47function layIn(two, w2, h2, dog, over, behind, rows) {
48  const fw = dog.frame[0].length, fh = dog.frame.length
49  const shift = dog.drop || 0, flip = dog.flipped
50  const at = (f, x, y) => { const yy = y - shift; return yy < 0 || yy >= f.length ? null : f[yy][flip ? fw - 1 - x : x] }
51  const out = two.slice()
52  for (let Y = 0; Y < h2; Y++) for (let X = 0; X < w2; X++) {
53    const x = X >> 1, y = Y >> 1, fx = x - dog.x, fy = y - dog.y
54    if (fx < 0 || fy < 0 || fx >= fw || fy >= fh) continue
55    if (over && over[y * (w2 >> 1) + x]) continue
56    if (rgbInt(dog.frame[fy][fx]) !== rgbInt(at(dog.raw, fx, fy))) continue
57    const rx = (flip ? fw * 2 - 1 - (X - dog.x * 2) : X - dog.x * 2), ry = Y - (dog.y + shift) * 2
58    const k = rows[ry]?.[rx]
59    out[Y * w2 + X] = k && k !== '.' ? KEY[k] : behind[Y * w2 + X]
60  }
61  return out
62}
63
64// The moon again at the finer pixels (half a dot): render.js's moonShape at twice its size. Off the finer shape each
65// pixel is its dot unscaled (Scale2x would have rounded the card's moon into the sky beside it), and a dot the card's
66// moon drew (and nothing drew over since) shows what it covered (scene.moon.under: the sky, a star, a leaf)
67function layMoon(two, w2, moon, canvas, w) {
68  const L = moon.left * 2, T = moon.top * 2, W = moon.w * 2, H = moon.h * 2
69  const shape = moonShape(moon.kind, W, H), col = [0, rgbInt(MOON.core), rgbInt(MOON.rim)]
70  for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
71    const i = (T + y) * w2 + L + x
72    if (shape[y * W + x]) { two[i] = col[shape[y * W + x]]; continue }
73    const X = (L + x) >> 1, Y = (T + y) >> 1, was = moon.under.get(Y * w + X)
74    two[i] = rgbInt(was && canvas[Y][X] === was[1] ? was[0] : canvas[Y][X])
75  }
76}
77
78/** the card in screen pixels: {px (colour ints, -1 empty), W, H, marks} */
79export function terryFineScene(mood, ms, hour = 12, columns, effort = 'high', date = null) {
80  const scene = terryScene(mood, ms, 'braille', hour, columns, effort, date, { track: true })
81  const { canvas, marks, dog } = scene
82  const w = columns * 2, h = TERRY_ROWS * 4
83  let two = scale2x(flat(canvas, w, h), w, h)
84  const w2 = w * 2 // a dot is 4 x 4 screen pixels: halved, 2 x 2
85  const rows = FINE2X[dog.set]?.[dog.index]
86  if (rows) {
87    const behind = scale2x(flat(terryScene(mood, ms, 'braille', hour, columns, effort, date, { noDog: true }).canvas, w, h), w, h)
88    two = layIn(two, w2, h * 2, dog, scene.over, behind, rows)
89  }
90  if (scene.moon) layMoon(two, w2, scene.moon, canvas, w)
91  const W = columns * CW, H = TERRY_ROWS * CH
92  const px = new Int32Array(W * H)
93  for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) px[y * W + x] = two[(y >> 1) * w2 + (x >> 1)]
94  return { px, W, H, marks }
95}
96
97/** the card as [codepoint, fg, bg] cells (render.js's DEFAULT for the terminal's own colour), marks written over it */
98export function terryFineCellList(mood, ms, hour, columns, effort = 'high', date = null) {
99  const scene = terryFineScene(mood, ms, hour, columns, effort, date)
100  const cells = cellList(cellsOf(scene, columns, TERRY_ROWS), glyph)
101  for (const m of scene.marks) writeText(cells, columns, m.x, m.y, m.text, m.color)
102  return cells
103}
104
hooks/lode-fine.js 399 lines
1// The ladder card drawn with the terminal's own pixels, through the Lode Cells font (docs/preview/lode/cellfont.py):
2// the scene is drawn at screen resolution, 8 x 16 pixels to a cell, and every cell becomes one of the font's glyphs
3// (a picture of which of its pixels are lit) in a foreground and a background colour. The glyphs are the cells this
4// very scene produces, gathered beforehand (docs/preview/lode/harvest.mjs); a cell that was never gathered takes the
5// nearest glyph. The same story as lode.js, three times finer: the runner and the monk from rig.py at scale 3.
6import FINE from './lode-fine-data.js'
7import GLYPHS from './lode-glyphs.js'
8import { TERRY_ROWS, packCells, writeText } from './render.js'
9import { onRouteOf } from './lode.js'
10
11export const CW = 8
12export const CH = 16
13export const GLYPH_BASE = 0x100000 // Supplementary Private Use Area-B: WaveTerm's Hack Nerd Font leaves it empty
14const DEFAULT = 0x01000000
15
16const KEYS = {
17  A: '2e2018', a: '5a4030', K: 'f0bc92', k: 'c88e66', E: '141414', U: 'f2f4f8', u: 'c4cad4', q: '8e96a4', V: '262630',
18  v: '50505e', N: '9a6636', n: '64401e', O: '3a2614', M: '707888', m: '3e4450', L: 'ff8a3c', R: 'd03030', r: '8a1a1a',
19  Z: '560c0c', B: 'f2ecd8', b: 'bcb096', G: 'f5c542', g: 'b8860b', Y: 'fff2a8',
20}
21const KEYI = Object.fromEntries(Object.entries(KEYS).map(([k, v]) => [k, parseInt(v, 16)]))
22const [SW, SH] = FINE.size // 72 x 96
23
24// frames, decoded once: each a list of rows of keys
25const unrle = row => row.replace(/(\d+)(.)/g, (_, n, k) => k.repeat(+n))
26const FR = {}
27for (const [hero, sets] of Object.entries(FINE.frames)) {
28  FR[hero] = {}
29  for (const [name, frames] of Object.entries(sets)) FR[hero][name] = frames.map(f => f.map(unrle))
30}
31
32// the scene, in screen pixels (everything three times lode.js's sizes)
33const FLOOR = 144 // the top of the ledge he stands on: the card's last cell row
34const LEDGE = 16
35const STOREY = 128 // the ledge above shows as a band in the second cell row
36const LADDER_W = 21
37const BAR_H = SH - 9 // at his raised hands
38const TURF_TOP = 0xaaff50, TURF = 0x68d628
39const RAIL = 0xd6dae0, RAIL_SHADE = 0x969ca6, RUNG = 0xf0f2f6, BAR = 0xececE4
40const GOLD = 0xf5c542, GOLD_DARK = 0xb8860b, GLINT = 0xfffadc, BEAM = 0xff6a3c, BEAM_HOT = 0xffd67a
41const SCALE = 3
42const route = onRouteOf(SCALE)
43const ROUND_W = route.storey(6).x0 - route.storey(0).x0 // the route repeats every six storeys, this far to the right
44
45// the turf's texture repeats every cell width, so a cell of turf is one of a few glyphs however far it has scrolled;
46// and it is two colours, the bright top and flecks of it in the green, so a cell can draw it exactly
47const turfAt = (wx, r) => {
48  if (r < 3) return TURF_TOP
49  const f = (((wx % CW) + CW) % CW) * 5 + r * 3
50  return f % 11 === 0 && r < LEDGE - 2 ? TURF_TOP : TURF
51}
52
53export function fineScene(hero, mood, ms, columns, effort = 'high') {
54  const W = columns * CW
55  const H = TERRY_ROWS * CH
56  const px = new Int32Array(W * H).fill(-1)
57  const put = (x, y, c) => { x |= 0; y |= 0; if (x >= 0 && x < W && y >= 0 && y < H) px[y * W + x] = c }
58  const clear = (x, y) => { if (x >= 0 && x < W && y >= 0 && y < H) px[y * W + x] = -1 }
59  const sprite = (rows, left, bottom) => {
60    const top = bottom - rows.length + 1
61    for (let y = 0; y < rows.length; y++) {
62      const row = rows[y]
63      for (let x = 0; x < row.length; x++) if (row[x] !== '.') put(left + x, top + y, KEYI[row[x]])
64    }
65  }
66  const marks = []
67  const t = ms / 1000
68  const running = mood === 'run' || mood === 'fetch'
69  const pace = route.PACE[effort] ?? 1
70  const here = running ? route.onRoute(t * pace) : { k: 0, x: route.storey(0).x0 + 42, up: 0, kind: 'stand', step: 0 }
71  // he stands on a cell boundary: his cells are always the same glyphs
72  const leftCell = Math.max(1, Math.round(columns * (hero === 'runner' && running ? 0.5 : 0.36)) - 4)
73  const left = leftCell * CW
74  const MX = left + SW / 2
75  const sx = x => MX + Math.round(x - here.x)
76  const sy = (k, h) => FLOOR - Math.round(k * STOREY + h - (here.k * STOREY + here.up))
77
78  for (let k = here.k - 1; k <= here.k + 1; k++) {
79    const st = route.storey(k), prev = route.storey(k - 1)
80    const top = sy(k, 0)
81    for (let x = Math.max(0, sx(prev.ladder - 90)); x <= Math.min(W - 1, sx(st.ladder + LADDER_W + 30)); x++) {
82      if (st.gap && x >= sx(st.gapFrom + 6) && x <= sx(st.gapTo - 6)) continue
83      const wx = x - sx(Math.floor(k / 6) * ROUND_W) // the same texture every round, so the same glyphs
84      for (let r = 0; r < LEDGE; r++) put(x, top + r, turfAt(wx, r))
85    }
86    if (st.gap) for (let x = sx(st.gapFrom - 36); x <= sx(st.gapTo + 36); x++) for (let r = 0; r < 3; r++) put(x, sy(k, BAR_H) + r, BAR)
87    const lx = sx(st.ladder) - Math.floor(LADDER_W / 2)
88    for (let h = 0; h <= STOREY; h++) {
89      const y = sy(k, h)
90      for (let r = 0; r < 3; r++) { put(lx + r, y, RAIL); put(lx + LADDER_W - 1 - r, y, RAIL_SHADE) }
91      if (h % 12 < 3) for (let x = lx + 3; x < lx + LADDER_W - 3; x++) put(x, y, RUNG)
92    }
93    const gone = k < here.k || (k === here.k && running && here.x > st.gold)
94    if (!gone) {
95      const gx = sx(st.gold) - 7, gy = sy(k, 0) - 15
96      const skull = ['.GGG.', 'GYGGG', 'GgGgG', 'GGGGG', '.GgG.']
97      skull.forEach((row, y) => [...row].forEach((c, x) => {
98        if (c === '.') return
99        for (let dy = 0; dy < 3; dy++) for (let dx = 0; dx < 3; dx++) put(gx + x * 3 + dx, gy + y * 3 + dy, c === 'G' ? GOLD : c === 'g' ? GOLD_DARK : GLINT)
100      }))
101    }
102  }
103
104  const streaks = []
105  if (running && pace >= 1.5 && here.kind === 'walk') {
106    for (let n = 0; n < 3; n++) {
107      const y = FLOOR - 24 - n * 24
108      const head = left - 3 - Math.floor(((t * 3 + n * 0.37) % 1) * 36)
109      for (let k = 0; k < 18; k++) for (let r = 0; r < 2; r++) streaks.push(head - k, y + r, k < 6 ? 0xe8ecf6 : 0x828696)
110    }
111  }
112
113  const F = FR[hero] || FR.runner
114  const feet = FLOOR - 1
115  const cellX = leftCell + 4
116  const pose = (G, at) => {
117    const frames = at.kind === 'climb' ? G.climb : at.kind === 'hang' ? G.hang : G.walk
118    const per = at.kind === 'walk' ? 6 : 12
119    return frames[Math.floor(at.step / per) % frames.length]
120  }
121  if (running) {
122    if (hero === 'runner' && t * pace > route.CHASE_SECS) {
123      const m = route.onRoute(t * pace - route.CHASE_SECS)
124      sprite(pose(FR.monk, m), sx(m.x) - SW / 2, sy(m.k, m.up) - 1)
125    }
126    sprite(pose(F, here), left, feet)
127  } else if (mood === 'sad' || mood === 'droop') {
128    for (let x = left + 6; x < left + SW - 6; x++) for (let r = 0; r < LEDGE; r++) clear(x, FLOOR + r)
129    sprite(F.stuck[Math.floor(t * 4) % 2], left, FLOOR + LEDGE - 1)
130  } else if (mood === 'sleep') {
131    sprite(F.sleep[Math.floor(t / 1.2) % 2], left, feet)
132    const p = Math.floor(t / 0.7) % 3
133    marks.push([cellX + 4, 3, 'z'])
134    if (p >= 1) marks.push([cellX + 5, 2, 'Z'])
135    if (p >= 2) marks.push([cellX + 6, 1, 'Z'])
136  } else if (mood === 'happy' || mood === 'catch' || mood === 'pet' || mood === 'bark') {
137    sprite(F.happy[Math.floor(t / 0.25) % 2], left, feet)
138    if (mood === 'bark' && Math.floor(t / 0.34) % 2 === 0) marks.push([cellX + 4, 1, '!', 0xffd166])
139    if (mood !== 'bark' && Math.floor(t / 0.3) % 2 === 0) marks.push([cellX + 4, 1, '*', 0xffd166])
140  } else if ((mood === 'dig' || mood === 'sniff') && hero === 'runner') {
141    const cycle = (t % 2.4) / 2.4
142    const firing = cycle < 0.45
143    sprite(F.dig[firing ? 1 : 0], left, feet)
144    const [mx, my] = FINE.muzzle.runner[firing ? 1 : 0]
145    const gx = left + mx, gy = feet - SH + 1 + my
146    const hx = left + SW + 3
147    const depth = Math.floor(Math.min(cycle, 0.45) / 0.45 * LEDGE)
148    if (firing) {
149      const span = Math.max(1, FLOOR + depth - gy)
150      for (let k = 0; k < span; k++) {
151        const x = gx + Math.round(k * (hx + 9 - gx) / span)
152        for (let w = 0; w < 3; w++) put(x + w, gy + k, k % 6 < 3 ? BEAM_HOT : BEAM)
153      }
154    }
155    const open = cycle < 0.85 ? Math.max(depth, cycle >= 0.45 ? LEDGE : 0) : 0
156    for (let x = hx; x < hx + 24; x++) for (let r = 0; r < open; r++) clear(x, FLOOR + r)
157  } else if (mood === 'dig' || mood === 'sniff') {
158    sprite(F.dig[Math.floor(t / 0.35) % 2], left, feet)
159  } else {
160    const out = mood === 'wag' || mood === 'ask' || Math.floor(t / 1.5) % 4 === 3
161    sprite(F.idle[out ? 1 : 0], left, feet)
162    if (mood === 'ask' && Math.floor(t / 0.6) % 4 !== 3) marks.push([cellX + 4, 1, '?', 0xffd166])
163  }
164  // speed lines only through cells nothing else is in: across the monk or a ledge they would make a new glyph at
165  // every pixel they move
166  if (streaks.length) {
167    const busy = new Set()
168    for (let i = 0; i < px.length; i++) if (px[i] !== -1) busy.add(Math.floor(i / W / CH) * columns + Math.floor((i % W) / CW))
169    for (let i = 0; i < streaks.length; i += 3) {
170      const x = streaks[i], y = streaks[i + 1]
171      if (x >= 0 && !busy.has(Math.floor(y / CH) * columns + Math.floor(x / CW))) put(x, y, streaks[i + 2])
172    }
173  }
174  return { px, W, H, marks }
175}
176
177// ---- cells: two colours each and which pixels take the first -----------------------------------------------------
178const BG_GUESS = [24, 24, 30] // what a terminal background looks like, to weigh empty pixels against colours
179const rgb = c => (c < 0 ? BG_GUESS : [(c >> 16) & 255, (c >> 8) & 255, c & 255])
180const distOf = (a, b) => { const p = rgb(a), q = rgb(b); return (p[0] - q[0]) ** 2 + (p[1] - q[1]) ** 2 + (p[2] - q[2]) ** 2 }
181// remembered: a card has a few dozen colours, and the row search below asks for the same pairs over and over
182const distMemo = new Map()
183const dist = (a, b) => {
184  const k = (a + 2) * 16777219 + b + 2
185  let d = distMemo.get(k)
186  if (d === undefined) {
187    if (distMemo.size > 200000) distMemo.clear()
188    distMemo.set(k, d = distOf(a, b))
189  }
190  return d
191}
192
193// A cell shows two colours of its own, its background and its glyph's, and a third borrowed from the cell on its left:
194// that cell's glyph may reach on into this one (the terminal draws a glyph wider than its cell over the next cell;
195// one reaching left is cut off). So where he passes a ladder or a bar, red, white and the dark between can all show.
196// Each row is chosen left to right as a whole: every cell's glyph colour is picked for itself and for its neighbour.
197// The choice is the one that misdraws the fewest pixels, where painting the background (or punching a hole in him)
198// counts several times over, because those mistakes show as the cell's own square, moving with him; a pixel of one
199// colour drawn in a nearby one hardly shows.
200const EDGE = 6 // what an empty pixel painted, or a lit one left empty, costs against a colour slip
201const cost = (v, c) => (v === c ? 0 : c === NONE ? Infinity : (v === -1) !== (c === -1) ? dist(v, c) * EDGE : dist(v, c))
202const NONE = -2 // no glyph colour
203const BORROW = 1 // a borrowed pixel costs a hair more, so a cell borrows only when it helps
204
205/** every cell of the scene as {mask, over, fg, bg} or null: mask [4 words, bit r*8+c] the cell's own pixels in fg,
206 * over the same for the pixels of the next cell its glyph draws, in fg too (colour -1 = the terminal's own) */
207export function cellsOf(scene, columns, rows) {
208  const { px, W } = scene
209  const out = []
210  for (let cy = 0; cy < rows; cy++) {
211    // a row of pixels seen before (most of the card stands still from one frame to the next) gives the same cells
212    const key = rowKey(px, cy * CH * W, CH * W, columns)
213    const seen = rowMemo.get(key)
214    if (seen) { out.push(...seen); continue }
215    const start = out.length
216    // each cell's colours and how many pixels of each
217    const counts = []
218    for (let cx = 0; cx < columns; cx++) {
219      const m = new Map()
220      for (let r = 0; r < CH; r++) for (let c = 0; c < CW; c++) {
221        const v = px[(cy * CH + r) * W + cx * CW + c]
222        m.set(v, (m.get(v) || 0) + 1)
223      }
224      counts.push(m)
225    }
226    // best[cx]: for each glyph colour of cell cx, the least error of cells 0..cx and how it was reached
227    const best = []
228    for (let cx = 0; cx < columns; cx++) {
229      const own = [...counts[cx].keys()]
230      const fgs = new Set([NONE, ...own.filter(v => v !== -1)])
231      if (cx + 1 < columns) for (const v of counts[cx + 1].keys()) if (v !== -1) fgs.add(v)
232      const bgs = counts[cx].has(-1) ? own : [...own, -1]
233      const prev = cx ? best[cx - 1] : new Map([[NONE, { e: 0 }]])
234      const here = new Map()
235      for (const fg of fgs) {
236        let pick = null
237        for (const [left, p] of prev) for (const bg of bgs) {
238          let e = p.e
239          for (const [v, n] of counts[cx]) {
240            const o = Math.min(cost(v, bg), cost(v, fg)), l = cost(v, left) + BORROW
241            e += n * (l < o ? l : o)
242            if (e >= (pick ? pick.e : Infinity)) break
243          }
244          if (!pick || e < pick.e) pick = { e, left, bg }
245        }
246        here.set(fg, pick)
247      }
248      best.push(here)
249    }
250    // back from the right: each cell's colours, then its pixels
251    const row = new Array(columns)
252    let fg = NONE, e = Infinity
253    for (const [k, p] of best[columns - 1]) if (p.e < e) { e = p.e; fg = k }
254    for (let cx = columns - 1; cx >= 0; cx--) {
255      const p = best[cx].get(fg)
256      row[cx] = { fg, bg: p.bg, left: p.left }
257      fg = p.left
258    }
259    for (let cx = 0; cx < columns; cx++) {
260      const { fg, bg, left } = row[cx]
261      const mask = [0, 0, 0, 0]
262      let lit = 0, borrowed = false
263      for (let r = 0; r < CH; r++) for (let c = 0; c < CW; c++) {
264        const v = px[(cy * CH + r) * W + cx * CW + c]
265        const o = Math.min(cost(v, bg), cost(v, fg)), l = cost(v, left) + BORROW
266        const i = r * CW + c
267        if (l < o) { row[cx - 1].over[i >> 5] |= 1 << (i & 31); borrowed = true }
268        else if (cost(v, fg) <= cost(v, bg)) { mask[i >> 5] |= 1 << (i & 31); lit++ }
269      }
270      row[cx].mask = mask
271      row[cx].over = [0, 0, 0, 0]
272      row[cx].lit = lit
273    }
274    for (let cx = 0; cx < columns; cx++) {
275      const c = row[cx]
276      const over = c.over.map(w => w >>> 0)
277      if (c.fg === NONE && over.every(w => !w)) {
278        out.push(c.bg === -1 ? null : { mask: [0, 0, 0, 0], over, fg: c.bg, bg: c.bg })
279        continue
280      }
281      let { mask, fg, bg } = c
282      // a cell more lit than not, lending nothing on, is the same glyph inverted, its colours swapped (when neither is
283      // the terminal's)
284      if (c.lit > 64 && bg !== -1 && over.every(w => !w)) {
285        for (let i = 0; i < 4; i++) mask[i] = ~mask[i]
286        ;[fg, bg] = [bg, fg]
287      }
288      out.push({ mask: mask.map(w => w >>> 0), over, fg, bg })
289    }
290    if (rowMemo.size > 4000) rowMemo.clear()
291    rowMemo.set(key, out.slice(start))
292  }
293  return out
294}
295const rowMemo = new Map()
296// a row's pixels as two 32-bit hashes (FNV-1a and a multiply-xor), and the row's width
297function rowKey(px, from, n, columns) {
298  let a = 0x811c9dc5, b = 0x9e3779b9
299  for (let i = from; i < from + n; i++) {
300    const v = px[i]
301    a = Math.imul(a ^ v, 0x01000193)
302    b = Math.imul(b ^ (v >>> 16) ^ (v << 16), 0x85ebca6b) ^ (b >>> 13)
303  }
304  return (a >>> 0).toString(36) + '.' + (b >>> 0).toString(36) + '.' + columns
305}
306/** a glyph's key: its own pixels (32 hex digits), then, if it reaches on, the next cell's (32 more) */
307export const keyOf = (mask, over) => {
308  const hex = m => m.map(w => w.toString(16).padStart(8, '0')).join('')
309  return over && over.some(w => w) ? hex(mask) + hex(over) : hex(mask)
310}
311
312// ---- glyphs: the gathered masks, in the font's order ---------------------------------------------------------------
313// The lists are kept as base64, 32 bytes a glyph (its 8 words, little-endian; the next cell's 4 are 0 when it reaches
314// no further): the engine will not read a module file over 1 MB, and the hex keys took 1.2 MB a card
315const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
316/** a list of glyph keys as that base64 */
317export function packKeys(keys) {
318  const bytes = new Uint8Array(keys.length * 32)
319  keys.forEach((k, g) => {
320    for (let i = 0; i < 8; i++) {
321      const w = parseInt(k.slice(i * 8, i * 8 + 8) || '0', 16)
322      for (let b = 0; b < 4; b++) bytes[g * 32 + i * 4 + b] = (w >>> (b * 8)) & 255
323    }
324  })
325  let out = ''
326  for (let i = 0; i < bytes.length; i += 3) {
327    const n = (bytes[i] << 16) | ((bytes[i + 1] ?? 0) << 8) | (bytes[i + 2] ?? 0)
328    out += B64[n >> 18] + B64[(n >> 12) & 63] + (i + 1 < bytes.length ? B64[(n >> 6) & 63] : '=') + (i + 2 < bytes.length ? B64[n & 63] : '=')
329  }
330  return out
331}
332/** packKeys back to the keys (keyOf's spelling) */
333export function unpackKeys(b64) {
334  const val = new Map([...B64].map((c, i) => [c, i]))
335  const bytes = new Uint8Array(Math.floor(b64.replace(/=+$/, '').length * 3 / 4))
336  for (let i = 0, o = 0; i < b64.length; i += 4) {
337    const n = (val.get(b64[i]) << 18) | (val.get(b64[i + 1]) << 12) | ((val.get(b64[i + 2]) ?? 0) << 6) | (val.get(b64[i + 3]) ?? 0)
338    for (const v of [n >> 16, (n >> 8) & 255, n & 255]) if (o < bytes.length) bytes[o++] = v & 255
339  }
340  const keys = []
341  for (let g = 0; g < bytes.length / 32; g++) {
342    const words = []
343    for (let i = 0; i < 8; i++) {
344      const j = g * 32 + i * 4
345      words.push((bytes[j] | (bytes[j + 1] << 8) | (bytes[j + 2] << 16) | (bytes[j + 3] << 24)) >>> 0)
346    }
347    keys.push(keyOf(words.slice(0, 4), words.slice(4)))
348  }
349  return keys
350}
351
352const pop = v => { v -= (v >>> 1) & 0x55555555; v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); return (((v + (v >>> 4)) & 0x0f0f0f0f) * 0x01010101) >>> 24 }
353/** a lookup for a gathered list of glyph keys laid out in the font from `base`: (mask, over) -> codepoint; a cell
354 * never gathered takes the nearest glyph (fewest pixels different) */
355export function glyphTable(keys, base) {
356  const index = new Map(keys.map((k, i) => [k, i]))
357  const words = keys.map(k => [0, 1, 2, 3, 4, 5, 6, 7].map(i => parseInt(k.slice(i * 8, i * 8 + 8) || '0', 16)))
358  const nearest = new Map()
359  return (mask, over) => {
360    const key = keyOf(mask, over)
361    let i = index.get(key) ?? nearest.get(key)
362    if (i !== undefined) return base + i
363    const want = [...mask, ...over]
364    let best = 0, bestD = 1e9
365    for (let g = 0; g < words.length; g++) {
366      const w = words[g]
367      let d = 0
368      for (let j = 0; j < 8 && d < bestD; j++) d += pop(w[j] ^ want[j])
369      if (d < bestD) { bestD = d; best = g; if (!d) break }
370    }
371    nearest.set(key, best)
372    return base + best
373  }
374}
375let lodeTable = null // unpacked on first use: a session that never draws with the font does not pay for it
376const lodeGlyph = (mask, over) => (lodeTable ??= glyphTable(unpackKeys(GLYPHS), GLYPH_BASE))(mask, over)
377
378/** cellsOf's cells as [codepoint, fg, bg] (render.js's DEFAULT for the terminal's own colour), through `glyph` */
379export function cellList(cells, glyph) {
380  // a cell all one colour, lending nothing on, is a blank in that background colour: a background fills its cell
381  // exactly, where a glyph's edges are smoothed and would show the cell as a faint seam
382  const solid = c => c.over.some(w => w) ? -1 : c.mask.every(w => w === 0xffffffff) ? c.fg : c.mask.every(w => w === 0) ? c.bg : -1
383  return cells.map(c =>
384    c === null ? [0x20, DEFAULT, DEFAULT] : solid(c) !== -1 ? [0x20, DEFAULT, solid(c)]
385      : [glyph(c.mask, c.over), c.fg < 0 ? DEFAULT : c.fg, c.bg < 0 ? DEFAULT : c.bg])
386}
387
388/** the card as [codepoint, fg, bg] cells, marks written over it */
389export function fineCellList(hero, mood, ms, columns, effort = 'high') {
390  const scene = fineScene(hero, mood, ms, columns, effort)
391  const cells = cellList(cellsOf(scene, columns, TERRY_ROWS), lodeGlyph)
392  for (const [x, y, text, color] of scene.marks) writeText(cells, columns, x, y, text, color ?? 0x9aa4c8)
393  return cells
394}
395
396export function fineCells(hero, mood, ms, columns, effort = 'high') {
397  return packCells(fineCellList(hero, mood, ms, columns, effort))
398}
399
hooks/terry-2x-data.js 4 lines
1// Generated by docs/preview/lode/terry2x.mjs from docs/preview/terry-edits-2x.json; do not edit by hand.
2// Terry's frames touched up at twice the dots (set -> frame -> rows in terrier-data.js's keys).
3export default {};
4
hooks/lode-fine-data.js 3 lines
1// Generated by docs/preview/lode/build-lode.py; do not edit by hand.
2export default {"size":[72,96],"frames":{"runner":{"walk":[["72.","72.","72.","72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U2u7U1u26.","25.3n4N3u1U2u7U1u26.","25.2n4N4u1U2u7U27.","25.2n4N4u1U2u6U1u27.","25.2n4N3u2U3u5U1u27.","25.2n4N3u2U3u5U1u27.","25.2n3N4u2U3u5U28.","24.3n3N4u2U3u4U1u28.","24.3n3N3u3U3u4U1u28.","24.2n4N3u3U3u4U1u28.","24.2n3N4u3U3u4U29.","24.2n3N4u3U3u3U1u29.","24.2n3N3u4U2u7U27.","24.2n3N3u4U2u10U24.","23.3n3N3u4U3u12U21.","23.3n2N4u4U6u9U2K1U18.","23.3n2N4u5U10u3U4K18.","23.4n1N3u2U3u4U9u6K17.","24.4n3u1U2u6U1u3.5u6K17.","25.2n1u3q2u5U4q6.2u4K18.","27.3q3u5U1u3q9.1K20.","27.3q3u5U1u2q31.","28.5u5U2u32.","28.5u5U2u32.","29.4u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.3u4U34.","31.3u4U34.","31.3u3U1u34.","31.3u3U1u34.","31.3u3U1u34.","24.2u11U1u34.","18.19U1u34.","12.1V24U1u34.","10.1u4V15U8u34.","10.5V5U17u1q34.","10.5V21u1q35.","10.5V13u2.3q3u1q35.","11.4V15.2q4u1q35.","11.5V14.2q4u1q35.","11.5V14.2q4u36.","11.5V14.2q3u1q36.","11.5V13.3q3u1q36.","11.4V14.2q4u1q36.","12.3V14.2q4u37.","29.2q3u1q37.","29.2q3u1q37.","29.2q3u1q37.","28.2q4u38.","28.2q3u1q38.","28.2q3u1q38.","28.2q3u1q38.","28.1q2m2u39.","27.1q7m37.","27.11m34.","27.12m33.","28.11m33.","29.1q8m34.","36.1m35."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U2u7U1u26.","25.3n4N5u4U1u3U1u26.","25.2n4N6u3U2u3U27.","25.2n4N5u4U1u3U1u27.","25.2n4N5u3U2u3U1u27.","25.2n4N4u4U1u4U1u27.","25.2n3N4u4U1u5U2u26.","24.3n3N4u4U1u4U3u11.3k1u11.","24.3n3N3u4U1u5U4u5.4u5k11.","24.2n4N3u3U2u5U13u5k11.","24.2n3N3u4U1u6U2q11u5k11.","24.2n3N3u4U1u5U1u2q9u2q5k11.","24.2n3N3u10U1u2q5u8q14.","24.2n3N4u9U1u11q18.","23.3n3N5u7U1u1.7q22.","23.3n2N7u6U1u3.2q25.","23.3n2N9u4U1u30.","23.4n1N3u2U5u4U30.","24.4n3u1U2u1U4u4U29.","25.2n1u3q2u3U4u1U3K28.","27.3q3u4U3u5K27.","27.3q3u5U2u5K27.","28.6u5U1u5K27.","28.6u6U4K28.","28.1q6u5U1u1.1K29.","28.2q5u6U31.","28.2q6u5U31.","27.2q7u6U30.","27.2q8u5U30.","26.2q10u5U29.","26.2q5u1q4u5U29.","25.2q5u2q1.4u5U28.","25.2q5u1q3.3u5U28.","24.3q4u2q3.4u5U27.","24.2q5u1q5.3u5U27.","23.3q4u2q5.4u4U1u26.","23.2q5u1q7.3u5U26.","22.3q4u2q7.4u4U1u25.","22.2q5u1q9.4u4U25.","22.2q4u2q9.6u2U25.","21.2q4u2q11.4u4U24.","20.2q5u1q13.3u4U24.","20.2q4u2q13.3u4U24.","19.2q4u2q15.3u3U1u23.","18.2q4u3q15.3u3U1u23.","17.2q5u2q16.3u4U23.","17.1q5u2q17.3u4U23.","16.2q4u2q18.3u4U23.","15.2q4u2q20.3u3U23.","14.2q4u2q21.3u3U23.","14.1q4u2q22.3u3U1u22.","13.1q5u2q22.3u4U22.","12.2q4u2q24.2u4U22.","11.2q4u2q25.3u3U22.","11.1q4u2q26.3u3U22.","10.1q4u2q27.3u3U22.","9.2q3u2q28.3u3U22.","8.5m1u1q30.2u4U21.","8.6m1q30.3u3U21.","8.7m30.3u3U21.","8.8m29.3u3U1.5V15.","9.8m29.1u10V15.","11.7m28.12V14.","12.6m28.11V15.","14.3m29.10V16.","47.5V20.","72.","72.","72.","72.","72.","72.","72."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n5u8U1u26.","25.3n4N4u5U1u3U1u26.","25.2n4N4u5U2u3U27.","25.2n4N4u4U2u3U2u12.4k10.","25.2n4N3u4U2u4U3u10.1u4k1u9.","25.2n4N2u4U2u5U3u7.1q2u6k9.","25.2n3N2u4U2u6U4u4.5u6k9.","24.3n3N1u4U2u6U1u1q4u1q8u4k10.","24.3n2N1u5U1u7U1u2q1u1q8u4q12.","24.2n2N2u4U2u7U1u3q7u4q14.","24.2n2N2u4U1u8U1.3q5u4q16.","24.2n1N3u12U1u1.4q2u4q18.","24.2n2N3u11U1u2.7q20.","24.2n2N4u10U1u3.4q22.","23.3n3N3u9U1u30.","23.3n2N5u8U1u30.","23.3n2N6u7U1u30.","23.4n1N7u6U1u30.","24.4n3u1U3u5U1u31.","25.2n1u3q5u1U2K1U2q30.","27.3q3u1U2u4K2q30.","27.3q3u1U1u5K1q31.","28.6u1U5K32.","28.7u1U4K1U31.","27.2q7u1U2K3U30.","26.3q7u7U29.","26.2q9u6U29.","25.2q6u1q4u6U28.","24.2q6u2q1.4u6U27.","2u22.2q5u3q1.5u5U27.","2m3u18.2q5u3q3.5u5U26.","2m5u15.2q6u2q5.4u6U25.","2m8u11.2q6u2q7.4u6U24.","2m2q9u8.2q5u2q9.4u5U24.","2m4q10u4.2q5u2q11.4u5U23.","1m8q10u2q5u3q11.5u5U22.","1m2.9q13u3q13.5u1U4u21.","6.8q11u2q15.6u3U21.","8.9q6u3q17.5u4U20.","11.9q3u2q19.4u4U20.","13.11q21.4u4U19.","16.7q23.3u4U19.","18.4q24.4u4U18.","47.3u4U18.","47.4u3U18.","48.3u4U17.","48.4u3U17.","49.3u4U16.","49.4u3U16.","50.3u4U15.","50.4u3U15.","51.3u4U14.","51.4u3U14.","52.3u4U13.","53.3u3U4.2V7.","53.3u4U1.5V6.","54.3u1U8V6.","54.2u10V6.","55.1u9V7.","55.1u7V9.","56.5V11.","57.3V12.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U2u7U1u26.","25.3n4N5u4U1u3U1u26.","25.2n4N6u3U2u3U27.","25.2n4N5u4U1u3U1u27.","25.2n4N5u3U2u3U1u27.","25.2n4N4u4U1u4U1u27.","25.2n3N4u4U1u5U2u26.","24.3n3N4u4U1u4U3u11.3k1u11.","24.3n3N3u4U1u5U4u5.4u5k11.","24.2n4N3u3U2u5U13u5k11.","24.2n3N3u4U1u6U2q11u5k11.","24.2n3N3u4U1u5U1u2q9u2q5k11.","24.2n3N3u10U1u2q5u8q14.","24.2n3N4u9U1u11q18.","23.3n3N5u7U1u1.7q22.","23.3n2N7u6U1u3.2q25.","23.3n2N9u4U1u30.","23.4n1N3u2U5u4U30.","24.4n3u1U2u1U4u4U29.","25.2n1u3q2u3U4u1U3K28.","27.3q3u4U3u5K27.","27.3q3u5U2u5K27.","28.6u5U1u5K27.","8.3m1u16.6u6U4K28.","7.5m1u15.1q6u5U1u1.1K29.","6.6m2u14.2q5u6U31.","5.7m3u13.2q6u5U31.","4.7m1q4u11.2q7u6U30.","3.7m2q5u10.2q8u5U30.","3.6m4q5u8.2q10u5U29.","3.5m2.4q4u8.2q5u1q4u5U29.","3.3m5.4q4u6.2q5u2q1.4u5U28.","12.4q4u5.2q5u1q3.3u5U28.","13.4q4u3.3q4u2q3.4u5U27.","14.4q4u2.2q5u1q5.3u5U27.","14.4q5u3q4u2q5.4u4U1u26.","15.4q5u1q5u1q7.3u5U26.","16.4q9u2q7.4u4U1u25.","17.4q8u1q9.4u4U25.","18.4q6u2q9.6u2U25.","18.5q4u2q11.4u4U24.","19.5q3u1q13.3u4U24.","20.8q13.3u4U24.","21.6q15.3u3U1u23.","22.5q15.3u4U23.","42.3u4U23.","43.3u3U23.","43.3u3U1u22.","43.3u4U22.","43.3u4U22.","44.3u3U22.","44.3u3U1u21.","44.3u4U21.","45.3u3U21.","45.3u3U21.","45.3u3U21.","46.2u4U20.","46.3u3U20.","46.3u3U20.","46.3u3U3.3V14.","47.3u1U8V13.","47.2u10V13.","47.1u11V13.","48.10V14.","48.7V17.","49.3V20.","72.","72.","72.","72.","72.","72.","72."],["72.","72.","72.","72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U2u7U1u26.","25.3n4N3u1U2u7U1u26.","25.2n4N4u1U2u7U27.","25.2n4N4u1U2u6U1u27.","25.2n4N3u2U3u5U1u27.","25.2n4N3u2U3u5U1u27.","25.2n3N4u2U3u5U28.","24.3n3N4u2U3u4U1u28.","24.3n3N3u3U3u4U1u28.","24.2n4N3u3U3u4U1u28.","24.2n3N4u3U3u4U29.","24.2n3N4u3U3u3U1u29.","24.2n3N3u4U2u7U27.","24.2n3N3u4U2u10U24.","23.3n3N3u4U3u12U21.","23.3n2N4u4U6u9U2K1U18.","23.3n2N4u5U10u3U4K18.","23.4n1N3u2U3u4U9u6K17.","24.4n3u1U2u6U1u3.5u6K17.","25.2n1u3q2u5U4q6.2u4K18.","27.3q3u5U1u3q9.1K20.","27.3q3u5U1u2q31.","28.5u5U2u32.","28.5u5U2u32.","29.4u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.3u4U34.","31.3u4U34.","31.3u3U1u34.","31.3u3U1u34.","31.4u2U1u34.","24.2q8u3U1u34.","18.16u3U1u34.","12.1m20u4U1u34.","10.1q4m15u1q2u4U1u34.","10.5m5u11q2u4U1u34.","10.5m15q3u3U1u35.","10.5m13q2.3u3U1u35.","11.4m15.2u4U1u35.","11.5m14.2u4U1u35.","11.5m14.2u4U36.","11.5m14.2u3U1u36.","11.5m13.3u3U1u36.","11.4m14.2u4U1u36.","12.3m14.2u4U37.","29.2u3U1u37.","29.2u3U1u37.","29.2u3U1u37.","28.2u4U38.","28.2u3U1u38.","28.2u3U1u38.","28.2u3U1u38.","28.1u2V2U39.","27.1u7V37.","27.11V34.","27.12V33.","28.11V33.","29.1u8V34.","36.1V35."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U3u6U1u26.","25.3n4N3u1U3u6U1u26.","25.2n4N4u2U3u5U27.","25.2n4N4u2U3u4U1u27.","25.2n4N3u4U3u4U27.","25.2n4N3u4U4u3U27.","25.2n3N4u5U3u4U26.","24.3n3N4u5U4u3U11.3K1U11.","24.3n3N3u7U3u4U5.4U5K11.","24.2n4N3u8U3u12U5K11.","24.2n3N4u8U4u11U5K11.","24.2n3N4u9U3u9U2u5K11.","24.2n3N3u10U3u5U8u14.","24.2n3N3u10U12u18.","23.3n3N3u9U1u1.7u22.","23.3n2N4u9U1u3.2u25.","23.3n2N4u9U1u30.","23.4n1N3u2U3u5U1u30.","24.4n3u1U2u6U3u29.","25.2n1u3q2u5U4q2k28.","27.3q3u5U1u3q3k27.","27.3q2u6U1u2q4k27.","28.4u5U3u5k27.","28.3u6U3u4k28.","28.3u5U4u1q1.1k29.","28.2u6U5u31.","28.2u5U6u31.","27.2u6U7u30.","27.2u5U2u1q5u30.","26.2u6U1u3q5u29.","26.2u5U2u3q5u29.","25.2u5U2u1.4q5u28.","25.2u5U1u3.3q5u28.","24.3u4U2u3.4q5u27.","24.2u5U1u5.3q5u27.","23.3u4U2u5.4q4u1q26.","23.2u5U1u7.3q5u26.","22.3u4U2u7.4q4u1q25.","22.2u5U1u9.4q4u25.","22.2u4U2u9.6q2u25.","21.2u4U2u11.4q4u24.","20.2u5U1u13.3q4u24.","20.2u4U2u13.3q4u24.","19.2u4U2u15.3q3u1q23.","18.2u4U3u15.3q3u1q23.","17.2u5U2u16.3q4u23.","17.1u5U2u17.3q4u23.","16.2u4U2u18.3q4u23.","15.2u4U2u20.3q3u23.","14.2u4U2u21.3q3u23.","14.1u4U2u22.3q3u1q22.","13.1u5U2u22.3q4u22.","12.2u4U2u24.2q4u22.","11.2u4U2u25.3q3u22.","11.1u4U2u26.3q3u22.","10.1u4U2u27.3q3u22.","9.2u3U2u28.3q3u22.","8.5V1U1u30.2q4u21.","8.6V1u30.3q3u21.","8.7V30.3q3u21.","8.8V29.3q3u1.5m15.","9.8V29.1q10m15.","11.7V28.12m14.","12.6V28.11m15.","14.3V29.10m16.","47.5m20.","72.","72.","72.","72.","72.","72.","72."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U3u6U1u26.","25.3n4N3u1U4u5U1u26.","25.2n4N4u2U4u4U27.","25.2n4N4u2U4u5U12.4K10.","25.2n4N3u4U4u5U10.1U4K1U9.","25.2n4N3u5U4u4U7.1u2U6K9.","25.2n3N4u6U4u4U4.5U6K9.","24.3n3N4u7U4u4U1u8U4K10.","24.3n3N3u9U4u1U1u8U4u12.","24.2n4N3u10U4u7U4u14.","24.2n3N4u10U1.3u5U4u16.","24.2n3N4u9U1u1.4u2U4u18.","24.2n3N3u10U1u2.7u20.","24.2n3N3u10U1u3.4u22.","23.3n3N3u9U1u30.","23.3n2N4u9U1u30.","23.3n2N4u9U1u30.","23.4n1N3u2U3u5U1u30.","24.4n3u1U2u6U1u31.","25.2n1u3q2u5U4q30.","27.3q2u6U1u3q30.","27.2q2u7U1u2q31.","28.3u6U3u32.","28.2u6U5u31.","27.2u7U6u30.","26.3u6U8u29.","26.2u6U9u29.","25.2u6U2u3q6u28.","24.2u6U2u1.4q6u27.","2U22.2u5U3u1.5q5u27.","2V3U18.2u5U3u3.5q5u26.","2V5U15.2u6U2u5.4q6u25.","2V8U11.2u6U2u7.4q6u24.","2V2u9U8.2u5U2u9.4q5u24.","2V4u10U4.2u5U2u11.4q5u23.","1V8u10U2u5U3u11.5q5u22.","1V2.9u13U3u13.5q1u4q21.","6.8u11U2u15.6q3u21.","8.9u6U3u17.5q4u20.","11.9u3U2u19.4q4u20.","13.11u21.4q4u19.","16.7u23.3q4u19.","18.4u24.4q4u18.","47.3q4u18.","47.4q3u18.","48.3q4u17.","48.4q3u17.","49.3q4u16.","49.4q3u16.","50.3q4u15.","50.4q3u15.","51.3q4u14.","51.4q3u14.","52.3q4u13.","53.3q3u4.2m7.","53.3q4u1.5m6.","54.3q1u8m6.","54.2q10m6.","55.1q9m7.","55.1q7m9.","56.5m11.","57.3m12.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72."],["72.","72.","72.","72.","37.7A28.","36.9A1K26.","35.11A1K25.","34.12A2K24.","34.13A1K24.","34.13A2K23.","33.10A6K23.","33.10A6K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A2K3E1K23.","34.9A6K23.","34.1u6A2k5K24.","33.3u4A4k4K24.","33.4u1U1A5k1K3k24.","33.3u3U5k1K3k24.","33.3u2U5k2U3k24.","32.4u1U2u3U1k3U26.","27.4n1.6u7U1u26.","26.3n2N1n3u1U3u6U1u26.","25.3n4N3u1U3u6U1u26.","25.2n4N4u2U3u5U27.","25.2n4N4u2U3u4U1u27.","25.2n4N3u4U3u4U27.","25.2n4N3u4U4u3U27.","25.2n3N4u5U3u4U26.","24.3n3N4u5U4u3U11.3K1U11.","24.3n3N3u7U3u4U5.4U5K11.","24.2n4N3u8U3u12U5K11.","24.2n3N4u8U4u11U5K11.","24.2n3N4u9U3u9U2u5K11.","24.2n3N3u10U3u5U8u14.","24.2n3N3u10U12u18.","23.3n3N3u9U1u1.7u22.","23.3n2N4u9U1u3.2u25.","23.3n2N4u9U1u30.","23.4n1N3u2U3u5U1u30.","24.4n3u1U2u6U3u29.","25.2n1u3q2u5U4q2k28.","27.3q3u5U1u3q3k27.","27.3q2u6U1u2q4k27.","28.4u5U3u5k27.","8.3V1U16.3u6U3u4k28.","7.5V1U15.3u5U4u1q1.1k29.","6.6V2U14.2u6U5u31.","5.7V3U13.2u5U6u31.","4.7V1u4U11.2u6U7u30.","3.7V2u5U10.2u5U2u1q5u30.","3.6V4u5U8.2u6U1u3q5u29.","3.5V2.4u4U8.2u5U2u3q5u29.","3.3V5.4u4U6.2u5U2u1.4q5u28.","12.4u4U5.2u5U1u3.3q5u28.","13.4u4U3.3u4U2u3.4q5u27.","14.4u4U2.2u5U1u5.3q5u27.","14.4u5U3u4U2u5.4q4u1q26.","15.4u5U1u5U1u7.3q5u26.","16.4u9U2u7.4q4u1q25.","17.4u8U1u9.4q4u25.","18.4u6U2u9.6q2u25.","18.5u4U2u11.4q4u24.","19.5u3U1u13.3q4u24.","20.8u13.3q4u24.","21.6u15.3q3u1q23.","22.5u15.3q4u23.","42.3q4u23.","43.3q3u23.","43.3q3u1q22.","43.3q4u22.","43.3q4u22.","44.3q3u22.","44.3q3u1q21.","44.3q4u21.","45.3q3u21.","45.3q3u21.","45.3q3u21.","46.2q4u20.","46.3q3u20.","46.3q3u20.","46.3q3u3.3m14.","47.3q1u8m13.","47.2q10m13.","47.1q11m13.","48.10m14.","48.7m17.","49.3m20.","72.","72.","72.","72.","72.","72.","72."]],"climb":[["72.","72.","72.","72.","72.","72.","72.","72.","24.4K16.4K1U23.","23.5K16.5K23.","23.5K16.5K23.","23.5K16.5K23.","23.1u4K5.6A5.4K2U22.","22.2u3U1u4.8A4.3u3U22.","22.2u3U4.10A4.2u3U22.","22.2u3U3.12A3.2u4U21.","22.1u4U3.12A3.2u4U21.","21.2u3U1u2.14A2.3u3U21.","21.2u3U3.14A3.2u3U21.","21.1u4U3.14A3.2u4U20.","20.2u4U3.14A3.2u4U20.","20.2u4U3.14A3.3u3U20.","20.2u3U1u4.12A4.3u4U19.","20.1u4U5.12A5.2u4U19.","19.3u4U4.1u2A6k2A1u4.4u2U1u19.","19.6u2U2.3u1A6k1A3u2.8u19.","20.4u4U1.3u1U6k1U3u1.2u2U4u20.","21.4u3U3u2U6k2U4u4U2u21.","22.3u3U3u2U6k2U3u5U1u22.","22.4u2U2u3U6k3U2u4U2u22.","23.4u1U2u15N2U2u23.","24.6u15N1U2u24.","25.5u15N1U1u25.","25.5u15N2u25.","26.4u15N1u26.","27.3u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15n27.","28.2u15n27.","28.2u15n27.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","28.14u2U28.","27.3u1U10u3U1u27.","27.3u3U6u5U1u27.","27.3u5U4u5U1u27.","27.3u5U2.2u5U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U4.2u5U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.3u3U1u4.4u3U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27."],["44.5K23.","44.5K23.","44.4K1U23.","44.1u2K3U22.","44.3u3U22.","45.2u3U22.","45.2u3U22.","45.2u3U22.","45.2u4U21.","45.2u4U21.","45.3u3U21.","46.2u3U21.","33.6A7.2u3U21.","32.8A6.2u4U20.","31.10A5.2u4U20.","30.12A4.3u3U20.","30.12A4.3u3U20.","25.2K1U1.14A4.2u3U20.","24.4K1.14A4.2u4U19.","23.5K1.14A4.2u3U1u19.","23.5K1.14A3.7u19.","23.5K1.14A3.6u20.","22.2u1U2K1u2.12A3.2u2U3u20.","22.1u4U3.12A3.1u4U1u21.","21.2u3U1u3.1u2A6k2A1u2.2u4U1u21.","21.1u4U1u2.3u1A6k1A5u4U1u22.","20.2u4U3.3u1U6k1U5u4U1u22.","20.2u3U1u2.3u2U6k2U3u4U1u23.","19.3u3U1u2U3u2U6k2U3u4U1u23.","19.3u2U1u3U2u3U6k3U2u3U1u24.","20.5u3U2u15N2U1u24.","20.6u2U2u15N1U1u25.","22.8u15N1U1u25.","24.6u15N1u26.","26.4u15N1u26.","27.3u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15n27.","28.2u15n27.","28.2u15n27.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","28.14u2U1u27.","28.2u1U10u3U1u27.","28.2u3U7u4U1u27.","27.3u5U1u1.3u4U1u27.","27.3u5U1u1.3u4U1u27.","27.3u5U1u1.3u5U27.","27.3u5U1u2.5u2U27.","27.3u5U3.4u3U27.","27.3u5U3.3u4U27.","27.3u4U1u3.3u4U27.","27.3u4U1u4.2u4U27.","27.3u4U1u4.2u4U27.","27.3u4U1u4.2u4U27.","27.3u4U1u4.2u4U27.","27.3u4U1u4.2u4U27.","27.3u4U1u4.2u4U27.","27.3u4U5.2u4U27.","27.3u4U5.2u4U27.","27.3u4U5.2u4U27.","27.2u4U1u5.2u4U27.","27.2u4U1u5.2u3U1u27.","27.2u4U1u5.2u3U1u27.","27.2u4U1u5.2u3U1u27.","27.4u2U1u5.2u3U1u27.","27.2u4U1u5.2u3U1u27.","27.2u4U1u5.2u3U1u27.","27.2u4U6.2u3U1u27.","27.2u4U3.9V27.","27.2u4U3.9V27.","27.2u4U3.9V27.","27.2u4U3.9V27.","27.2u4U3.9V27.","27.3u3U3.9V27.","27.3u3U39.","27.3u3U39.","27.3u3U39.","27.3u3U39.","27.3u3U39.","27.3u3U39."],["72.","72.","72.","72.","72.","72.","72.","72.","24.4K16.4K1U23.","23.5K16.5K23.","23.5K16.5K23.","23.5K16.5K23.","23.1u4K5.6A5.4K2U22.","22.2u3U1u4.8A4.3u3U22.","22.2u3U4.10A4.2u3U22.","22.2u3U3.12A3.2u4U21.","22.1u4U3.12A3.2u4U21.","21.2u3U1u2.14A2.3u3U21.","21.2u3U3.14A3.2u3U21.","21.1u4U3.14A3.2u4U20.","20.2u4U3.14A3.2u4U20.","20.2u4U3.14A3.3u3U20.","20.2u3U1u4.12A4.3u4U19.","20.1u4U5.12A5.2u4U19.","19.3u4U4.1u2A6k2A1u4.4u2U1u19.","19.6u2U2.3u1A6k1A3u2.8u19.","20.4u4U1.3u1U6k1U3u1.2u2U4u20.","21.4u3U3u2U6k2U4u4U2u21.","22.3u3U3u2U6k2U3u5U1u22.","22.4u2U2u3U6k3U2u4U2u22.","23.4u1U2u15N2U2u23.","24.6u15N1U2u24.","25.5u15N1U1u25.","25.5u15N2u25.","26.4u15N1u26.","27.3u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15n27.","28.2u15n27.","28.2u15n27.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","28.14u2U28.","27.3u1U10u3U1u27.","27.3u3U6u5U1u27.","27.3u5U4u5U1u27.","27.3u5U2.2u5U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U1u2.3u4U1u27.","27.3u4U4.2u5U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.3u3U1u4.4u3U27.","27.2u4U1u4.3u4U27.","27.2u4U1u4.3u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.2u4U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u4U27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.3u3U6.2u3U1u27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27."],["23.5K44.","23.5K44.","23.1u4K44.","23.2u2K1U44.","23.1u4U44.","22.2u3U45.","22.2u3U45.","22.2u3U45.","22.1u4U45.","21.2u4U45.","21.2u3U1u45.","21.2u3U46.","21.2u3U7.6A33.","21.1u4U6.8A32.","20.2u4U5.10A31.","20.2u4U4.12A30.","20.2u3U1u4.12A30.","20.2u3U4.14A2.2K1U24.","20.1u4U4.14A1.4K1U23.","19.3u4U3.14A1.5K23.","19.6u1U3.14A1.5K1U22.","20.4u3U2.14A1.5K1U22.","20.4u3U3.12A2.1u2K3U22.","21.3u4U2.12A3.2u4U21.","21.4u3U2.1u2A6k2A1u3.3u3U21.","22.3u4U3u1A6k1A3u2.3u4U20.","22.3u4U3u1U6k1U3u3.2u4U20.","23.3u2U3u2U6k2U3u2.3u4U19.","23.3u2U3u2U6k2U3u1.4u4U19.","24.3u1U2u3U6k3U2u3U3u2U1u19.","24.3u1U2u15N2U5u20.","25.5u15N3U4u20.","25.5u15N1U4u22.","26.4u15N3u24.","26.4u15N1u26.","27.3u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15N27.","28.2u15n27.","28.2u15n27.","28.2u15n27.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","27.15u2U28.","27.3u1U10u3U28.","27.3u3U6u5U28.","27.3u4U1u1.3u5U1u27.","27.3u4U1u1.3u5U1u27.","27.3u4U1u1.3u5U1u27.","27.4u2U1u2.3u5U1u27.","27.3u3U1u3.2u5U1u27.","27.2u4U1u3.3u4U1u27.","27.2u4U1u3.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U4.3u4U1u27.","27.2u4U5.2u4U1u27.","27.3u3U5.2u5U27.","27.3u3U5.3u4U27.","27.3u3U5.3u4U27.","27.3u3U5.3u4U27.","27.3u3U5.3u4U27.","27.3u3U5.3u4U27.","27.3u3U5.5u2U27.","27.3u3U5.3u4U27.","27.3u3U5.3u4U27.","27.3u3U6.2u4U27.","27.9V3.2u4U27.","27.9V3.2u4U27.","27.9V3.2u4U27.","27.9V3.2u4U27.","27.9V3.2u4U27.","27.9V3.2u4U27.","39.2u4U27.","39.2u4U27.","39.2u3U1u27.","39.2u3U1u27.","39.2u3U1u27.","39.2u3U1u27."]],"hang":[["35.3k6K28.","35.1q2k1u4K29.","35.1q3u1U2K1U29.","34.2q3u3U1u29.","34.2q3u3U30.","34.2q2u4U30.","33.3A2u4U30.","31.5A2u3U1u30.","30.6A2u3U31.","29.6A2u4U1K30.","29.6A2u4U2K29.","29.6A2u3U1u1A1K29.","28.7A2u3U4K28.","28.6A6u4K28.","28.6A6u4K28.","28.6A2u1U1u1U1u2K3E27.","29.4A2u4U3K3E27.","29.4A2u4U3K3E27.","29.1u3A2u3U1u4K29.","28.2u3A2u3U1u4K29.","28.6u4U1u3K30.","28.3u1U2u4U4k30.","28.3u1U2u3U1u1U3k30.","28.5u4U1u1U3k30.","28.5u4U1u2U1u31.","21.5n2.5u7U1u31.","20.3n4N1.9u3U1u31.","20.2n5N1.9u3U1u31.","20.2n6N3u1U4u4U1u31.","20.2n5N1.3u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n5N1n4u9U1u31.","19.2n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.2n6N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n4N1n1.4u9U1u31.","18.7n2.4u2U3u4U1u31.","19.6n2.4u1U2u6U1u31.","21.2n4.1u3q2u5U4q30.","27.3q3u5U1u3q30.","27.3q3u5U1u2q31.","28.5u5U2u32.","28.5u5U2u32.","29.4u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.3u4U34.","31.3u4U34.","31.3u3U1u34.","31.3u3U1u34.","31.4u2U1u34.","31.3u3U1u34.","31.3u3U1u34.","31.2u4U1u34.","31.2u4U1u34.","30.2u4U1u35.","30.2u4U1u35.","30.2u3U2u35.","29.2u4U1u36.","29.2u4U1u36.","29.2u3U1u37.","28.2u4U1u37.","28.2u4U1u37.","28.2u3U1u38.","27.2u4U1u38.","27.2u3U1u39.","27.2u3U1u39.","26.2u4U1u39.","26.2u3U1u40.","26.2u3U1u40.","25.2u4U41.","25.2u3U1u41.","25.5V1u41.","24.1u7V40.","24.11V37.","25.10V37.","26.9V37.","29.6V37.","33.1V38."],["31.1q4k1u5.5K25.","31.2q2k2u5.5K25.","31.2q4u4.1u5K25.","31.2q4u4.1u1U3K26.","31.2q4u3.2u3U1u26.","31.2q4u3.1u4U27.","31.2q5A1.2u3U1u27.","31.8A1u4U1u27.","30.8A2u4U28.","29.9A2u3U1u28.","29.8A2u4U29.","29.8A2u3U1u29.","28.9A2u3U1u1K28.","28.8A3u2U1u2K28.","28.8A6u2K28.","28.7A7u3E27.","29.6A2u3U1u1K3E27.","29.5A2u4U1u1K3E27.","29.1u4A2u3U1u3K29.","28.2u3A2u4U1u3K29.","28.4u1A2u4U1u2K30.","28.3u2U1u4U1u3k30.","28.3u1U2u4U1u3k30.","28.3u1U2u3U1u1U3k30.","28.5u4U1u2U1u31.","21.5n2.5u4U1u2U1u31.","20.3n4N1.9u3U1u31.","20.2n5N1.9u3U1u31.","20.2n6N3u1U4u4U1u31.","20.2n5N1.3u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n5N1n4u9U1u31.","19.2n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.2n6N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n4N1n1.4u9U1u31.","18.7n2.4u2U3u4U1u31.","19.6n2.4u1U2u6U1u31.","21.2n4.1u3q2u5U4q30.","27.3q3u5U1u3q30.","27.3q3u6U2q31.","28.5u6U1u32.","28.6u5U1u32.","29.5u5U1u32.","29.1q4u6U32.","29.2q4u5U32.","29.2q4u5U32.","28.3q4u5U1u31.","28.3q5u5U31.","28.2q6u5U31.","28.2q6u5U31.","27.3q7u4U1u30.","27.3q7u5U30.","27.2q8u5U30.","27.2q4u1q4u4U30.","26.3q4u1q1.3u4U1u29.","26.3q4u1q1.3u5U29.","26.2q4u2q1.4u4U29.","26.2q4u1q3.3u4U29.","25.4q3u1q3.5u2U1u28.","25.3q3u2q3.4u3U1u28.","25.2q4u1q5.3u4U28.","24.2q5u1q5.3u4U28.","23.2q5u2q5.3u3U1u28.","23.2q4u2q6.3u3U1u28.","22.2q4u2q7.3u3U1u28.","21.2q5u2q7.3u3U1u28.","21.2q4u2q8.3u3U1u28.","20.2q4u2q9.3u3U1u28.","19.2q4u2q10.3u3U1u28.","19.2q4u1q11.3u3U29.","18.2q4u2q11.2u4U29.","17.2q4u2q12.2u4U29.","17.1q4u2q13.2u4U29.","16.2q4u1q14.2u4U29.","15.2q4u2q14.2u3U1u29.","15.1q4u2q15.2u3U1u29.","14.2q3u2q16.2u3U1u29.","13.1q3m2u1q17.2u3U1u29.","13.5m1q18.2u3U30.","13.7m17.2u3U30.","13.8m16.2u3U30.","14.8m15.1u6V28.","16.7m14.11V24.","17.6m14.11V24.","19.4m14.11V24.","37.1u9V25.","72.","72."],["35.3k6K28.","35.1q2k1u4K29.","35.1q3u1U2K1U29.","34.2q3u3U1u29.","34.2q3u3U30.","34.2q2u4U30.","33.3A2u4U30.","31.5A2u3U1u30.","30.6A2u3U31.","29.6A2u4U1K30.","29.6A2u4U2K29.","29.6A2u3U1u1A1K29.","28.7A2u3U4K28.","28.6A6u4K28.","28.6A6u4K28.","28.6A2u1U1u1U1u2K3E27.","29.4A2u4U3K3E27.","29.4A2u4U3K3E27.","29.1u3A2u3U1u4K29.","28.2u3A2u3U1u4K29.","28.6u4U1u3K30.","28.3u1U2u4U4k30.","28.3u1U2u3U1u1U3k30.","28.5u4U1u1U3k30.","28.5u4U1u2U1u31.","21.5n2.5u7U1u31.","20.3n4N1.9u3U1u31.","20.2n5N1.9u3U1u31.","20.2n6N3u1U4u4U1u31.","20.2n5N1.3u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n5N1n4u9U1u31.","19.2n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.2n6N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n4N1n1.4u9U1u31.","18.7n2.4u2U3u4U1u31.","19.6n2.4u1U2u6U1u31.","21.2n4.1u3q2u5U4q30.","27.3q3u5U1u3q30.","27.3q3u5U1u2q31.","28.5u5U2u32.","28.5u5U2u32.","29.4u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","30.3u5U1u33.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.2u5U34.","31.3u4U34.","31.3u4U34.","31.3u3U1u34.","31.3u3U1u34.","31.4u2U1u34.","31.3u3U1u34.","31.3u3U1u34.","31.2u4U1u34.","31.2u4U1u34.","30.2u4U1u35.","30.2u4U1u35.","30.2u3U2u35.","29.2u4U1u36.","29.2u4U1u36.","29.2u3U1u37.","28.2u4U1u37.","28.2u4U1u37.","28.2u3U1u38.","27.2u4U1u38.","27.2u3U1u39.","27.2u3U1u39.","26.2u4U1u39.","26.2u3U1u40.","26.2u3U1u40.","25.2u4U41.","25.2u3U1u41.","25.5V1u41.","24.1u7V40.","24.11V37.","25.10V37.","26.9V37.","29.6V37.","33.1V38."],["35.5K4k28.","34.2u3K5k28.","34.2u3U1q3k29.","34.2u3U4u29.","34.2u3U3u1q29.","34.2u3U3u30.","33.1A1u4U3u30.","31.2A2u4U1K2u30.","30.3A2u4U1A1K1q30.","29.4A2u4U2A1K30.","29.4A2u3U1u2A2K29.","29.4A2u3U1u3A1K29.","28.5A3u2U6K28.","28.5A5u6K28.","28.4A6u6K28.","28.4A2u4U4K3E27.","29.3A2u4U4K3E27.","29.3A2u3U1u4K3E27.","29.1u2A2u3U1u5K29.","28.2u2A2u3U1u5K29.","28.6u3U1u1k3K30.","28.6u3U1u4k30.","28.5u4U1k1U3k30.","28.5u4U1k1U3k30.","28.5u7U1u31.","21.5n2.5u7U1u31.","20.3n4N1.9u3U1u31.","20.2n5N1.9u3U1u31.","20.2n6N3u1U4u4U1u31.","20.2n5N1.3u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.3n5N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n6N4u9U1u31.","19.2n5N1n4u9U1u31.","19.2n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.2n6N1.4u9U1u31.","18.3n5N1.4u9U1u31.","18.3n4N1n1.4u9U1u31.","18.7n2.4u2U3u4U1u31.","19.6n2.4u1U2u6U1u31.","21.2n4.1u3q2u5U4q30.","27.3q3u5U1u3q30.","27.3q2u6U1u2q31.","28.4u6U2u32.","28.4u5U3u32.","29.3u5U2u1q32.","29.3u5U3u32.","29.2u5U4u32.","29.2u5U4u32.","28.3u5U4u1q31.","28.3u4U6u31.","28.2u5U6u31.","28.2u5U6u31.","27.3u4U2u1q4u1q30.","27.3u4U1u2q5u30.","27.2u5U1u2q5u30.","27.2u4U2u3q4u30.","26.3u4U1u1.3q4u1q29.","26.3u4U1u1.3q5u29.","26.2u4U2u1.4q4u29.","26.2u4U1u3.3q4u29.","25.4u3U1u3.5q2u1q28.","25.3u3U2u3.4q3u1q28.","25.2u4U1u5.3q4u28.","24.2u5U1u5.3q4u28.","23.2u5U2u5.3q3u1q28.","23.2u4U2u6.3q3u1q28.","22.2u4U2u7.3q3u1q28.","21.2u5U2u7.3q3u1q28.","21.2u4U2u8.3q3u1q28.","20.2u4U2u9.3q3u1q28.","19.2u4U2u10.3q3u1q28.","19.2u4U1u11.3q3u29.","18.2u4U2u11.2q4u29.","17.2u4U2u12.2q4u29.","17.1u4U2u13.2q4u29.","16.2u4U1u14.2q4u29.","15.2u4U2u14.2q3u1q29.","15.1u4U2u15.2q3u1q29.","14.2u3U2u16.2q3u1q29.","13.1u3V2U1u17.2q3u1q29.","13.5V1u18.2q3u30.","13.7V17.2q3u30.","13.8V16.2q3u30.","14.8V15.1q6m28.","16.7V14.11m24.","17.6V14.11m24.","19.4V14.11m24.","37.1q9m25.","72.","72."]],"idle":[["72.","72.","72.","72.","72.","72.","34.4A34.","32.8A1K31.","31.10A1K30.","30.12A1K29.","30.12A2K28.","29.14A1K28.","29.10A6K27.","29.10A6K27.","29.10A6K27.","29.10A3K3E27.","30.9A3K3E27.","30.9A3K3E27.","30.9A5K28.","29.2u5A3k5K28.","29.3u3A5k3K29.","29.3u3U7k30.","28.4u2U8k30.","28.4u1U2u2U1k1U3k30.","28.6u7U1u30.","22.5n1.6u7U1u30.","21.3n4N6u7U1u30.","21.2n5N6u7U1u30.","21.2n5N7u6U1u30.","21.2n5N7u6U1u30.","20.3n5N3u1U3u6U1u30.","20.3n5N3u1U3u3U1u2U1u30.","20.2n6N3u2U2u6U1u30.","20.2n6N3u2U2u6U31.","20.2n6N3u2U3u5U31.","20.2n5N1n3u2U3u5U31.","20.2n5N1.3u2U3u5U31.","19.3n5N1.3u2U3u4U1u31.","19.3n5N1.3u3U2u4U1u31.","19.2n6N1.3u3U2u4U1u31.","19.2n6N1.3u3U3u3U1u31.","19.2n5N1n1.3u3U3u4U31.","19.3n4N1n4u4U2u4U31.","19.7n1.4u2U5u3U31.","20.6n1.4u1U2u1U3u3U31.","22.2n3.1u3q2u3U2u4U30.","27.3q3u3U3u3U30.","27.3q3u3U3u3U30.","28.5u4U2u4U29.","28.5u4U3u3U29.","29.4u5U1u1K8M24.","30.3u5U1K9M3m21.","30.1q2u5U1K9M3m21.","30.1q2u5U1K9M3m21.","30.1q3u4U1u3K30.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.1q3u4U1u33.","30.2q2u4U1u33.","30.2q3u3U1u33.","30.2q3u3U1u33.","30.2q3u4U33.","30.2q4u3U33.","30.2q3u3U1u33.","30.2q3u4U33.","30.2q3u4U33.","30.2q3u4U33.","30.2q3u3U1u33.","30.2q3u3U1u33.","30.2q3u3U1u33.","29.3q3u3U1u33.","29.3q3u3U1u33.","29.3q3u3U1u33.","29.3q3u3U1u33.","29.3q3u3U1u33.","29.3q3u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U1u33.","29.2q4u3U34.","28.1q4m1u10V28.","28.1q4m11V28.","28.5m12V27.","29.4m11V28.","30.4m9V29.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","33.6A33.","31.10A31.","30.12A30.","29.14A29.","29.14A29.","29.14A29.","29.14A29.","29.1A12K1A29.","29.14K29.","29.14K29.","29.4K3E3K3E1K29.","30.3K3E3K3E30.","30.3K3E3K3E30.","30.1u2K6k2K1u30.","29.3u1K6k1K3u29.","29.3u1U6k1U3u29.","28.3u2U6k2U3u28.","28.3u2U6k2U3u28.","28.1u3O1U6k1U3O1u28.","26.3u3O8U3O1u2U26.","25.2u1U2u2O8U2O2u3U25.","25.2u1U2u2O8U2O2u3U25.","25.2u1U2u2O8U2O2u3U25.","25.2u1U2u2O8U2O2u3U25.","25.2u1U2u2O8U2O2u3U25.","24.3u1U2u2O8U2O2u3U1u24.","24.3u1U2u2O8U2O2u4U24.","24.2u2U2u3O6U3O2u4U24.","24.2u2U2u3O6U3O3u3U24.","24.2u2U2u3O6U3O3u3U24.","24.2u2U2u3O6U3O3u3U24.","24.2u2U2u1U2O6U2O1U4u2U24.","23.2u3U2u1U2O6U2O1U3u4U23.","23.2u3U2u1U1O8U1O1U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U2u12U3u4U23.","23.2u3U16q2u3U23.","23.2u2U18q1u3U23.","23.2u3U16q2u3U23.","23.1u3K1U3u10U4u3K1U23.","23.5K4u8U3u1U1K2M2K23.","23.5K6u4U5u1U4M1K23.","23.5K14u2U4M1K23.","24.4K13u3U4M24.","28.3u2U6u5U4M24.","28.3u4U4u5U4M24.","28.3u4U4u5U1.3M24.","28.3u4U4u5U1.4M23.","28.3u4U4u4U1u1.4M23.","28.3u4U4u4U1u1.4M23.","28.3u4U4u4U1u1.4M23.","28.3u4U4u4U1u2.2M24.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.3u3U1u28.","28.5u1U1u2.5u1U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27."]],"happy":[["33.6G33.","31.10G31.","30.12G30.","29.4G3Y7G29.","29.4G3Y7G29.","28.5G3Y8G28.","28.16G28.","28.16G28.","22.4K2.16G2.4K22.","21.6K2.4G3g3G3g1G2.6K21.","21.6K2.4G3g3G3g1G2.6K21.","21.6K3.3G3g3G3g3.6K21.","21.1u4K5.11G4.4K1U21.","21.2u3U7.9G4.2u3U21.","21.2u3U7.9G4.2u3U21.","21.2u3U5.5A3g2A5.2u4U20.","21.1u4U4.6A3g3A4.2u4U20.","20.2u4U3.7A3g4A3.2u4U20.","20.2u4U3.14A3.3u3U20.","20.2u3U1u3.14A3.3u3U20.","20.2u3U4.14A4.2u3U20.","20.2u3U4.1A12K1A4.2u3U20.","20.1u4U4.14K4.2u4U19.","19.3u3U4.14K4.2u4U19.","19.3u2U1u1U3.4K3E3K3E1K3.4u2U1u19.","20.5u1U4.3K3E3K3E4.6u20.","20.4u3U3.3K3E3K3E3.2u1U4u20.","21.3u3U3.1u2K6k2K1u3.2u3U1u21.","21.3u4U1.3u1K6k1K3u1.2u4U1u21.","22.3u4U3u1U6k1U3u1.1u4U1u22.","22.3u3U3u2U6k2U4u4U1u22.","23.3u2U3u2U6k2U3u4U1u23.","23.3u2U1u3O1U6k1U3O1u4U1u23.","24.3u1U1u3O8U3O1u3U1u24.","24.3u1U2u2O8U2O2u3U1u24.","25.5u2O8U2O2u2U1u25.","25.5u2O8U2O5u25.","26.4u2O8U2O4u26.","27.3u2O8U2O3u27.","28.2u2O8U2O2u28.","28.2u2O8U2O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U1O8U1O1U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","28.14u2U28.","28.13u3U28.","28.3u2U6u5U28.","28.3u4U4u5U28.","28.3u4U4u5U28.","28.3u4U4u5U28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.3u3U1u28.","28.5u1U1u2.5u1U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","27.18V27.","27.18V27.","27.18V27."],["29.4G3Y7G29.","29.4G3Y7G29.","28.5G3Y8G28.","28.16G28.","28.16G28.","22.4K2.16G2.4K22.","21.6K2.4G3g3G3g1G2.6K21.","21.6K2.4G3g3G3g1G2.6K21.","21.6K3.3G3g3G3g3.6K21.","21.1u4K5.11G4.4K1U21.","21.2u3U7.9G4.2u3U21.","21.2u3U7.9G4.2u3U21.","21.2u3U5.5A3g2A5.2u4U20.","21.1u4U4.6A3g3A4.2u4U20.","20.2u4U3.7A3g4A3.2u4U20.","20.2u4U3.14A3.3u3U20.","20.2u3U1u3.14A3.3u3U20.","20.2u3U4.14A4.2u3U20.","20.2u3U4.1A12K1A4.2u3U20.","20.1u4U4.14K4.2u4U19.","19.3u3U4.14K4.2u4U19.","19.3u2U1u1U3.4K3E3K3E1K3.4u2U1u19.","20.5u1U4.3K3E3K3E4.6u20.","20.4u3U3.3K3E3K3E3.2u1U4u20.","21.3u3U3.1u2K6k2K1u3.2u3U1u21.","21.3u4U1.3u1K6k1K3u1.2u4U1u21.","22.3u4U3u1U6k1U3u1.1u4U1u22.","22.3u3U3u2U6k2U4u4U1u22.","23.3u2U3u2U6k2U3u4U1u23.","23.3u2U1u3O1U6k1U3O1u4U1u23.","24.3u1U1u3O8U3O1u3U1u24.","24.3u1U2u2O8U2O2u3U1u24.","25.5u2O8U2O2u2U1u25.","25.5u2O8U2O5u25.","26.4u2O8U2O4u26.","27.3u2O8U2O3u27.","28.2u2O8U2O2u28.","28.2u2O8U2O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U1O8U1O1U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28.","28.14u2U28.","28.13u3U28.","28.3u2U6u5U28.","28.3u4U4u5U28.","28.3u4U4u5U28.","28.3u4U4u5U28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U4u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.2u4U1u28.","28.3u4U2.3u3U1u28.","28.5u1U1u2.5u1U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","28.3u3U1u2.3u3U1u28.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","29.2u3U4.2u3U29.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27.","27.18V27."]],"sleep":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","29.5A38.","27.9A1K35.","26.11A1K34.","26.11A2K33.","25.13A2K32.","25.13A2K32.","25.10A5K32.","25.10A6K31.","25.10A4K3E30.","25.10A4K3E30.","24.1u10A4K3E30.","24.2u9A5K32.","24.2u4A4k1A5K32.","24.3u2A1u2U3k4K33.","24.3u1U2u3U2k1K3k33.","18.4n2.6u4U1k1K3k33.","17.3n3N2.5u6U3k33.","16.3n5N1.6u7U34.","16.3n5N1.7u6U1u33.","16.3n5N1.3u1U4u5U1u33.","16.2n6N1.3u2U4u4U1u33.","16.2n6N1.4u2U4u4U33.","16.2n6N1.4u3U4u4U8.3U3K1U17.","16.2n5N2.4u3U5u4U1.8U5K17.","15.3n5N3.3u4U4u1U1u11U5K17.","15.3n5N3.3u5U5u11U5K17.","15.2n6N3.3u6U4u6U5u4K18.","15.2n6N3.4u6U14u3k19.","15.2n6N3.4u7U11u5k19.","15.2n6N3.4u8U3u7q5k3q3u13.","15.2n5N1n3.4u9U1u9q3k2u1q4u1q12.","15.2n5N5.3u9U1u3.3q5u3U2u4U12.","15.3n4N5.3u10U4u10U2u4U12.","15.7n5.4u2U3u18U2u4U12.","15.6n6.4u1U2u20U2u4U12.","17.3n7.1u3q2u19U5u3U12.","27.3q3u15U9u3U1u11.","27.3q3u10U14u3U1u11.","28.6u4U13u3.3u3U1u11.","28.19u7.3u3U1u11.","29.13u12.3u3U1u11.","30.8u16.3u3U1u11.","31.6u17.1q2u4U11.","54.1q2u4U11.","54.1q2u4U11.","55.3u3U11.","55.3u3U11.","55.3u3U11.","55.3u3U11.","55.3u3U11."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","30.3A39.","28.7A1K36.","27.9A2K34.","26.11A2K33.","25.13A1K33.","25.13A2K32.","25.10A5K32.","25.10A5K32.","24.1u10A6K31.","24.1u10A4K3E30.","24.1u5A3k2A4K3E30.","24.1u4A1u2U2k1A4K3E30.","24.2u2A2u3U1k1A5K32.","18.4n2.6u4U1k4K33.","17.3n3N2.5u5U4K33.","16.3n5N1.6u5U3k33.","16.3n5N1.7u5U2k33.","16.3n5N1.3u1U4u4U2k33.","16.2n6N1.3u2U4u4U1u33.","16.2n6N1.4u2U4u4U33.","16.2n6N1.4u3U4u4U8.3U3K1U17.","16.2n5N2.4u3U5u4U1.8U5K17.","15.3n5N3.3u4U4u1U1u11U5K17.","15.3n5N3.3u5U5u11U5K17.","15.2n6N3.3u6U4u6U5u4K18.","15.2n6N3.4u6U14u3k19.","15.2n6N3.4u7U11u5k19.","15.2n6N3.4u8U3u7q5k3q3u13.","15.2n5N1n3.4u9U1u9q3k2u1q4u1q12.","15.2n5N5.3u9U1u3.3q5u3U2u4U12.","15.3n4N5.3u10U4u10U2u4U12.","15.7n5.4u2U3u18U2u4U12.","15.6n6.4u1U2u20U2u4U12.","17.3n7.1u3q2u19U5u3U12.","27.3q3u15U9u3U1u11.","27.3q3u10U14u3U1u11.","28.6u4U13u3.3u3U1u11.","28.19u7.3u3U1u11.","29.13u12.3u3U1u11.","30.8u16.3u3U1u11.","31.6u17.1q2u4U11.","54.1q2u4U11.","54.1q2u4U11.","55.3u3U11.","55.3u3U11.","55.3u3U11.","55.3u3U11.","55.3u3U11."]],"stuck":[["72.","72.","22.4K20.4K22.","21.6K18.6K21.","21.6K18.6K21.","21.6K18.6K21.","21.1u4K20.4K1U21.","21.2u3U20.2u3U21.","21.2u3U7.6A7.2u3U21.","21.2u3U5.10A5.2u4U20.","21.1u4U4.12A4.2u4U20.","20.2u4U3.14A3.2u4U20.","20.2u4U3.14A3.3u3U20.","20.2u3U1u3.14A3.3u3U20.","20.2u3U4.14A4.2u3U20.","20.2u3U4.1A12K1A4.2u3U20.","20.1u4U4.14K4.2u4U19.","19.3u3U4.14K4.2u4U19.","19.3u2U1u1U3.4K3E3K3E1K3.4u2U1u19.","20.5u1U4.3K3E3K3E4.6u20.","20.4u3U3.3K3E3K3E3.2u1U4u20.","21.3u3U3.1u2K6k2K1u3.2u3U1u21.","21.3u4U1.3u1K6k1K3u1.2u4U1u21.","22.3u4U3u1U6k1U3u1.1u4U1u22.","22.3u3U3u2U6k2U4u4U1u22.","23.3u2U3u2U6k2U3u4U1u23.","23.3u2U1u3O1U6k1U3O1u4U1u23.","24.3u1U1u3O8U3O1u3U1u24.","24.3u1U2u2O8U2O2u3U1u24.","25.5u2O8U2O2u2U1u25.","25.5u2O8U2O5u25.","26.4u2O8U2O4u26.","27.3u2O8U2O3u27.","28.2u2O8U2O2u28.","28.2u2O8U2O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U1O8U1O1U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28."],["72.","72.","19.4K20.4K25.","18.6K18.6K24.","18.6K18.6K24.","18.6K18.6K24.","18.1u4K20.4K1U24.","18.2u3U20.2u3U24.","18.2u3U7.6A7.2u3U24.","18.2u3U5.10A5.2u4U23.","18.1u4U4.12A4.2u4U23.","17.2u4U3.14A3.2u4U23.","17.2u4U3.14A3.3u3U23.","17.2u3U1u3.14A3.3u3U23.","17.2u3U4.14A4.2u3U23.","20.2u3U4.1A12K1A4.2u3U20.","20.1u4U4.14K4.2u4U19.","19.3u3U4.14K4.2u4U19.","19.3u2U1u1U3.4K3E3K3E1K3.4u2U1u19.","20.5u1U4.3K3E3K3E4.6u20.","20.4u3U3.3K3E3K3E3.2u1U4u20.","21.3u3U3.1u2K6k2K1u3.2u3U1u21.","21.3u4U1.3u1K6k1K3u1.2u4U1u21.","22.3u4U3u1U6k1U3u1.1u4U1u22.","22.3u3U3u2U6k2U4u4U1u22.","23.3u2U3u2U6k2U3u4U1u23.","23.3u2U1u3O1U6k1U3O1u4U1u23.","24.3u1U1u3O8U3O1u3U1u24.","24.3u1U2u2O8U2O2u3U1u24.","25.5u2O8U2O2u2U1u25.","25.5u2O8U2O5u25.","26.4u2O8U2O4u26.","27.3u2O8U2O3u27.","28.2u2O8U2O2u28.","28.2u2O8U2O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u3O6U3O2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U2O6U2O1U2u28.","28.2u1U1O8U1O1U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.2u12U2u28.","28.16q28.","27.18q27.","28.16q28.","28.3u10U3u28.","28.4u8U3u1U28.","28.6u4U5u1U28."]],"dig":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","38.6A28.","37.9A26.","36.10A2K24.","35.12A2K23.","35.13A1K23.","35.13A2K22.","34.10A6K22.","34.10A6K22.","34.10A4K3E21.","35.9A4K3E21.","35.9A4K3E21.","35.9A6K22.","35.1u6A1k1A5K23.","34.3u4A4k4K23.","34.4u2A8k24.","34.3u3U8k24.","33.4u2U5k1U3k24.","33.4u1U2u3U1k3U25.","29.2n2.3u1U2u7U1u25.","27.6n3u1U3u6U1u25.","26.3n3N4u1U4u5U1u25.","26.2n4N4u1U5u5U25.","26.2n4N3u3U5u5U24.","26.2n3N4u5U4u5U23.","26.2n3N4u6U5u5U21.","25.3n3N3u8U5u5U20.","25.3n3N3u9U5u1U1u3U19.","25.2n3N4u10U6u4U18.","25.2n3N4u9U1u2.4u6U16.","25.2n3N3u10U1u3.4u6U15.","25.2n3N3u10U1u4.5u5U14.","25.2n2N4u9U1u6.5u5U13.","24.3n2N3u10U1u8.4u5U12.","24.3n2N3u10U1u9.4u5U11.","24.3n1N4u9U2u10.5u4U10.","24.3n1N4u9U3u11.4u3M1K9.","24.4n3u2U3u5U3u12.2u1K4M9.","25.3n3u1U2u6U5u12.1u1K5M8.","26.1n1u3q2u5U4q4u12.1K6M7.","27.3q3u6U4q4u12.1K6M6.","27.3q3u6U5q4u13.6M5.","28.6u5U1u1.3q4k15.6M3.","28.6u6U2.2q5k15.5M3.","29.6u5U3.6k16.4M3.","29.1q5u6U3.5k17.3m3.","29.2q5u5U3.4k18.3m3.","29.2q5u5U25.3m3.","28.3q6u5U30.","28.3q6u5U30.","28.2q8u5U29.","28.2q8u5U29.","27.3q4u1q4u4U29.","27.3q4u1q4u5U28.","27.2q5u1q1.4u4U28.","27.2q4u2q1.4u4U1u27.","26.3q4u1q3.4u4U27.","26.3q4u1q3.4u4U27.","26.2q4u2q4.3u5U26.","26.2q4u1q5.6u2U26.","25.4q3u1q6.4u3U1u25.","25.3q3u2q6.4u4U25.","25.2q4u1q8.3u3U1u25.","24.2q5u1q8.2u4U1u25.","23.2q5u2q8.2u4U1u25.","22.2q5u2q8.3u3U1u26.","22.1q5u2q9.3u3U1u26.","21.2q4u2q10.2u4U1u26.","20.2q4u2q11.2u3U1u27.","19.2q4u3q10.3u3U1u27.","18.2q5u2q11.2u4U1u27.","18.1q5u2q12.2u4U28.","17.2q4u2q13.2u3U1u28.","16.2q4u2q13.3u3U1u28.","15.2q4u2q14.2u4U1u28.","15.1q4u2q15.2u3U1u29.","14.1q4u2q16.2u3U1u29.","13.2q4u1q16.3u3U1u29.","12.4m2u1q17.2u3U1u30.","12.5m2q17.2u3U1u30.","11.1q6m18.2u3U1u30.","12.7m16.1u4V1U31.","12.1q7m15.8V29.","14.7m14.10V27.","15.6m14.11V26.","17.4m15.10V26.","18.2m19.7V26."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","38.6A28.","37.9A26.","36.10A2K24.","35.12A2K23.","35.13A1K23.","35.13A2K22.","34.10A6K22.","34.10A6K22.","34.10A4K3E21.","35.9A4K3E21.","35.9A4K3E21.","35.9A6K22.","35.1u6A1k1A5K23.","34.3u4A4k4K23.","34.4u2A8k24.","34.3u3U8k24.","33.4u2U5k1U3k24.","33.4u1U2u3U1k3U25.","29.2n2.3u1U2u7U1u25.","27.6n3u1U3u6U1u25.","26.3n3N4u1U4u6U25.","26.2n4N4u1U6u6U23.","26.2n4N3u3U6u6U22.","26.2n3N4u5U6u6U20.","26.2n3N4u7U6u3U1u2U18.","25.3n3N3u9U8u5U16.","25.3n3N3u10U7u6U15.","25.2n3N4u10U3.5u7U13.","25.2n3N4u9U1u4.6u6U12.","25.2n3N3u10U1u6.5u7U10.","25.2n3N3u10U1u8.5u6U9.","25.2n2N4u9U1u11.5u3U1K2U7.","24.3n2N3u10U1u12.5u1U1K2M1K7.","24.3n2N3u10U1u14.3u1K5M6.","24.3n1N4u9U2u16.1u1K6M5.","24.3n1N4u9U3u16.1u8M3.","24.4n3u2U3u5U3u18.1K7M2.","25.3n3u1U2u6U5u19.7M1.","26.1n1u3q2u5U4q4u20.3M3m","27.3q3u6U4q4u21.1M3m","27.3q3u6U5q4u21.3m","28.6u5U1u1.3q4k24.","28.6u6U2.2q5k23.","29.6u5U3.6k23.","29.1q5u6U3.5k23.","29.2q5u5U3.4k24.","29.2q5u5U31.","28.3q6u5U30.","28.3q6u5U30.","28.2q8u5U29.","28.2q8u5U29.","27.3q4u1q4u4U29.","27.3q4u1q4u5U28.","27.2q5u1q1.4u4U28.","27.2q4u2q1.4u4U1u27.","26.3q4u1q3.4u4U27.","26.3q4u1q3.4u4U27.","26.2q4u2q4.3u5U26.","26.2q4u1q5.6u2U26.","25.4q3u1q6.4u3U1u25.","25.3q3u2q6.4u4U25.","25.2q4u1q8.3u3U1u25.","24.2q5u1q8.2u4U1u25.","23.2q5u2q8.2u4U1u25.","22.2q5u2q8.3u3U1u26.","22.1q5u2q9.3u3U1u26.","21.2q4u2q10.2u4U1u26.","20.2q4u2q11.2u3U1u27.","19.2q4u3q10.3u3U1u27.","18.2q5u2q11.2u4U1u27.","18.1q5u2q12.2u4U28.","17.2q4u2q13.2u3U1u28.","16.2q4u2q13.3u3U1u28.","15.2q4u2q14.2u4U1u28.","15.1q4u2q15.2u3U1u29.","14.1q4u2q16.2u3U1u29.","13.2q4u1q16.3u3U1u29.","12.4m2u1q17.2u3U1u30.","12.5m2q17.2u3U1u30.","11.1q6m18.2u3U1u30.","12.7m16.1u4V1U31.","12.1q7m15.8V29.","14.7m14.10V27."]]},"monk":{"walk":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","34.2R1.13R22.","34.3R2.15R18.","34.4R2.13R19.","33.7R2.8R3.1R18.","33.7R11.7R14.","33.6R3.21R9.","32.6R4.23R7.","32.6R4.25R5.","31.6R6.24R5.","31.6R2.2R3.23R5.","30.6R3.2R7.19R5.","30.6R2.5R14.7R8.","30.5R3.9R25.","29.6R2.18R17.","29.5R3.15R1.12R7.","28.6R2.16R3.10R7.","28.5R3.16R5.7R8.","27.6R2.17R7.3R10.","27.5R3.17R20.","26.6R2.18R20.","26.5R3.18R20.","25.6R2.19R20.","25.5R3.4R2.13R20.","25.5R2.5R2.13R20.","24.5R3.5R2.13R20.","24.5R2.6R3.12R20.","23.5R3.7R2.12R20.","23.5R2.8R2.12R20.","22.5R3.8R2.12R20.","22.5R2.9R2.12R20.","21.5R3.9R2.12R20.","21.5R2.10R2.12R20.","20.5R3.10R3.11R20.","20.5R2.12R2.12R19.","19.5R3.12R2.12R19.","19.5R2.13R2.12R19.","18.5R3.13R2.12R19.","18.5R2.14R2.12R19.","17.36R19.","17.36R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","35.1R1.13R22.","34.3R2.15R18.","34.4R2.13R19.","34.6R2.8R3.6R13.","33.7R11.14R7.","33.6R3.25R5.","32.6R4.25R5.","32.6R4.26R4.","32.5R6.24R5.","31.6R2.2R3.22R6.","31.6R2.2R18.4R9.","30.6R2.5R29.","30.6R2.13R13.2R6.","30.5R3.14R1.13R6.","29.6R2.15R4.10R6.","29.5R3.15R6.6R8.","28.6R2.16R20.","28.5R3.16R20.","28.5R2.17R20.","27.5R3.17R20.","27.5R2.18R20.","26.5R3.19R19.","26.5R2.5R2.13R19.","25.6R2.5R3.12R19.","25.5R2.7R2.12R19.","24.6R2.7R2.12R19.","24.5R3.7R2.12R19.","24.5R2.8R2.12R19.","23.5R3.8R2.12R19.","23.5R2.9R2.12R19.","22.5R3.9R3.11R19.","22.5R2.11R2.11R19.","21.5R3.11R2.11R19.","21.5R2.12R2.12R18.","20.5R3.12R2.12R18.","20.5R2.13R2.12R18.","19.6R2.13R2.12R18.","19.6R1.14R3.11R18.","18.36R18.","18.36R18.","17.37R18.","25.9R4.9R25.","25.9R4.9R25.","25.9R4.9R25.","25.9R38.","25.9R38.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","35.1R1.13R22.","34.3R2.15R18.","34.4R2.13R19.","34.6R2.8R3.11R8.","33.7R11.15R6.","33.6R3.25R5.","33.5R4.26R4.","32.6R4.25R5.","32.6R5.24R5.","31.6R2.2R3.20R8.","31.6R2.2R31.","31.5R3.4R22.1R6.","30.6R2.28R6.","30.5R3.14R2.12R6.","29.6R2.15R5.8R7.","29.5R3.15R8.3R9.","29.5R2.17R19.","28.6R2.17R19.","28.5R2.18R19.","27.6R2.18R19.","27.5R3.18R19.","27.5R2.19R19.","26.5R3.5R2.12R19.","26.5R2.6R2.12R19.","25.5R3.6R2.12R19.","25.5R2.7R2.12R19.","24.6R2.7R3.11R19.","24.5R2.8R3.11R19.","23.6R2.9R2.11R19.","23.5R3.9R2.12R18.","23.5R2.10R2.12R18.","22.5R3.10R2.12R18.","22.5R2.11R2.12R18.","21.5R3.11R3.11R18.","21.5R2.12R3.11R18.","20.5R3.13R2.11R18.","20.5R2.14R2.11R18.","19.6R2.14R2.11R18.","19.36R17.","18.37R17.","18.37R17.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","35.1R1.13R22.","34.3R2.15R18.","34.4R2.13R19.","34.6R2.8R3.6R13.","33.7R11.14R7.","33.6R3.25R5.","32.6R4.25R5.","32.6R4.26R4.","32.5R6.24R5.","31.6R2.2R3.22R6.","31.6R2.2R18.4R9.","30.6R2.5R29.","30.6R2.13R13.2R6.","30.5R3.14R1.13R6.","29.6R2.15R4.10R6.","29.5R3.15R6.6R8.","28.6R2.16R20.","28.5R3.16R20.","28.5R2.17R20.","27.5R3.17R20.","27.5R2.18R20.","26.5R3.19R19.","26.5R2.5R2.13R19.","25.6R2.5R3.12R19.","25.5R2.7R2.12R19.","24.6R2.7R2.12R19.","24.5R3.7R2.12R19.","24.5R2.8R2.12R19.","23.5R3.8R2.12R19.","23.5R2.9R2.12R19.","22.5R3.9R3.11R19.","22.5R2.11R2.11R19.","21.5R3.11R2.11R19.","21.5R2.12R2.12R18.","20.5R3.12R2.12R18.","20.5R2.13R2.12R18.","19.6R2.13R2.12R18.","19.6R1.14R3.11R18.","18.36R18.","18.36R18.","17.37R18.","25.9R4.9R25.","25.9R4.9R25.","25.9R4.9R25.","38.9R25.","38.9R25.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","34.2R1.13R22.","34.3R2.15R18.","34.4R2.13R19.","33.7R2.8R3.1R18.","33.7R11.7R14.","33.6R3.21R9.","32.6R4.23R7.","32.6R4.25R5.","31.6R6.24R5.","31.6R2.2R3.23R5.","30.6R3.2R7.19R5.","30.6R2.5R14.7R8.","30.5R3.9R25.","29.6R2.18R17.","29.5R3.15R1.12R7.","28.6R2.16R3.10R7.","28.5R3.16R5.7R8.","27.6R2.17R7.3R10.","27.5R3.17R20.","26.6R2.18R20.","26.5R3.18R20.","25.6R2.19R20.","25.5R3.4R2.13R20.","25.5R2.5R2.13R20.","24.5R3.5R2.13R20.","24.5R2.6R3.12R20.","23.5R3.7R2.12R20.","23.5R2.8R2.12R20.","22.5R3.8R2.12R20.","22.5R2.9R2.12R20.","21.5R3.9R2.12R20.","21.5R2.10R2.12R20.","20.5R3.10R3.11R20.","20.5R2.12R2.12R19.","19.5R3.12R2.12R19.","19.5R2.13R2.12R19.","18.5R3.13R2.12R19.","18.5R2.14R2.12R19.","17.36R19.","17.36R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","34.2R1.13R22.","34.3R2.15R18.","33.5R2.13R19.","33.7R2.8R22.","33.7R11.4R17.","32.7R3.16R14.","32.6R4.19R11.","31.7R4.22R8.","31.6R6.23R6.","30.7R2.2R3.23R5.","30.6R3.2R6.20R5.","30.6R2.5R9.15R5.","29.6R3.8R10.10R6.","29.6R2.14R10.2R9.","28.6R2.19R17.","28.5R3.15R2.7R12.","27.6R2.16R3.10R8.","27.5R3.16R5.8R8.","26.6R2.17R7.4R10.","26.5R3.17R21.","25.6R2.18R21.","25.5R3.18R21.","24.6R2.4R2.13R21.","24.5R3.4R2.13R21.","23.6R2.5R2.13R21.","23.5R2.6R2.13R21.","22.5R3.6R2.13R21.","22.5R2.7R3.12R21.","21.5R3.8R2.12R21.","21.5R2.9R2.12R21.","20.5R3.9R2.12R21.","20.5R2.10R2.12R21.","19.5R3.10R2.12R21.","19.5R2.11R2.12R21.","18.5R3.11R3.11R21.","18.5R2.13R2.12R20.","17.5R2.14R2.12R20.","17.5R2.14R2.12R20.","16.36R20.","15.37R20.","15.37R20.","22.9R4.9R28.","22.9R4.9R28.","22.9R4.9R28.","22.9R41.","22.9R41.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","34.2R1.13R22.","34.3R2.15R18.","33.5R2.13R19.","33.7R2.8R22.","33.7R11.3R18.","32.7R3.15R15.","32.6R4.17R13.","31.7R4.20R10.","31.6R6.21R8.","30.7R2.2R3.22R6.","30.6R3.2R6.20R5.","29.7R2.5R8.16R5.","29.6R2.9R9.11R6.","28.6R3.13R9.5R8.","28.6R2.18R18.","27.6R3.15R1.6R14.","27.6R2.16R3.10R8.","26.6R3.16R4.9R8.","26.6R2.17R5.7R9.","25.6R3.17R7.2R12.","25.5R3.18R21.","24.6R2.19R21.","24.5R3.3R2.14R21.","23.6R2.4R2.14R21.","23.5R3.4R3.13R21.","22.6R2.6R2.13R21.","22.5R3.6R2.13R21.","21.6R2.7R2.13R21.","21.5R2.8R2.13R21.","20.5R3.8R2.13R21.","20.5R2.9R2.13R21.","19.5R3.9R3.12R21.","19.5R2.11R2.12R21.","18.5R3.11R2.12R21.","18.5R2.12R2.12R21.","17.5R2.13R2.12R21.","17.4R3.13R2.12R21.","16.6R1.14R2.12R21.","15.36R21.","15.36R21.","14.37R21.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","42.8R22.","40.12R20.","39.15R18.","38.17R17.","37.19R16.","36.3R2.16R15.","35.4R2.16R15.","35.4R2.17R14.","34.5R2.10R3.4R14.","34.4R3.8R7.2R14.","34.4R2.8R5.2B2.2R13.","34.4R2.8R4.5B1.1R13.","34.4R2.7R4.4B2.1B14.","34.3R3.7R4.4B17.","34.3R2.8R3.5B17.","34.3R2.8R3.5B2.2B13.","34.3R2.8R3.9B13.","34.3R2.8R3.8B14.","35.12R4.2B19.","35.12R4.2B19.","36.12R4.5B15.","37.12R4.3B16.","34.2R1.13R22.","34.3R2.15R18.","33.5R2.13R19.","33.7R2.8R22.","33.7R11.4R17.","32.7R3.16R14.","32.6R4.19R11.","31.7R4.22R8.","31.6R6.23R6.","30.7R2.2R3.23R5.","30.6R3.2R6.20R5.","30.6R2.5R9.15R5.","29.6R3.8R10.10R6.","29.6R2.14R10.2R9.","28.6R2.19R17.","28.5R3.15R2.7R12.","27.6R2.16R3.10R8.","27.5R3.16R5.8R8.","26.6R2.17R7.4R10.","26.5R3.17R21.","25.6R2.18R21.","25.5R3.18R21.","24.6R2.4R2.13R21.","24.5R3.4R2.13R21.","23.6R2.5R2.13R21.","23.5R2.6R2.13R21.","22.5R3.6R2.13R21.","22.5R2.7R3.12R21.","21.5R3.8R2.12R21.","21.5R2.9R2.12R21.","20.5R3.9R2.12R21.","20.5R2.10R2.12R21.","19.5R3.10R2.12R21.","19.5R2.11R2.12R21.","18.5R3.11R3.11R21.","18.5R2.13R2.12R20.","17.5R2.14R2.12R20.","17.5R2.14R2.12R20.","16.36R20.","15.37R20.","15.37R20.","22.9R4.9R28.","22.9R4.9R28.","22.9R4.9R28.","35.9R28.","35.9R28.","72."]],"climb":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","32.8R32.","20.3R7.12R7.3R20.","19.5R4.16R4.5R19.","18.7R2.3R2.13R2.7R18.","18.7R1.4R2.14R1.7R18.","18.12R2.22R18.","19.11R2.21R19.","19.10R3.21R19.","19.10R2.22R19.","19.10R2.22R19.","19.10R2.22R19.","20.8R3.21R20.","20.8R2.22R20.","20.8R2.22R20.","20.8R2.22R20.","20.7R3.22R20.","21.6R2.22R21.","21.6R2.22R21.","21.30R21.","21.30R21.","21.3R1.22R1.3R21.","22.2R1.22R1.2R22.","22.3R1.20R1.3R22.","22.4R1.18R1.4R22.","22.3R3.16R3.3R22.","22.3R2.1R2.12R2.1R2.3R22.","23.2R2.2R3.8R3.2R2.2R23.","23.1R3.4R10.4R3.1R23.","23.1R2.20R2.1R23.","26.20R26.","26.20R26.","26.9R2.9R26.","26.9R2.9R26.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","24.11R2.11R24.","24.11R2.11R24.","24.11R2.11R24.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R3.12R22.","22.13R3.12R22.","22.13R3.12R22.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.15R2.13R21.","21.15R2.13R21.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","18.18R2.16R18.","18.18R2.16R18.","18.36R18.","18.36R18.","18.36R18.","26.7R6.7R26.","26.6R8.6R26.","26.6R8.6R26.","26.6R8.6R26.","27.4R10.4R27.","72."],["48.5R19.","47.6R19.","47.7R18.","47.7R18.","47.7R18.","47.6R19.","46.7R19.","46.7R19.","46.7R19.","32.8R6.7R19.","30.12R4.7R19.","28.16R1.8R19.","27.3R2.20R20.","26.4R2.20R20.","25.5R2.20R20.","25.5R2.20R20.","24.5R3.20R20.","24.5R2.21R20.","24.5R2.21R20.","23.6R2.20R21.","23.5R3.20R21.","19.9R2.21R21.","19.9R2.21R21.","18.10R2.21R21.","18.9R3.21R21.","19.8R2.22R21.","19.8R2.22R21.","19.31R22.","20.30R22.","20.4R1.22R1.2R22.","20.4R1.22R1.2R22.","21.4R1.20R1.3R22.","21.5R1.18R1.4R22.","22.3R3.16R3.3R22.","22.3R2.1R2.12R2.1R2.2R23.","22.3R2.2R3.8R3.2R2.2R23.","23.1R3.4R10.4R3.1R23.","23.1R2.20R2.1R23.","26.20R26.","26.20R26.","26.9R2.9R26.","26.9R2.9R26.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","24.11R2.11R24.","24.11R2.11R24.","24.11R2.11R24.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R3.12R22.","22.13R3.12R22.","22.13R3.12R22.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.15R2.13R21.","21.15R2.13R21.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","18.18R2.16R18.","18.18R2.16R18.","18.36R18.","18.36R18.","18.36R18.","72.","27.5R40.","26.7R39.","26.7R39.","26.7R39.","26.7R39."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","32.8R32.","20.3R7.12R7.3R20.","19.5R4.16R4.5R19.","18.7R2.3R2.13R2.7R18.","18.7R1.4R2.14R1.7R18.","18.12R2.22R18.","19.11R2.21R19.","19.10R3.21R19.","19.10R2.22R19.","19.10R2.22R19.","19.10R2.22R19.","20.8R3.21R20.","20.8R2.22R20.","20.8R2.22R20.","20.8R2.22R20.","20.7R3.22R20.","21.6R2.22R21.","21.6R2.22R21.","21.30R21.","21.30R21.","21.3R1.22R1.3R21.","22.2R1.22R1.2R22.","22.3R1.20R1.3R22.","22.4R1.18R1.4R22.","22.3R3.16R3.3R22.","22.3R2.1R2.12R2.1R2.3R22.","23.2R2.2R3.8R3.2R2.2R23.","23.1R3.4R10.4R3.1R23.","23.1R2.20R2.1R23.","26.20R26.","26.20R26.","26.9R2.9R26.","26.9R2.9R26.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","24.11R2.11R24.","24.11R2.11R24.","24.11R2.11R24.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R3.12R22.","22.13R3.12R22.","22.13R3.12R22.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.15R2.13R21.","21.15R2.13R21.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","18.18R2.16R18.","18.18R2.16R18.","18.36R18.","18.36R18.","18.36R18.","26.7R6.7R26.","26.6R8.6R26.","26.6R8.6R26.","26.6R8.6R26.","27.4R10.4R27.","72."],["19.5R48.","19.6R47.","18.7R47.","18.7R47.","18.7R47.","19.6R47.","19.7R46.","19.7R46.","19.7R46.","19.7R6.8R32.","19.7R4.12R30.","19.8R1.16R28.","20.10R2.13R27.","20.10R2.14R26.","20.10R2.15R25.","20.10R2.15R25.","20.9R3.16R24.","20.9R2.17R24.","20.9R2.17R24.","21.8R2.18R23.","21.7R3.18R23.","21.7R2.23R19.","21.7R2.23R19.","21.7R2.24R18.","21.6R3.24R18.","21.6R2.24R19.","21.6R2.24R19.","22.31R19.","22.30R20.","22.2R1.22R1.4R20.","22.2R1.22R1.4R20.","22.3R1.20R1.4R21.","22.4R1.18R1.5R21.","22.3R3.16R3.3R22.","23.2R2.1R2.12R2.1R2.3R22.","23.2R2.2R3.8R3.2R2.3R22.","23.1R3.4R10.4R3.1R23.","23.1R2.20R2.1R23.","26.20R26.","26.20R26.","26.9R2.9R26.","26.9R2.9R26.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","25.10R2.10R25.","24.11R2.11R24.","24.11R2.11R24.","24.11R2.11R24.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","23.12R2.12R23.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R2.13R22.","22.13R3.12R22.","22.13R3.12R22.","22.13R3.12R22.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.14R3.13R21.","21.15R2.13R21.","21.15R2.13R21.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","20.16R2.14R20.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","19.17R2.15R19.","18.18R2.16R18.","18.18R2.16R18.","18.36R18.","18.36R18.","18.36R18.","72.","40.5R27.","39.7R26.","39.7R26.","39.7R26.","39.7R26."]],"hang":[["35.3R2.4R28.","34.3R2.5R28.","34.3R2.6R27.","34.3R2.6R27.","34.3R2.6R27.","34.2R3.6R27.","34.2R3.6R27.","34.2R2.7R27.","34.2R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.2R3.6R28.","33.2R3.6R28.","33.2R2.7R28.","33.2R2.7R28.","33.2R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.12R28.","30.14R28.","29.15R28.","28.17R27.","27.19R26.","26.3R2.16R25.","25.4R2.16R25.","25.4R2.17R24.","24.5R2.10R4.3R24.","24.4R3.8R7.2R24.","24.4R2.8R5.3B1.2R23.","24.4R2.8R4.5B1.1R23.","24.4R2.7R4.4B2.1B24.","24.3R3.7R4.4B27.","24.3R2.8R3.5B27.","24.3R2.8R3.5B2.2B23.","24.3R2.8R3.9B23.","24.3R1.9R3.8B24.","25.12R4.2B29.","25.12R4.2B29.","26.12R4.5B25.","27.12R4.3B26.","28.12R32.","26.1R2.15R28.","26.2R2.12R30.","25.3R4.8R32.","25.3R2.2R9.1R30.","25.3R2.3R2.7R30.","25.3R3.2R3.6R30.","25.3R4.2R3.4R31.","24.4R15.2R27.","24.4R2.1R11.3R27.","24.4R2.15R27.","24.4R2.15R27.","24.4R2.15R27.","23.4R3.16R26.","23.4R2.17R26.","23.4R2.17R26.","23.4R2.17R26.","22.5R2.18R25.","22.5R2.18R25.","22.4R3.18R25.","22.4R2.19R25.","21.5R2.20R24.","21.5R2.20R24.","21.5R2.9R2.9R24.","21.4R3.9R2.9R24.","20.5R3.9R2.10R23.","20.5R2.10R3.9R23.","20.5R2.11R2.9R23.","20.5R2.11R2.9R23.","19.6R2.11R2.10R22.","19.5R3.11R2.10R22.","19.5R2.12R2.10R22.","19.5R2.12R2.10R22.","18.6R2.12R3.10R21.","18.6R2.13R2.10R21.","18.6R2.13R2.10R21.","17.6R3.13R2.11R20.","17.6R2.14R2.11R20.","17.6R2.14R2.11R20.","17.35R20.","16.37R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["35.3R2.4R28.","34.3R2.5R28.","34.3R2.6R27.","34.3R2.6R27.","34.3R2.6R27.","34.2R3.6R27.","34.2R3.6R27.","34.2R2.7R27.","34.2R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.2R3.6R28.","33.2R3.6R28.","33.2R2.7R28.","33.2R2.7R28.","33.2R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.12R28.","30.14R28.","29.15R28.","28.17R27.","27.19R26.","26.3R2.16R25.","25.4R2.16R25.","25.4R2.17R24.","24.5R2.10R4.3R24.","24.4R3.8R7.2R24.","24.4R2.8R5.3B1.2R23.","24.4R2.8R4.5B1.1R23.","24.4R2.7R4.4B2.1B24.","24.3R3.7R4.4B27.","24.3R2.8R3.5B27.","24.3R2.8R3.5B2.2B23.","24.3R2.8R3.9B23.","24.3R1.9R3.8B24.","25.12R4.2B29.","25.12R4.2B29.","26.12R4.5B25.","27.12R4.3B26.","28.12R32.","26.1R2.15R28.","26.2R2.12R30.","26.2R4.8R32.","26.2R2.2R9.1R30.","25.3R2.3R2.7R30.","25.3R3.2R3.6R2.1R27.","25.3R4.2R3.4R3.1R27.","25.3R15.2R27.","25.3R2.1R11.3R27.","25.3R2.16R26.","24.4R2.16R26.","24.4R2.16R26.","24.4R2.16R26.","24.4R2.17R25.","24.4R2.17R25.","24.3R3.17R25.","23.4R3.17R25.","23.4R2.19R24.","23.4R2.19R24.","23.4R2.19R24.","22.5R2.20R23.","22.5R2.20R23.","22.5R2.10R2.8R23.","22.5R2.10R2.8R23.","22.4R3.10R2.9R22.","21.5R2.11R2.9R22.","21.5R2.11R3.8R22.","21.5R2.11R3.9R21.","21.5R2.12R2.9R21.","21.5R2.12R2.9R21.","20.6R2.12R2.10R20.","20.6R2.12R2.10R20.","20.6R2.12R2.10R20.","20.5R3.12R3.9R20.","19.6R2.13R3.10R19.","19.6R2.14R2.10R19.","19.6R2.14R2.10R19.","19.6R2.14R2.11R18.","18.36R18.","18.36R18.","18.37R17.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","23.9R9.9R22.","72."],["35.3R2.4R28.","34.3R2.5R28.","34.3R2.6R27.","34.3R2.6R27.","34.3R2.6R27.","34.2R3.6R27.","34.2R3.6R27.","34.2R2.7R27.","34.2R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.2R3.6R28.","33.2R3.6R28.","33.2R2.7R28.","33.2R2.7R28.","33.2R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.12R28.","30.14R28.","29.15R28.","28.17R27.","27.19R26.","26.3R2.16R25.","25.4R2.16R25.","25.4R2.17R24.","24.5R2.10R4.3R24.","24.4R3.8R7.2R24.","24.4R2.8R5.3B1.2R23.","24.4R2.8R4.5B1.1R23.","24.4R2.7R4.4B2.1B24.","24.3R3.7R4.4B27.","24.3R2.8R3.5B27.","24.3R2.8R3.5B2.2B23.","24.3R2.8R3.9B23.","24.3R1.9R3.8B24.","25.12R4.2B29.","25.12R4.2B29.","26.12R4.5B25.","27.12R4.3B26.","28.12R32.","26.1R2.15R28.","26.2R2.12R30.","25.3R4.8R32.","25.3R2.2R9.1R30.","25.3R2.3R2.7R30.","25.3R3.2R3.6R30.","25.3R4.2R3.4R31.","24.4R15.2R27.","24.4R2.1R11.3R27.","24.4R2.15R27.","24.4R2.15R27.","24.4R2.15R27.","23.4R3.16R26.","23.4R2.17R26.","23.4R2.17R26.","23.4R2.17R26.","22.5R2.18R25.","22.5R2.18R25.","22.4R3.18R25.","22.4R2.19R25.","21.5R2.20R24.","21.5R2.20R24.","21.5R2.9R2.9R24.","21.4R3.9R2.9R24.","20.5R3.9R2.10R23.","20.5R2.10R3.9R23.","20.5R2.11R2.9R23.","20.5R2.11R2.9R23.","19.6R2.11R2.10R22.","19.5R3.11R2.10R22.","19.5R2.12R2.10R22.","19.5R2.12R2.10R22.","18.6R2.12R3.10R21.","18.6R2.13R2.10R21.","18.6R2.13R2.10R21.","17.6R3.13R2.11R20.","17.6R2.14R2.11R20.","17.6R2.14R2.11R20.","17.35R20.","16.37R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["35.3R2.4R28.","34.3R2.5R28.","34.3R2.6R27.","34.3R2.6R27.","34.3R2.6R27.","34.2R3.6R27.","34.2R3.6R27.","34.2R2.7R27.","34.2R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.3R2.6R28.","33.2R3.6R28.","33.2R3.6R28.","33.2R2.7R28.","33.2R2.7R28.","33.2R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.3R2.7R28.","32.12R28.","30.14R28.","29.15R28.","28.17R27.","27.19R26.","26.3R2.16R25.","25.4R2.16R25.","25.4R2.17R24.","24.5R2.10R4.3R24.","24.4R3.8R7.2R24.","24.4R2.8R5.3B1.2R23.","24.4R2.8R4.5B1.1R23.","24.4R2.7R4.4B2.1B24.","24.3R3.7R4.4B27.","24.3R2.8R3.5B27.","24.3R2.8R3.5B2.2B23.","24.3R2.8R3.9B23.","24.3R1.9R3.8B24.","25.12R4.2B29.","25.12R4.2B29.","26.12R4.5B25.","27.12R4.3B26.","28.12R32.","25.2R2.15R28.","25.3R2.12R30.","25.3R4.8R32.","25.3R2.2R9.1R30.","25.3R2.3R2.7R30.","24.4R3.2R3.6R30.","24.4R4.2R3.4R31.","24.4R15.1R28.","24.4R2.1R11.2R28.","23.5R2.14R28.","23.4R3.15R27.","23.4R2.16R27.","23.4R2.16R27.","22.5R2.16R27.","22.4R3.16R27.","22.4R2.17R27.","22.4R2.18R26.","21.5R2.18R26.","21.5R2.18R26.","21.4R3.18R26.","20.5R2.20R25.","20.5R2.20R25.","20.5R2.8R2.10R25.","20.4R3.8R2.10R25.","19.5R2.9R3.9R25.","19.5R2.10R2.10R24.","19.5R2.10R2.10R24.","18.6R2.10R2.10R24.","18.5R3.10R2.10R24.","18.5R2.11R2.10R24.","17.6R2.11R2.11R23.","17.6R2.11R3.10R23.","17.5R3.12R2.10R23.","17.5R2.13R2.10R23.","16.6R2.13R2.11R22.","16.6R2.13R2.11R22.","16.5R3.13R2.11R22.","15.7R1.14R2.11R22.","15.36R21.","15.36R21.","14.37R21.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","19.9R9.9R26.","72."]],"idle":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","38.7R27.","36.11R25.","34.15R23.","33.17R22.","32.19R21.","31.3R2.16R20.","30.4R2.16R20.","30.4R2.17R19.","30.4R2.11R2.4R19.","29.4R3.9R6.2R19.","29.4R2.9R8.2R18.","29.4R2.8R4.5B1.1R18.","29.4R2.7R4.5B1.1B19.","29.4R2.7R4.4B22.","29.3R3.7R3.5B22.","29.3R2.8R3.5B2.2B18.","29.3R2.8R3.9B18.","29.3R2.8R3.9B18.","30.12R4.3B23.","30.12R4.2B24.","31.12R4.5B20.","31.13R4.3B21.","30.1R1.13R27.","30.2R1.16R23.","30.3R2.13R24.","29.5R3.9R26.","29.6R11.1R25.","29.6R2.3R2.7R23.","29.5R3.14R21.","28.5R4.15R20.","28.5R4.17R18.","28.5R2.1R2.18R16.","27.5R3.1R4.18R14.","27.5R2.3R6.17R12.","27.5R2.6R5.16R11.","26.5R3.8R6.13R11.","26.5R2.12R6.10R11.","26.5R2.14R6.6R13.","25.5R3.17R6.1R15.","25.5R2.20R20.","25.5R2.23R17.","24.5R3.25R15.","24.5R2.25R16.","24.5R2.19R2.1R19.","23.5R3.19R22.","23.5R2.7R2.11R22.","23.5R2.7R2.11R22.","22.5R3.7R2.11R22.","22.5R2.8R3.10R22.","21.6R2.9R2.11R21.","21.5R3.9R2.11R21.","21.5R2.10R2.11R21.","20.6R2.10R2.11R21.","20.5R3.10R2.11R21.","20.5R2.11R2.11R21.","19.6R2.11R3.11R20.","19.5R3.12R2.11R20.","18.6R2.13R2.11R20.","18.6R2.13R2.11R20.","18.5R3.13R2.11R20.","17.6R2.14R2.11R20.","17.36R19.","16.37R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","33.6R33.","30.12R30.","28.16R28.","27.18R27.","26.20R26.","25.22R25.","25.22R25.","24.8R8B8R24.","23.8R10B8R23.","23.7R12B7R23.","23.6R14B6R23.","23.5R16B5R23.","22.6R16B6R22.","22.5R18B5R22.","22.5R18B5R22.","22.5R18B5R22.","22.5R3B6E3B6E5R22.","23.4R3B6E3B6E4R23.","23.4R3B6E3B6E4R23.","23.4R9B3E6B4R23.","23.5R8B3E5B5R23.","24.4R8B3E5B4R24.","25.4R14B4R25.","25.5R12B5R25.","26.5R10B5R26.","26.1r5R1B3b3E3b4R26.","26.2r5R3b3E3b4R26.","23.7r3R3b3E3b7R23.","22.8r20R22.","22.8r20R22.","22.8r20R22.","21.9r21R21.","21.9r21R21.","21.9r21R21.","20.10r22R20.","20.10r22R20.","20.10r22R20.","19.11r23R19.","19.10r24R19.","19.10r24R19.","18.11r25R18.","18.11r25R18.","18.11r25R18.","18.11r25R18.","17.12r26R17.","17.12r26R17.","17.12r26R17.","16.13r27R16.","16.13r27R16.","16.13r27R16.","15.13r29R15.","15.2r1B10r26R1B2R15.","15.5B8r24R5B15.","14.7B7r23R7B14.","14.7B1.6r22R1.7B14.","14.7B1.6r22R1.7B14.","14.7B7r23R7B14.","15.5B1.7r23R1.5B15.","17.1B3.7r23R3.1B17.","21.7r23R21.","21.7r23R21.","21.7r23R21.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.7r27R19.","18.8r28R18.","18.8r28R18.","18.8r28R18.","18.8r28Z18.","18.8r28Z18.","18.8r28Z18.","17.9r29Z17.","17.9r29Z17.","17.9r29Z17.","24.8b8.8b24.","24.7b10.7b24.","26.1b18.1b26.","72.","72."]],"happy":[["31.10G31.","30.12G30.","29.14G29.","29.4G3Y7G29.","28.5G3Y8G28.","28.5G3Y8G28.","28.5G3g3G3g2G28.","28.5G3g3G3g2G28.","29.4G3g3G3g1G29.","29.14G29.","21.3B6.12G6.3B21.","20.5B6.10G6.5B20.","19.7B4.3R3G3g3G4.7B19.","19.7B2.5R3G3g3G2R2.7B19.","19.7B1.6R3G3g3G3R1.7B19.","19.1r5B1r21R5B1R19.","19.2r3B1r23R3B2R19.","20.5r27R20.","20.4r8R8B12R20.","20.3r8R10B11R20.","20.3r7R12B10R20.","20.3r6R14B9R20.","20.3r5R16B8R20.","20.2r6R16B8R20.","20.2r5R18B7R20.","20.2r5R18B7R20.","21.1r5R18B6R21.","21.1r5R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R9B3E6B6R21.","21.2r5R8B3E5B7R21.","21.3r4R8B3E5B7R21.","21.4r4R14B8R21.","21.4r5R12B9R21.","21.5r5R10B10R21.","22.5r5R1B3b3E3b8R22.","22.6r5R3b3E3b8R22.","22.8r3R3b3E3b8R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","23.7r19R23.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.7r27R19.","18.8r28R18.","18.8r28R18.","18.8r28R18.","18.8r28Z18.","18.8r28Z18.","18.8r28Z18.","17.9r29Z17.","17.9r29Z17.","17.9r29Z17.","24.8b8.8b24.","24.7b10.7b24."],["29.4G3Y7G29.","28.5G3Y8G28.","28.5G3Y8G28.","28.5G3g3G3g2G28.","28.5G3g3G3g2G28.","29.4G3g3G3g1G29.","29.14G29.","21.3B6.12G6.3B21.","20.5B6.10G6.5B20.","19.7B4.3R3G3g3G4.7B19.","19.7B2.5R3G3g3G2R2.7B19.","19.7B1.6R3G3g3G3R1.7B19.","19.1r5B1r21R5B1R19.","19.2r3B1r23R3B2R19.","20.5r27R20.","20.4r8R8B12R20.","20.3r8R10B11R20.","20.3r7R12B10R20.","20.3r6R14B9R20.","20.3r5R16B8R20.","20.2r6R16B8R20.","20.2r5R18B7R20.","20.2r5R18B7R20.","21.1r5R18B6R21.","21.1r5R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R9B3E6B6R21.","21.2r5R8B3E5B7R21.","21.3r4R8B3E5B7R21.","21.4r4R14B8R21.","21.4r5R12B9R21.","21.5r5R10B10R21.","22.5r5R1B3b3E3b8R22.","22.6r5R3b3E3b8R22.","22.8r3R3b3E3b8R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","23.7r19R23.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","22.6r22R22.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","21.7r23R21.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","20.7r25R20.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.8r26R19.","19.7r27R19.","18.8r28R18.","18.8r28R18.","18.8r28R18.","18.8r28Z18.","18.8r28Z18.","18.8r28Z18.","17.9r29Z17.","17.9r29Z17.","17.9r29Z17.","24.8b8.8b24.","24.7b10.7b24.","26.1b18.1b26.","72.","72."]],"sleep":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","58.5R9.","55.11R6.","53.14R5.","52.17R3.","51.19R2.","50.4R1.15R2.","50.3R2.16R1.","49.4R2.17R","49.4R2.17R","48.4R3.9R6.2R","48.4R2.9R8.1R","48.4R2.8R4.5B1.","48.4R2.7R4.6B1.","48.4R2.7R4.4B3.","48.3R3.7R3.5B3.","48.3R2.8R3.5B2.1B","48.3R2.8R3.8B","48.3R2.8R3.8B","49.12R3.8B","49.12R4.2B5.","50.12R3.6B1.","47.2R1.13R3.4B2.","46.4R1.13R8.","46.5R1.14R6.","45.7R1.14R5.","44.9R2.10R7.","43.11R5.3R10.","42.12R2.2R5.2R7.","42.10R4.10R6.","41.10R5.11R5.","40.10R3.1R2.12R4.","39.10R3.2R3.13R2.","38.10R3.4R3.13R1.","37.9R4.6R4.12R","37.8R4.9R3.11R","36.8R3.12R4.9R","35.8R3.13R5.8R","34.8R3.14R2.1R3.7R","33.8R3.14R3.2R4.5R","32.5R6.15R4.2R4.4R","31.6R5.16R5.3R3.3R","31.6R3.17R6.4R4.1R","30.6R4.17R7.4R4.","29.6R5.17R8.5R2.","28.6R3.1R2.17R8.7R","27.5R4.2R2.16R10.4R2.","26.5R4.3R2.16R16.","25.5R3.5R2.16R16.","24.5R3.6R2.15R17.","24.4R3.7R3.14R17.","23.4R3.9R2.14R17.","22.3R4.10R2.14R17.","21.3R3.12R2.13R18.","20.3R3.13R2.13R18.","19.4R2.14R2.13R18.","18.36R18.","17.36R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","60.7R5.","57.12R3.","56.15R1.","55.17R","54.18R","53.3R2.14R","52.4R2.14R","52.4R2.14R","51.4R3.11R2.1R","51.4R2.9R6.","51.4R2.8R7.","51.4R2.8R4.3B","51.4R2.7R4.4B","51.3R3.7R4.3B1.","51.3R2.8R3.4B1.","51.3R2.7R4.5B","51.3R2.7R4.5B","51.3R2.8R3.5B","52.12R3.3B2.","52.12R4.2B2.","53.12R3.4B","49.3R1.13R4.2B","48.5R1.13R5.","47.7R1.16R1.","47.8R2.13R2.","46.10R3.9R4.","45.12R15.","44.12R3.9R4.","43.12R4.10R3.","42.11R6.11R2.","41.11R4.1R2.13R","40.11R3.3R3.12R","39.10R4.5R4.10R","38.10R3.8R4.9R","37.9R4.11R3.8R","36.9R4.11R6.6R","35.9R3.13R7.5R","34.3R2.3R4.14R4.1R3.4R","33.4R2.2R4.14R5.2R4.2R","32.5R6.16R6.2R4.1R","31.6R5.16R8.3R3.","30.7R3.18R8.4R2.","30.5R5.18R9.5R","29.5R6.17R11.4R","28.5R3.2R2.17R11.4R","27.4R4.3R2.17R12.3R","26.4R3.5R2.16R16.","25.3R4.6R3.15R16.","24.3R4.8R2.15R16.","23.3R3.10R2.14R17.","22.2R4.11R2.14R17.","20.3R4.12R2.14R17.","19.4R2.14R2.13R18.","18.36R18.","17.37R18.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."]],"stuck":[["72.","72.","72.","72.","21.3B24.3B21.","20.5B8.6R8.5B20.","19.7B4.12R4.7B19.","19.7B2.16R2.7B19.","19.7B1.18R1.7B19.","19.1r5B1r21R5B1R19.","19.2r3B1r23R3B2R19.","20.5r27R20.","20.4r8R8B12R20.","20.3r8R10B11R20.","20.3r7R12B10R20.","20.3r6R14B9R20.","20.3r5R16B8R20.","20.2r6R16B8R20.","20.2r5R18B7R20.","20.2r5R18B7R20.","21.1r5R18B6R21.","21.1r5R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R3B6E3B6E6R21.","21.2r4R9B3E6B6R21.","21.2r5R8B3E5B7R21.","21.3r4R8B3E5B7R21.","21.4r4R14B8R21.","21.4r5R12B9R21.","21.5r5R10B10R21.","22.5r5R1B3b3E3b8R22.","22.6r5R3b3E3b8R22.","22.8r3R3b3E3b8R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","22.8r20R22.","23.7r19R23.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.6r18R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","24.5r19R24.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23.","23.6r20R23."],["72.","72.","72.","72.","18.3B24.3B24.","17.5B8.6R8.5B23.","16.7B4.12R4.7B22.","16.7B2.16R2.7B22.","16.7B1.18R1.7B22.","16.1r5B1r21R5B1R22.","16.2r3B1r23R3B2R22.","17.5r27R23.","17.4r8R8B12R23.","17.3r8R10B11R23.","17.3r7R12B10R23.","17.3r6R14B9R23.","17.3r5R16B8R23.","17.2r6R16B8R23.","17.2r5R18B7R23.","17.2r5R18B7R23.","18.1r5R18B6R24.","18.1r5R3B6E3B6E6R24.","18.2r4R3B6E3B6E6R24.","18.2r4R3B6E3B6E6R24.","18.2r4R9B3E6B6R24.","18.2r5R8B3E5B7R24.","18.3r4R8B3E5B7R24.","18.4r4R14B8R24.","18.4r5R12B9R24.","18.5r5R10B10R24.","19.5r5R1B3b3E3b8R25.","19.6r5R3b3E3b8R25.","19.8r3R3b3E3b8R25.","19.8r20R25.","19.8r20R25.","19.8r20R25.","19.8r20R25.","19.8r20R25.","20.7r19R26.","21.6r18R27.","21.6r18R27.","21.6r18R27.","21.6r18R27.","21.5r19R27.","21.5r19R27.","21.5r19R27.","21.5r19R27.","21.5r19R27.","20.6r20R26.","20.6r20R26.","20.6r20R26.","20.6r20R26.","20.6r20R26.","20.6r20R26."]],"dig":[["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","36.7R29.","34.12R26.","32.15R25.","31.17R24.","30.19R23.","29.4R2.15R22.","29.3R3.16R21.","28.4R2.17R21.","28.4R2.11R3.3R21.","28.4R2.9R7.2R20.","27.5R2.8R5.1B3.1R20.","27.4R3.7R4.5B1.1R20.","27.4R2.8R4.4B1.1B21.","27.4R2.7R4.4B24.","27.4R2.7R4.4B3.1B20.","27.3R3.7R4.5B1.2B20.","27.3R2.8R4.8B20.","28.3R1.8R4.8B20.","28.12R4.3B25.","29.12R3.3B25.","29.12R4.5B22.","30.12R4.3B23.","31.12R29.","29.1R2.15R25.","28.3R2.13R26.","28.5R2.9R28.","28.5R39.","28.4R3.9R2.1R25.","27.5R3.10R27.","27.5R3.10R27.","27.4R5.10R26.","27.4R2.1R3.9R26.","26.5R2.2R2.10R25.","26.5R2.3R2.10R24.","26.4R2.4R3.9R24.","25.5R2.5R3.9R23.","25.5R2.6R3.9R22.","25.4R3.7R2.9R22.","24.5R2.9R2.9R21.","24.5R2.9R3.9R20.","24.5R2.10R3.9R19.","24.4R3.11R3.9R18.","23.5R2.13R2.9R18.","23.5R2.13R3.7R19.","23.4R3.14R3.4R21.","22.5R2.8R2.6R27.","22.5R2.8R2.7R26.","22.5R2.8R2.11R22.","21.5R3.8R3.10R22.","21.5R2.10R2.10R22.","21.5R2.10R2.10R22.","20.5R3.10R2.10R22.","20.5R2.11R2.11R21.","20.5R2.11R2.11R21.","19.6R2.11R2.11R21.","19.5R3.11R3.10R21.","19.5R2.13R2.10R21.","18.6R2.13R2.11R20.","18.6R2.13R2.11R20.","18.5R3.13R2.11R20.","17.6R2.14R2.11R20.","17.36R19.","16.37R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."],["72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","72.","52.4R16.","49.11R12.","47.14R11.","46.17R9.","45.19R8.","44.4R1.15R8.","44.3R2.16R7.","43.4R2.17R6.","43.4R2.17R6.","42.4R3.9R6.2R6.","42.4R2.9R8.2R5.","42.4R2.8R4.4B2.1R5.","42.4R2.7R4.6B1.1R5.","42.4R2.7R4.4B9.","42.3R3.7R3.5B9.","42.3R2.8R3.5B2.2B5.","42.3R2.8R3.9B5.","42.3R2.8R3.9B4R1.","43.12R3.8B1.5R","43.12R4.2B6.5R","44.12R3.6B1.6R","42.1R1.12R4.4B2.6R","41.3R1.12R8.6R1.","41.4R1.13R3.1R1.5R3.","40.6R1.14R2.5R4.","40.7R2.11R2.4R4.2R","39.9R4.4R4.5R3.4R","38.10R2.2R5.6R4.5R","38.9R3.12R3.7R","37.9R4.10R4.5R3.","37.8R5.9R3.2R8.","36.8R3.1R3.6R15.","35.8R3.3R4.2R17.","35.7R3.5R22.","34.8R2.8R20.","33.8R2.13R16.","33.7R3.13R16.","32.7R3.14R16.","31.7R3.15R16.","31.6R3.16R16.","30.7R2.16R17.","29.7R2.17R17.","29.6R4.16R17.","28.6R5.16R17.","27.6R3.1R2.16R17.","27.5R3.2R3.15R17.","26.5R3.4R2.15R17.","25.6R2.5R2.15R17.","25.5R3.5R2.14R18.","24.5R3.6R2.14R18.","23.5R3.7R2.14R18.","23.4R3.8R2.14R18.","22.4R3.9R3.13R18.","21.5R2.11R2.13R18.","21.4R3.11R2.13R18.","20.4R3.12R2.13R18.","19.4R3.13R2.13R18.","18.5R2.14R2.12R19.","18.35R19.","17.36R19.","16.37R19.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","30.9R33.","72."]]}},"muzzle":{"runner":[[67,55],[70,52]]}};
3