{"version":3,"sources":["doors.mjs"],"sourcesContent":["// DOORS AND RUNGS (the owner's confirmed proposal, Oct 20: artifact 2UjFM3wnvMAwfKyhsQgRyo). Pure rules, shared by the\n// page, the Cloud Functions and the zone server (twins: functions/lib/doors.mjs, zone-server/lib/doors.mjs).\n//\n// FIVE DOORS, each opened with a use (F, right-click, a tap), its halves PARTING rather than swinging (the owner's notes):\n//   Door          1 x 2 kubes (a tall part: the base and a Door Upper above it); two half-kube-wide halves slide apart\n//   Glass Door    the same, Reinforced Glass in a metal frame; light comes through it shut\n//   Double Door   one LEAF, 1 x 2; two leaves side by side facing the same way open together, each sliding away from the other\n//   Hatch         1 x 1 in a floor or a ceiling: a half-kube panel in the top half of its cell, two halves sliding apart\n//   Shutter       a 1 x 1 SECTION; sections in one flat wall join into one shutter that rolls up into a half-kube housing\n//                 along its top row\n// Every door faces the way its placer stood (f), anyone may open it, it stays as it is left, and it never shuts on anyone\n// standing in it (the page waits). Its state rides in its chunk's machine summary, { k: 'd', f, o } at the base's cell\n// (storage-machines.mjs decodeSummary), written with the placement (functions/index.js) and toggled through the zone\n// server (zone-server/lib/doors.js), which relays it at once.\n//\n// RUNGS: a fixture a kube wide and half a kube high on the side of a kube or a bit, stored as a bit in the seat against\n// that face (bit-slot.js), never solid; the walker climbs a run of them (system-view.js climb).\n\nexport const WOODS = ['Verge Wood', 'Bloom Wood', 'Tide Wood', 'Glint Wood', 'Solis Wood', 'Scorched Wood', 'Void Wood', 'Gloam Wood',\n  'Fathom Wood', 'Drift Wood', 'Halo Wood', 'Echo Wood'];   // tools/material-variants.py WOODS\nexport const METALS = ['Iron', 'Aluminum', 'Copper', 'Titanium', 'Steel'];\nexport const DOOR_UPPER = 'Door Upper';\n// family head → [kind, the materials of its variants, the head's own look]\nconst FAMILIES = {\n  'Door': ['door', [...WOODS, ...METALS], 'Drift Wood'],\n  'Glass Door': ['glass', METALS, 'Steel'],\n  'Double Door': ['double', [...WOODS, ...METALS], 'Drift Wood'],\n  'Hatch': ['hatch', [...WOODS, ...METALS], 'Drift Wood'],\n  'Shutter': ['shutter', ['Steel', 'Aluminum'], 'Steel'],\n};\nconst KIND = new Map(), MAT = new Map();\nfor (const [head, [kind, mats, look]] of Object.entries(FAMILIES)) {\n  KIND.set(head, kind); MAT.set(head, look);\n  for (const m of mats) { KIND.set(`${head} (${m})`, kind); MAT.set(`${head} (${m})`, m); }\n}\nexport const DOOR_NAMES = Object.freeze([...KIND.keys()]);\nexport const RUNG_NAMES = Object.freeze(['Rungs', ...METALS.map((m) => `Rungs (${m})`)]);\nconst RUNGS = new Set(RUNG_NAMES);\nexport const doorKindOf = (n) => KIND.get(n) || null;            // 'door' | 'glass' | 'double' | 'hatch' | 'shutter'\nexport const isDoorName = (n) => KIND.has(n);\nexport const isDoorPart = (n) => KIND.has(n) || n === DOOR_UPPER;   // a door's cell, its upper half's included\nexport const isTallDoor = (n) => { const k = KIND.get(n); return k === 'door' || k === 'glass' || k === 'double'; };\nexport const doorMaterialOf = (n) => MAT.get(n) || null;         // the kube its panels wear (a Glass Door's: its frame)\nexport const isRungName = (n) => RUNGS.has(n);\nexport const rungMaterialOf = (n) => (n === 'Rungs' ? 'Steel' : RUNGS.has(n) ? n.slice(7, -1) : null);\nexport const GLASS_PANE = 'Reinforced Glass';\nexport const DOOR_NO_SHUT = 'Someone is standing in the doorway.';\nexport const RUNG_FACE = 'Rungs go on the side of a kube or a bit.';\n\n// ---- THE FACING --------------------------------------------------------------------------------------------------------\n// A cell's UP is its outward axis on a world, +Y on a vessel (vessel-life.mjs cellUp, the rule tall parts stand by). Its two\n// tangents are tA = (a + 1) % 3 and tB = (a + 2) % 3, as a machine's pose is. A door's facing f (0..3) is the way its face\n// looks: 0 +tA, 1 −tA, 2 +tB, 3 −tB; its panel lies across the other tangent (its LATERAL axis), up the up axis.\nexport function cellUp(x, y, z, vessel) {\n  if (vessel) return { a: 1, s: 1 };\n  const cx = x + 0.5, cy = y + 0.5, cz = z + 0.5, ax = Math.abs(cx), ay = Math.abs(cy), az = Math.abs(cz);\n  const a = (ax >= ay && ax >= az) ? 0 : (ay >= az ? 1 : 2);\n  return { a, s: (a === 0 ? cx : a === 1 ? cy : cz) >= 0 ? 1 : -1 };\n}\nexport function doorAxes(up, f) {\n  const tA = (up.a + 1) % 3, tB = (up.a + 2) % 3, nrm = (f | 0) < 2 ? tA : tB, lat = nrm === tA ? tB : tA;\n  return { up: up.a, upS: up.s, nrm, nrmS: (f & 1) ? -1 : 1, lat };\n}\n// THE FACING OF A DOOR PLACED FROM `from` (the placer's eye) into cell (x, y, z): the tangent the placer is furthest along.\nexport function facingToward(x, y, z, from, vessel) {\n  const up = cellUp(x, y, z, vessel), tA = (up.a + 1) % 3, tB = (up.a + 2) % 3, c = [x + 0.5, y + 0.5, z + 0.5];\n  const dA = from[tA] - c[tA], dB = from[tB] - c[tB];\n  return Math.abs(dA) >= Math.abs(dB) ? (dA >= 0 ? 0 : 1) : (dB >= 0 ? 2 : 3);\n}\nexport const isFacing = (f) => Number.isInteger(f) && f >= 0 && f <= 3;\n\n// ---- THE SHAPES, in the door's own frame (u lateral, v up, w along the facing) --------------------------------------\n// Boxes are [u0, v0, w0, u1, v1, w1]; u and w run 0..1 across the cell, v from the door's foot (to 2 for a tall door, whose\n// upper half is the cell above). THICK is the panel's depth: a bit's, half a kube (the owner: \"the bits on either side\n// parting\"), centred in the cell. OPENING COMPRESSES (the owner's note on the looks, Oct 20: \"when doors slide open, they\n// should compress rather than move ... not slide into adjacent spaces\"): each half folds up against its jamb like an\n// accordion, to COMPRESS (a tenth of a kube, the owner's pick) when open; nothing ever leaves the doorway.\nexport const THICK = 0.5, HOUSING = 0.5, COMPRESS = 0.1;\nconst W0 = 0.5 - THICK / 2, W1 = 0.5 + THICK / 2;\nconst ease = (t) => { const e = t < 0 ? 0 : t > 1 ? 1 : t; return e * e * (3 - 2 * e); };\n// How wide a half (or a double door's leaf, `full` 1) stands at open fraction t.\nexport const halfWidth = (t, full = 0.5) => full - (full - COMPRESS) * ease(t);\n// What stops a walker IN ONE CELL (v 0..1 here): a shut door's whole panel; an open one's folded stacks against its jambs;\n// a hatch's top half shut, its two edge stacks open; a shutter's housing always, its slats while shut.\n// `ctx`: { top } for a shutter section in its shutter's top row; { away } for a double door's leaf (+1 or −1: the side\n// along u it folds to, away from its partner).\nexport function doorSolidBoxes(kind, open, ctx = {}) {\n  const C = COMPRESS;\n  if (kind === 'hatch') return open ? [[0, 1 - THICK, 0, 1, 1, C], [0, 1 - THICK, 1 - C, 1, 1, 1]] : [[0, 1 - THICK, 0, 1, 1, 1]];\n  if (kind === 'shutter') { const out = [];\n    if (ctx.top) out.push([0, 1 - HOUSING, 0.2, 1, 1, 0.8]);\n    if (!open) out.push([0, 0, W0, 1, ctx.top ? 1 - HOUSING : 1, W1]);\n    return out; }\n  if (kind === 'double') return open ? [(ctx.away || 1) > 0 ? [1 - C, 0, W0, 1, 1, W1] : [0, 0, W0, C, 1, W1]] : [[0, 0, W0, 1, 1, W1]];\n  return open ? [[0, 0, W0, C, 1, W1], [1 - C, 0, W0, 1, 1, W1]] : [[0, 0, W0, 1, 1, W1]];\n}\n// THE SAME FOR A WHOLE DOOR (a town's, version 22: its cells are no part of the world's grid of kubes, so it is tested as\n// one), v 0..2 for a tall door.\nexport const doorHeightOf = (kind) => (kind === 'door' || kind === 'glass' || kind === 'double' ? 2 : 1);\nexport function doorWholeBoxes(kind, open, ctx = {}) {\n  const H = doorHeightOf(kind);\n  return doorSolidBoxes(kind, open, ctx).map((b) => (H === 1 ? b : [b[0], b[1] * H, b[2], b[3], b[4] * H, b[5]]));\n}\n// WHAT IS DRAWN at open fraction t (0 shut … 1 open): pieces { b, part, uv, fold } — b the box; part 'panel' (its face\n// drawn across it, squeezed as it folds), 'frame', 'glass', 'knob', 'slat' or 'housing'; uv the box its face texture is\n// laid across (the panel itself, so the face folds with it; a shutter section its whole cell, so the slats roll away\n// under a still texture); fold how folded it is (0..1, the accordion's creases). A tall door's pieces run v 0..2.\n// ctx: { away } for a double door's leaf; { row, rows, top } for a shutter section.\nexport function doorPieces(kind, t, ctx = {}) {\n  const e = ease(t), out = [];\n  const put = (b, part, uv = b, fold = 0) => out.push({ b, part, uv, fold });\n  const knobs = (u, s) => { const a = s > 0 ? u - 0.1 : u + 0.04, c = a + 0.06;   // a knob on each face, by the half's inner edge, at hand height\n    put([a, 0.95, W1, c, 1.03, W1 + 0.06], 'knob'); put([a, 0.95, W0 - 0.06, c, 1.03, W0], 'knob'); };\n  if (kind === 'door' || kind === 'glass') {\n    const w = halfWidth(t);\n    for (const [a, c, s] of [[0, w, 1], [1 - w, 1, -1]]) {   // s: +1 the half at u = 0 (its inner edge at c), −1 the one at u = 1\n      if (kind === 'door') { put([a, 0, W0, c, 2, W1], 'panel', [a, 0, W0, c, 2, W1], e); knobs(s > 0 ? c : a, s); continue; }\n      const f = 0.07, F0 = W0 + 0.08, F1 = W1 - 0.08;\n      put([a, 0, F0, a + f, 2, F1], 'frame'); put([c - f, 0, F0, c, 2, F1], 'frame');\n      put([a + f, 0, F0, c - f, 0.1, F1], 'frame'); put([a + f, 1.9, F0, c - f, 2, F1], 'frame');\n      if (c - a > 2 * f + 0.02) put([a + f, 0.1, 0.44, c - f, 1.9, 0.56], 'glass');\n      knobs(s > 0 ? c : a, s);\n    }\n    return out;\n  }\n  if (kind === 'double') { const w = halfWidth(t, 1), away = ctx.away || 1, a = away > 0 ? 1 - w : 0, c = a + w;\n    put([a, 0, W0, c, 2, W1], 'panel', [a, 0, W0, c, 2, W1], e); knobs(away > 0 ? a : c, away > 0 ? -1 : 1); return out; }\n  if (kind === 'hatch') { const w = halfWidth(t);\n    for (const [a, c] of [[0, w], [1 - w, 1]]) put([0, 1 - THICK, a, 1, 1, c], 'panel', [0, 1 - THICK, a, 1, 1, c], e);\n    return out; }\n  if (kind === 'shutter') {\n    const rows = Math.max(1, ctx.rows | 0), row = ctx.row | 0, span = rows - HOUSING, lo = e * span;\n    const v0 = Math.max(0, lo - row), v1 = Math.min(1, span - row);\n    if (v1 - v0 > 1e-3) put([0, v0, 0.4, 1, v1, 0.6], 'slat', [0, 0, 0.4, 1, 1, 0.6]);\n    if (ctx.top) put([0, 1 - HOUSING, 0.2, 1, 1, 0.8], 'housing');\n    return out;\n  }\n  return out;\n}\n// A cell-frame box [u0, v0, w0, u1, v1, w1] in grid axes: { min: [x, y, z], max: [x, y, z] } relative to the cell's corner.\n// v runs up the cell's up (flipped where up is a negative axis); u and w are centred, so their signs never matter but for\n// a slide, which `doorPieces` already made symmetric about the cell (a double door's `away` is given in grid sign: see doorAway).\nexport function boxToGrid(ax, bx) {\n  const min = [0, 0, 0], max = [0, 0, 0];\n  const set = (axis, a, b) => { min[axis] = Math.min(a, b); max[axis] = Math.max(a, b); };\n  set(ax.lat, bx[0], bx[3]);\n  if (ax.upS > 0) set(ax.up, bx[1], bx[4]); else set(ax.up, 1 - bx[1], 1 - bx[4]);\n  set(ax.nrm, bx[2], bx[5]);\n  return { min, max };\n}\n// (A HATCH lies flat: its panel spans u, its halves fold along w, toward the cell's edges; doorPieces and doorSolidBoxes\n// already lay it in v's top half, so it maps by the same call.)\n\n// ---- A SHUTTER'S SECTIONS, A DOUBLE DOOR'S PAIR ------------------------------------------------------------------------\n// The same rule everywhere a door is opened: what opens with it. `doorAt(x, y, z)` → { name, f } of a door's BASE cell (a\n// tall door's upper resolves to its base), or null.\n// A SHUTTER is the sections connected to this one across its lateral axis and its up axis, in its own plane, facing as it\n// does: rows counted from its bottom, `top` the sections with no section above them.\nexport function shutterGroup(x, y, z, doorAt, vessel, cap = 64) {\n  const me = doorAt(x, y, z); if (!me || doorKindOf(me.name) !== 'shutter') return null;\n  const up = cellUp(x, y, z, vessel), ax = doorAxes(up, me.f), key = (c) => c.join(',');\n  const seen = new Map([[key([x, y, z]), [x, y, z]]]), q = [[x, y, z]];\n  while (q.length && seen.size < cap) { const c = q.shift();\n    for (const [axis, s] of [[ax.lat, 1], [ax.lat, -1], [ax.up, 1], [ax.up, -1]]) { const n = c.slice(); n[axis] += s; const k = key(n);\n      if (seen.has(k)) continue; const d = doorAt(n[0], n[1], n[2]);\n      if (!d || doorKindOf(d.name) !== 'shutter' || d.f !== me.f) continue;\n      const u2 = cellUp(n[0], n[1], n[2], vessel); if (u2.a !== up.a || u2.s !== up.s) continue;\n      seen.set(k, n); q.push(n); } }\n  const cells = [...seen.values()], hOf = (c) => c[ax.up] * ax.upS;\n  const lo = Math.min(...cells.map(hOf)), hi = Math.max(...cells.map(hOf));\n  return cells.map((c) => ({ x: c[0], y: c[1], z: c[2], row: hOf(c) - lo, rows: hi - lo + 1,\n    top: !seen.has(key((() => { const n = c.slice(); n[ax.up] += ax.upS; return n; })())) }));\n}\n// A DOUBLE DOOR'S PARTNER: the leaf beside it along its lateral axis, facing as it does. Its own leaf slides AWAY from the\n// partner (+1 or −1 in grid sign along the lateral axis; +1 alone).\nexport function doublePartner(x, y, z, doorAt, vessel) {\n  const me = doorAt(x, y, z); if (!me || doorKindOf(me.name) !== 'double') return null;\n  const ax = doorAxes(cellUp(x, y, z, vessel), me.f);\n  for (const s of [1, -1]) { const n = [x, y, z]; n[ax.lat] += s; const d = doorAt(n[0], n[1], n[2]);\n    if (d && doorKindOf(d.name) === 'double' && d.f === me.f) return { x: n[0], y: n[1], z: n[2], side: s }; }\n  return null;\n}\n// What one use opens or shuts: the door's base cell, its partner's, or every section of its shutter.\nexport function doorMembers(x, y, z, doorAt, vessel) {\n  const me = doorAt(x, y, z); if (!me) return [];\n  const k = doorKindOf(me.name);\n  if (k === 'shutter') return (shutterGroup(x, y, z, doorAt, vessel) || []).map((c) => [c.x, c.y, c.z]);\n  if (k === 'double') { const p = doublePartner(x, y, z, doorAt, vessel); return p ? [[x, y, z], [p.x, p.y, p.z]] : [[x, y, z]]; }\n  return [[x, y, z]];\n}\n\n// ---- RUNGS --------------------------------------------------------------------------------------------------------------\n// A rung's seat (bit-slot.js: offsets 0.25 / 0.5 / 0.75 on each axis) says where it is: against the face its normal axis is\n// off-centre toward, at the height of its up offset, centred along the other tangent. `off` is slotOffset's [x, y, z].\n// Returns { nrm, nrmS (the way out of the wall), lat, up, upS, h (its middle's height in the cell, along up from the floor) }\n// or null for a seat no rung can take.\nexport function rungFrame(off, up) {\n  const tA = (up.a + 1) % 3, tB = (up.a + 2) % 3, oA = off[tA] - 0.5, oB = off[tB] - 0.5;\n  const isA = Math.abs(oA) > 0.1, isB = Math.abs(oB) > 0.1;\n  if (isA === isB) return null;\n  const nrm = isA ? tA : tB, lat = isA ? tB : tA, o = isA ? oA : oB;\n  const hv = up.s > 0 ? off[up.a] : 1 - off[up.a];\n  return { nrm, nrmS: o < 0 ? 1 : -1, lat, up: up.a, upS: up.s, h: hv, wallAt: o < 0 ? 0 : 1 };\n}\n// THE SEAT A RUNG TAKES on a face: stepped off the face (normal axis `n`, the side `s` the rung stands out to), its height\n// from the aim (0.25, 0.5 or 0.75 of the cell, along up), centred laterally. As slot offsets [x, y, z].\nexport function rungSeatOffsets(n, s, up, aimV) {\n  const off = [0.5, 0.5, 0.5]; off[n] = s > 0 ? 0.25 : 0.75;\n  const v = aimV < 0.375 ? 0.25 : aimV < 0.625 ? 0.5 : 0.75; off[up.a] = up.s > 0 ? v : 1 - v;\n  return off;\n}\n// THE CLIMB (the owner's picks): walk into a run of rungs; W climbs at 3 kubes a second; no key held, you slide down at 4;\n// at the top you keep pressing forward to step off. A rung reaches the walker within REACH of its wall's plane.\nexport const CLIMB = Object.freeze({ up: 3, down: 4, reach: 0.65, overTop: 0.6, facing: 0.3 });\n"],"mappings":"AAkBO,aAAM,MAAQ,CAAC,aAAc,aAAc,YAAa,aAAc,aAAc,gBAAiB,YAAa,aACvH,cAAe,aAAc,YAAa,WAAW,EAC1C,OAAS,CAAC,OAAQ,WAAY,SAAU,WAAY,OAAO,EAC3D,WAAa,aAE1B,MAAM,SAAW,CACf,KAAQ,CAAC,OAAQ,CAAC,GAAG,MAAO,GAAG,MAAM,EAAG,YAAY,EACpD,aAAc,CAAC,QAAS,OAAQ,OA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