Bagel Calculator Source Code

Source Code · Bagel Calculator

This is the complete source of the Bagel Calculator, published by the Bagel Bakers Union of the Greater Milwaukee Area, Local 7, filed as B.B.U.G.M.A. (ba-BOOG-ma). It is plain JavaScript. It uses no libraries, sets no cookies, writes nothing to browser storage, and makes no network requests. Inputs live in memory until the page is closed.

Calculator Script, as Served

The script below is the calculator exactly as it runs: a small component runtime, the calculator, its data, and its stylesheet, unminified. Select Copy to place all of it on the clipboard.

bagel-calculator.js · plain JavaScript
/* Bagel Calculator. Bagelnomics, Bagel Bakers Union of the Greater Milwaukee Area, Local 7.
   Plain JavaScript, no libraries, no cookies, no localStorage, no network calls. Inputs live in memory for this visit only.
   Prices are read from the JSON block with id bn-prices in the same page. */
(function () {
/* Bagel Calculator runtime: a tiny component and state layer in plain JavaScript.
   No libraries, no network calls, no cookies, no localStorage. State lives in memory for the visit. */
var BNC = (function () {
  "use strict";
  var SVG_NS = "http://www.w3.org/2000/svg";
  var SVG_TAGS = { svg: 1, g: 1, line: 1, path: 1, circle: 1, text: 1, rect: 1 };
  var UNITLESS = { fontWeight: 1, opacity: 1, flex: 1, lineHeight: 1, zIndex: 1 };

  /* ---------- element factory ---------- */
  function Fragment(props) { return props.children; }
  function h(type, props) {
    var kids = [];
    for (var i = 2; i < arguments.length; i++) kids.push(arguments[i]);
    return { type: type, props: props || {}, children: kids };
  }

  /* ---------- hooks ---------- */
  var stores = {};      // component path -> { s: [], i: 0 }
  var current = null;   // store of the component being rendered
  var rootFn = null, rootEl = null, queued = false;

  function useState(initial) {
    var st = current, idx = st.i++;
    if (!(idx in st.s)) st.s[idx] = typeof initial === "function" ? initial() : initial;
    var setter = function (v) {
      var next = typeof v === "function" ? v(st.s[idx]) : v;
      if (next === st.s[idx]) return;
      st.s[idx] = next;
      schedule();
    };
    return [st.s[idx], setter];
  }
  function useMemo(fn) { return fn(); }

  var THEME = {
    bg: { subtle: "#f4f6f8" },
    border: { default: "#d5dae0", strong: "#007398" },
    radius: { sm: "4px" },
    text: { primary: "#041c2c", secondary: "#5a5a6e", accent: "#007398", warning: "#7a3b12", success: "#3d4a00" },
    fill: { warningSubtle: "#f1d9c7", successSubtle: "#e3ec9a", secondary: "#d5dae0", accentSubtle: "#dcecf2" },
    font: { label: { fontSize: "0.82rem" } }
  };
  function useGrokTheme() { return THEME; }

  /* ---------- expand components into plain nodes ---------- */
  // Returns a flat array of nodes: { tag, props, kids } or { text }.
  function expand(node, path) {
    if (node == null || node === false || node === true) return [];
    if (Array.isArray(node)) {
      var out = [];
      for (var i = 0; i < node.length; i++) out = out.concat(expand(node[i], path + "." + i));
      return out;
    }
    if (typeof node === "string" || typeof node === "number") return [{ text: String(node) }];
    if (typeof node.type === "function") {
      var props = Object.assign({}, node.props, { children: node.children });
      var prev = current;
      var st = stores[path] || (stores[path] = { s: [], i: 0 });
      st.i = 0; current = st;
      var res = node.type(props);
      current = prev;
      return expand(res, path + "/" + (node.type.name || "c"));
    }
    var kids = [];
    for (var j = 0; j < node.children.length; j++) kids = kids.concat(expand(node.children[j], path + "." + j));
    return [{ tag: node.type, props: node.props, kids: kids }];
  }

  /* ---------- DOM patching ---------- */
  function kebab(k) { return k.replace(/[A-Z]/g, function (m) { return "-" + m.toLowerCase(); }); }
  function setStyle(el, oldS, newS) {
    oldS = oldS || {}; newS = newS || {};
    Object.keys(oldS).forEach(function (k) { if (!(k in newS)) el.style[k] = ""; });
    Object.keys(newS).forEach(function (k) {
      var v = newS[k];
      if (typeof v === "number" && !UNITLESS[k]) v = v + "px";
      if (oldS[k] !== newS[k]) el.style[k] = v;
    });
  }
  function setProps(el, oldP, newP, isSvg, tag) {
    oldP = oldP || {};
    Object.keys(oldP).forEach(function (k) {
      if (k === "children" || k === "key" || k === "style" || k in newP) return;
      if (/^on[A-Z]/.test(k)) { el["on" + evtName(k, tag)] = null; return; }
      el.removeAttribute(k === "className" ? "class" : isSvg ? kebab(k) : k);
    });
    Object.keys(newP).forEach(function (k) {
      var v = newP[k];
      if (k === "children" || k === "key") return;
      if (k === "style") { setStyle(el, oldP.style, v); return; }
      if (/^on[A-Z]/.test(k)) { el["on" + evtName(k, tag)] = v; return; }
      if (k === "value") { if (el.value !== String(v)) el.value = String(v); return; }
      if (oldP[k] === v) return;
      var name = k === "className" ? "class" : (isSvg && k !== "viewBox") ? kebab(k) : k;
      if (v === false || v == null) el.removeAttribute(name);
      else el.setAttribute(name, v === true ? "" : v);
    });
  }
  function evtName(k, tag) {
    var n = k.slice(2).toLowerCase();
    if (n === "change" && tag === "input") return "input";
    return n;
  }
  function create(n, parentSvg) {
    if (n.text != null) return document.createTextNode(n.text);
    var svg = parentSvg || n.tag === "svg";
    var el = svg ? document.createElementNS(SVG_NS, n.tag) : document.createElement(n.tag);
    el.__p = null; el.__tag = n.tag;
    setProps(el, null, n.props, svg, n.tag); el.__p = n.props;
    patchKids(el, n.kids, svg);
    return el;
  }
  function same(dom, n) {
    if (n.text != null) return dom.nodeType === 3;
    return dom.nodeType === 1 && dom.__tag === n.tag;
  }
  function patchNode(dom, n, parentSvg) {
    if (n.text != null) { if (dom.nodeValue !== n.text) dom.nodeValue = n.text; return; }
    var svg = parentSvg || n.tag === "svg";
    setProps(dom, dom.__p, n.props, svg, n.tag); dom.__p = n.props;
    patchKids(dom, n.kids, svg);
  }
  function patchKids(parent, kids, svg) {
    var i = 0;
    for (; i < kids.length; i++) {
      var dom = parent.childNodes[i];
      if (!dom) parent.appendChild(create(kids[i], svg));
      else if (same(dom, kids[i])) patchNode(dom, kids[i], svg);
      else parent.replaceChild(create(kids[i], svg), dom);
    }
    while (parent.childNodes.length > kids.length) parent.removeChild(parent.lastChild);
  }

  function render() {
    queued = false;
    var nodes = expand(h(rootFn, {}), "root");
    patchKids(rootEl, nodes, false);
  }
  function schedule() {
    if (queued) return;
    queued = true;
    (window.requestAnimationFrame || setTimeout)(render);
  }
  function mount(fn, el) { rootFn = fn; rootEl = el; render(); }

  /* ---------- title case for headings and labels (house style) ---------- */
  var MINOR = " a an the and but or nor for of in on at to by as vs per via with from into than ";
  var KEEP = " mm lb oz g kg ";
  function tcWord(w, force) {
    var lw = w.toLowerCase();
    if (KEEP.indexOf(" " + w + " ") >= 0) return w;
    if (/[A-Z]/.test(w.slice(1))) return w;
    if (!force && MINOR.indexOf(" " + lw + " ") >= 0) return lw;
    return w.charAt(0).toUpperCase() + w.slice(1);
  }
  function tc(s) {
    s = String(s);
    var re = /[A-Za-z][A-Za-z\u2019']*/g, m, last = -1, all = [];
    while ((m = re.exec(s))) { all.push(m); last = m.index; }
    var out = "", pos = 0, brk = true;
    all.forEach(function (mm) {
      var pre = s.slice(pos, mm.index);
      out += pre;
      if (/[:.?!\u00b7]\s*$/.test(pre)) brk = true;
      var digit = /[0-9]$/.test(pre), hy = /-$/.test(pre);
      out += digit ? mm[0] : tcWord(mm[0], brk || mm.index === last || hy);
      brk = false; pos = mm.index + mm[0].length;
    });
    return out + s.slice(pos);
  }

  /* ---------- page components (plain HTML with bnc-* classes) ---------- */
  var T = { success: "ok", warning: "warn", danger: "bad" };
  function inline(text) {
    // `code` spans become <code>
    var parts = String(text).split("`"), out = [];
    for (var i = 0; i < parts.length; i++) {
      if (!parts[i]) continue;
      out.push(i % 2 ? h("code", null, parts[i]) : parts[i]);
    }
    return out;
  }
  function Page(p) {
    return h("div", { className: "bnc-page" },
      p.summary ? h("p", { className: "bnc-lede" }, p.summary) : null,
      p.children,
      p.sources && p.sources.length ? h("section", { className: "bnc-sources" },
        h("h2", { className: "bnc-h2" }, "Sources"),
        h("ul", null, p.sources.map(function (s) { return h("li", null, s); }))) : null);
  }
  function Section(p) {
    return h("section", { className: "bnc-section", id: p.id }, h("h2", { className: "bnc-h2" }, tc(p.heading)), p.children);
  }
  function Text(p) {
    var out = [];
    p.children.forEach(function (c) { out = out.concat(typeof c === "string" ? inline(c) : [c]); });
    return h("p", { className: "bnc-p" }, out);
  }
  function TableOfContents(p) {
    return h("nav", { className: "bnc-toc", "aria-label": "On this page" },
      h("p", { className: "bnc-toc__head" }, "Contents"),
      h("ol", null, p.items.map(function (it) { return h("li", null, h("a", { href: "#" + it.id }, tc(it.label))); })));
  }
  function Callout(p) {
    return h("div", { className: "bnc-callout bnc-callout--" + (p.tone || "info"), role: "note" },
      h("strong", null, tc(p.lead) + ". "), p.children);
  }
  function Properties(p) {
    return h("dl", { className: "bnc-props" }, p.items.map(function (it) {
      return h("div", { className: "bnc-props__row" }, h("dt", null, tc(it.label)), h("dd", null, it.value));
    }));
  }
  function cell(c) {
    if (c && typeof c === "object") return h("span", { className: "bnc-badge bnc-badge--" + (T[c.tone] || "plain") }, c.text);
    return c;
  }
  function Table(p) {
    var al = p.align || [];
    return h("div", { className: "bnc-tablewrap" }, h("table", { className: "bnc-table" },
      h("thead", null, h("tr", null, p.columns.map(function (c, i) { return h("th", { scope: "col", className: al[i] === "end" ? "is-end" : null }, tc(c)); }))),
      h("tbody", null, p.rows.map(function (r) {
        return h("tr", null, r.map(function (c, i) {
          return h(i === 0 ? "th" : "td", { scope: i === 0 ? "row" : null, className: al[i] === "end" ? "is-end" : null }, cell(c));
        }));
      }))));
  }
  function Diagram(p) {
    var edge = {};
    p.edges.forEach(function (e) { edge[e.from] = e; });
    var out = [];
    p.nodes.forEach(function (n) {
      out.push(h("div", { className: "bnc-node bnc-node--" + (n.kind || "box") }, h("strong", null, n.label), h("span", null, n.detail)));
      if (edge[n.id]) out.push(h("div", { className: "bnc-edge", "aria-hidden": "true" }, h("span", { className: "bnc-edge__arrow" }, "↓"), edge[n.id].label ? h("span", { className: "bnc-edge__label" }, edge[n.id].label) : null));
    });
    return h("div", { className: "bnc-diagram", role: "group", "aria-label": "Approval routing flow, top to bottom" }, out);
  }
  function Steps(p) {
    return h("ol", { className: "bnc-steps" }, p.steps.map(function (s) {
      return h("li", null, h("strong", null, tc(s.title)), h("span", null, s.detail));
    }));
  }
  function BulletList(p) { return h("ul", { className: "bnc-list" }, p.items.map(function (i) { return h("li", null, inline(i)); })); }
  function Segmented(p) {
    return h("div", { className: "bnc-seg", role: "group" }, p.options.map(function (o) {
      var on = o.value === p.value;
      return h("button", { type: "button", className: "bnc-seg__btn" + (on ? " is-on" : ""), "aria-pressed": on ? "true" : "false", onClick: function () { p.onChange(o.value); } }, tc(o.label));
    }));
  }
  function Equation(p) { return h("div", { className: "bnc-eq", role: "math" }, h("span", { className: "bnc-eq__body" }, p.children), h("span", { className: "bnc-eq__label" }, p.label)); }
  function Frac(p) { return h("span", { className: "bnc-frac" }, h("span", { className: "bnc-frac__num" }, p.num), h("span", { className: "bnc-frac__den" }, p.den)); }
  function LinkCards(p) {
    return h("div", { className: "bnc-cards" }, p.links.map(function (l) {
      return h("a", { className: "bnc-card", href: l.href, target: "_blank", rel: "noreferrer noopener" },
        h("strong", null, l.title), h("span", null, l.site + (l.date ? " · " + l.date : "")));
    }));
  }
  function BackToTop() { return h("p", { className: "bnc-top" }, h("a", { href: "#bn-calc" }, "Back to Top")); }
  function Input(p) {
    var id = "bnc-in-" + (p.id || p.label.replace(/[^a-z0-9]+/gi, "-").toLowerCase());
    return h("div", { className: "bnc-field" },
      h("label", { "for": id }, tc(p.label)),
      h("input", { id: id, type: p.type || "text", step: "any", min: "0", inputMode: "decimal", autoComplete: "off", value: p.value, onChange: function (e) { p.onChange(e.target.value); } }));
  }
  function Button(p) { return h("button", { type: "button", className: "bnc-btn", onClick: p.onClick }, tc(p.label)); }

  return {
    h: h, Fragment: Fragment, mount: mount, useState: useState, useMemo: useMemo, useGrokTheme: useGrokTheme,
    Page: Page, Section: Section, Text: Text, TableOfContents: TableOfContents, Callout: Callout, Properties: Properties,
    Table: Table, Diagram: Diagram, Steps: Steps, BulletList: BulletList, Segmented: Segmented, Equation: Equation,
    Frac: Frac, LinkCards: LinkCards, BackToTop: BackToTop, Input: Input, Button: Button
  };
})();

var __h = BNC.h, __Frag = BNC.Fragment, useState = BNC.useState, useMemo = BNC.useMemo, useGrokTheme = BNC.useGrokTheme;
var Page = BNC.Page, Section = BNC.Section, Text = BNC.Text, TableOfContents = BNC.TableOfContents, Callout = BNC.Callout, Properties = BNC.Properties, Table = BNC.Table, Diagram = BNC.Diagram, Steps = BNC.Steps, BulletList = BNC.BulletList, Segmented = BNC.Segmented, Equation = BNC.Equation, Frac = BNC.Frac, LinkCards = BNC.LinkCards, BackToTop = BNC.BackToTop, Input = BNC.Input, Button = BNC.Button;
function App() {
  return /* @__PURE__ */ __h(
    Page,
    {
      title: "Bagel Calculator",
      summary: "The Bagel Calculator scales an approved formula to a requisition. Select a published formula, enter a batch multiple, choose an ingredient type where a published variant exists, and read the scaled ingredient weights, the priced cost of each line, the Burden Rate added to it, and the routing slip the requisition follows."
    },
    /* @__PURE__ */ __h(
      TableOfContents,
      {
        items: [
          { label: "What this tool is", id: "what" },
          { label: "Bagel types and status", id: "types" },
          { label: "Approval routing slip", id: "routing" },
          { label: "User flow, edge cases, and errors", id: "flow" },
          { label: "Published prices and sources", id: "prices" }
        ]
      }
    ),
    /* @__PURE__ */ __h(Section, { heading: "What this tool is", id: "what" }, /* @__PURE__ */ __h(Text, null, "The Bagel Calculator scales an approved formula to a requisition. A colleague selects a published formula, enters a batch multiple, chooses an ingredient type where the formula allows one, and reads the scaled ingredient weights, the bagel count for the lot, the cost of each priced line, the Burden Rate added to it, and the routing slip that the requisition follows. The requisition panel sits to the right of this page. The Bagel Bakers Union of the Greater Milwaukee Area, Local 7, issues it as decision support for documented readiness."), /* @__PURE__ */ __h(Text, null, "It does not order food or release a lot. A requisition is a demand signal that still has to walk `PPL-1400`. Flavor remains a downstream concern of the vendor. Priya Nandakumar owns the gates."), /* @__PURE__ */ __h(
      Properties,
      {
        items: [
          { label: "Owner", value: "Bagel Lifecycle PMO for routing, Bagel Bakers Union of the Greater Milwaukee Area, Local 7 for release language" },
          { label: "Official close", value: "Index and BRI figures lock at Tuesday 08:00 close, America/Chicago" },
          { label: "What it is not", value: "Not a storefront, not a payment form, not a Stage 15, not a way around the everything-bagel freeze" },
          { label: "Prices", value: "Published list prices, plus the Wisconsin minimum wage, Bureau of Labor Statistics benefit rates and Energy Information Administration energy figures for the Burden Rate, each with its source and date (the operating cost is labeled an estimate), under Published Prices and Sources" },
          { label: "Status", value: "In service" }
        ]
      }
    )),
    /* @__PURE__ */ __h(Section, { heading: "Bagel types and status", id: "types" }, /* @__PURE__ */ __h(Text, null, "Variety comes first. Toppings are not a garnish list built by hand. They are baked into the type, then flagged against current compliance. Each type carries a status, the governing policy, and a rule for whether a requisition can be opened. Unclassified novelty is in scope of `SAF-400` but is not a released breakfast."), /* @__PURE__ */ __h(
      Table,
      {
        columns: ["Type", "Built-in toppings", "Status", "Requisition rule"],
        rows: [
          [
            "Plain",
            "None",
            { text: "Released", tone: "success" },
            "Default authorized variety. No seed-loss audit. Still requires a complete storage log and an in-tier schmear, including a 4 mm halo if any cream cheese is applied."
          ],
          [
            "Sesame",
            "Sesame only",
            { text: "Released, under watch", tone: "warning" },
            "Retention sits at 91.7 percent against a 93.0 percent threshold under `BSC-220`. Catch-tray plating is required. Do not call it a bib. Seeds beyond the seven-seed cap are reported to the requestor's cost-center."
          ],
          [
            "Poppy",
            "Poppy only",
            { text: "Released, unauditable", tone: "warning" },
            "Still on the service mix, but poppy is too small to audit in good faith. The working group formed on 22 October 2026 has not agreed on a counting method. A good-faith uncountability allowance applies in the interim."
          ],
          [
            "Everything",
            "Sesame, poppy, garlic, onion, and other visible granules",
            { text: "Frozen", tone: "danger" },
            "Removed from the standard mix pending a complete allium bill of materials, by weight range and origin lot. Other visible granules is not a documentation standard. The calculator may explain the freeze. It will not release a requisition. Heritage Inventory already in the building as of 31 October may be noted, untoasted only, and is not a new demand signal."
          ],
          [
            "Unclassified novelty",
            "Whatever the vendor has not yet named",
            { text: "Not releasable", tone: "danger" },
            "Requires an appendix and a taste-panel waiver almost no one completes on time. Selecting it opens a denial."
          ]
        ]
      }
    ), /* @__PURE__ */ __h(Text, null, "After variety, the form reveals only the add-ons that policy can still imagine: schmear at the employee's morning-of-service tier from Dana Ruiz's roster, toasting inside a reserved window at the employee's Toaster Privilege Level, and, for Vice President and above, lox adjacency if `SAF-400-B` was filed the prior business day. Capers are out of scope and must not appear on the requisition, in a photograph, or in a line item. Tier 0 colleagues, including Sam Delgado and anyone unattested, receive visual schmear only. Acting titles do not confer acting schmear.")),
    /* @__PURE__ */ __h(Section, { heading: "Approval routing slip", id: "routing" }, /* @__PURE__ */ __h(Text, null, "A requisition emits a routing slip: a one-page artifact the colleague can recognize as a memo's cousin, with policy citations in the margin of each step. Jordan Hale is Informed immediately and becomes Responsible only at placement. A requisition approval is not a Stage 14 release. The lot can still be pulled if the morning temperature log opens a CAPA."), /* @__PURE__ */ __h(
      Diagram,
      {
        direction: "vertical",
        nodes: [
          { id: "req", label: "Requestor", detail: "Attests quantity one, in-window", kind: "person" },
          { id: "roster", label: "Dana Ruiz roster", detail: "Morning-of-service tier", kind: "box" },
          { id: "quote", label: "Requisition recorded", detail: "Quantities as scaled", kind: "box" },
          { id: "finance", label: "Margaret Lin", detail: "Flour envelope, 4410-B, capex if any", kind: "person" },
          { id: "gates", label: "Policy gates", detail: "Schmear, storage, yeast as needed", kind: "decision" },
          { id: "pmo", label: "Priya Nandakumar", detail: "PPL-1400 still applies", kind: "person" },
          { id: "board", label: "CFBRB", detail: "Confirms gates, not taste", kind: "box" },
          { id: "obe", label: "Helen Voss / Local 7", detail: "Conditional release language", kind: "person" },
          { id: "steward", label: "Jordan Hale", detail: "Informed now, Responsible at the tray", kind: "terminal" }
        ],
        edges: [
          { from: "req", to: "roster", label: "Tier check" },
          { from: "roster", to: "quote" },
          { from: "quote", to: "finance", label: "Flour check" },
          { from: "finance", to: "gates" },
          { from: "gates", to: "pmo", label: "If still a bagel" },
          { from: "pmo", to: "board" },
          { from: "board", to: "obe" },
          { from: "obe", to: "steward", label: "Informed" }
        ]
      }
    ), /* @__PURE__ */ __h(
      Table,
      {
        columns: ["Slip line", "Policy cited", "What it records"],
        rows: [
          ["Quantity one, this window only", "EBO-MEMO-2026-118; SAF-400 \xA72", "No anticipatory consumption, no Friday second bagel, no banking of an unspread half"],
          ["Requestor tier at service", "SAF-400 \xA72; People Operations roster", "Morning-of-service role. Acting titles do not confer acting schmear"],
          ["Schmear depth and 4 mm halo", "SAF-400 \xA72\u20133", "Issued spreader S-2 only. A second pass may correct a gap, not add depth. Filling in the halo is a reportable event"],
          ["Exception, if any", "SAF-400 \xA74, Form SAF-EX-1", "Two business days' notice. Hunger, habit, and it looks thin are not grounds. Committee every other Thursday"],
          ["Lox adjacency, if any", "SAF-400 Executive Overlay; SAF-400-B", "Prior business day. Capers excluded. Routes as capex, not as a condiment"],
          ["Toaster, if any", "BSC-220 \xA73; TIP-9", "Reserved 15-minute slot, closed 16:30 the prior day. After-hours needs two TPL-4 acknowledgments. I like it dark is returned"],
          ["Seed-loss cap", "BSC-220 \xA72", "Seven sesame seeds per bagel per shift, 24-inch vicinity. They just fall off is not a root cause"],
          ["Hold and temperature", "BSC-220 \xA71", "68.0 to 72.0 F. Room temperature is retired. No still-good checkbox"],
          ["Lifecycle gates remain open", "PPL-1400 Stages 1\u201314", "A bagel does not arrive. It is released. Boil no-change confirmation still required. Silence is not a control"],
          ["Yeast docket, if the lot is new", "PPL-1400 Stage 4", "Tuesday 09:00, cutoff 08:55"],
          ["Finance attestation", "PPL-1400 Stage 13", "Per-bagel ceiling on request with a reason and a cost-center. Complimentary extras refused"],
          ["Conditional release", "PPL-1400 Stage 14", "Tray card, lot number, Steward on duty. Still recallable if a CAPA opens"]
        ]
      }
    ), /* @__PURE__ */ __h(Text, null, "The foot of the slip reads: questions go to the Bagel Bakers Union of the Greater Milwaukee Area, Local 7, not to your manager's manager; printed copies are uncontrolled after 24 hours; please do not reply all.")),
    /* @__PURE__ */ __h(Section, { heading: "User flow, edge cases, and errors", id: "flow" }, /* @__PURE__ */ __h(Text, null, "The flow should feel like an intranet form. Each step can fail in a voice the Union already uses."), /* @__PURE__ */ __h(
      Steps,
      {
        steps: [
          {
            title: "Identify the colleague",
            detail: "The roster, not the meeting they are walking into, sets tier and toaster privilege for the morning of service. Unattested colleagues are treated as Tier 0."
          },
          {
            title: "Choose a service date and window",
            detail: "Primary window 08:15 to 10:00. After 10:00 the form reclassifies the ask as Mid-Morning Hold. After 16:30 it becomes a Heritage Inventory question, untoasted, and usually a no."
          },
          {
            title: "Select a bagel type",
            detail: "Compliance flags appear immediately. Frozen and unreleasable types stop the requisition and may still show a ghost line so the record shows a decision."
          },
          {
            title: "Declare schmear, toast, and any Executive Overlay add-on",
            detail: "Controls that the roster does not permit are visible and disabled, with the governing sentence underneath, not hidden."
          },
          {
            title: "Scale the approved formula",
            detail: "The published bill of materials is multiplied by the batch multiple. A zero or negative multiple is refused, and a fractional multiple is accepted."
          },
          {
            title: "Choose ingredient types",
            detail: "Where a formula allows a published variant, the ingredient name is the selector. A change of type never changes a quantity. It changes only the price source for that line."
          },
          {
            title: "Attest and submit",
            detail: "Quantity one, this window, no anticipatory consumption, halo respected, no capers in any accompanying image. Submit emits the routing slip. It does not release a lot."
          }
        ]
      }
    ), /* @__PURE__ */ __h(Section, { heading: "Error messages, in the Union voice" }, /* @__PURE__ */ __h(
      Table,
      {
        columns: ["Trigger", "Message"],
        rows: [
          ["Everything selected", "This variety is frozen pending allium documentation. An exception cannot authorize a product that is not released."],
          ["DIY everything or reapply seeds", "Reapplication is reconstruction of a finished product and is out of scope for all privilege levels."],
          ["Tier 0 schmear", "Visual schmear only. Cream cheese may be observed in its tub. A dry bagel is still a bagel."],
          ["It looks thin, hunger, or habit as grounds", "Not accepted grounds under SAF-400. The form is for mission-critical, non-habitual need, in 150 words or fewer."],
          ["Filling in the halo", "The 4 mm halo of naked bagel is mandatory. Filling it in is a reportable event, not a preference."],
          ["Manager spots schmear onto a report's bagel", "That is a transfer of controlled commodity. It cannot be entered on this requisition."],
          ["Second bagel, especially on Friday", "Anticipatory consumption is not a recognized need. If Monday is a concern, Monday's forecast is the correct instrument."],
          ["Complimentary extra from the vendor", "An uncontrolled unit will be refused at receiving. Do not add it here."],
          ["Just order more cream cheese", "This option was considered in the tiger-team pre-read and is closed."],
          ["I like it dark, or after-hours toast", "Comments of that form are returned for a business justification. After-hours cycles require two TPL-4 acknowledgments and will chime."],
          ["Room temperature, or still good", "Room temperature was retired in BSC-220 Rev 3.0. There is no still-good checkbox. Without a calibrated reading, the bagel is merely located."],
          ["They just fall off", "That is a description, not a root cause. The seven-seed cap still applies."],
          ["Calling the catch-tray a bib", "Employees have asked us not to call it that."],
          ["Lot docketed after 08:55 Tuesday", "Yeast Governance will not review a late docket this week. The requisition can exist. The lot cannot move."],
          ["Just this once on cooling", "This stage has no expedite path. The request has been filed and then not approved."],
          ["Skip a gate to get bagels in the building", "That path is how the March incident occurred, and it is not a calculator function."],
          ["Capers on the requisition or in a photo", "Capers are out of scope and must not appear in the same photograph as an official bagel."],
          ["Eyeballing depth", "Authorized depth is measured with the official feeler gauge. Eyeballing is not a method."],
          ["Unattested user seeking Tier 1", "Acknowledgment of SAF-400 Rev 4.2 is outstanding. You will be served under Tier 0 until the form is filed."],
          ["Midweek BRI used as official", "Midweek improvement is encouraging but not official. The factor in (1) is the Tuesday close."]
        ]
      }
    ))),
    /* @__PURE__ */ __h(Section, { heading: "Related material" }, /* @__PURE__ */ __h(
      LinkCards,
      {
        links: [
          {
            title: "Opening Notice: Bagelnomics Enters Service as the System of Record",
            site: "www.bagelnomics.com",
            date: "11 November 2026",
            href: "https://www.bagelnomics.com/2026/11/11/we-do-not-make-bagels-we-make-bagel-certainty/"
          }
        ]
      }
    )),
    /* @__PURE__ */ __h(BackToTop, null)
  );
}

/* Bagel Calculator, requisition panel, price tape and price record.
   Plain JavaScript, no libraries, no cookies, no localStorage, no network calls.
   Prices, the minimum wage, the benefit load and the energy rates are read from the JSON block with id "bn-prices" that sits in the same page.
   Every selection lives in memory for this visit only. */
var PANEL = (function () {
  "use strict";
  var G_PER_LB = 453.59237;
  var FORMULAS = [{"id":"ka-classic","name":"King Arthur Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/bagels-recipe","group":"original","bagels":12,"yieldNote":"12 standard-size; 8 large also published","rows":[{"n":"Instant yeast","d":"1 tablespoon (9g)","g":9,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups (480g)","g":480,"c":"flour","s":"flour_bread"},{"n":"Table salt","d":"2 teaspoons (12g)","g":12,"c":"salt","s":"salt_table"},{"n":"Non-diastatic malt powder","d":"1 tablespoon (9g); brown sugar or barley malt syrup also published","g":9,"c":"malt","s":"malt_nondiastatic"},{"n":"Water, dough","d":"1 1/3 cups (303g)","g":303,"fx":"fix_water"},{"n":"Water, bath","d":"2 quarts (1814g)","g":1814,"fx":"fix_water"},{"n":"Non-diastatic malt powder, bath","d":"2 tablespoons (18g)","g":18,"c":"malt","s":"malt_nondiastatic","q":"bath"},{"n":"Granulated sugar, bath","d":"1 tablespoon (14g)","g":14,"c":"sweetener","s":"sweet_granulated","q":"bath"}]},{"id":"se-magic","name":"Serious Eats Magic Bagels (Stella Parks)","source":"Serious Eats","href":"https://www.seriouseats.com/homemade-bagels-recipe","group":"original","bagels":8,"rows":[{"n":"Water, yukone","d":"6 ounces / 3/4 cup (170g)","g":170,"fx":"fix_water"},{"n":"Bread flour, yukone","d":"3 1/2 ounces (100g)","g":100,"c":"flour","s":"flour_bread","q":"yukone"},{"n":"Bread flour, dough","d":"12 1/2 ounces (355g)","g":355,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Sugar","d":"1/2 ounce / 1 tablespoon (15g)","g":15,"c":"sweetener","s":"sweet_granulated"},{"n":"Diamond Crystal kosher salt","d":"2 1/2 teaspoons (9g)","g":9,"c":"salt","s":"salt_dckosher"},{"n":"Instant dry yeast","d":"1 teaspoon (4g)","g":4,"c":"yeast","s":"yeast_instant"},{"n":"Water, dough","d":"3 1/2 ounces (100g)","g":100,"fx":"fix_water"},{"n":"Barley malt syrup, bath","d":"1 ounce / 4 teaspoons (30g)","g":30,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"nyt-saffitz","name":"NYT Cooking guide (Claire Saffitz)","source":"NYT Cooking","href":"https://cooking.nytimes.com/article/bagels","group":"original","bagels":12,"yieldNote":"12 pieces at 125g; a baker's dozen of 4-ounce pieces is also published","convNote":"Malt syrup tablespoons converted at 21g; baking soda teaspoon at 4.6g. Bath syrup may be increased until the water looks like strong black tea; taken at the 1/4 cup published start.","rows":[{"n":"Lukewarm water","d":"2 1/4 cups / 530 milliliters","g":530,"fx":"fix_water"},{"n":"Barley malt syrup, dough","d":"2 tablespoons","g":42,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Active dry yeast","d":"1 (1/4-ounce) packet / about 2 1/4 teaspoons","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Bread flour","d":"6 1/2 cups / 885 grams","g":885,"c":"flour","s":"flour_bread"},{"n":"Kosher salt","d":"2 tablespoons / 17 grams Diamond Crystal, or 1 tablespoon / 17 grams Morton","g":17,"c":"salt","s":"salt_dckosher"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Barley malt syrup, bath","d":"1/4 cup / 60 milliliters, plus more as needed","g":85,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"smitten-reinhart","name":"Peter Reinhart via Smitten Kitchen","source":"Smitten Kitchen","href":"https://smittenkitchen.com/2007/09/bronx-worthy-bagels/","group":"original","bagels":12,"yieldNote":"12 standard (4 1/2 ounce pieces); 16 regularly large or 24 miniature also published","convNote":"The page publishes cups and teaspoons only. Grams use King Arthur standard weights: flour 120g/cup, water 237g/cup, instant yeast 3.1g/tsp, table salt 6g/tsp, malt powder 3g/tsp, baking soda 14g/tbsp.","rows":[{"n":"Instant yeast, sponge","d":"1 teaspoon","g":3.1,"c":"yeast","s":"yeast_instant","q":"sponge"},{"n":"Bread or high-gluten flour, sponge","d":"4 cups","g":480,"c":"flour","s":"flour_bread","q":"sponge"},{"n":"Water, sponge","d":"2 1/2 cups","g":591,"fx":"fix_water"},{"n":"Instant yeast, dough","d":"1/2 teaspoon","g":1.6,"c":"yeast","s":"yeast_instant","q":"dough"},{"n":"Bread or high-gluten flour, dough","d":"3 3/4 cups","g":450,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Salt","d":"2 3/4 teaspoons","g":16.5,"c":"salt","s":"salt_table"},{"n":"Malt powder","d":"2 teaspoons; 1 tablespoon malt syrup, honey, or brown sugar also published","g":6,"c":"malt","s":"malt_nondiastatic"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"sally-everything","name":"Sally's Everything Bagels","source":"Sally's Baking Addiction","href":"https://sallysbakingaddiction.com/homemade-everything-bagels/","group":"original","bagels":8,"convNote":"Yeast, salt, and toppings published by volume; grams use King Arthur/typical spice weights. Egg white counted as one egg.","rows":[{"n":"Warm water, dough","d":"1 1/2 cups (360ml)","g":360,"fx":"fix_water"},{"n":"Instant or active dry yeast","d":"2 3/4 teaspoons","g":8.5,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups (520g)","g":520,"c":"flour","s":"flour_bread"},{"n":"Packed brown sugar","d":"1 tablespoon; barley malt syrup also published","g":14,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Water, bath","d":"2 quarts","g":1893,"fx":"fix_water"},{"n":"Honey, bath","d":"1/4 cup (85g); barley malt syrup also published","g":85,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Poppy seeds","d":"2 tablespoons","g":18,"c":"topping","s":"top_poppy"},{"n":"Sesame seeds","d":"2 tablespoons","g":18,"c":"topping","s":"top_sesame"},{"n":"Dried minced onion","d":"1 tablespoon","g":5,"c":"topping","s":"top_onion"},{"n":"Dried garlic flakes","d":"1 tablespoon","g":8,"c":"topping","s":"top_garlic"},{"n":"Coarse or flaky sea salt","d":"1 tablespoon","g":18,"c":"salt","s":"salt_pretzel"},{"n":"Egg white, wash","d":"1 egg white beaten with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"ka-montreal","name":"King Arthur Montreal Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/montreal-bagels-recipe","group":"original","bagels":8,"convNote":"Maple syrup 2 teaspoons converted at 7g/tsp.","rows":[{"n":"Water, dough","d":"1 cup (227g)","g":227,"fx":"fix_water"},{"n":"Maple syrup","d":"2 teaspoons","g":14,"c":"sweetener","s":"sweet_maple"},{"n":"Instant or active dry yeast","d":"2 teaspoons","g":6.2,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"3 1/4 to 3 1/2 cups (390g to 420g); taken at 420g, including flour used as needed to knead","g":420,"c":"flour","s":"flour_bread"},{"n":"Table salt","d":"1 teaspoon (6g)","g":6,"c":"salt","s":"salt_table"},{"n":"Sesame or poppy seeds","d":"3/4 cup (106g)","g":106,"c":"topping","s":"top_sesame"},{"n":"Water, bath","d":"3 quarts (2722g)","g":2722,"fx":"fix_water"},{"n":"Honey, bath","d":"1/3 cup (113g); 1/4 cup (85g) barley malt syrup also published","g":113,"c":"sweetener","s":"sweet_honey","q":"bath"}]},{"id":"tpl-sourdough","name":"The Perfect Loaf Sourdough Bagels","source":"The Perfect Loaf (Maurizio Leo)","href":"https://www.theperfectloaf.com/sourdough-bagel/","group":"original","bagels":12,"yieldNote":"12 x 125g bagels","rows":[{"n":"High-protein flour, levain","d":"116g","g":116,"c":"flour","s":"flour_bread","q":"levain"},{"n":"Water, levain","d":"58g","g":58,"fx":"fix_water"},{"n":"Ripe sourdough starter","d":"23g","g":23,"fx":"fix_none"},{"n":"High-protein flour, dough","d":"848g","g":848,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Water, dough","d":"472g","g":472,"fx":"fix_water"},{"n":"Caster sugar","d":"29g","g":29,"c":"sweetener","s":"sweet_granulated"},{"n":"Barley malt syrup","d":"29g","g":29,"c":"malt","s":"malt_barleysyrup"},{"n":"Salt","d":"18g","g":18,"c":"salt","s":"salt_table"},{"n":"Diastatic malt","d":"7g","g":7,"c":"malt","s":"malt_diastatic"}]},{"id":"ka-sourdough","name":"King Arthur Sourdough Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/sourdough-bagels-recipe","group":"original","bagels":12,"rows":[{"n":"Bread flour","d":"7 cups (840g)","g":840,"c":"flour","s":"flour_bread"},{"n":"Water, dough","d":"1 3/4 cups plus 2 tablespoons (425g)","g":425,"fx":"fix_water"},{"n":"Ripe sourdough starter","d":"1 cup (227g)","g":227,"fx":"fix_none"},{"n":"Honey, dough","d":"3 tablespoons (63g)","g":63,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Table salt, dough","d":"1 tablespoon (18g)","g":18,"c":"salt","s":"salt_table","q":"dough"},{"n":"Water, bath","d":"about 2 quarts (2000g)","g":2000,"fx":"fix_water"},{"n":"Honey, bath","d":"1 tablespoon (21g)","g":21,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Table salt, bath","d":"1/2 teaspoon (3g)","g":3,"c":"salt","s":"salt_table","q":"bath"},{"n":"Everything, sesame, or poppy topping, optional","d":"2/3 cup (94g)","g":94,"o":1,"c":"topping","s":"top_everything","q":"optional"}]},{"id":"ba-szewczyk","name":"Bon Appetit (Szewczyk)","source":"Bon Appetit, Jesse Szewczyk","href":"https://www.bonappetit.com/recipe/homemade-bagels","group":"addition","bagels":12,"convNote":"Water 2 1/4 cups at 237g/cup. Salt grams use Diamond Crystal 3g/tsp for 1 Tbsp plus 1 1/2 tsp. Sugar divided 50g as published.","rows":[{"n":"Bread flour","d":"3 3/4 cups (469g)","g":469,"c":"flour","s":"flour_bread"},{"n":"All-purpose flour","d":"3 cups (375g)","g":375,"c":"flour","s":"flour_ap"},{"n":"Diamond Crystal kosher salt","d":"1 Tbsp. plus 1 1/2 tsp.; 2 3/4 tsp. Morton also published","g":10.5,"c":"salt","s":"salt_dckosher"},{"n":"Sugar, dough","d":"1 Tbsp. of the 4 Tbsp. (50g) divided","g":12.5,"c":"sweetener","s":"sweet_granulated","q":"dough"},{"n":"Instant yeast","d":"1 tsp.","g":3.1,"c":"yeast","s":"yeast_instant"},{"n":"Water, dough","d":"2 1/4 cups room-temperature, published in the method","g":532,"fx":"fix_water"},{"n":"Baking soda, bath","d":"1 Tbsp.","g":14,"fx":"fix_bakingsoda"},{"n":"Sugar, bath","d":"remaining 3 Tbsp. of the 4 Tbsp. (50g) divided","g":37.5,"c":"sweetener","s":"sweet_granulated","q":"bath"}]},{"id":"food52","name":"Food52 Homemade Bagels","source":"Food52","href":"https://food52.com/recipes/22934-homemade-bagels","group":"addition","bagels":8,"yieldNote":"Makes 6 to 8; 8, the smaller published piece count, is used","convNote":"Flour uses the published 1 pound weight, at 454g. Other volumes use King Arthur / roster standard weights: water 237g/cup so 1 cup plus 2 tablespoons is 267g, instant yeast 3.1g/tsp, coarse kosher salt 3g/tsp, honey 21g/tbsp, baking soda 4.6g/tsp. The 3 teaspoons of salt are divided 2 teaspoons in the dough and 1 teaspoon in the bath, as published in the method.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 7 February 2025 archive.org snapshot of this URL. The live page returned HTTP 403 and 429 (Vercel challenge) on retry. Seeds are published as \"Seeds!\" without a quantity and are omitted. Bath water is \"at least 4 inches deep\" with no volume and is omitted. The headnote allows barley malt syrup in place of honey; honey is the published formula and is used.","rows":[{"n":"Unbleached flour","d":"3 1/2 cups (1 pound / 454g)","g":454,"c":"flour","s":"flour_ap"},{"n":"Coarse kosher salt, dough","d":"2 teaspoons of the 3 teaspoons, divided","g":6,"c":"salt","s":"salt_mortonkosher","q":"dough"},{"n":"Instant yeast","d":"3/4 teaspoon","g":2.3,"c":"yeast","s":"yeast_instant"},{"n":"Honey","d":"1 tablespoon; barley malt syrup also published in the headnote","g":21,"c":"sweetener","s":"sweet_honey"},{"n":"Water, dough","d":"1 cup plus 2 tablespoons, room-temp or slightly warm","g":267,"fx":"fix_water"},{"n":"Coarse kosher salt, bath","d":"remaining 1 teaspoon of the 3 teaspoons, divided","g":3,"c":"salt","s":"salt_mortonkosher","q":"bath"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Egg white, optional wash","d":"1 egg white, optional","e":1,"o":1,"fx":"fix_egg"}]},{"id":"atk-ny","name":"ATK New York Bagels","source":"America's Test Kitchen (Andrew Janjigian)","href":"https://www.americastestkitchen.com/recipes/8358-new-york-bagels","group":"addition","bagels":8,"convNote":"Malt syrup 2 Tbsp and vital wheat gluten 4 tsp converted at 21g/tbsp and 3g/tsp. Baking soda 14g/tbsp.","rows":[{"n":"Ice water","d":"1 cup plus 2 tablespoons (9 ounces / 255 grams)","g":255,"fx":"fix_water"},{"n":"Malt syrup","d":"2 tablespoons","g":42,"c":"malt","s":"malt_barleysyrup"},{"n":"Bread flour","d":"2 2/3 cups (14 2/3 ounces / 416 grams)","g":416,"c":"flour","s":"flour_bread"},{"n":"Vital wheat gluten","d":"4 teaspoons","g":12,"fx":"fix_vwg"},{"n":"Instant or rapid-rise yeast","d":"2 teaspoons","g":6.2,"c":"yeast","s":"yeast_instant"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Cornmeal","d":"1/4 cup (1 1/4 ounces / 35 grams)","g":35,"fx":"fix_cornmeal"},{"n":"Sugar, bath","d":"1/4 cup (1 3/4 ounces / 50 grams)","g":50,"c":"sweetener","s":"sweet_granulated","q":"bath"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"bbc-kimber","name":"BBC Good Food (Edd Kimber)","source":"BBC Good Food","href":"https://www.bbcgoodfood.com/recipes/edds-bagels","group":"addition","bagels":10,"convNote":"Brown sugar 2 Tbsp at 14g. Salt 1 tsp at 6g.","notes":"Seeds of your choice are published without a quantity and are omitted.","rows":[{"n":"Fast-action dried yeast","d":"7g sachet","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Strong white flour","d":"500g","g":500,"c":"flour","s":"flour_bread"},{"n":"Light brown soft sugar","d":"2 tbsp","g":28,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Salt","d":"1 tsp, published in the method","g":6,"c":"salt","s":"salt_table"},{"n":"Lukewarm water","d":"300ml, published in the method","g":300,"fx":"fix_water"},{"n":"Bicarbonate of soda, bath","d":"1 tbsp","g":14,"fx":"fix_bakingsoda"},{"n":"Egg white, glaze","d":"1 egg white","e":1,"fx":"fix_egg"}]},{"id":"weissman","name":"Joshua Weissman New York Bagels","source":"Joshua Weissman","href":"https://www.joshuaweissman.com/recipes/the-best-homemade-new-york-bagels-recipe","group":"addition","bagels":8,"notes":"Food-grade lye is published as optional and is excluded. A large pinch of bath salt has no quantity and is omitted. Cream cheese, lox, and service garnishes are a serving suggestion, not the formula.","rows":[{"n":"Sesame seeds, everything mix","d":"3 Tbsp (27g)","g":27,"c":"topping","s":"top_sesame","q":"everything mix"},{"n":"Poppy seeds, everything mix","d":"2 Tbsp (20g)","g":20,"c":"topping","s":"top_poppy","q":"everything mix"},{"n":"Onion flakes","d":"1 Tbsp (9g)","g":9,"c":"topping","s":"top_onion"},{"n":"Minced dried garlic","d":"1/2 Tbsp (4g)","g":4,"c":"topping","s":"top_garlic"},{"n":"Flaky salt, everything mix","d":"1 Tbsp (12g)","g":12,"c":"salt","s":"salt_pretzel","q":"everything mix"},{"n":"Water, dough","d":"1.5 cups (360mL)","g":360,"fx":"fix_water"},{"n":"Instant yeast","d":"1 tsp (3g)","g":3,"c":"yeast","s":"yeast_instant"},{"n":"Barley malt syrup, dough","d":"2.5 tsp (18g)","g":18,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Bread flour","d":"4 cups (600g)","g":600,"c":"flour","s":"flour_bread"},{"n":"Fine sea salt, dough","d":"1 Tbsp (16g)","g":16,"c":"salt","s":"salt_finesea","q":"dough"},{"n":"Water, bath","d":"3 quarts (2.8L)","g":2800,"fx":"fix_water"},{"n":"Barley malt syrup, bath","d":"1.5 Tbsp (23ml)","g":31,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"lagerstrom","name":"Brian Lagerstrom New York Bagels","source":"Brian Lagerstrom","href":"https://brianlagerstrom.com/recipes/new-york-bagels/","group":"addition","bagels":12,"rows":[{"n":"Warm water, dough","d":"530g","g":530,"fx":"fix_water"},{"n":"Instant yeast","d":"3g","g":3,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"940g","g":940,"c":"flour","s":"flour_bread"},{"n":"Diastatic malt powder","d":"10g; 10 grams sugar also published as a substitute","g":10,"c":"malt","s":"malt_diastatic"},{"n":"Kosher salt","d":"20g","g":20,"c":"salt","s":"salt_dckosher"},{"n":"Water, bath","d":"3-4 L; taken at 3.5 L, the midpoint of the published range","g":3500,"fx":"fix_water"},{"n":"Molasses, bath","d":"50g","g":50,"c":"sweetener","s":"sweet_molasses","q":"bath"}]},{"id":"alexandra","name":"Alexandra's Kitchen Foolproof Chewy Bagels","source":"Alexandra's Kitchen","href":"https://alexandracooks.com/2018/08/16/very-good-bagels-easy-ish-too/","group":"addition","bagels":12,"yieldNote":"12 smaller bagels at about 105g, or 10 at 125g; 12 is used","convNote":"Heaping teaspoon of malt syrup converted at 8g; bath 'about 1/4 cup' at 85g.","rows":[{"n":"Bread, high-gluten, or all-purpose flour","d":"6 cups (768g)","g":768,"c":"flour","s":"flour_bread"},{"n":"Diamond Crystal kosher salt","d":"3 teaspoons (20g)","g":20,"c":"salt","s":"salt_dckosher"},{"n":"Instant yeast","d":"1.5 tsp (6g)","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Water","d":"2 cups (454g)","g":454,"fx":"fix_water"},{"n":"Barley malt syrup, dough","d":"1 heaping teaspoon","g":8,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Barley malt syrup, bath","d":"about 1/4 cup","g":85,"c":"malt","s":"malt_barleysyrup","q":"bath"},{"n":"Egg, wash","d":"1 egg whisked with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"bbb","name":"Bigger Bolder Baking New York-Style Bagels","source":"Bigger Bolder Baking (Gemma Stafford)","href":"https://www.biggerbolderbaking.com/easy-new-york-style-bagel-recipe/","group":"addition","bagels":8,"notes":"Optional toppings are named without quantities and are omitted.","rows":[{"n":"Bread flour","d":"3 1/2 cups (18oz/500g)","g":500,"c":"flour","s":"flour_bread"},{"n":"Instant dry yeast","d":"2 teaspoons (6g)","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 1/2 tablespoons (18.75g)","g":18.75,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"1 1/2 teaspoons (9g)","g":9,"c":"salt","s":"salt_table"},{"n":"Warm water","d":"1 1/3 cups (300ml)","g":300,"fx":"fix_water"},{"n":"Extra bread flour for kneading in","d":"3/4 cup (3 3/4oz/105g)","g":105,"c":"flour","s":"flour_bread"}]},{"id":"alton","name":"Alton Brown Bagels from Scratch","source":"Food Network / Good Eats","href":"https://www.foodnetwork.com/recipes/alton-brown/bagels-from-scratch-9873518","group":"addition","bagels":12,"rows":[{"n":"Bread flour","d":"855 grams (6 1/4 cups)","g":855,"c":"flour","s":"flour_bread"},{"n":"Filtered water, dough","d":"520 grams (2 1/4 cups)","g":520,"fx":"fix_water"},{"n":"Malt syrup, total","d":"100 grams (1/4 cup plus 1 tablespoon), of which 20g goes in the dough and 80g in the bath","g":100,"c":"malt","s":"malt_barleysyrup","q":"total"},{"n":"Fine salt, total","d":"75 grams (1/4 cup plus 1 teaspoon), of which 25g goes in the dough and 50g in the bath","g":75,"c":"salt","s":"salt_table","q":"total"},{"n":"Active dry yeast","d":"4 grams (3/4 teaspoon)","g":4,"c":"yeast","s":"yeast_activedry"}]},{"id":"black-seed","name":"Black Seed via Epicurious","source":"Epicurious / Black Seed (Dianna Daoheung)","href":"https://www.epicurious.com/recipes/food/views/plain-bagels-51237040","group":"addition","bagels":12,"convNote":"Flour 120g/cup, water 237g/cup, honey 21g/tbsp and 84g per 1/4 cup, oil 14g/tbsp, malt powder 9g/tbsp, kosher salt 3g/tsp.","rows":[{"n":"Active dry yeast","d":"1 envelope (1/4 ounce)","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Honey, total","d":"1 1/2 tablespoons plus 1/4 cup, divided","g":115,"c":"sweetener","s":"sweet_honey","q":"total"},{"n":"Non-diastatic malt powder","d":"1 tablespoon","g":9,"c":"malt","s":"malt_nondiastatic"},{"n":"Neutral oil","d":"3 tablespoons","g":42,"c":"oil","s":"oil_vegetable"},{"n":"High-gluten or bread flour","d":"9 cups","g":1080,"c":"flour","s":"flour_highgluten"},{"n":"Kosher salt","d":"2 teaspoons","g":6,"c":"salt","s":"salt_dckosher"},{"n":"Water, dough","d":"2 2/3 cups, published in the method (also in the Eater reprint of the same formula)","g":631,"fx":"fix_water"},{"n":"Water, bath","d":"4 quarts","g":3785,"fx":"fix_water"}]},{"id":"kitchn","name":"The Kitchn Homemade Bagels","source":"The Kitchn","href":"https://www.thekitchn.com/bagel-recipe-23035192","group":"addition","bagels":12,"convNote":"King Arthur weights: flour 120g/cup, water 237g/cup, brown sugar 14g/tbsp, kosher salt 3g/tsp, yeast 3.1g/tsp, baking soda 4.6g/tsp, seeds 144g/cup.","rows":[{"n":"Bread flour","d":"4 cups, plus more for kneading","g":480,"c":"flour","s":"flour_bread"},{"n":"Packed light brown sugar, dough","d":"1 tablespoon","g":14,"c":"sweetener","s":"sweet_lightbrown","q":"dough"},{"n":"Kosher salt, dough","d":"1 1/2 teaspoons","g":4.5,"c":"salt","s":"salt_dckosher","q":"dough"},{"n":"Active dry yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water, dough","d":"1 1/2 cups","g":355,"fx":"fix_water"},{"n":"Water, bath","d":"8 cups (2 quarts)","g":1893,"fx":"fix_water"},{"n":"Packed light brown sugar, bath","d":"3 tablespoons","g":42,"c":"sweetener","s":"sweet_lightbrown","q":"bath"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Kosher salt, bath","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher","q":"bath"},{"n":"Topping, optional","d":"1/2 cup everything, poppy, or sesame","g":72,"o":1,"fx":"fix_none"}]},{"id":"wapo","name":"Washington Post Best-of Bagels","source":"The Washington Post","href":"https://www.washingtonpost.com/recipes/best-bagels/","group":"addition","bagels":9,"yieldNote":"8 to 9 equal portions of about 4 ounces / 115 grams; 9 is used, matching the published nutrition basis and JSON-LD yield","convNote":"Flour 623g and water 337g are the published weights. Malt syrup 1 tablespoon plus 1 teaspoon converted at 21g/tbsp, fine salt at 6g/tsp, instant yeast at 3.1g/tsp, cornmeal at 9g/tbsp, and optional 1/2 cup toppings at 144g/cup.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 17 June 2024 archive.org snapshot of this URL. A live WebFetch returned the same title and headnote but was truncated before the ingredient list; direct curl to the live host timed out. Bath water is \"3 inches\" with no volume and is omitted. Optional toppings are published as 1/2 cup of a favorite, or an everything mix of 2 tablespoons each sesame and poppy and 1 tablespoon each caraway, salt, onion, and garlic; counted as 1/2 cup sesame.","rows":[{"n":"Bread flour","d":"623 grams (22 ounces; scant 5 cups); high-gluten flour also published","g":623,"c":"flour","s":"flour_bread"},{"n":"Barley malt syrup","d":"1 tablespoon plus 1 teaspoon","g":28,"c":"malt","s":"malt_barleysyrup"},{"n":"Fine salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Instant or rapid-rise active dry yeast","d":"1 1/2 teaspoons, preferably SAF brand","g":4.65,"c":"yeast","s":"yeast_instant"},{"n":"Warm water, dough","d":"337 grams (scant 1 1/2 cups), 80 degrees","g":337,"fx":"fix_water"},{"n":"Cornmeal, for dusting","d":"3 tablespoons","g":27,"fx":"fix_cornmeal"},{"n":"Optional toppings","d":"1/2 cup sesame, poppy, or everything; an everything mix of 2 tablespoons each sesame and poppy and 1 tablespoon each caraway, salt, onion, and garlic is also published","g":72,"o":1,"fx":"fix_none"}]},{"id":"love-lemons","name":"Love and Lemons Homemade Bagels","source":"Love and Lemons","href":"https://www.loveandlemons.com/bagel-recipe/","group":"addition","bagels":8,"convNote":"Water 237g/cup, maple 20g/tbsp, table/sea salt 6g/tsp, baking soda 4.6g/tsp. Everything seasoning is 'for sprinkling' without a quantity and is omitted.","rows":[{"n":"Maple or barley malt syrup, dough","d":"1 tablespoon","g":20,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Active dry yeast","d":"1 (1/4-ounce) package / 2 1/4 teaspoons","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water, dough","d":"1 1/4 cups","g":296,"fx":"fix_water"},{"n":"Bread flour","d":"540 grams; 4 1/3 cups also published","g":540,"c":"flour","s":"flour_bread"},{"n":"Sea salt, dough","d":"2 teaspoons","g":12,"c":"salt","s":"salt_finesea","q":"dough"},{"n":"Maple syrup, bath","d":"1 1/2 tablespoons","g":30,"c":"sweetener","s":"sweet_maple","q":"bath"},{"n":"Baking soda, bath","d":"2 teaspoons","g":9.2,"fx":"fix_bakingsoda"},{"n":"Salt, bath","d":"1/2 tablespoon","g":9,"c":"salt","s":"salt_table","q":"bath"},{"n":"Egg white, optional wash","d":"1 egg white with 1 tablespoon water","e":1,"o":1,"fx":"fix_egg"}]},{"id":"bbc-allen","name":"BBC Food (Rachel Allen)","source":"BBC Food","href":"https://www.bbc.co.uk/food/recipes/bagels_47163","group":"addition","bagels":7,"convNote":"Honey 21g/tbsp, oil 14g/tbsp, molasses/treacle 20g/tbsp, salt 6g/tsp.","notes":"Fine polenta for sprinkling and optional toppings have no quantities and are omitted.","rows":[{"n":"Strong white flour","d":"450g / 1lb, plus extra for dusting","g":450,"c":"flour","s":"flour_bread"},{"n":"Salt","d":"2 tsp","g":12,"c":"salt","s":"salt_table"},{"n":"Fast-acting yeast","d":"7g sachet","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Clear honey","d":"2 tbsp","g":42,"c":"sweetener","s":"sweet_honey"},{"n":"Vegetable oil","d":"1 tbsp","g":14,"c":"oil","s":"oil_vegetable"},{"n":"Black treacle or molasses","d":"3 tbsp","g":60,"c":"sweetener","s":"sweet_molasses"},{"n":"Egg, beaten","d":"1 free-range egg","e":1,"fx":"fix_egg"}]},{"id":"nyt-montreal","name":"NYT Montreal (Marcy Goldman)","source":"NYT Cooking, Marcy Goldman-Posluns","href":"https://cooking.nytimes.com/recipes/6795-montreal-bagels","group":"addition","bagels":18,"convNote":"King Arthur weights: water 237g/cup, flour 120g/cup, oil 198g/cup, honey 337g/cup so 1/2 cup=168g and 1/3 cup=113g, yeast packets 7g each, sugar 4g/tsp, salt 6g/tsp.","notes":"Sesame or poppy seeds for sprinkling have no quantity and are omitted. 'Or more' flour is taken at the 5 cups stated.","rows":[{"n":"Water, dough","d":"1 1/2 cups, room temperature","g":355,"fx":"fix_water"},{"n":"Dry quick-rising yeast","d":"2 packages; or 1 1/2 ounces fresh yeast","g":14,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 teaspoon","g":4,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"2 1/2 teaspoons","g":15,"c":"salt","s":"salt_table"},{"n":"Whole egg","d":"1 whole egg","e":1,"fx":"fix_egg"},{"n":"Egg yolk","d":"1 egg yolk; counted as a second egg","e":1,"fx":"fix_egg"},{"n":"Oil","d":"1/4 cup","g":50,"c":"oil","s":"oil_vegetable"},{"n":"Honey, dough","d":"1/2 cup","g":168,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Bread flour","d":"5 cups or more; taken at 5 cups","g":600,"c":"flour","s":"flour_bread"},{"n":"Water, bath","d":"3 quarts","g":2839,"fx":"fix_water"},{"n":"Honey or malt syrup, bath","d":"1/3 cup","g":113,"c":"malt","s":"sweet_honey","q":"bath"}]},{"id":"fnc-montreal","name":"Food Network Canada Montreal","source":"Food Network Canada","href":"https://www.foodnetwork.ca/recipe/how-to-make-montreal-style-bagels/","group":"addition","bagels":12,"convNote":"King Arthur / roster standard weights: water 237g/cup, flour 120g/cup, oil 198g/cup so 1/4 cup is 50g, honey 337g/cup so 1/2 cup is 168g, granulated sugar 12.5g/tbsp, table salt 6g/tsp, seeds 144g/cup. Yeast uses the published 16g from two 8g packages. Bath water of 8-10 cups is taken at 9 cups, the midpoint.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 8 August 2024 archive.org snapshot of this URL. The live page returned HTTP 500 on retry. Flour \"or more if dough becomes too sticky\" is taken at the 4 1/2 cups stated. A 1 tablespoon yeast measure is also published; the two 8g packages are used. Poppy or sesame seeds are published at about 1/2 cup each; taken at 1/2 cup sesame, one topping.","rows":[{"n":"Warm water, dough","d":"1 cup","g":237,"fx":"fix_water"},{"n":"Quick-rising yeast","d":"2 x 8 g packages, or 1 tablespoon; taken at 16g, the two published packages","g":16,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 tablespoon","g":12.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Egg","d":"1 egg","e":1,"fx":"fix_egg"},{"n":"Vegetable oil","d":"1/4 cup","g":50,"c":"oil","s":"oil_vegetable"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Honey, dough","d":"1/2 cup of the 1 cup, divided","g":168,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Flour","d":"4 1/2 cups, or more if dough becomes too sticky; taken at 4 1/2 cups","g":540,"c":"flour","s":"flour_ap"},{"n":"Water, bath","d":"8-10 cups; taken at 9 cups, the midpoint of the published range","g":2133,"fx":"fix_water"},{"n":"Honey, bath","d":"remaining 1/2 cup of the 1 cup, divided","g":168,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Sesame or poppy topping","d":"about 1/2 cup each published; taken at 1/2 cup sesame","g":72,"c":"topping","s":"top_sesame"}]},{"id":"amy-bakes","name":"Amy Bakes Bread sourdough","source":"Amy Bakes Bread","href":"https://amybakesbread.com/easy-homemade-sourdough-bagels/","group":"addition","bagels":12,"notes":"The 200g ripe levain in the dough is the levain already listed, not a second flour charge. Cornmeal and toppings have no quantities and are omitted.","rows":[{"n":"Ripe sourdough starter, levain","d":"24g","g":24,"fx":"fix_none"},{"n":"Granulated sugar, levain","d":"20g","g":20,"c":"sweetener","s":"sweet_granulated","q":"levain"},{"n":"Water, levain","d":"60g","g":60,"fx":"fix_water"},{"n":"All-purpose or bread flour, levain","d":"120g","g":120,"c":"flour","s":"flour_ap","q":"levain"},{"n":"Water, dough","d":"475g","g":475,"fx":"fix_water"},{"n":"Pure maple syrup","d":"30g","g":30,"c":"sweetener","s":"sweet_maple"},{"n":"Bread flour, dough","d":"820g","g":820,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Vital wheat gluten","d":"30g","g":30,"fx":"fix_vwg"},{"n":"Diastatic malt powder","d":"7g","g":7,"c":"malt","s":"malt_diastatic"},{"n":"Salt","d":"18g","g":18,"c":"salt","s":"salt_table"}]},{"id":"ka-cinnamon","name":"King Arthur Cinnamon Raisin Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/cinnamon-raisin-bagels-recipe","group":"addition","bagels":8,"notes":"Soaker water is drained and is not counted. Semolina for sprinkling has no quantity and is omitted.","rows":[{"n":"Water, raisin soaker","d":"1/2 cup (113g), hot; used to soak, then drained, and not counted as dough water retained","g":0,"fx":"fix_water"},{"n":"Raisins","d":"2/3 cup (107g)","g":107,"fx":"fix_none"},{"n":"Vietnamese cinnamon","d":"1 generous tablespoon (7g)","g":7,"fx":"fix_none"},{"n":"Water, cinnamon swirl","d":"1 tablespoon (14g)","g":14,"fx":"fix_water"},{"n":"Water, dough","d":"1 1/4 cups plus 1 tablespoon (295g)","g":295,"fx":"fix_water"},{"n":"High-gluten flour","d":"4 1/4 cups (510g)","g":510,"c":"flour","s":"flour_highgluten"},{"n":"Table salt","d":"2 teaspoons (12g)","g":12,"c":"salt","s":"salt_table"},{"n":"Barley malt syrup","d":"1 tablespoon (21g); 1 tablespoon (13g) dark brown sugar also published","g":21,"c":"malt","s":"malt_barleysyrup"},{"n":"Instant yeast","d":"1 1/2 teaspoons (5g)","g":5,"c":"yeast","s":"yeast_instant"},{"n":"Water, bath","d":"about 2 quarts (2000g)","g":2000,"fx":"fix_water"}]},{"id":"ka-ww","name":"King Arthur Whole Wheat Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/whole-wheat-bagels-recipe","group":"addition","bagels":14,"convNote":"Optional diastatic malt 1 teaspoon at 2.8g. A bread-machine half batch of 7 is also published; official yield is 14.","rows":[{"n":"Water, warm","d":"2 cups (454g)","g":454,"fx":"fix_water"},{"n":"Active dry or instant yeast","d":"1 tablespoon (11g)","g":11,"c":"yeast","s":"yeast_activedry"},{"n":"Light brown sugar","d":"1 tablespoon (14g)","g":14,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Granulated sugar","d":"1 tablespoon (11g)","g":11,"c":"sweetener","s":"sweet_granulated"},{"n":"Diastatic malt powder, optional","d":"1 teaspoon","g":2.8,"o":1,"c":"malt","s":"malt_diastatic","q":"optional"},{"n":"Bread flour","d":"3 cups (360g)","g":360,"c":"flour","s":"flour_bread"},{"n":"Golden wheat flour","d":"3 cups (340g)","g":340,"c":"flour","s":"flour_whitewheat"},{"n":"Table salt","d":"1 tablespoon (18g)","g":18,"c":"salt","s":"salt_table"}]},{"id":"gvd-pumpernickel","name":"Girl Versus Dough Pumpernickel","source":"Girl Versus Dough","href":"https://www.girlversusdough.com/pumpernickel-bagels/","group":"addition","bagels":12,"convNote":"King Arthur weights: WW 113g/cup, dark rye 106g/cup, bread 120g/cup, cocoa 85g/cup so 1/3 cup=28g, water 237g/cup, molasses 340g/cup, oil 14g/tbsp, yeast 3.1g/tsp, salt 6g/tsp, caraway and espresso 6g/tbsp.","rows":[{"n":"Whole wheat flour","d":"1 cup","g":113,"c":"flour","s":"flour_wholewheat"},{"n":"Active dry yeast","d":"4 teaspoons","g":12.4,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water","d":"1 1/4 cups","g":296,"fx":"fix_water"},{"n":"Dark rye flour","d":"1 cup","g":106,"fx":"fix_none"},{"n":"Unsweetened cocoa powder","d":"1/3 cup","g":28,"fx":"fix_none"},{"n":"Caraway seeds","d":"1 tablespoon","g":6,"fx":"fix_none"},{"n":"Instant espresso granules","d":"1 tablespoon","g":6,"fx":"fix_none"},{"n":"Salt","d":"1 1/2 teaspoons","g":9,"c":"salt","s":"salt_table"},{"n":"Molasses","d":"1/2 cup","g":170,"c":"sweetener","s":"sweet_molasses"},{"n":"Vegetable oil","d":"1 tablespoon","g":14,"c":"oil","s":"oil_vegetable"},{"n":"Bread flour","d":"1 1/4 cups, plus more as needed; taken at 1 1/4 cups","g":150,"c":"flour","s":"flour_bread"}]},{"id":"atk-gf","name":"ATK Gluten-Free Bagels","source":"America's Test Kitchen","href":"https://www.americastestkitchen.com/recipes/9007-gluten-free-bagels","group":"addition","bagels":6,"convNote":"Yeast 3.1g/tsp, sugar 12.5g/tbsp, butter 14g/tbsp, molasses 7g/tsp, psyllium ~6.7g/tbsp, baking powder 4.5g/tsp, salt 6g/tsp, xanthan 3g/tsp, baking soda 14g/tbsp.","rows":[{"n":"Warm water, dough","d":"13.3 ounces (377 grams / 1 2/3 cups)","g":377,"fx":"fix_water"},{"n":"Instant or rapid-rise yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 tablespoon","g":12.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Unsalted butter, melted","d":"3 tablespoons","g":42,"c":"butter","s":"butter_unsalted","q":"melted"},{"n":"Molasses","d":"1 teaspoon","g":7,"c":"sweetener","s":"sweet_molasses"},{"n":"ATK all-purpose gluten-free flour blend","d":"13 1/2 ounces (383 grams / 3 cups)","g":383,"fx":"fix_none"},{"n":"Gluten-free oat flour","d":"2 ounces (57 grams / 2/3 cup)","g":57,"fx":"fix_none"},{"n":"Powdered psyllium husk","d":"1 1/2 tablespoons","g":10,"fx":"fix_none"},{"n":"Baking powder","d":"2 teaspoons","g":9,"fx":"fix_none"},{"n":"Salt","d":"1 1/2 teaspoons","g":9,"c":"salt","s":"salt_table"},{"n":"Xanthan gum","d":"1/2 teaspoon","g":1.5,"fx":"fix_none"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"skinny","name":"Skinnytaste Yogurt Bagels","source":"Skinnytaste","href":"https://www.skinnytaste.com/easy-bagel-recipe/","group":"addition","bagels":4,"convNote":"Flour uses the published 5 oz weight. Yogurt 1 cup at 227g. Baking powder 4.5g/tsp, kosher salt 3g/tsp.","notes":"Optional toppings are named without quantities and are omitted. This is a no-boil yogurt dough.","rows":[{"n":"Unbleached all-purpose, whole wheat, or gluten-free mix","d":"1 cup (5 oz in weight)","g":142,"fx":"fix_none"},{"n":"Baking powder","d":"2 teaspoons","g":9,"fx":"fix_none"},{"n":"Kosher salt","d":"3/4 teaspoon","g":2.3,"c":"salt","s":"salt_dckosher"},{"n":"Non-fat Greek yogurt","d":"1 cup","g":227,"fx":"fix_none"},{"n":"Egg white or whole egg, beaten","d":"1 egg white or whole egg","e":1,"fx":"fix_egg"}]},{"id":"hbh-pretzel","name":"Half Baked Harvest Pretzel Bagels","source":"Half Baked Harvest","href":"https://www.halfbakedharvest.com/pretzel-bagels/","group":"addition","bagels":10,"convNote":"Flour 120g/cup, water 237g/cup, molasses 20g/tbsp, butter 14g/tbsp, baking soda 20g/tbsp so 1/4 cup=68g, kosher salt 3g/tsp.","notes":"Pretzel or flaky salt for topping has no quantity and is omitted.","rows":[{"n":"Warm water","d":"2 cups","g":473,"fx":"fix_water"},{"n":"Instant yeast","d":"1 packet (2 1/4 teaspoons)","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Molasses or honey","d":"1 tablespoon","g":20,"c":"sweetener","s":"sweet_molasses"},{"n":"All-purpose flour","d":"5 1/2 cups","g":660,"c":"flour","s":"flour_ap"},{"n":"Kosher salt, dough","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher","q":"dough"},{"n":"Salted butter, room temperature","d":"6 tablespoons","g":85,"c":"butter","s":"butter_salted","q":"room temperature"},{"n":"Baking soda, bath","d":"1/4 cup","g":68,"fx":"fix_bakingsoda"},{"n":"Egg, beaten","d":"1 egg","e":1,"fx":"fix_egg"}]},{"id":"okonomi","name":"Okonomi Kitchen Japanese Bagels","source":"Okonomi Kitchen","href":"https://www.okonomikitchen.com/japanese-style-bagel-recipe/","group":"addition","bagels":6,"convNote":"Malt powder 1 tsp at 3g.","notes":"The boil lists malt syrup, honey, or brown sugar without a quantity; that bath line is omitted.","rows":[{"n":"Water, dough","d":"260–268g; taken at 260g, the first published figure","g":260,"fx":"fix_water"},{"n":"Oil, optional","d":"13g","g":13,"o":1,"c":"oil","s":"oil_vegetable","q":"optional"},{"n":"Bread flour","d":"432g","g":432,"c":"flour","s":"flour_bread"},{"n":"Active dry yeast","d":"2g; a Hoshino yeast version is also published on the same page","g":2,"c":"yeast","s":"yeast_activedry"},{"n":"Malt powder","d":"1 tsp","g":3,"c":"malt","s":"malt_nondiastatic"},{"n":"Salt","d":"10g","g":10,"c":"salt","s":"salt_table"},{"n":"Brown sugar","d":"22g","g":22,"c":"sweetener","s":"sweet_lightbrown"}]},{"id":"med-jerusalem","name":"Mediterranean Dish Jerusalem Bagels","source":"The Mediterranean Dish","href":"https://www.themediterraneandish.com/jerusalem-bagel-recipe/","group":"addition","bagels":6,"convNote":"Flour 120g/cup, sugar 12.5g/tbsp, salt 6g/tsp, milk 237g/cup, yeast 3.1g/tsp, baking powder 4.5g/tsp, sesame 144g/cup, honey 21g/tbsp.","notes":"Olive oil is named without a quantity and is omitted.","rows":[{"n":"All-purpose or white bread flour","d":"4 1/2 cup","g":540,"c":"flour","s":"flour_ap"},{"n":"Sugar","d":"2 tablespoon","g":25,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"2 teaspoon","g":12,"c":"salt","s":"salt_table"},{"n":"Whole milk, warm","d":"1 1/2 cups; unsweetened almond milk also published","g":354,"fx":"fix_milk"},{"n":"Active dry yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_activedry"},{"n":"Baking powder","d":"1 teaspoon","g":4.5,"fx":"fix_none"},{"n":"Sesame seeds","d":"1 cup","g":144,"c":"topping","s":"top_sesame"},{"n":"Honey, for sesame","d":"1 to 2 tablespoons; taken at 1 tablespoon, the low end of the published range","g":21,"c":"sweetener","s":"sweet_honey","q":"for sesame"}]},{"id":"practical-egg","name":"Practical Kitchen Egg Bagels","source":"The Practical Kitchen","href":"https://thepracticalkitchen.com/homemade-egg-bagels/","group":"addition","bagels":8,"convNote":"Poppy 1/8 cup at 144g/cup.","rows":[{"n":"All-purpose flour","d":"500 grams","g":500,"c":"flour","s":"flour_ap"},{"n":"Brown sugar","d":"19 grams","g":19,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Diamond Crystal kosher salt","d":"11 grams","g":11,"c":"salt","s":"salt_dckosher"},{"n":"Instant yeast","d":"6 grams","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Warm water","d":"100 grams","g":100,"fx":"fix_water"},{"n":"Large eggs","d":"3 large eggs","e":3,"fx":"fix_egg"},{"n":"Large egg yolks","d":"3 large egg yolks; counted as 3 additional eggs","e":3,"fx":"fix_egg"},{"n":"Poppy seeds, optional topping","d":"1/8 cup","g":18,"o":1,"c":"topping","s":"top_poppy","q":"optional topping"}]},{"id":"iambaker-blueberry","name":"I Am Baker Blueberry Bagels","source":"I Am Baker","href":"https://iambaker.net/blueberry-bagel/","group":"addition","bagels":12,"convNote":"Flour 120g/cup, sugar 12.5g/tbsp, yeast 3.1g/tsp, kosher salt 3g/tsp, oil 14g/tbsp, fresh blueberries 140g/cup, dried blueberries 160g/cup, cornmeal 9g/tbsp.","rows":[{"n":"Warm water","d":"1 1/4 cups (296g)","g":296,"fx":"fix_water"},{"n":"Instant yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"5 cups","g":600,"c":"flour","s":"flour_bread"},{"n":"Granulated sugar","d":"3 tablespoons","g":37.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Kosher salt","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher"},{"n":"Vegetable oil","d":"2 tablespoons","g":28,"c":"oil","s":"oil_vegetable"},{"n":"Fresh blueberries","d":"1 cup","g":140,"fx":"fix_none"},{"n":"Dried blueberries","d":"1 cup","g":160,"fx":"fix_none"},{"n":"Water, bath","d":"4 quarts","g":3785,"fx":"fix_water"},{"n":"Yellow cornmeal","d":"2 tablespoons","g":18,"fx":"fix_cornmeal"},{"n":"Egg white, wash","d":"1 egg white with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"vegan-idtlc","name":"It Doesn't Taste Like Chicken Vegan","source":"It Doesn't Taste Like Chicken (Sam Turnbull)","href":"https://itdoesnttastelikechicken.com/the-best-vegan-bagels/","group":"addition","bagels":10,"convNote":"King Arthur weights: flour 120g/cup, water 237g/cup, brown sugar 14g/tbsp and 213g/cup so 1/4 cup=53g, yeast 3.1g/tsp, salt 6g/tsp, seeds 9g/tbsp.","notes":"Aquafaba (2-3 tablespoons) is the liquid from a can of chickpeas and is not counted. A yield of 8 extra-large is also published; 10 is used.","rows":[{"n":"Warm water, dough","d":"1 1/2 cups","g":355,"fx":"fix_water"},{"n":"Brown sugar, dough","d":"1 tablespoon; barley malt syrup also published","g":14,"c":"sweetener","s":"sweet_lightbrown","q":"dough"},{"n":"Instant yeast","d":"2 3/4 teaspoons","g":8.5,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups","g":480,"c":"flour","s":"flour_bread"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Water, bath","d":"8 cups (2 liters)","g":2000,"fx":"fix_water"},{"n":"Brown sugar, bath","d":"1/4 cup; barley malt syrup also published","g":53,"c":"sweetener","s":"sweet_lightbrown","q":"bath"},{"n":"Sesame, poppy, or everything topping","d":"2-3 tablespoons; taken at 2 tablespoons","g":18,"c":"topping","s":"top_sesame"}]},{"id":"se-jogold","name":"Serious Eats Jo Goldenberg","source":"Serious Eats","href":"https://www.seriouseats.com/how-to-make-homemade-bagels-a-la-jo-goldenberg-recipe","group":"addition","bagels":10,"convNote":"Sugar 12.5g/tbsp, salt 18g/tbsp, malt syrup 21g/tbsp.","rows":[{"n":"Bread flour","d":"19.25 ounces / 3 1/2 cups (530g)","g":530,"c":"flour","s":"flour_bread"},{"n":"Instant dry yeast","d":"1/4 ounce / 2 1/2 teaspoons (7g)","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"2 tablespoons","g":25,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"1 tablespoon","g":18,"c":"salt","s":"salt_table"},{"n":"Hot water","d":"12 ounces / 1 1/2 cups (340g)","g":340,"fx":"fix_water"},{"n":"Malt syrup, bath","d":"1 1/2 tablespoons; sugar also published as a substitute","g":32,"c":"malt","s":"malt_barleysyrup","q":"bath"},{"n":"Egg, optional wash","d":"1 egg beaten with 1 teaspoon water","e":1,"o":1,"fx":"fix_egg"}]},{"id":"bodhi","name":"Bodhi Miami Grain-Free","source":"Bodhi Miami","href":"https://www.bodhimiami.com/blogs/bodhi-babe-blog/easy-homemade-bagel-recipe-grain-free","group":"addition","bagels":6,"convNote":"Coconut flour 112g/cup, baking powder 4.5g/tsp, shredded mozzarella 112g/cup, butter 14g/tbsp, cream cheese 28.35g/oz.","notes":"Optional toppings are named without quantities and are omitted. This is a bake-only, no-boil formula.","rows":[{"n":"Coconut flour","d":"1/2 cup","g":56,"fx":"fix_none"},{"n":"Baking powder","d":"4 teaspoons","g":18,"fx":"fix_none"},{"n":"Shredded mozzarella","d":"2 1/2 cups","g":280,"fx":"fix_none"},{"n":"Cream cheese","d":"2 ounces","g":57,"fx":"fix_creamcheese"},{"n":"Large eggs","d":"3 large eggs","e":3,"fx":"fix_egg"},{"n":"Melted butter","d":"4 tablespoons","g":57,"c":"butter","s":"butter_unsalted"}]}];
  var PRICES = null;
  try { PRICES = JSON.parse(document.getElementById("bn-prices").textContent); } catch (e) { PRICES = null; }
  var MON = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

  /* ---------- helpers ---------- */
  function h(tag, attrs) {
    var n = document.createElement(tag), k, i, c;
    for (k in (attrs || {})) {
      if (k === "text") n.textContent = attrs[k];
      else if (k === "class") n.className = attrs[k];
      else if (attrs[k] !== null && attrs[k] !== undefined && attrs[k] !== false) n.setAttribute(k, attrs[k] === true ? "" : attrs[k]);
    }
    function put(c) {
      if (c === null || c === undefined || c === false) return;
      if (Array.isArray(c)) { c.forEach(put); return; }
      n.appendChild(typeof c === "string" ? document.createTextNode(c) : c);
    }
    for (i = 2; i < arguments.length; i++) put(arguments[i]);
    return n;
  }
  function clear(n) { while (n.firstChild) n.removeChild(n.firstChild); }
  function fmt(n, d) { return n.toLocaleString("en-US", { minimumFractionDigits: d, maximumFractionDigits: d }); }
  function money(x) { return "$" + fmt(x, x < 1 ? 3 : 2); }
  function money2(x) { return "$" + fmt(x, 2); }
  function fmtDate(s) {
    var m = /^(\d{4})-(\d{2})-(\d{2})/.exec(s || "");
    if (m) return parseInt(m[3], 10) + " " + MON[parseInt(m[2], 10) - 1] + " " + m[1];
    var p = /^(\w+) (\d{4})$/.exec(s || "");
    return p ? p[1].slice(0, 3) + " " + p[2] : (s || "");
  }
  function fmtStamp(iso) {
    var m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(iso || "");
    if (!m) return "";
    var hr = parseInt(m[4], 10), ap = hr >= 12 ? "PM" : "AM";
    hr = hr % 12 || 12;
    return parseInt(m[3], 10) + " " + MON[parseInt(m[2], 10) - 1] + " " + m[1] + ", " + hr + ":" + m[5] + " " + ap + " CT";
  }
  function srcShort(id) { return (PRICES && PRICES.sources[id] && PRICES.sources[id].short) || String(id).toUpperCase(); }
  function recOf(id) {
    if (!PRICES) return null;
    var o = PRICES.options[id] || PRICES.fixed[id];
    return o && o.price ? o.price : null;
  }
  function labelOf(id) {
    if (!PRICES) return id;
    var o = PRICES.options[id] || PRICES.fixed[id];
    return o ? o.label : id;
  }
  function priceText(rec) {
    if (!rec) return "";
    if (rec.unit === "each") return "$" + fmt(rec.usd_per_each, 3) + " per egg";
    return "$" + fmt(rec.usd_per_lb, 2) + " per lb";
  }
  function costOf(row, id, mult) {
    var rec = recOf(id);
    if (!rec) return null;
    if (row.e != null) return rec.usd_per_each != null ? row.e * mult * rec.usd_per_each : null;
    if (row.g != null) return rec.usd_per_g != null ? row.g * mult * rec.usd_per_g : null;
    return null;
  }
  function rowOptionId(row, sel, i) { return row.c ? (sel[i] || row.s) : row.fx; }
  function rowLabel(row, id) {
    if (!row.c) return row.n + (row.o ? ", optional" : "");
    return labelOf(id) + (row.q ? ", " + row.q : "") + (row.o && !row.q ? ", optional" : "");
  }
  /* ---------- burden rate ----------
     Burden Rate = time x (baker market hourly rate + bakery operating cost per hour).
     Baker labor hourly rate = Wisconsin minimum wage (DWD and U.S. DOL) x (1 + ECEC total benefits per hour / ECEC wages per hour),
       private industry production occupations. Total benefits in ECEC already include the legally required benefits (Social Security,
       Medicare, federal and state unemployment insurance, workers' compensation), so no payroll tax is added a second time.
     Operating cost per hour (ESTIMATE) = CBECS 2018 Food service annual electricity (kWh) and natural gas (cubic feet) per building,
       divided by annual operating hours (mean weekly hours x 52), x EIA Wisconsin commercial electricity and natural gas prices.
     Time = published hands-on time + published bake time of the recipe, times the batch multiple. */
  function laborOk() {
    var L = PRICES && PRICES.labor, O = L && L.operating, C = O && O.cbecs;
    return !!(L && L.minimum_wage && L.minimum_wage.value != null && L.ecec && L.hands_on && L.hands_on.default_minutes != null && O && C && C.weekly_hours && C.electricity && C.gas &&
      O.electricity && O.electricity.cents_per_kwh != null && O.gas && O.gas.usd_per_mcf != null);
  }
  function handsOn(fid) {
    var ho = PRICES.labor.hands_on, r = ho.formulas && ho.formulas[fid];
    if (r) return { min: r.minutes, hands: r.hands_on_min, bake: r.bake_min, published: true, text: r.text, url: r.url, total: r.total_min, stale: !!r.stale };
    var d = ho.formulas[ho.default_formula || "ka-classic"];
    return { min: ho.default_minutes, hands: d.hands_on_min, bake: d.bake_min, published: false, text: ho.default_basis, url: ho.default_url, total: d.total_min, stale: false };
  }
  function opRates() {
    var O = PRICES.labor.operating, C = O.cbecs, hrs = C.weekly_hours.value * 52;
    var kwh = C.electricity.kwh_per_building / hrs, mcf = C.gas.cf_per_building / 1000 / hrs;
    var e = kwh * O.electricity.cents_per_kwh / 100, g = mcf * O.gas.usd_per_mcf;
    return { hrs: hrs, kwh: kwh, mcf: mcf, elec: e, gas: g, perHour: e + g };
  }
  function laborCalc(f, mult) {
    if (!laborOk()) return null;
    var L = PRICES.labor, ho = handsOn(f.id), wage = L.minimum_wage.value, rate = L.ecec.benefits.value / L.ecec.wages.value, op = opRates();
    var loaded = wage * (1 + rate), minutes = ho.min * mult, hours = minutes / 60;
    var baker = hours * loaded, oper = hours * op.perHour;
    return { ho: ho, minutes: minutes, wage: wage, rate: rate, loaded: loaded, op: op, baker: baker, oper: oper, burden: baker + oper, hourly: loaded + op.perHour };
  }
  function minText(m) {
    if (m < 90) return fmt(m, m % 1 ? 1 : 0) + " min";
    return fmt(m / 60, 2) + " hr (" + fmt(m, m % 1 ? 1 : 0) + " min)";
  }
  function byId(id) { for (var i = 0; i < FORMULAS.length; i++) if (FORMULAS[i].id === id) return FORMULAS[i]; return FORMULAS[0]; }

  /* ---------- state ---------- */
  var state = { formula: "ka-classic", batch: "1", sel: {} };
  var open = null;                 // the listbox currently open: { btn, list, close }
  var root, tapeRoot, recordRoot, tapeItems = {}, tapeHead;

  function closeOpen() { if (open) { open.close(); open = null; } }
  document.addEventListener("click", function (e) { if (open && !open.wrap.contains(e.target)) closeOpen(); });
  document.addEventListener("keydown", function (e) { if (e.key === "Escape" && open) { var b = open.btn; closeOpen(); b.focus(); } });

  /* ---------- ingredient selector: the ingredient name is the control ---------- */
  function selector(row, i, current, onPick) {
    var cat = PRICES.categories[row.c], ids = cat.options;
    var wrap = h("div", { class: "bnp-sel" });
    var listId = "bnp-list-" + i;
    var btn = h("button", { type: "button", class: "bnp-sel__btn", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": listId,
      "aria-label": "Ingredient type for " + row.n + ". Current: " + labelOf(current) + ". Quantity stays fixed." });
    btn.appendChild(h("span", { class: "bnp-sel__name", text: rowLabel(row, current) }));
    btn.appendChild(h("span", { class: "bnp-sel__caret", "aria-hidden": "true", text: "\u25BE" }));
    var list = h("ul", { class: "bnp-list", role: "listbox", id: listId, tabindex: "-1", hidden: true });
    var opts = [];
    ids.forEach(function (oid) {
      var rec = recOf(oid);
      var li = h("li", { class: "bnp-opt" + (oid === current ? " is-on" : ""), role: "option", "aria-selected": oid === current ? "true" : "false", "data-oid": oid, tabindex: "-1" },
        h("span", { class: "bnp-opt__name", text: labelOf(oid) }),
        h("span", { class: "bnp-opt__price" + (rec ? "" : " is-none"), text: rec ? priceText(rec) + " \u00B7 " + srcShort(rec.source) : "No published price" }));
      li.addEventListener("click", function (e) { e.stopPropagation(); closeOpen(); onPick(oid); });
      opts.push(li); list.appendChild(li);
    });
    function focusOpt(k) { k = Math.max(0, Math.min(opts.length - 1, k)); opts[k].focus(); }
    function doOpen() {
      closeOpen();
      list.hidden = false; btn.setAttribute("aria-expanded", "true"); wrap.classList.add("is-open");
      open = { btn: btn, wrap: wrap, close: function () { list.hidden = true; btn.setAttribute("aria-expanded", "false"); wrap.classList.remove("is-open"); } };
      var cur = ids.indexOf(current); focusOpt(cur < 0 ? 0 : cur);
    }
    btn.addEventListener("click", function (e) { e.stopPropagation(); if (open && open.btn === btn) closeOpen(); else doOpen(); });
    btn.addEventListener("keydown", function (e) { if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); doOpen(); } });
    list.addEventListener("keydown", function (e) {
      var k = opts.indexOf(document.activeElement);
      if (e.key === "ArrowDown") { e.preventDefault(); focusOpt(k + 1); }
      else if (e.key === "ArrowUp") { e.preventDefault(); focusOpt(k - 1); }
      else if (e.key === "Home") { e.preventDefault(); focusOpt(0); }
      else if (e.key === "End") { e.preventDefault(); focusOpt(opts.length - 1); }
      else if (e.key === "Enter" || e.key === " ") { e.preventDefault(); if (k >= 0) { var oid = ids[k]; closeOpen(); onPick(oid); } }
      else if (e.key === "Tab") { closeOpen(); }
    });
    wrap.appendChild(btn); wrap.appendChild(list);
    return wrap;
  }

  /* ---------- total cost reveal ----------
     A scoreboard panel for the burdened total per bagel, with the per dozen and per batch figures beneath it.
     The figures count up from zero and land on exactly the value in the Burdened Cost table (the same expressions, the same
     formatting; the last frame is written from the exact value, not from the animation). With prefers-reduced-motion the final
     value is written at once and nothing moves. The animated figures are hidden from assistive technology; a visually hidden
     polite status line carries the final values only, once per change. The node is built once and moved into each new card. */
  var reveal = null, revealKey = null, revealRaf = 0, revealRunning = false, revealTimers = [];
  function buildReveal() {
    var strips = ["t", "r", "b", "l"].map(function (k) { return h("span", { class: "bnp-bulbs bnp-bulbs--" + k, "aria-hidden": "true" }); });
    var num = h("div", { class: "bnp-reveal__num", "aria-hidden": "true", text: "$0.00" });
    var dz = h("span", { class: "bnp-reveal__v", text: "$0.00" }), bt = h("span", { class: "bnp-reveal__v", text: "$0.00" });
    function cell(label, v) { return h("div", { class: "bnp-reveal__cell" }, h("span", { class: "bnp-reveal__k", text: label }), v); }
    var sr = h("p", { class: "bnp-reveal__sr", role: "status", "aria-live": "polite", "aria-atomic": "true" });
    var el = h("section", { class: "bnp-reveal", "aria-label": "Total Cost Per Bagel, Burdened" }, strips,
      h("p", { class: "bnp-reveal__label", "aria-hidden": "true", text: "Total Cost Per Bagel, Burdened" }), num,
      h("div", { class: "bnp-reveal__sub", "aria-hidden": "true" }, cell("Per Dozen", dz), cell("Per Batch", bt)),
      h("p", { class: "bnp-reveal__cap", "aria-hidden": "true", text: "Ingredients Plus Burden Rate" }), sr);
    reveal = { el: el, num: num, dz: dz, bt: bt, sr: sr };
  }
  function revealClear() {
    if (revealRaf) window.cancelAnimationFrame(revealRaf);
    revealRaf = 0; revealRunning = false;
    revealTimers.forEach(function (t) { window.clearTimeout(t); }); revealTimers = [];
    reveal.el.classList.remove("is-live"); reveal.el.classList.remove("is-landed");
  }
  function updateReveal(v) {
    if (!reveal) return;
    var R = reveal;
    if (!v) {
      revealClear(); revealKey = null;
      R.num.textContent = "\u2014"; R.dz.textContent = "\u2014"; R.bt.textContent = "\u2014";
      R.sr.textContent = "Total cost per bagel, burdened: withheld.";
      return;
    }
    var fin = [money2(v.bagel), money2(v.dozen), money2(v.batch)], key = fin.join("|");
    function setFinal() { R.num.textContent = fin[0]; R.dz.textContent = fin[1]; R.bt.textContent = fin[2]; }
    if (key === revealKey) { if (!revealRunning) setFinal(); return; }
    revealKey = key;
    revealClear();
    R.sr.textContent = "Total Cost Per Bagel, Burdened: " + fin[0] + ". Per dozen: " + fin[1] + ". Per batch: " + fin[2] + ".";
    var reduce = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
    if (reduce || !window.requestAnimationFrame) { setFinal(); return; }
    var D = 1200, t0 = null;
    revealRunning = true;
    R.el.classList.add("is-live");
    R.num.textContent = money2(0); R.dz.textContent = money2(0); R.bt.textContent = money2(0);
    function frame(ts) {
      if (t0 === null) t0 = ts;
      var p = Math.min(1, (ts - t0) / D);
      if (p >= 1) {
        revealRunning = false; revealRaf = 0; setFinal();
        R.el.classList.add("is-landed");
        revealTimers.push(window.setTimeout(function () { R.el.classList.remove("is-landed"); }, 900));
        revealTimers.push(window.setTimeout(function () { R.el.classList.remove("is-live"); }, 2600));
        return;
      }
      var e = 1 - Math.pow(1 - p, 3);
      R.num.textContent = money2(v.bagel * e); R.dz.textContent = money2(v.dozen * e); R.bt.textContent = money2(v.batch * e);
      revealRaf = window.requestAnimationFrame(frame);
    }
    revealRaf = window.requestAnimationFrame(frame);
  }

  /* ---------- the requisition panel ---------- */
  function render() {
    closeOpen();
    var f = byId(state.formula);
    var bp = parseFloat(state.batch);
    var invalid = !isFinite(bp) || bp <= 0;
    var mult = invalid ? 0 : bp;
    var bagels = invalid ? 0 : f.bagels * mult;
    clear(root);

    var card = h("div", { class: "bnp-card" });
    card.appendChild(h("h2", { class: "bnp-title", text: "Requisition Panel" }));
    card.appendChild(h("p", { class: "bnp-sub", text: "Select a formula and a batch multiple. Quantities are fixed by the published formula. Where a formula allows a variant, click the ingredient name to change its type." }));

    /* formula selector */
    var sel = h("select", { id: "bnp-formula", class: "bnp-input", "aria-label": "Approved formula" });
    [["original", "Original Eight"], ["addition", "Union Additions"]].forEach(function (g) {
      var og = h("optgroup", { label: g[1] });
      FORMULAS.forEach(function (x) { if (x.group === g[0]) og.appendChild(h("option", { value: x.id, text: x.name, selected: x.id === f.id })); });
      sel.appendChild(og);
    });
    sel.value = f.id;
    sel.addEventListener("change", function () { state.formula = sel.value; state.sel = {}; render(); });
    card.appendChild(h("label", { class: "bnp-label", for: "bnp-formula", text: "Approved Formula" }));
    card.appendChild(sel);
    card.appendChild(h("p", { class: "bnp-meta" },
      f.source + " \u00B7 " + f.bagels + " bagels at 1x" + (f.yieldNote ? ". " + f.yieldNote : "") + ". ",
      h("a", { href: f.href, target: "_blank", rel: "noreferrer", text: "Source page" })));

    /* batch */
    var inp = h("input", { id: "bnp-batch", class: "bnp-input bnp-input--num", type: "number", step: "any", min: "0", inputmode: "decimal", value: state.batch, "aria-label": "Batch multiple, any positive number" });
    inp.addEventListener("input", function () { state.batch = inp.value; renderBody(); });
    card.appendChild(h("label", { class: "bnp-label", for: "bnp-batch", text: "Batch Multiple, Any Positive Number" }));
    var bar = h("div", { class: "bnp-batch" });
    bar.appendChild(inp);
    function step(label, fn, aria) { var b = h("button", { type: "button", class: "bnp-btn", text: label, "aria-label": aria || label }); b.addEventListener("click", function () { state.batch = fn(); inp.value = state.batch; renderBody(); }); return b; }
    function cur() { var n = parseFloat(state.batch); return isFinite(n) ? n : 0; }
    bar.appendChild(step("\u22121", function () { var n = cur() - 1; return n <= 0 ? "0" : String(n); }, "Remove one batch"));
    bar.appendChild(step("+1", function () { return String(cur() + 1); }, "Add one batch"));
    [["1/2", "0.5"], ["1x", "1"], ["2x", "2"], ["3x", "3"], ["10x", "10"], ["100x", "100"]].forEach(function (p) { bar.appendChild(step(p[0], function () { return p[1]; })); });
    card.appendChild(bar);

    if (!reveal) buildReveal();
    card.appendChild(reveal.el);
    var body = h("div", { id: "bnp-body" });
    card.appendChild(body);
    root.appendChild(card);
    renderBody();
  }

  function renderBody() {
    closeOpen();
    var body = document.getElementById("bnp-body");
    if (!body) return;
    clear(body);
    var f = byId(state.formula);
    var bp = parseFloat(state.batch);
    var invalid = !isFinite(bp) || bp <= 0;
    var mult = invalid ? 0 : bp;
    if (invalid) {
      body.appendChild(h("p", { class: "bnp-warn", role: "status", text: "A batch of zero requires a Form 0 waiver. A negative batch is not a batch, and a blank or unreadable multiple is treated the same way. The requisition is withheld until a positive multiple is entered." }));
      refreshTape([]);
      updateReveal(null);
      return;
    }
    var bagels = f.bagels * mult;
    body.appendChild(h("h3", { class: "bnp-h3", text: "Requisition Lines" }));
    var ul = h("ul", { class: "bnp-lines" });
    var total = 0, baseTotal = 0, priced = 0, lines = 0, unpricedNames = [], totalG = 0, usedIds = [], changed = 0;
    f.rows.forEach(function (row, i) {
      var id = rowOptionId(row, state.sel, i);
      var baseId = row.c ? row.s : row.fx;
      var cost = costOf(row, id, mult);
      var baseCost = costOf(row, baseId, mult);
      lines++;
      if (row.g != null && row.e == null) totalG += row.g * mult;
      if (cost !== null) { total += cost; priced++; usedIds.push(id); } else unpricedNames.push(rowLabel(row, id));
      if (baseCost !== null) baseTotal += baseCost;
      if (row.c && id !== baseId) changed++;
      var li = h("li", { class: "bnp-line" + (cost === null ? " is-unpriced" : "") });
      var left = h("div", { class: "bnp-line__name" });
      if (row.c) left.appendChild(selector(row, i, id, function (oid) { state.sel[i] = oid; renderBody(); var again = document.querySelector('#bnp-body .bnp-line:nth-child(' + (i + 1) + ') .bnp-sel__btn'); if (again) again.focus(); }));
      else left.appendChild(h("span", { class: "bnp-line__fixed", text: rowLabel(row, id) }));
      var pubNote = "Published: " + row.d;
      if (row.c && id !== baseId) pubNote += ". As published: " + row.n + ".";
      else if (row.c && rowLabel(row, id).toLowerCase() !== (row.n + (row.o && !row.q ? ", optional" : "")).toLowerCase()) pubNote += ". As published: " + row.n + ".";
      left.appendChild(h("span", { class: "bnp-line__pub", text: pubNote }));
      var q = row.e != null ? fmt(row.e * mult, 2) + " each" : row.g != null ? fmt(row.g * mult, 1) + " g" : "\u2014";
      var rec = recOf(id);
      var costCell = cost !== null ? money(cost) : (row.c ? "No published price" : "Not priced");
      li.appendChild(left);
      li.appendChild(h("div", { class: "bnp-line__qty", text: q }));
      var cc = h("div", { class: "bnp-line__cost", text: costCell });
      if (cost !== null && rec) cc.appendChild(h("span", { class: "bnp-line__src", text: srcShort(rec.source) + " " + fmtDate(rec.as_of) }));
      li.appendChild(cc);
      ul.appendChild(li);
    });
    body.appendChild(ul);

    var dl = h("dl", { class: "bnp-totals" });
    function tot(k, v, strong) { dl.appendChild(h("div", { class: "bnp-totals__row" + (strong ? " is-strong" : "") }, h("dt", { text: k }), h("dd", { text: v }))); }
    tot("Bagels in This Requisition", fmt(bagels, 2) + " (" + f.bagels + " at 1x)");
    tot("Total Listed Ingredient Weight", fmt(totalG, 1) + " g (" + fmt(totalG / G_PER_LB, 2) + " lb)");
    tot("Listed Weight per Bagel", fmt(bagels > 0 ? totalG / bagels : 0, 1) + " g");
    tot("Priced Ingredient Cost", money2(total), true);
    tot("Ingredient Cost per Bagel", bagels > 0 ? money2(total / bagels) : "\u2014", true);
    tot("Lines Priced", priced + " of " + lines);
    if (changed > 0) {
      var d = total - baseTotal;
      tot("Change from Published Types", (d >= 0 ? "+" : "\u2212") + money2(Math.abs(d)) + " (" + changed + " line" + (changed === 1 ? "" : "s") + " changed, quantities unchanged)");
    }
    body.appendChild(dl);

    var lab = laborCalc(f, mult);
    body.appendChild(h("h3", { class: "bnp-h3", text: "Burdened Cost" }));
    if (lab) {
      var perDz = function (x) { return x / bagels * 12; };
      var brk = h("table", { class: "bnp-break" },
        h("thead", null, h("tr", null, h("th", { scope: "col", text: "Component" }), h("th", { scope: "col", text: "Per Bagel" }), h("th", { scope: "col", text: "Per Dozen" }), h("th", { scope: "col", text: "Per Batch" }))));
      var bb = h("tbody");
      var totalB = total + lab.burden;
      updateReveal({ bagel: totalB / bagels, dozen: totalB / bagels * 12, batch: totalB });
      [["Ingredients", total, ""], ["Burden Rate", lab.burden, "is-burden"], ["Baker Labor (Minimum Wage)", lab.baker, "is-sub"], ["Operating Cost", lab.oper, "is-sub"], ["Total", totalB, "is-total"]].forEach(function (r) {
        bb.appendChild(h("tr", { class: r[2], "data-row": r[0] },
          h("th", { scope: "row", text: r[0] }),
          h("td", { class: "is-num", "data-col": "bagel", text: money2(r[1] / bagels) }),
          h("td", { class: "is-num", "data-col": "dozen", text: money2(perDz(r[1])) }),
          h("td", { class: "is-num", "data-col": "batch", text: money2(r[1]) })));
      });
      brk.appendChild(bb);
      body.appendChild(h("div", { class: "bnp-breakwrap" }, brk));
      body.appendChild(h("p", { class: "bnp-note", text: "The batch is this requisition: " + fmt(bagels, 2) + " bagels. A dozen is twelve bagels at the same per-bagel cost. Ingredients are the priced lines above; any line without a published price is left out of every column. Burden Rate is Baker Labor plus Operating Cost." }));
      var ld = h("dl", { class: "bnp-totals bnp-labor" });
      function lrow(k, v, strong) { ld.appendChild(h("div", { class: "bnp-totals__row" + (strong ? " is-strong" : "") }, h("dt", { text: k }), h("dd", { text: v }))); }
      var OP = PRICES.labor.operating;
      lrow("Time, Hands-On Plus Bake", minText(lab.minutes) + " = " + fmt(lab.ho.hands * mult, lab.ho.hands * mult % 1 ? 1 : 0) + " hands-on + " + fmt(lab.ho.bake * mult, lab.ho.bake * mult % 1 ? 1 : 0) + " bake" + (mult === 1 ? "" : " (" + minText(lab.ho.min) + " at 1x)") + (lab.ho.published ? ", published by the formula source" : ", default"));
      lrow("Baker Labor Rate, Minimum Wage, Loaded", "$" + fmt(lab.loaded, 2) + " per hour = $" + fmt(lab.wage, 2) + " Wisconsin minimum wage \u00D7 (1 + " + fmt(lab.rate * 100, 2) + "%)");
      lrow("Operating Cost, Estimate", "$" + fmt(lab.op.perHour, 2) + " per hour ($" + fmt(lab.op.perHour / 60, 3) + " per minute) = electricity $" + fmt(lab.op.elec, 2) + " + natural gas $" + fmt(lab.op.gas, 2));
      lrow("Burden Rate per Hour", "$" + fmt(lab.hourly, 2) + " ($" + fmt(lab.hourly / 60, 3) + " per minute) = $" + fmt(lab.loaded, 2) + " + $" + fmt(lab.op.perHour, 2), true);
      body.appendChild(ld);
      body.appendChild(h("p", { class: "bnp-note" },
        lab.ho.published
          ? ["Time for this formula is the one its source page publishes: ", h("a", { href: lab.ho.url, target: "_blank", rel: "noreferrer", text: lab.ho.text }), " (total time on the page " + minText(lab.ho.total) + ", which includes unattended rising and resting that is not counted). It scales with the batch multiple."]
          : ["This formula\u2019s source page publishes no times, so a default applies: the published time of ", h("a", { href: lab.ho.url, target: "_blank", rel: "noreferrer", text: "King Arthur Bagels" }), " (" + PRICES.labor.hands_on.formulas[PRICES.labor.hands_on.default_formula].text + "). It is a fixed default per batch, not a measurement of this formula, and it scales with the batch multiple."]));
      body.appendChild(h("p", { class: "bnp-note" }, h("strong", { text: "Operating Cost is an ESTIMATE. " }),
        "It is the average energy use of a U.S. Food service building (EIA CBECS 2018: " + fmt(OP.cbecs.electricity.kwh_per_building, 0) + " kWh and " + fmt(OP.cbecs.gas.cf_per_building, 0) + " cubic feet of natural gas per building per year, covering heating, cooling, ventilation, refrigeration, cooking, hot water and lighting), spread over " + fmt(OP.hours_per_year, 0) + " operating hours a year (" + OP.cbecs.weekly_hours.value + " hours a week \u00D7 52), priced at EIA Wisconsin commercial rates (electricity " + fmt(OP.electricity.cents_per_kwh, 2) + " cents per kWh, natural gas $" + fmt(OP.gas.usd_per_mcf, 2) + " per thousand cubic feet, " + OP.electricity.period + "). It is not a measurement of any one bakery. Rent, insurance and equipment depreciation are not priced, because no clean published hourly rate exists; they are left out, not guessed."));
      body.appendChild(h("p", { class: "bnp-note" }, "Baker Labor is priced at the Wisconsin minimum wage, $" + fmt(lab.wage, 2) + " per hour (", h("a", { href: PRICES.labor.minimum_wage.dwd_url, target: "_blank", rel: "noreferrer", text: "Wisconsin DWD" }), " and ", h("a", { href: PRICES.labor.minimum_wage.dol_url, target: "_blank", rel: "noreferrer", text: "U.S. DOL" }), ", in force since " + PRICES.labor.minimum_wage.effective + ", read " + fmtDate(PRICES.labor.minimum_wage.retrieved_at) + "), plus the employer benefit load for private industry production occupations, which already includes the legally required benefits (Social Security, Medicare, unemployment insurance, workers\u2019 compensation). The minimum wage is the legal floor, not the market wage for Bakers; the BLS mean wage for Bakers in Milwaukee-Waukesha is shown under Published Prices and Sources for reference only. Every rate is listed there."));
    } else {
      updateReveal(null);
      body.appendChild(h("p", { class: "bnp-note", text: "Burden Rate is not priced: the minimum wage, benefit or energy records could not be read. The figures above are ingredients only." }));
    }
    if (unpricedNames.length) {
      body.appendChild(h("p", { class: "bnp-note" }, h("strong", { text: "Not in the total: " }), unpricedNames.join("; ") + ". These lines have no sourced price in the price record, so they are left out rather than estimated."));
    }
    if (f.notes) body.appendChild(h("p", { class: "bnp-note", text: f.notes }));
    if (f.convNote) body.appendChild(h("p", { class: "bnp-note", text: f.convNote }));
    body.appendChild(h("p", { class: "bnp-foot" },
      "Costs use the listed prices and the minimum wage, benefit and energy rates in the price record, dated and sourced line by line. They are not a quote and not an order. See ",
      h("a", { href: "#prices", text: "Published Prices and Sources" }), "."));
    var reset = h("button", { type: "button", class: "bnp-btn bnp-btn--reset", text: "Reset To Published Types" });
    reset.addEventListener("click", function () { state.sel = {}; renderBody(); });
    if (changed > 0) body.appendChild(reset);
    if (lab) { usedIds.push("labor-wage"); usedIds.push("labor-burden"); usedIds.push("op-elec"); usedIds.push("op-gas"); }
    refreshTape(usedIds, total, priced, lines, lab ? total + lab.burden : null);
  }

  /* ---------- price tape ---------- */
  function pctText(now, prev) {
    if (!prev || !isFinite(prev) || prev === 0) return "";
    var p = (now - prev) / prev * 100;
    if (Math.abs(p) < 0.005) return " UNCH";
    return (p > 0 ? " \u25B2" : " \u25BC") + fmt(Math.abs(p), 1) + "%";
  }
  function buildTape() {
    if (!PRICES || !tapeRoot) return;
    clear(tapeRoot);
    var seen = {}, items = [];
    function add(oid) {
      if (seen[oid]) return; seen[oid] = 1;
      var rec = recOf(oid), label = labelOf(oid).toUpperCase();
      if (!rec) { items.push({ oid: oid, cls: "is-none", text: label + "  NO PUBLISHED PRICE" }); return; }
      var now = rec.unit === "each" ? rec.usd_per_each : rec.usd_per_lb;
      var prev = rec.previous ? (rec.unit === "each" ? rec.previous.usd_per_each : rec.previous.usd_per_lb) : null;
      var ch = pctText(now, prev);
      items.push({ oid: oid, cls: (rec.stale ? "is-stale " : "") + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : ""),
        text: label + "  " + (rec.unit === "each" ? "$" + fmt(now, 3) + "/EA" : "$" + fmt(now, 2) + "/LB") + ch + "  " + srcShort(rec.source) + " " + fmtDate(rec.as_of).toUpperCase() + (rec.stale ? "  STALE" : "") });
    }
    Object.keys(PRICES.categories).forEach(function (c) { PRICES.categories[c].options.forEach(add); });
    Object.keys(PRICES.fixed).forEach(function (k) { if (recOf(k)) add(k); });
    if (laborOk()) {
      var MW = PRICES.labor.minimum_wage, LE = PRICES.labor.ecec;
      items.push({ oid: "labor-wage", cls: MW.stale ? "is-stale" : "", text: "WISCONSIN MINIMUM WAGE  $" + fmt(MW.value, 2) + "/HR  WI DWD AND US DOL, IN FORCE SINCE " + MW.effective.toUpperCase() + ", READ " + fmtDate(MW.retrieved_at).toUpperCase() + (MW.stale ? "  STALE" : "") });
      items.push({ oid: "labor-burden", cls: LE.stale ? "is-stale" : "", text: "EMPLOYER BENEFIT LOAD, PRODUCTION OCCUPATIONS  " + fmt(LE.benefits.value / LE.wages.value * 100, 1) + "% OF WAGES  BLS ECEC " + LE.period.toUpperCase() + (LE.stale ? "  STALE" : "") });
      var OPT = PRICES.labor.operating;
      items.push({ oid: "op-elec", cls: OPT.electricity.stale || OPT.stale ? "is-stale" : "", text: "WISCONSIN COMMERCIAL ELECTRICITY  " + fmt(OPT.electricity.cents_per_kwh, 2) + " CENTS/KWH  EIA " + OPT.electricity.period.toUpperCase() + (OPT.stale ? "  STALE" : "") });
      items.push({ oid: "op-gas", cls: OPT.gas.stale || OPT.stale ? "is-stale" : "", text: "WISCONSIN COMMERCIAL NATURAL GAS  $" + fmt(OPT.gas.usd_per_mcf, 2) + "/MCF  EIA " + OPT.gas.period.toUpperCase() + (OPT.stale ? "  STALE" : "") });
    }
    (PRICES.bls_reference || []).forEach(function (r) {
      var ch = pctText(r.value, r.prev_value);
      items.push({ oid: "bls-" + r.series, cls: "is-ref " + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : ""),
        text: r.name.toUpperCase() + "  $" + fmt(r.value, 3) + "/LB" + ch + "  BLS " + fmtDate(r.period).toUpperCase() + "  NATIONAL AVG" });
    });
    (PRICES.futures || []).forEach(function (q) {
      var ch = pctText(q.price, q.prev_close);
      items.push({ oid: "fut-" + q.symbol, cls: "is-ref " + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : "") + (q.stale ? " is-stale" : ""),
        text: q.symbol + " " + q.name.toUpperCase() + "  " + fmt(q.price, 2) + " " + q.unit.toUpperCase() + ch + "  YF " + fmtStamp(q.quote_time).toUpperCase() + "  DELAYED, NOT COSTED" + (q.stale ? "  STALE" : "") });
    });
    var track = h("div", { class: "bnt-track", "aria-hidden": "true" });
    [0, 1].forEach(function (copy) {
      var seg = h("div", { class: "bnt-seg" });
      items.forEach(function (it) {
        var s = h("span", { class: "bnt-item " + it.cls, text: it.text });
        (tapeItems[it.oid] = tapeItems[it.oid] || []).push(s);
        seg.appendChild(s);
      });
      track.appendChild(seg);
    });
    var lane = h("div", { class: "bnt-lane" }, track);
    tapeRoot.appendChild(lane);
    window.requestAnimationFrame(function () {
      var w = track.firstChild.getBoundingClientRect().width || 3000;
      track.style.animationDuration = Math.max(60, Math.round(w / 45)) + "s";
    });
  }
  function refreshTape(usedIds, total, priced, lines, burdened) {
    var used = {}; (usedIds || []).forEach(function (i) { used[i] = 1; });
    Object.keys(tapeItems).forEach(function (k) { tapeItems[k].forEach(function (n) { n.classList.toggle("is-sel", !!used[k]); }); });
    if (tapeHead) tapeHead.textContent = priced ? "In this requisition: " + priced + " priced line" + (priced === 1 ? "" : "s") + ", " + money2(total) + (burdened !== null && burdened !== undefined ? ", " + money2(burdened) + " burdened" : "") : "No requisition in force";
  }
  function buildTapeFrame() {
    var anyStale = false;
    Object.keys(PRICES.options).concat(Object.keys(PRICES.fixed)).forEach(function (k) { var r = recOf(k); if (r && r.stale) anyStale = true; });
    var top = h("div", { class: "bnt-top" },
      h("span", { class: "bnt-brand", text: "Bagel Bakers Union of the Greater Milwaukee Area, Local 7 \u00B7 Published Price Tape" }),
      h("span", { class: "bnt-flag", text: "Dated readings. Not a live feed." }));
    tapeHead = h("span", { class: "bnt-req", "aria-live": "polite" });
    var pause = h("button", { type: "button", class: "bnt-pause", "aria-pressed": "false", text: "Pause Tape" });
    pause.addEventListener("click", function () {
      var on = tapeRoot.parentNode.classList.toggle("is-paused");
      pause.setAttribute("aria-pressed", on ? "true" : "false"); pause.textContent = on ? "Resume Tape" : "Pause Tape";
    });
    var skip = h("a", { class: "bnt-skip", href: "#prices", text: "Read the Tape as a Table" });
    var bar = h("div", { class: "bnt-bar" }, tapeHead, h("span", { class: "bnt-bar__r" }, skip, pause));
    var foot = h("div", { class: "bnt-foot" },
      "Ingredient prices read " + fmtStamp(PRICES.generated_at) + ". Listed prices carry the date they were read. BLS averages are monthly and carry their month; the minimum wage is the statutory rate and carries the date it was read, the benefit load is the quarterly ECEC, and the Wisconsin energy prices are the monthly EIA figures. Futures are delayed quotes. Highlighted items are in the requisition. WSR WebstaurantStore \u00B7 KAB King Arthur Baking \u00B7 BLS Bureau of Labor Statistics \u00B7 DWD Wisconsin Department of Workforce Development \u00B7 DOL U.S. Department of Labor \u00B7 EIA Energy Information Administration \u00B7 YF Yahoo Finance." + (anyStale ? " Items marked STALE could not be read in the last check; their last reading is shown." : ""));
    var wrap = tapeRoot;
    wrap.parentNode.insertBefore(top, wrap);
    wrap.parentNode.insertBefore(bar, wrap);
    wrap.parentNode.appendChild(foot);
  }

  /* ---------- price record ---------- */
  function recordRows(tbody, ids) {
    ids.forEach(function (oid) {
      var rec = recOf(oid), o = PRICES.options[oid] || PRICES.fixed[oid];
      var tr = h("tr", { class: rec ? "" : "is-none" });
      tr.appendChild(h("th", { scope: "row", text: o.label }));
      if (!rec) {
        tr.appendChild(h("td", { text: "No published price" }));
        tr.appendChild(h("td", { text: o.unpriced_reason || "" }));
        tr.appendChild(h("td", { text: "\u2014" }));
        tr.appendChild(h("td", { text: "\u2014" }));
        tbody.appendChild(tr); return;
      }
      tr.appendChild(h("td", { class: "is-num", text: priceText(rec) }));
      tr.appendChild(h("td", { text: (rec.source === "bls" ? "" : "$" + fmt(rec.list_price, 2) + " per ") + rec.pack_text }));
      tr.appendChild(h("td", null, h("a", { href: rec.url, target: "_blank", rel: "noreferrer", text: srcShort(rec.source) }), " " + rec.product));
      tr.appendChild(h("td", { text: fmtDate(rec.as_of) + (rec.stale ? " (stale)" : "") }));
      tbody.appendChild(tr);
    });
  }
  function table(cols, cls) {
    var thead = h("thead", null, h("tr", null, cols.map(function (c) { return h("th", { scope: "col", text: c }); })));
    var tbody = h("tbody");
    return { el: h("div", { class: "bnr-wrap" }, h("table", { class: "bnr-table" + (cls ? " " + cls : "") }, thead, tbody)), body: tbody };
  }
  function buildLaborRecord() {
    var L = PRICES.labor, W = L.wage, MW = L.minimum_wage, E = L.ecec, HO = L.hands_on, O = L.operating, C = O.cbecs, R = opRates();
    var rate = E.benefits.value / E.wages.value;
    function link(u, text) { return h("a", { href: u, target: "_blank", rel: "noreferrer", text: text }); }
    var stale = function (x) { return x ? " (stale)" : ""; };
    recordRoot.appendChild(h("h3", { class: "bnr-h3", id: "burden-rate", text: "Burden Rate" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Burden Rate is time \u00D7 (baker labor rate per hour + operating cost per hour). The baker labor rate is the Wisconsin minimum wage loaded with the employer benefit load (total benefits cost per hour divided by wages cost per hour, private industry production occupations, the occupational group that contains Bakers). Total benefits in that series already include the legally required benefits, so they are not added again. The minimum wage is the legal floor, not the market wage for Bakers; the Bureau of Labor Statistics wage for Bakers is listed for reference only and is not used in any cost. Operating cost is an ESTIMATE of what an hour of running a food service building costs in heating, cooling and the other electricity and gas it uses, from federal building energy surveys and Wisconsin commercial energy prices." }));
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Baker Labor Rate, Minimum Wage" }));
    var t = table(["Rate", "Value", "Basis", "Source", "As of"], "bnr-wide3");
    function row(tb, name, val, basis, src, asof, cls) {
      tb.body.appendChild(h("tr", { class: cls || "" }, h("th", { scope: "row", text: name }), h("td", { class: "is-num", text: val }), h("td", { text: basis }), h("td", null, src), h("td", { text: asof })));
    }
    row(t, "Wisconsin Minimum Wage", "$" + fmt(MW.value, 2) + " per hour", MW.basis + " In force since " + MW.effective + ". Used in every Baker Labor figure.", [link(MW.dwd_url, "Wisconsin DWD"), " \u00B7 ", link(MW.dol_url, "U.S. DOL")], fmtDate(MW.retrieved_at) + stale(MW.stale));
    row(t, "Bakers, Hourly Mean Wage (Reference Only)", "$" + fmt(W.mean.value, 2) + " per hour", "Occupation Bakers (SOC 51-3011), " + W.area + ". Market wage, shown for comparison. Not used in a cost. Release: " + W.release + ".", link(W.mean.url, "BLS " + W.mean.series), W.period + stale(W.stale));
    row(t, "Bakers, Hourly Median Wage", "$" + fmt(W.median.value, 2) + " per hour", "Same occupation and area. Reference only, not used in a cost.", link(W.median.url, "BLS " + W.median.series), W.period);
    row(t, "Wages and Salaries Cost per Hour", "$" + fmt(E.wages.value, 2) + " per hour", E.group + ". Release: " + E.release + ".", link(E.wages.url, "BLS " + E.wages.series), E.period + stale(E.stale));
    row(t, "Total Benefits Cost per Hour", "$" + fmt(E.benefits.value, 2) + " per hour", E.group + ". Includes the legally required benefits below.", link(E.benefits.url, "BLS " + E.benefits.series), E.period);
    row(t, "Of Which Legally Required Benefits", "$" + fmt(E.legal.value, 2) + " per hour (" + fmt(E.legal.value / E.wages.value * 100, 2) + "% of wages)", "Social Security, Medicare, federal and state unemployment insurance, workers\u2019 compensation. Already inside the benefits line above.", link(E.legal.url, "BLS " + E.legal.series), E.period);
    row(t, "Employer Benefit Load", fmt(rate * 100, 2) + "% of wages", "Total benefits cost per hour divided by wages cost per hour: $" + fmt(E.benefits.value, 2) + " \u00F7 $" + fmt(E.wages.value, 2) + ".", link(E.release_url, "BLS ECEC release"), E.period, "bnr-calc");
    row(t, "Baker Labor Rate, Minimum Wage, Loaded", "$" + fmt(MW.value * (1 + rate), 2) + " per hour", "$" + fmt(MW.value, 2) + " \u00D7 (1 + " + fmt(rate * 100, 2) + "%). Worked out in the page from the lines above.", "\u2014", E.period, "bnr-calc");
    recordRoot.appendChild(t.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Operating Cost per Hour, Estimate" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "ESTIMATE. The Energy Information Administration\u2019s Commercial Buildings Energy Consumption Survey (CBECS 2018, the newest published, released 2022) reports the average yearly electricity and natural gas use of a Food service building, which is a building where food is prepared and sold, and the average hours it operates. Dividing a year of use by a year of operating hours gives use per hour. Pricing that at the EIA Wisconsin commercial rates gives dollars per hour. The 2018 use is combined with current prices, and no bakery in particular was measured. Heating, cooling, ventilation, refrigeration, cooking, hot water and lighting are inside these totals." }));
    var t4 = table(["Item", "Value", "Basis", "Source", "As of"], "bnr-wide3");
    row(t4, "Mean Operating Hours per Week", fmt(C.weekly_hours.value, 0) + " hours", C.activity + " buildings. " + C.weekly_hours.table + ".", link(C.weekly_hours.url, "EIA CBECS Table B1"), "2018 survey");
    row(t4, "Operating Hours per Year", fmt(R.hrs, 0) + " hours", fmt(C.weekly_hours.value, 0) + " hours a week \u00D7 52 weeks.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Electricity Use per Building", fmt(C.electricity.kwh_per_building, 0) + " kWh per year", C.activity + ". " + C.electricity.table + ".", link(C.electricity.url, "EIA CBECS Table C22"), "2018 survey");
    row(t4, "Natural Gas Use per Building", fmt(C.gas.cf_per_building, 0) + " cubic feet per year", C.activity + ", buildings using natural gas. " + C.gas.table + ".", link(C.gas.url, "EIA CBECS Table C32"), "2018 survey");
    row(t4, "Wisconsin Commercial Electricity Price", fmt(O.electricity.cents_per_kwh, 2) + " cents per kWh", O.electricity.source + ". " + O.electricity.period + "; " + O.electricity.prior_period + " was " + fmt(O.electricity.prior_year, 2) + ".", link(O.electricity.url, "EIA Table 5.6.A"), O.electricity.period + stale(O.electricity.stale || O.stale));
    row(t4, "Wisconsin Commercial Natural Gas Price", "$" + fmt(O.gas.usd_per_mcf, 2) + " per thousand cubic feet", O.gas.source + ". " + O.gas.period + (O.gas.prior_month != null ? "; " + O.gas.prior_period + " was $" + fmt(O.gas.prior_month, 2) : "") + ".", link(O.gas.url, "EIA Natural Gas Prices"), O.gas.period + stale(O.gas.stale || O.stale));
    row(t4, "Electricity per Hour", "$" + fmt(R.elec, 2) + " ($" + fmt(R.elec / 60, 3) + " per minute)", fmt(R.kwh, 2) + " kWh per hour \u00D7 " + fmt(O.electricity.cents_per_kwh, 2) + " cents. Worked out in the page.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Natural Gas per Hour", "$" + fmt(R.gas, 2) + " ($" + fmt(R.gas / 60, 3) + " per minute)", fmt(R.mcf, 4) + " thousand cubic feet per hour \u00D7 $" + fmt(O.gas.usd_per_mcf, 2) + ". Worked out in the page.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Operating Cost per Hour, Estimate", "$" + fmt(R.perHour, 2) + " ($" + fmt(R.perHour / 60, 3) + " per minute)", "Electricity plus natural gas.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Not Priced: " + O.unpriced.join(", "), "Not priced", O.unpriced_reason, "\u2014", "\u2014");
    recordRoot.appendChild(t4.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Time per Batch" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Time is the recipe\u2019s published hands-on time plus its published bake time, using the midpoint where a range is given. Unattended rising, resting and chilling time, which is most of the published total time, is not counted. King Arthur Baking\u2019s recipe pages state these times. The other source pages state none in a form this record can read, so every other formula uses the default below, which is the published time of the King Arthur Bagels formula. Time is fixed for one batch and scales with the batch multiple. It is not a measurement of any other formula." }));
    var t3 = table(["Formula", "Minutes Counted", "Basis", "Source"], "bnr-wide3");
    var pub = FORMULAS.filter(function (x) { return HO.formulas[x.id]; });
    pub.forEach(function (x) {
      var r = HO.formulas[x.id];
      t3.body.appendChild(h("tr", null, h("th", { scope: "row", text: x.name }), h("td", { class: "is-num", text: fmt(r.minutes, 1) + " min" }), h("td", { text: "Published by the source page: " + r.text + "; total time on the page " + fmt(r.total_min, 0) + " min" + stale(r.stale) }), h("td", null, link(r.url, "Recipe page"))));
    });
    t3.body.appendChild(h("tr", { class: "bnr-calc" }, h("th", { scope: "row", text: "Every Other Formula (" + (FORMULAS.length - pub.length) + ")" }), h("td", { class: "is-num", text: fmt(HO.default_minutes, 1) + " min" }), h("td", { text: "Default. " + HO.default_basis + "." }), h("td", null, link(HO.default_url, "King Arthur Bagels"))));
    recordRoot.appendChild(t3.el);
  }
  function buildRecord() {
    if (!PRICES || !recordRoot) return;
    clear(recordRoot);
    recordRoot.appendChild(h("h2", { class: "bnr-h2", id: "prices", text: "Published Prices and Sources" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Every price and rate on this page is a published figure with a source and a date. Every figure is read from its source; the one estimate, Operating Cost, is labeled as such and its basis is shown. If a type has no published price, the panel says so and leaves the line out of the total." }));
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "How Prices Are Kept Current" }));
    var how = h("ul", { class: "bnr-list" });
    [
      "The Union rewrites this record by reading each source again. The ingredient prices were last read " + fmtStamp(PRICES.generated_at) + ". Nothing on this page refreshes itself in your browser.",
      "Listed prices (WSR, KAB) are the price shown on the product page that day, divided by the weight of the listed pack. Dairy and other perishable listings can change more than once a day.",
      "Burden Rate inputs change on the schedule of their source: the Wisconsin minimum wage only when the law changes (it has been $7.25 since July 24, 2009), the ECEC benefit load once a quarter (published about three months after the quarter closes), the Wisconsin commercial electricity and natural gas prices once a month, and the CBECS building use figures only when a new survey is published (the 2018 survey is the newest).",
      "BLS figures are national monthly average retail prices. The newest month is published about two weeks after month-end, so they move once a month.",
      "Futures quotes (YF) are delayed exchange quotes shown for reference. They are never used in a cost.",
      "A source that cannot be read keeps its last reading, marked STALE with its date. The tape does not refresh itself in your browser. This page makes no outside requests and keeps nothing about you."
    ].forEach(function (t) { how.appendChild(h("li", { text: t })); });
    recordRoot.appendChild(how);

    if (laborOk()) buildLaborRecord();
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Price Record by Ingredient Type" }));
    var t1 = table(["Type", "Price", "Basis", "Source and product", "As of"]);
    Object.keys(PRICES.categories).forEach(function (c) {
      var cat = PRICES.categories[c];
      t1.body.appendChild(h("tr", { class: "bnr-group" }, h("th", { colspan: "5", scope: "colgroup", text: cat.label })));
      recordRows(t1.body, cat.options);
    });
    t1.body.appendChild(h("tr", { class: "bnr-group" }, h("th", { colspan: "5", scope: "colgroup", text: "Lines Without a Selector" })));
    recordRows(t1.body, Object.keys(PRICES.fixed));
    recordRoot.appendChild(t1.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "National Averages and Futures, Reference Only" }));
    var t2 = table(["Series", "Latest", "Prior", "Source", "As of"]);
    (PRICES.bls_reference || []).forEach(function (r) {
      t2.body.appendChild(h("tr", null, h("th", { scope: "row", text: r.name + ", " + r.unit_text }), h("td", { class: "is-num", text: "$" + fmt(r.value, 3) }),
        h("td", { class: "is-num", text: r.prev_value ? "$" + fmt(r.prev_value, 3) + " (" + fmtDate(r.prev_period) + ")" : "\u2014" }),
        h("td", null, h("a", { href: r.url, target: "_blank", rel: "noreferrer", text: "BLS " + r.series })), h("td", { text: fmtDate(r.period) })));
    });
    (PRICES.futures || []).forEach(function (q) {
      t2.body.appendChild(h("tr", null, h("th", { scope: "row", text: q.name + " (" + q.symbol + "), " + q.unit_text }), h("td", { class: "is-num", text: fmt(q.price, 2) }),
        h("td", { class: "is-num", text: fmt(q.prev_close, 2) + " (prior close)" }),
        h("td", null, h("a", { href: q.url, target: "_blank", rel: "noreferrer", text: "YF " + q.symbol })), h("td", { text: fmtStamp(q.quote_time) + (q.stale ? " (stale)" : "") })));
    });
    recordRoot.appendChild(t2.el);
    var w = PRICES.weight_chart;
    recordRoot.appendChild(h("p", { class: "bnr-p bnr-small" },
      "Where a pack is sold by volume, its weight is taken from the ", h("a", { href: w.url, target: "_blank", rel: "noreferrer", text: w.name }),
      " (molasses 340 g per cup, maple syrup 312 g per cup, milk 227 g per cup). Egg lines are costed at one whole egg for each egg named, at the BLS price per dozen divided by twelve. Formula quantities are unchanged from the published formulas."));
  }

  function mount(panelEl, tapeEl, recordEl) {
    if (!PRICES) { panelEl.textContent = "The price record could not be read. The calculator is unavailable."; return; }
    root = panelEl; tapeRoot = tapeEl; recordRoot = recordEl;
    buildTapeFrame(); buildTape(); buildRecord(); render();
  }
  return { mount: mount, _state: state };
})();

var CSS = "/* Bagel Calculator styles. Everything is scoped to #bn-calc so nothing leaks into the rest of the site. */\n#bn-calc { --c-navy:#041c2c; --c-sky:#007398; --c-lime:#c4d600; --c-brown:#7a3b12; --c-line:#d5dae0; --c-soft:#f4f6f8; --c-muted:#5a5a6e;\n  color: var(--c-navy); font-size: 1rem; line-height: 1.6; max-width: 100%; }\n#bn-calc * { box-sizing: border-box; }\n#bn-calc .bnc-lede { font-size: 1.15rem; max-width: 52rem; }\n#bn-calc .bnc-p { max-width: 56rem; margin: 0.75rem 0; }\n#bn-calc .bnc-h2 { font-size: 1.6rem; margin: 2.6rem 0 0.6rem; padding-top: 0.6rem; border-top: 3px solid var(--c-navy); line-height: 1.2; }\n#bn-calc .bnc-section { margin-bottom: 1rem; }\n#bn-calc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--c-soft); border: 1px solid var(--c-line); padding: 0 0.3em; border-radius: 3px; }\n#bn-calc a { color: var(--c-sky); }\n#bn-calc .bnc-toc { border: 1px solid var(--c-line); background: var(--c-soft); padding: 0.8rem 1.1rem; margin: 1.2rem 0; max-width: 38rem; }\n#bn-calc .bnc-toc__head { margin: 0 0 0.3rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }\n#bn-calc .bnc-toc ol { margin: 0; padding-left: 1.3rem; columns: 2 16rem; }\n#bn-calc .bnc-callout { border-left: 5px solid var(--c-sky); background: #e8f3f7; padding: 0.7rem 1rem; margin: 1rem 0; max-width: 56rem; }\n#bn-calc .bnc-callout--warning { border-left-color: var(--c-brown); background: #f6e9df; }\n#bn-calc .bnc-props { margin: 1rem 0; border: 1px solid var(--c-line); max-width: 56rem; }\n#bn-calc .bnc-props__row { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; border-bottom: 1px solid var(--c-line); }\n#bn-calc .bnc-props__row:last-child { border-bottom: 0; }\n#bn-calc .bnc-props dt { margin: 0; padding: 0.5rem 0.8rem; background: var(--c-soft); font-weight: 700; font-size: 0.9rem; }\n#bn-calc .bnc-props dd { margin: 0; padding: 0.5rem 0.8rem; font-size: 0.95rem; }\n#bn-calc .bnc-tablewrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--c-line); max-width: 100%; }\n#bn-calc .bnc-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin: 0; }\n#bn-calc .bnc-table th, #bn-calc .bnc-table td { padding: 0.5rem 0.7rem; border: 0; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }\n#bn-calc .bnc-table thead th { background: var(--c-navy); color: #fff; font-weight: 700; white-space: nowrap; }\n#bn-calc .bnc-table tbody th { font-weight: 600; min-width: 9rem; background: #fbfcfd; }\n#bn-calc .bnc-table tbody tr:last-child > * { border-bottom: 0; }\n#bn-calc .bnc-table .is-end { text-align: right; font-variant-numeric: tabular-nums; }\n#bn-calc .bnc-badge { display: inline-block; padding: 0.1rem 0.5rem; font-weight: 700; font-size: 0.8rem; border-radius: 2px; white-space: nowrap; }\n#bn-calc .bnc-badge--ok { background: var(--c-lime); color: var(--c-navy); }\n#bn-calc .bnc-badge--warn { background: var(--c-sky); color: #fff; }\n#bn-calc .bnc-badge--bad { background: var(--c-brown); color: #fff; }\n#bn-calc .bnc-badge--plain { background: var(--c-soft); color: var(--c-navy); border: 1px solid var(--c-line); }\n#bn-calc .bnc-seg { display: flex; flex-wrap: wrap; gap: 0; margin: 1rem 0; }\n#bn-calc .bnc-seg__btn, #bn-calc .bnc-btn { font: inherit; font-size: 0.9rem; cursor: pointer; padding: 0.45rem 0.9rem; border: 1px solid var(--c-navy); background: #fff; color: var(--c-navy); border-radius: 0; margin: 0; line-height: 1.3; }\n#bn-calc .bnc-seg__btn { margin-right: -1px; }\n#bn-calc .bnc-seg__btn.is-on { background: var(--c-navy); color: #fff; }\n#bn-calc .bnc-seg__btn:hover, #bn-calc .bnc-btn:hover { background: var(--c-sky); color: #fff; border-color: var(--c-sky); }\n#bn-calc .bnc-btn { margin: 0.25rem 0.4rem 0.25rem 0; }\n#bn-calc button:focus-visible, #bn-calc input:focus-visible, #bn-calc a:focus-visible { outline: 3px solid var(--c-sky); outline-offset: 2px; }\n#bn-calc .bnc-field { display: grid; grid-template-columns: minmax(12rem, 28rem) 10rem; gap: 0.3rem 1rem; align-items: center; margin: 0.4rem 0; }\n#bn-calc .bnc-field label { font-size: 0.92rem; font-weight: 600; }\n#bn-calc .bnc-field input { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--c-navy); background: #fff; color: var(--c-navy); width: 100%; border-radius: 0; font-variant-numeric: tabular-nums; }\n#bn-calc .bnc-eq { display: flex; justify-content: space-between; align-items: center; gap: 1rem; max-width: 40rem; margin: 1rem 0; padding: 0.8rem 1rem; background: var(--c-soft); border: 1px solid var(--c-line); font-size: 1.1rem; }\n#bn-calc .bnc-eq__label { color: var(--c-muted); }\n#bn-calc .bnc-frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; margin: 0 0.3rem; }\n#bn-calc .bnc-frac__num { border-bottom: 2px solid var(--c-navy); padding: 0 0.3rem 0.1rem; }\n#bn-calc .bnc-frac__den { padding-top: 0.1rem; }\n#bn-calc .bnc-list { max-width: 56rem; padding-left: 1.3rem; }\n#bn-calc .bnc-list li { margin: 0.4rem 0; }\n#bn-calc .bnc-cards { display: grid; gap: 0.6rem; margin: 0.8rem 0; max-width: 56rem; }\n#bn-calc .bnc-card { display: flex; flex-direction: column; border: 1px solid var(--c-line); padding: 0.6rem 0.9rem; text-decoration: none; color: var(--c-navy); background: #fff; }\n#bn-calc .bnc-card strong { color: var(--c-sky); }\n#bn-calc .bnc-card span { font-size: 0.82rem; color: var(--c-muted); }\n#bn-calc .bnc-card:hover { border-color: var(--c-sky); }\n#bn-calc .bnc-steps { max-width: 56rem; padding-left: 1.3rem; }\n#bn-calc .bnc-steps li { margin: 0.7rem 0; }\n#bn-calc .bnc-steps strong { display: block; }\n#bn-calc .bnc-diagram { display: flex; flex-direction: column; align-items: center; margin: 1.2rem 0; max-width: 28rem; }\n#bn-calc .bnc-node { width: 100%; border: 2px solid var(--c-navy); padding: 0.5rem 0.8rem; text-align: center; background: #fff; display: flex; flex-direction: column; }\n#bn-calc .bnc-node span { font-size: 0.85rem; color: var(--c-muted); }\n#bn-calc .bnc-node--person { border-radius: 2rem; }\n#bn-calc .bnc-node--decision { border-style: dashed; background: #e8f3f7; }\n#bn-calc .bnc-node--terminal { background: var(--c-navy); color: #fff; }\n#bn-calc .bnc-node--terminal span { color: #d5dae0; }\n#bn-calc .bnc-edge { display: flex; align-items: center; gap: 0.5rem; color: var(--c-sky); font-size: 0.85rem; min-height: 1.8rem; }\n#bn-calc .bnc-edge__arrow { font-size: 1.2rem; line-height: 1; }\n#bn-calc .bnc-sources { margin-top: 2rem; font-size: 0.85rem; color: var(--c-muted); }\n#bn-calc .bnc-sources .bnc-h2 { font-size: 1.1rem; }\n#bn-calc .bnc-top { margin-top: 2rem; }\n#bn-calc .bnc-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }\n#bn-calc .bnc-links a { display: inline-block; border: 1px solid var(--c-navy); padding: 0.45rem 0.9rem; text-decoration: none; color: var(--c-navy); font-weight: 600; background: #fff; }\n#bn-calc .bnc-links a:hover { background: var(--c-navy); color: #fff; }\n@media (max-width: 640px) {\n  #bn-calc .bnc-props__row { grid-template-columns: 1fr; }\n  #bn-calc .bnc-field { grid-template-columns: 1fr; }\n  #bn-calc .bnc-h2 { font-size: 1.35rem; }\n  #bn-calc .bnc-toc ol { columns: 1; }\n}\nhtml:has(#bn-calc), body:has(#bn-calc) { overflow-x: clip; }\n/* Let the page title line up with the wide calculator column */\nbody:has(#bn-calc) .wp-block-post-title { max-width: var(--wp--style--global--wide-size, 1340px) !important; margin-left: auto !important; margin-right: auto !important; }\n\n/* ===== Bagel Calculator redesign: split layout, requisition panel, price tape, price record ===== */\n#bn-ticker, #bn-split, #bn-record { --c-navy:#041c2c; --c-sky:#007398; --c-lime:#c4d600; --c-brown:#7a3b12; --c-line:#d5dae0; --c-soft:#f4f6f8; --c-muted:#5a5a6e; color: var(--c-navy); line-height: 1.5; }\n#bn-ticker *, #bn-split *, #bn-record * { box-sizing: border-box; }\n\n/* two columns on desktop: page content left, requisition panel right */\n#bn-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 33rem); gap: 2.5rem; align-items: start; margin: 1.5rem 0 0; }\n#bn-split > #bn-calc { min-width: 0; }\n#bn-panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; min-width: 0; }\n@media (max-width: 1020px) {\n  #bn-split { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }\n  #bn-panel { order: -1; position: static; max-height: none; overflow: visible; }\n}\n\n/* ---- price tape: terminal look from the original concept, full width ---- */\n#bn-ticker { width: 100vw; max-width: 100vw; margin: 1.2rem calc(50% - 50vw) 0; background: #000; color: #FFB000; font-family: ui-monospace, \"IBM Plex Mono\", Menlo, Consolas, monospace;\n  border-top: 4px double #FFB000; border-bottom: 4px double #00FF41; padding: 10px 0 12px; overflow: hidden; position: relative; }\n#bn-ticker .bnt-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 0 16px 8px; border-bottom: 1px solid #FFB000; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }\n#bn-ticker .bnt-brand { color: #00FF41; }\n#bn-ticker .bnt-flag { color: #FFB000; }\n#bn-ticker .bnt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 6px 16px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid #3a2a00; color: #00FF41; }\n#bn-ticker .bnt-bar__r { display: inline-flex; gap: 14px; align-items: center; }\n#bn-ticker .bnt-skip { color: #FFB000; text-decoration: underline; }\n#bn-ticker .bnt-pause { font: inherit; letter-spacing: inherit; text-transform: uppercase; background: transparent; color: #FFB000; border: 1px solid #FFB000; padding: 1px 8px; cursor: pointer; }\n#bn-ticker .bnt-pause:hover, #bn-ticker .bnt-pause:focus-visible { background: #FFB000; color: #000; outline: none; }\n#bn-ticker .bnt-lane { overflow: hidden; white-space: nowrap; border-bottom: 1px solid #3a2a00; }\n#bn-ticker .bnt-track { display: inline-flex; white-space: nowrap; animation: bnt-run 240s linear infinite; will-change: transform; }\n#bn-ticker:hover .bnt-track, #bn-ticker.is-paused .bnt-track { animation-play-state: paused; }\n#bn-ticker .bnt-seg { display: inline-flex; flex: none; }\n#bn-ticker .bnt-item { display: inline-block; padding: 8px 14px; font-size: 12px; letter-spacing: 0.05em; color: #00FF41; border-right: 1px solid #3a2a00; }\n#bn-ticker .bnt-item.is-up { color: #00FF41; }\n#bn-ticker .bnt-item.is-down { color: #FF4D4D; }\n#bn-ticker .bnt-item.is-ref { color: #FFB000; }\n#bn-ticker .bnt-item.is-ref.is-down { color: #FF4D4D; }\n#bn-ticker .bnt-item.is-none { color: #8a7a4a; font-style: italic; }\n#bn-ticker .bnt-item.is-stale { text-decoration: line-through; text-decoration-color: #FFB000; }\n#bn-ticker .bnt-item.is-sel { background: #00FF41; color: #000; font-weight: 700; }\n#bn-ticker .bnt-foot { padding: 8px 16px 0; font-size: 11px; letter-spacing: 0.04em; color: #c9a94d; max-width: 110ch; white-space: normal; }\n@keyframes bnt-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }\n@media (prefers-reduced-motion: reduce) { #bn-ticker .bnt-track { animation: none; } #bn-ticker .bnt-lane { overflow-x: auto; } }\n\n/* ---- requisition panel ---- */\n#bn-panel .bnp-card { border: 2px solid var(--c-navy); background: #fff; padding: 1rem 1.1rem 1.2rem; }\n#bn-panel .bnp-title { margin: 0 0 0.2rem; font-size: 1.35rem; line-height: 1.2; }\n#bn-panel .bnp-sub { margin: 0 0 0.8rem; font-size: 0.88rem; color: var(--c-muted); }\n#bn-panel .bnp-label { display: block; margin: 0.7rem 0 0.25rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }\n#bn-panel .bnp-input { width: 100%; font: inherit; font-size: 0.95rem; padding: 0.4rem 0.5rem; border: 1px solid var(--c-navy); background: #fff; color: var(--c-navy); border-radius: 0; font-weight: 500; }\n#bn-panel .bnp-input--num { width: 7rem; font-variant-numeric: tabular-nums; font-weight: 600; }\n#bn-panel .bnp-meta { margin: 0.4rem 0 0; font-size: 0.82rem; color: var(--c-muted); }\n#bn-panel a { color: var(--c-sky); }\n#bn-panel .bnp-batch { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }\n#bn-panel .bnp-btn { font: inherit; font-size: 0.82rem; cursor: pointer; padding: 0.38rem 0.6rem; border: 1px solid var(--c-navy); background: #fff; color: var(--c-navy); border-radius: 0; line-height: 1.2; }\n#bn-panel .bnp-btn:hover { background: var(--c-sky); border-color: var(--c-sky); color: #fff; }\n#bn-panel .bnp-btn--reset { margin-top: 0.7rem; }\n#bn-panel button:focus-visible, #bn-panel input:focus-visible, #bn-panel select:focus-visible, #bn-panel a:focus-visible, #bn-panel .bnp-opt:focus-visible { outline: 3px solid var(--c-sky); outline-offset: 2px; }\n#bn-panel .bnp-h3 { margin: 1.1rem 0 0.3rem; padding-top: 0.5rem; border-top: 3px solid var(--c-navy); font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; }\n#bn-panel .bnp-lines { list-style: none; margin: 0; padding: 0; }\n#bn-panel .bnp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 5.6rem; gap: 0.1rem 0.7rem; padding: 0.55rem 0; border-bottom: 1px solid var(--c-line); align-items: start; }\n#bn-panel .bnp-line__name { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }\n#bn-panel .bnp-line__fixed { font-weight: 600; font-size: 0.93rem; padding: 0.15rem 0; }\n#bn-panel .bnp-line__pub { font-size: 0.75rem; color: var(--c-muted); line-height: 1.3; }\n#bn-panel .bnp-line__qty { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.93rem; padding-top: 0.15rem; white-space: nowrap; }\n#bn-panel .bnp-line__cost { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; padding-top: 0.15rem; display: flex; flex-direction: column; align-items: flex-end; }\n#bn-panel .bnp-line__src { font-size: 0.68rem; color: var(--c-muted); letter-spacing: 0.02em; white-space: nowrap; }\n#bn-panel .bnp-line.is-unpriced .bnp-line__cost { color: var(--c-brown); font-size: 0.74rem; font-style: italic; line-height: 1.25; }\n/* the ingredient name is the control */\n#bn-panel .bnp-sel { position: relative; }\n#bn-panel .bnp-sel__btn { display: inline-flex; align-items: center; gap: 0.35rem; max-width: 100%; text-align: left; font: inherit; font-weight: 700; font-size: 0.93rem; color: var(--c-sky); background: transparent; border: 0; border-bottom: 2px dotted var(--c-sky); padding: 0.1rem 0; cursor: pointer; border-radius: 0; line-height: 1.3; }\n#bn-panel .bnp-sel__btn:hover, #bn-panel .bnp-sel.is-open .bnp-sel__btn { background: #e8f3f7; }\n#bn-panel .bnp-sel__caret { font-size: 0.8rem; flex: none; }\n#bn-panel .bnp-list { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; min-width: min(22rem, 86vw); max-width: 92vw; margin: 0; padding: 0; list-style: none; background: #fff; border: 2px solid var(--c-navy); box-shadow: 0 8px 24px rgba(4, 28, 44, 0.25); max-height: 17rem; overflow-y: auto; }\n#bn-panel .bnp-list[hidden] { display: none; }\n#bn-panel .bnp-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.7rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--c-line); cursor: pointer; font-size: 0.88rem; align-items: baseline; }\n#bn-panel .bnp-opt:last-child { border-bottom: 0; }\n#bn-panel .bnp-opt:hover, #bn-panel .bnp-opt:focus { background: var(--c-navy); color: #fff; outline: none; }\n#bn-panel .bnp-opt.is-on { background: #e8f3f7; font-weight: 700; }\n#bn-panel .bnp-opt.is-on:hover, #bn-panel .bnp-opt.is-on:focus { background: var(--c-navy); }\n#bn-panel .bnp-opt__price { font-size: 0.76rem; color: var(--c-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }\n#bn-panel .bnp-opt__price.is-none { color: var(--c-brown); font-style: italic; }\n#bn-panel .bnp-opt:hover .bnp-opt__price, #bn-panel .bnp-opt:focus .bnp-opt__price { color: #d5dae0; }\n#bn-panel .bnp-totals { margin: 0.9rem 0 0; border: 1px solid var(--c-line); background: var(--c-soft); }\n#bn-panel .bnp-totals__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--c-line); font-size: 0.86rem; }\n#bn-panel .bnp-totals__row:last-child { border-bottom: 0; }\n#bn-panel .bnp-totals dt { margin: 0; color: var(--c-muted); }\n#bn-panel .bnp-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }\n#bn-panel .bnp-totals__row.is-strong { background: var(--c-navy); color: #fff; border-bottom-color: var(--c-navy); }\n#bn-panel .bnp-totals__row.is-strong dt { color: #d5dae0; }\n#bn-panel .bnp-note, #bn-panel .bnp-foot, #bn-panel .bnp-warn { font-size: 0.8rem; color: var(--c-muted); margin: 0.7rem 0 0; line-height: 1.45; }\n#bn-panel .bnp-warn { border-left: 5px solid var(--c-brown); background: #f6e9df; color: var(--c-navy); padding: 0.6rem 0.8rem; margin-top: 1rem; }\n@media (max-width: 640px) {\n  #bn-panel .bnp-card { padding: 0.8rem 0.8rem 1rem; }\n  #bn-panel .bnp-line { grid-template-columns: minmax(0, 1fr) auto; }\n  #bn-panel .bnp-line__cost { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 0.6rem; text-align: left; padding-top: 0; }\n  #bn-panel .bnp-list { min-width: 0; width: calc(100vw - 3.2rem); max-width: 100%; }\n  #bn-ticker .bnt-top, #bn-ticker .bnt-bar, #bn-ticker .bnt-foot { padding-left: 10px; padding-right: 10px; }\n}\n\n/* ---- price record, full width below the columns ---- */\n#bn-record { margin-top: 2.6rem; }\n#bn-record .bnr-h2 { font-size: 1.6rem; margin: 0 0 0.6rem; padding-top: 0.6rem; border-top: 3px solid var(--c-navy); line-height: 1.2; scroll-margin-top: 1rem; }\n#bn-record .bnr-h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }\n#bn-record .bnr-p { max-width: 56rem; margin: 0.6rem 0; }\n#bn-record .bnr-small { font-size: 0.85rem; color: var(--c-muted); }\n#bn-record .bnr-list { max-width: 56rem; padding-left: 1.3rem; }\n#bn-record .bnr-list li { margin: 0.4rem 0; }\n#bn-record a { color: var(--c-sky); }\n#bn-record .bnr-wrap { overflow-x: auto; margin: 0.6rem 0 1rem; border: 1px solid var(--c-line); max-width: 100%; }\n#bn-record .bnr-table { border-collapse: collapse; width: 100%; font-size: 0.86rem; margin: 0; }\n#bn-record .bnr-table th, #bn-record .bnr-table td { padding: 0.45rem 0.7rem; border: 0; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }\n#bn-record .bnr-table thead th { background: var(--c-navy); color: #fff; white-space: nowrap; }\n#bn-record .bnr-table tbody th[scope=row] { font-weight: 600; min-width: 11rem; background: #fbfcfd; }\n#bn-record .bnr-table tr.bnr-group th { background: var(--c-soft); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; border-top: 2px solid var(--c-navy); }\n#bn-record .bnr-table td.is-num { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }\n#bn-record .bnr-table tr.is-none td { color: var(--c-brown); font-style: italic; }\n#bn-record .bnr-table td:last-child { white-space: nowrap; }\n\n/* burden breakdown */\n#bn-panel .bnp-breakwrap { margin: 0.6rem 0 0; border: 1px solid var(--c-line); overflow-x: auto; max-width: 100%; }\n#bn-panel .bnp-break { border-collapse: collapse; width: 100%; font-size: 0.86rem; margin: 0; }\n#bn-panel .bnp-break th, #bn-panel .bnp-break td { padding: 0.4rem 0.6rem; border: 0; border-bottom: 1px solid var(--c-line); text-align: right; font-variant-numeric: tabular-nums; }\n#bn-panel .bnp-break thead th { background: var(--c-soft); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }\n#bn-panel .bnp-break th[scope=row], #bn-panel .bnp-break thead th:first-child { text-align: left; font-weight: 600; }\n#bn-panel .bnp-break tr:last-child th, #bn-panel .bnp-break tr:last-child td { border-bottom: 0; }\n#bn-panel .bnp-break tr.is-total th, #bn-panel .bnp-break tr.is-total td { background: var(--c-navy); color: #fff; font-weight: 700; }\n#bn-panel .bnp-labor { margin-top: 0.7rem; }\n#bn-panel .bnp-break tr.is-burden th, #bn-panel .bnp-break tr.is-burden td { background: var(--c-soft); font-weight: 700; }\n#bn-panel .bnp-break tr.is-sub th { font-weight: 400; padding-left: 1.6rem; color: var(--c-muted); }\n#bn-panel .bnp-break tr.is-sub td { color: var(--c-muted); }\n#bn-record .bnr-table tr.bnr-calc th, #bn-record .bnr-table tr.bnr-calc td { background: var(--c-soft); }\n#bn-record .bnr-table.bnr-wide3 td:nth-child(3) { min-width: 17rem; }\n#bn-record .bnr-table.bnr-wide3 td:nth-child(4) { min-width: 9rem; word-break: break-all; }\n\n/* total cost reveal: scoreboard panel, lime bulb border, big tabular figures */\n#bn-panel .bnp-reveal { position: relative; box-sizing: border-box; margin: 1rem 0 0; padding: 1.55rem 1.1rem 1.15rem; min-height: 13.4rem; text-align: center; color: #fff; border: 2px solid var(--c-navy); background: radial-gradient(ellipse at 50% 0%, #0d3b5a 0%, #062a40 45%, #041c2c 100%); overflow: hidden; }\n#bn-panel .bnp-reveal__label { margin: 0; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-lime); line-height: 1.35; }\n#bn-panel .bnp-reveal__num { margin: 0.45rem 0 0.5rem; font-size: clamp(2.9rem, 13.5vw, 4.4rem); line-height: 1.08; min-height: 1.08em; font-weight: 800; letter-spacing: -0.01em; color: #fff; font-variant-numeric: tabular-nums; font-feature-settings: \"tnum\" 1; white-space: nowrap; text-shadow: 0 0 16px rgba(196, 214, 0, 0.45); }\n#bn-panel .bnp-reveal__sub { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding-top: 0.65rem; border-top: 1px solid rgba(196, 214, 0, 0.45); }\n#bn-panel .bnp-reveal__cell { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }\n#bn-panel .bnp-reveal__k { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #d5dae0; }\n#bn-panel .bnp-reveal__v { font-size: 1.25rem; line-height: 1.2; min-height: 1.2em; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; font-feature-settings: \"tnum\" 1; white-space: nowrap; }\n#bn-panel .bnp-reveal__cap { margin: 0.55rem 0 0; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: #9fb3c0; line-height: 1.3; }\n#bn-panel .bnp-reveal__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }\n/* bulbs: steady at rest; chasing only while the figures count and for a moment after they land */\n#bn-panel .bnp-bulbs { position: absolute; pointer-events: none; }\n#bn-panel .bnp-bulbs--t, #bn-panel .bnp-bulbs--b { left: 5px; right: 5px; height: 12px; }\n#bn-panel .bnp-bulbs--t { top: 3px; }\n#bn-panel .bnp-bulbs--b { bottom: 3px; }\n#bn-panel .bnp-bulbs--l, #bn-panel .bnp-bulbs--r { top: 19px; bottom: 19px; width: 12px; }\n#bn-panel .bnp-bulbs--l { left: 3px; }\n#bn-panel .bnp-bulbs--r { right: 3px; }\n#bn-panel .bnp-bulbs::before, #bn-panel .bnp-bulbs::after { content: \"\"; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }\n#bn-panel .bnp-bulbs--t::before, #bn-panel .bnp-bulbs--t::after, #bn-panel .bnp-bulbs--b::before, #bn-panel .bnp-bulbs--b::after { background: radial-gradient(circle at 50% 50%, #c4d600 0 3px, rgba(196, 214, 0, 0) 3.7px) 0 0 / 18px 12px repeat-x; }\n#bn-panel .bnp-bulbs--l::before, #bn-panel .bnp-bulbs--l::after, #bn-panel .bnp-bulbs--r::before, #bn-panel .bnp-bulbs--r::after { background: radial-gradient(circle at 50% 50%, #c4d600 0 3px, rgba(196, 214, 0, 0) 3.7px) 0 0 / 12px 18px repeat-y; }\n#bn-panel .bnp-bulbs::before { opacity: 0.8; }\n#bn-panel .bnp-bulbs::after { opacity: 0; filter: drop-shadow(0 0 3px #c4d600); }\n#bn-panel .bnp-bulbs--t::after, #bn-panel .bnp-bulbs--b::after { -webkit-mask: linear-gradient(90deg, #000 0 18px, transparent 18px) 0 0 / 54px 100% repeat; mask: linear-gradient(90deg, #000 0 18px, transparent 18px) 0 0 / 54px 100% repeat; }\n#bn-panel .bnp-bulbs--l::after, #bn-panel .bnp-bulbs--r::after { -webkit-mask: linear-gradient(180deg, #000 0 18px, transparent 18px) 0 0 / 100% 54px repeat; mask: linear-gradient(180deg, #000 0 18px, transparent 18px) 0 0 / 100% 54px repeat; }\n@media (prefers-reduced-motion: no-preference) {\n  #bn-panel .bnp-reveal.is-live .bnp-bulbs::before { opacity: 0.3; }\n  #bn-panel .bnp-reveal.is-live .bnp-bulbs::after { opacity: 1; animation: bnp-chase-x 0.6s steps(3) infinite; }\n  #bn-panel .bnp-reveal.is-live .bnp-bulbs--l::after, #bn-panel .bnp-reveal.is-live .bnp-bulbs--r::after { animation-name: bnp-chase-y; }\n  #bn-panel .bnp-reveal.is-live .bnp-bulbs--b::after, #bn-panel .bnp-reveal.is-live .bnp-bulbs--l::after { animation-direction: reverse; }\n  #bn-panel .bnp-reveal.is-landed .bnp-reveal__num { animation: bnp-land 0.9s ease-out; }\n  @keyframes bnp-chase-x { to { -webkit-mask-position: 54px 0; mask-position: 54px 0; } }\n  @keyframes bnp-chase-y { to { -webkit-mask-position: 0 54px; mask-position: 0 54px; } }\n  @keyframes bnp-land { 0% { text-shadow: 0 0 38px rgba(196, 214, 0, 1), 0 0 8px #c4d600; } 100% { text-shadow: 0 0 16px rgba(196, 214, 0, 0.45); } }\n}\n@media (max-width: 640px) {\n  #bn-panel .bnp-reveal { padding: 1.45rem 0.8rem 1rem; }\n  #bn-panel .bnp-reveal__v { font-size: 1.1rem; }\n}\n";
var el = document.getElementById('bn-calc');
if (el) {
  var st = document.createElement('style'); st.id = 'bn-calc-css'; st.textContent = CSS; document.head.appendChild(st);
  el.textContent = ''; BNC.mount(App, el);
  PANEL.mount(document.getElementById('bn-panel'), document.getElementById('bn-tape'), document.getElementById('bn-record'));
}
})();

Authoring Source (TSX)

The calculator was written as TSX and compiled to the script above. This is the authoring source, with the formulas, routing, and policy text in one file.

bagel-calculator.tsx · authoring source
/* ============================================================================
   Bagel Calculator: Authoring Source
   Bagelnomics (www.bagelnomics.com), published by the Bagel Bakers Union of
   the Greater Milwaukee Area, Local 7.

   WHAT THIS FILE IS
   This is the readable source the Bagel Calculator is built from. The file
   that actually runs on the page is the Calculator Script, the .txt download
   offered on the Bagel Calculator page and on the Source Code page. That
   file is this source after one build step:
   the TSX in Part 1 is compiled to plain JavaScript and joined to a small
   component runtime, the panel code in Part 2, the stylesheet and the mount
   code. Nothing else is added.

   CONTENTS
   Part 1  The left column: the recipe, its ingredient drop-downs and the
           fixed quantities. Written in TSX (TypeScript with JSX syntax).
           Components such as Page, Section, Table, Input and Button come from
           the small runtime that ships in the Calculator Script download.
   Part 2  The requisition panel on the right, the scrolling price tape and
           the Price Record at the bottom of the page. Plain JavaScript. The
           formula data for every recipe is inlined at the top of this part.

   HOW PRICES AND RATES WORK
   The calculator does not call any outside service. Prices and rates are
   published inside the page itself, as a block of JSON data with the element
   id bn-prices, and the script reads that block when it starts. The block holds
   one record per ingredient option: the price, the pack size, the product
   name, the source, the address of the source page, the date the price was
   read and the time it was retrieved. A price that could not be read on the
   day keeps its earlier record and is marked stale. A number is never
   estimated or filled in. An option with no published price is shown as
   unpriced, and it is left out of the totals. The same block holds the labor
   record: the wage, the benefit load, the time per batch and the operating
   cost inputs described below.

   SOURCES
   Ingredient prices are the listed prices on the public product pages of
   WebstaurantStore (restaurant-supply pack sizes) and King Arthur Baking.
   Monthly national retail averages for flour, sugar and butter come from the
   U.S. Bureau of Labor Statistics, Average Price Data, and are shown beside
   the bulk prices for comparison. The wheat, sugar and soybean oil futures on
   the tape are delayed public quotes from Yahoo Finance. They are shown as a
   reference only and are never used in a total. Every figure on the page
   shows where it came from and when.

   BURDEN RATE
   Burden Rate is time times (the baker labor rate per hour plus the
   operating cost per hour). It is shown as one line, with Baker Labor
   (Minimum Wage) and Operating Cost beneath it.
   The baker labor rate is the Wisconsin minimum wage, $7.25 per hour, read
   from the Wisconsin Department of Workforce Development and the U.S.
   Department of Labor (the two must agree), times one plus the
   employer benefit load: total benefits cost per hour divided by wages cost
   per hour from the BLS Employer Costs for Employee Compensation (ECEC),
   private industry workers in production occupations. ECEC total benefits
   already include the legally required benefits (Social Security, Medicare,
   unemployment insurance, workers compensation), so no payroll tax is added a
   second time. The minimum wage is the legal floor, not the market
   wage for Bakers; the Bureau of Labor Statistics OEWS wage for Bakers is
   listed in the record for reference only and is not used in any cost.
   Operating cost is an ESTIMATE. It is the yearly electricity and natural gas
   use of the average U.S. Food service building (EIA Commercial Buildings
   Energy Consumption Survey 2018, Tables C22 and C32), divided by its yearly
   operating hours (mean weekly hours from Table B1, times 52), priced at the
   EIA Wisconsin commercial electricity and natural gas prices. Heating,
   cooling, ventilation, refrigeration, cooking, hot water and lighting are
   inside those totals. Rent, insurance and equipment depreciation are not
   priced because no clean published hourly rate was found; they are left out.
   Time is the recipe's published hands-on time plus its published bake time.
   The King Arthur Baking pages state both; the other source pages state none
   in a form the record can read, so every other formula uses a default: the
   published time of the King Arthur Bagels formula. It is fixed for one batch
   and scales with the batch multiple. Unattended rising and resting time is
   not counted. The minimum wage changes only when the law changes, the ECEC load once a
   quarter, the EIA prices once a month and the CBECS figures only when a new
   survey is published.

   HOW THE TOTALS ARE FIGURED
   Every formula lists its ingredients with fixed quantities. The quantities
   are not editable. Choosing a different type for an ingredient, such as
   another flour or another salt, swaps in that type's published price and
   pack size, and the totals are worked out again from the price record. Each
   line is the quantity used, taken as a share of the pack, times the price of
   the pack. The burdened total adds the Burden Rate to the ingredient
   cost. The tape, the panel and the Price Record all read the
   same published data, so a figure on one of them always matches the others.

   TOTAL COST REVEAL
   The scoreboard panel under the batch controls shows the burdened total per
   bagel, with the per dozen and per batch figures beneath it. The figures
   count up and land on exactly the values in the Burdened Cost table. With
   the reduced motion setting on, they are shown at once and nothing moves.
   Screen readers are given the final values only, once per change.

   WHAT IS NOT HERE
   There is no rent, insurance or equipment cost, no account, no saved state,
   no shopping cart and no link to buy. The page reports published prices and
   rates and does the arithmetic. It does not place an order or hold stock for
   anyone.

   PRIVACY
   No cookies, no browser storage and no network requests. Whatever you choose
   in the calculator stays in memory until you close or reload the page.

   READING THIS FILE
   Part 1 begins directly below this note, and Part 2 begins at the line that
   reads Part 2: panel.js. Both parts are unminified and carry their own
   comments. The Source Code page has a Copy button for each file, and the
   same text can be downloaded as a .txt file from that page.
   ============================================================================ */

/* Part 1: calc-left.tsx, the left-column page content (TSX). */
/* Bagel Calculator, authoring source (TSX). Components such as Page, Section, Table, Input and Button are supplied by the small runtime in bagel-calculator.js; this file is compiled to that script with esbuild. */
function App() {
  return (
    <Page
      title="Bagel Calculator"
      summary="The Bagel Calculator scales an approved formula to a requisition. Select a published formula, enter a batch multiple, choose an ingredient type where a published variant exists, and read the scaled ingredient weights, the priced cost of each line, the Burden Rate added to it, and the routing slip the requisition follows."
    >
      <TableOfContents
        items={[
          { label: "What this tool is", id: "what" },
          { label: "Bagel types and status", id: "types" },
          { label: "Approval routing slip", id: "routing" },
          { label: "User flow, edge cases, and errors", id: "flow" },
          { label: "Published prices and sources", id: "prices" },
        ]}
      />

      <Section heading="What this tool is" id="what">
        <Text>
          The Bagel Calculator scales an approved formula to a requisition. A colleague selects a published formula, enters a batch multiple, chooses an ingredient type where the formula allows one, and reads the scaled ingredient weights, the bagel count for the lot, the cost of each priced line, the Burden Rate added to it, and the routing slip that the requisition follows. The requisition panel sits to the right of this page. The Bagel Bakers Union of the Greater Milwaukee Area, Local 7, issues it as decision support for documented readiness.
        </Text>
        <Text>
          It does not order food or release a lot. A requisition is a demand signal that still has to walk `PPL-1400`. Flavor remains a downstream concern of the vendor. Priya Nandakumar owns the gates.
        </Text>
        <Properties
          items={[
            { label: "Owner", value: "Bagel Lifecycle PMO for routing, Bagel Bakers Union of the Greater Milwaukee Area, Local 7 for release language" },
            { label: "Official close", value: "Index and BRI figures lock at Tuesday 08:00 close, America/Chicago" },
            { label: "What it is not", value: "Not a storefront, not a payment form, not a Stage 15, not a way around the everything-bagel freeze" },
            { label: "Prices", value: "Published list prices, plus the Wisconsin minimum wage, Bureau of Labor Statistics benefit rates and Energy Information Administration energy figures for the Burden Rate, each with its source and date (the operating cost is labeled an estimate), under Published Prices and Sources" },
            { label: "Status", value: "In service" },
          ]}
        />
      </Section>

      <Section heading="Bagel types and status" id="types">
        <Text>
          Variety comes first. Toppings are not a garnish list built by hand. They are baked into the type, then flagged against current compliance. Each type carries a status, the governing policy, and a rule for whether a requisition can be opened. Unclassified novelty is in scope of `SAF-400` but is not a released breakfast.
        </Text>
        <Table
          columns={["Type", "Built-in toppings", "Status", "Requisition rule"]}
          rows={[
            [
              "Plain",
              "None",
              { text: "Released", tone: "success" },
              "Default authorized variety. No seed-loss audit. Still requires a complete storage log and an in-tier schmear, including a 4 mm halo if any cream cheese is applied.",
            ],
            [
              "Sesame",
              "Sesame only",
              { text: "Released, under watch", tone: "warning" },
              "Retention sits at 91.7 percent against a 93.0 percent threshold under `BSC-220`. Catch-tray plating is required. Do not call it a bib. Seeds beyond the seven-seed cap are reported to the requestor's cost-center.",
            ],
            [
              "Poppy",
              "Poppy only",
              { text: "Released, unauditable", tone: "warning" },
              "Still on the service mix, but poppy is too small to audit in good faith. The working group formed on 22 October 2026 has not agreed on a counting method. A good-faith uncountability allowance applies in the interim.",
            ],
            [
              "Everything",
              "Sesame, poppy, garlic, onion, and other visible granules",
              { text: "Frozen", tone: "danger" },
              "Removed from the standard mix pending a complete allium bill of materials, by weight range and origin lot. Other visible granules is not a documentation standard. The calculator may explain the freeze. It will not release a requisition. Heritage Inventory already in the building as of 31 October may be noted, untoasted only, and is not a new demand signal.",
            ],
            [
              "Unclassified novelty",
              "Whatever the vendor has not yet named",
              { text: "Not releasable", tone: "danger" },
              "Requires an appendix and a taste-panel waiver almost no one completes on time. Selecting it opens a denial.",
            ],
          ]}
        />
        <Text>
          After variety, the form reveals only the add-ons that policy can still imagine: schmear at the employee's morning-of-service tier from Dana Ruiz's roster, toasting inside a reserved window at the employee's Toaster Privilege Level, and, for Vice President and above, lox adjacency if `SAF-400-B` was filed the prior business day. Capers are out of scope and must not appear on the requisition, in a photograph, or in a line item. Tier 0 colleagues, including Sam Delgado and anyone unattested, receive visual schmear only. Acting titles do not confer acting schmear.
        </Text>
      </Section>

      <Section heading="Approval routing slip" id="routing">
        <Text>
          A requisition emits a routing slip: a one-page artifact the colleague can recognize as a memo's cousin, with policy citations in the margin of each step. Jordan Hale is Informed immediately and becomes Responsible only at placement. A requisition approval is not a Stage 14 release. The lot can still be pulled if the morning temperature log opens a CAPA.
        </Text>
        <Diagram
          direction="vertical"
          nodes={[
            { id: "req", label: "Requestor", detail: "Attests quantity one, in-window", kind: "person" },
            { id: "roster", label: "Dana Ruiz roster", detail: "Morning-of-service tier", kind: "box" },
            { id: "quote", label: "Requisition recorded", detail: "Quantities as scaled", kind: "box" },
            { id: "finance", label: "Margaret Lin", detail: "Flour envelope, 4410-B, capex if any", kind: "person" },
            { id: "gates", label: "Policy gates", detail: "Schmear, storage, yeast as needed", kind: "decision" },
            { id: "pmo", label: "Priya Nandakumar", detail: "PPL-1400 still applies", kind: "person" },
            { id: "board", label: "CFBRB", detail: "Confirms gates, not taste", kind: "box" },
            { id: "obe", label: "Helen Voss / Local 7", detail: "Conditional release language", kind: "person" },
            { id: "steward", label: "Jordan Hale", detail: "Informed now, Responsible at the tray", kind: "terminal" },
          ]}
          edges={[
            { from: "req", to: "roster", label: "Tier check" },
            { from: "roster", to: "quote" },
            { from: "quote", to: "finance", label: "Flour check" },
            { from: "finance", to: "gates" },
            { from: "gates", to: "pmo", label: "If still a bagel" },
            { from: "pmo", to: "board" },
            { from: "board", to: "obe" },
            { from: "obe", to: "steward", label: "Informed" },
          ]}
        />
        <Table
          columns={["Slip line", "Policy cited", "What it records"]}
          rows={[
            ["Quantity one, this window only", "EBO-MEMO-2026-118; SAF-400 §2", "No anticipatory consumption, no Friday second bagel, no banking of an unspread half"],
            ["Requestor tier at service", "SAF-400 §2; People Operations roster", "Morning-of-service role. Acting titles do not confer acting schmear"],
            ["Schmear depth and 4 mm halo", "SAF-400 §2–3", "Issued spreader S-2 only. A second pass may correct a gap, not add depth. Filling in the halo is a reportable event"],
            ["Exception, if any", "SAF-400 §4, Form SAF-EX-1", "Two business days' notice. Hunger, habit, and it looks thin are not grounds. Committee every other Thursday"],
            ["Lox adjacency, if any", "SAF-400 Executive Overlay; SAF-400-B", "Prior business day. Capers excluded. Routes as capex, not as a condiment"],
            ["Toaster, if any", "BSC-220 §3; TIP-9", "Reserved 15-minute slot, closed 16:30 the prior day. After-hours needs two TPL-4 acknowledgments. I like it dark is returned"],
            ["Seed-loss cap", "BSC-220 §2", "Seven sesame seeds per bagel per shift, 24-inch vicinity. They just fall off is not a root cause"],
            ["Hold and temperature", "BSC-220 §1", "68.0 to 72.0 F. Room temperature is retired. No still-good checkbox"],
            ["Lifecycle gates remain open", "PPL-1400 Stages 1–14", "A bagel does not arrive. It is released. Boil no-change confirmation still required. Silence is not a control"],
            ["Yeast docket, if the lot is new", "PPL-1400 Stage 4", "Tuesday 09:00, cutoff 08:55"],
            ["Finance attestation", "PPL-1400 Stage 13", "Per-bagel ceiling on request with a reason and a cost-center. Complimentary extras refused"],
            ["Conditional release", "PPL-1400 Stage 14", "Tray card, lot number, Steward on duty. Still recallable if a CAPA opens"],
          ]}
        />
        <Text>
          The foot of the slip reads: questions go to the Bagel Bakers Union of the Greater Milwaukee Area, Local 7, not to your manager's manager; printed copies are uncontrolled after 24 hours; please do not reply all.
        </Text>
      </Section>

      <Section heading="User flow, edge cases, and errors" id="flow">
        <Text>
          The flow should feel like an intranet form. Each step can fail in a voice the Union already uses.
        </Text>
        <Steps
          steps={[
            {
              title: "Identify the colleague",
              detail: "The roster, not the meeting they are walking into, sets tier and toaster privilege for the morning of service. Unattested colleagues are treated as Tier 0.",
            },
            {
              title: "Choose a service date and window",
              detail: "Primary window 08:15 to 10:00. After 10:00 the form reclassifies the ask as Mid-Morning Hold. After 16:30 it becomes a Heritage Inventory question, untoasted, and usually a no.",
            },
            {
              title: "Select a bagel type",
              detail: "Compliance flags appear immediately. Frozen and unreleasable types stop the requisition and may still show a ghost line so the record shows a decision.",
            },
            {
              title: "Declare schmear, toast, and any Executive Overlay add-on",
              detail: "Controls that the roster does not permit are visible and disabled, with the governing sentence underneath, not hidden.",
            },
            {
              title: "Scale the approved formula",
              detail: "The published bill of materials is multiplied by the batch multiple. A zero or negative multiple is refused, and a fractional multiple is accepted.",
            },
            {
              title: "Choose ingredient types",
              detail: "Where a formula allows a published variant, the ingredient name is the selector. A change of type never changes a quantity. It changes only the price source for that line.",
            },
            {
              title: "Attest and submit",
              detail: "Quantity one, this window, no anticipatory consumption, halo respected, no capers in any accompanying image. Submit emits the routing slip. It does not release a lot.",
            },
          ]}
        />
        <Section heading="Error messages, in the Union voice">
          <Table
            columns={["Trigger", "Message"]}
            rows={[
              ["Everything selected", "This variety is frozen pending allium documentation. An exception cannot authorize a product that is not released."],
              ["DIY everything or reapply seeds", "Reapplication is reconstruction of a finished product and is out of scope for all privilege levels."],
              ["Tier 0 schmear", "Visual schmear only. Cream cheese may be observed in its tub. A dry bagel is still a bagel."],
              ["It looks thin, hunger, or habit as grounds", "Not accepted grounds under SAF-400. The form is for mission-critical, non-habitual need, in 150 words or fewer."],
              ["Filling in the halo", "The 4 mm halo of naked bagel is mandatory. Filling it in is a reportable event, not a preference."],
              ["Manager spots schmear onto a report's bagel", "That is a transfer of controlled commodity. It cannot be entered on this requisition."],
              ["Second bagel, especially on Friday", "Anticipatory consumption is not a recognized need. If Monday is a concern, Monday's forecast is the correct instrument."],
              ["Complimentary extra from the vendor", "An uncontrolled unit will be refused at receiving. Do not add it here."],
              ["Just order more cream cheese", "This option was considered in the tiger-team pre-read and is closed."],
              ["I like it dark, or after-hours toast", "Comments of that form are returned for a business justification. After-hours cycles require two TPL-4 acknowledgments and will chime."],
              ["Room temperature, or still good", "Room temperature was retired in BSC-220 Rev 3.0. There is no still-good checkbox. Without a calibrated reading, the bagel is merely located."],
              ["They just fall off", "That is a description, not a root cause. The seven-seed cap still applies."],
              ["Calling the catch-tray a bib", "Employees have asked us not to call it that."],
              ["Lot docketed after 08:55 Tuesday", "Yeast Governance will not review a late docket this week. The requisition can exist. The lot cannot move."],
              ["Just this once on cooling", "This stage has no expedite path. The request has been filed and then not approved."],
              ["Skip a gate to get bagels in the building", "That path is how the March incident occurred, and it is not a calculator function."],
              ["Capers on the requisition or in a photo", "Capers are out of scope and must not appear in the same photograph as an official bagel."],
              ["Eyeballing depth", "Authorized depth is measured with the official feeler gauge. Eyeballing is not a method."],
              ["Unattested user seeking Tier 1", "Acknowledgment of SAF-400 Rev 4.2 is outstanding. You will be served under Tier 0 until the form is filed."],
              ["Midweek BRI used as official", "Midweek improvement is encouraging but not official. The factor in (1) is the Tuesday close."],
            ]}
          />
        </Section>
      </Section>

      <Section heading="Related material">
        <LinkCards
          links={[
            {
              title: "Opening Notice: Bagelnomics Enters Service as the System of Record",
              site: "www.bagelnomics.com",
              date: "11 November 2026",
              href: "https://www.bagelnomics.com/2026/11/11/we-do-not-make-bagels-we-make-bagel-certainty/",
            },
          ]}
        />
      </Section>

      <BackToTop />
    </Page>
  );
}



/* ===== Part 2: panel.js ===== */
/* Bagel Calculator, requisition panel, price tape and price record.
   Plain JavaScript, no libraries, no cookies, no localStorage, no network calls.
   Prices, the minimum wage, the benefit load and the energy rates are read from the JSON block with id "bn-prices" that sits in the same page.
   Every selection lives in memory for this visit only. */
var PANEL = (function () {
  "use strict";
  var G_PER_LB = 453.59237;
  var FORMULAS = [{"id":"ka-classic","name":"King Arthur Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/bagels-recipe","group":"original","bagels":12,"yieldNote":"12 standard-size; 8 large also published","rows":[{"n":"Instant yeast","d":"1 tablespoon (9g)","g":9,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups (480g)","g":480,"c":"flour","s":"flour_bread"},{"n":"Table salt","d":"2 teaspoons (12g)","g":12,"c":"salt","s":"salt_table"},{"n":"Non-diastatic malt powder","d":"1 tablespoon (9g); brown sugar or barley malt syrup also published","g":9,"c":"malt","s":"malt_nondiastatic"},{"n":"Water, dough","d":"1 1/3 cups (303g)","g":303,"fx":"fix_water"},{"n":"Water, bath","d":"2 quarts (1814g)","g":1814,"fx":"fix_water"},{"n":"Non-diastatic malt powder, bath","d":"2 tablespoons (18g)","g":18,"c":"malt","s":"malt_nondiastatic","q":"bath"},{"n":"Granulated sugar, bath","d":"1 tablespoon (14g)","g":14,"c":"sweetener","s":"sweet_granulated","q":"bath"}]},{"id":"se-magic","name":"Serious Eats Magic Bagels (Stella Parks)","source":"Serious Eats","href":"https://www.seriouseats.com/homemade-bagels-recipe","group":"original","bagels":8,"rows":[{"n":"Water, yukone","d":"6 ounces / 3/4 cup (170g)","g":170,"fx":"fix_water"},{"n":"Bread flour, yukone","d":"3 1/2 ounces (100g)","g":100,"c":"flour","s":"flour_bread","q":"yukone"},{"n":"Bread flour, dough","d":"12 1/2 ounces (355g)","g":355,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Sugar","d":"1/2 ounce / 1 tablespoon (15g)","g":15,"c":"sweetener","s":"sweet_granulated"},{"n":"Diamond Crystal kosher salt","d":"2 1/2 teaspoons (9g)","g":9,"c":"salt","s":"salt_dckosher"},{"n":"Instant dry yeast","d":"1 teaspoon (4g)","g":4,"c":"yeast","s":"yeast_instant"},{"n":"Water, dough","d":"3 1/2 ounces (100g)","g":100,"fx":"fix_water"},{"n":"Barley malt syrup, bath","d":"1 ounce / 4 teaspoons (30g)","g":30,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"nyt-saffitz","name":"NYT Cooking guide (Claire Saffitz)","source":"NYT Cooking","href":"https://cooking.nytimes.com/article/bagels","group":"original","bagels":12,"yieldNote":"12 pieces at 125g; a baker's dozen of 4-ounce pieces is also published","convNote":"Malt syrup tablespoons converted at 21g; baking soda teaspoon at 4.6g. Bath syrup may be increased until the water looks like strong black tea; taken at the 1/4 cup published start.","rows":[{"n":"Lukewarm water","d":"2 1/4 cups / 530 milliliters","g":530,"fx":"fix_water"},{"n":"Barley malt syrup, dough","d":"2 tablespoons","g":42,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Active dry yeast","d":"1 (1/4-ounce) packet / about 2 1/4 teaspoons","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Bread flour","d":"6 1/2 cups / 885 grams","g":885,"c":"flour","s":"flour_bread"},{"n":"Kosher salt","d":"2 tablespoons / 17 grams Diamond Crystal, or 1 tablespoon / 17 grams Morton","g":17,"c":"salt","s":"salt_dckosher"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Barley malt syrup, bath","d":"1/4 cup / 60 milliliters, plus more as needed","g":85,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"smitten-reinhart","name":"Peter Reinhart via Smitten Kitchen","source":"Smitten Kitchen","href":"https://smittenkitchen.com/2007/09/bronx-worthy-bagels/","group":"original","bagels":12,"yieldNote":"12 standard (4 1/2 ounce pieces); 16 regularly large or 24 miniature also published","convNote":"The page publishes cups and teaspoons only. Grams use King Arthur standard weights: flour 120g/cup, water 237g/cup, instant yeast 3.1g/tsp, table salt 6g/tsp, malt powder 3g/tsp, baking soda 14g/tbsp.","rows":[{"n":"Instant yeast, sponge","d":"1 teaspoon","g":3.1,"c":"yeast","s":"yeast_instant","q":"sponge"},{"n":"Bread or high-gluten flour, sponge","d":"4 cups","g":480,"c":"flour","s":"flour_bread","q":"sponge"},{"n":"Water, sponge","d":"2 1/2 cups","g":591,"fx":"fix_water"},{"n":"Instant yeast, dough","d":"1/2 teaspoon","g":1.6,"c":"yeast","s":"yeast_instant","q":"dough"},{"n":"Bread or high-gluten flour, dough","d":"3 3/4 cups","g":450,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Salt","d":"2 3/4 teaspoons","g":16.5,"c":"salt","s":"salt_table"},{"n":"Malt powder","d":"2 teaspoons; 1 tablespoon malt syrup, honey, or brown sugar also published","g":6,"c":"malt","s":"malt_nondiastatic"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"sally-everything","name":"Sally's Everything Bagels","source":"Sally's Baking Addiction","href":"https://sallysbakingaddiction.com/homemade-everything-bagels/","group":"original","bagels":8,"convNote":"Yeast, salt, and toppings published by volume; grams use King Arthur/typical spice weights. Egg white counted as one egg.","rows":[{"n":"Warm water, dough","d":"1 1/2 cups (360ml)","g":360,"fx":"fix_water"},{"n":"Instant or active dry yeast","d":"2 3/4 teaspoons","g":8.5,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups (520g)","g":520,"c":"flour","s":"flour_bread"},{"n":"Packed brown sugar","d":"1 tablespoon; barley malt syrup also published","g":14,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Water, bath","d":"2 quarts","g":1893,"fx":"fix_water"},{"n":"Honey, bath","d":"1/4 cup (85g); barley malt syrup also published","g":85,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Poppy seeds","d":"2 tablespoons","g":18,"c":"topping","s":"top_poppy"},{"n":"Sesame seeds","d":"2 tablespoons","g":18,"c":"topping","s":"top_sesame"},{"n":"Dried minced onion","d":"1 tablespoon","g":5,"c":"topping","s":"top_onion"},{"n":"Dried garlic flakes","d":"1 tablespoon","g":8,"c":"topping","s":"top_garlic"},{"n":"Coarse or flaky sea salt","d":"1 tablespoon","g":18,"c":"salt","s":"salt_pretzel"},{"n":"Egg white, wash","d":"1 egg white beaten with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"ka-montreal","name":"King Arthur Montreal Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/montreal-bagels-recipe","group":"original","bagels":8,"convNote":"Maple syrup 2 teaspoons converted at 7g/tsp.","rows":[{"n":"Water, dough","d":"1 cup (227g)","g":227,"fx":"fix_water"},{"n":"Maple syrup","d":"2 teaspoons","g":14,"c":"sweetener","s":"sweet_maple"},{"n":"Instant or active dry yeast","d":"2 teaspoons","g":6.2,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"3 1/4 to 3 1/2 cups (390g to 420g); taken at 420g, including flour used as needed to knead","g":420,"c":"flour","s":"flour_bread"},{"n":"Table salt","d":"1 teaspoon (6g)","g":6,"c":"salt","s":"salt_table"},{"n":"Sesame or poppy seeds","d":"3/4 cup (106g)","g":106,"c":"topping","s":"top_sesame"},{"n":"Water, bath","d":"3 quarts (2722g)","g":2722,"fx":"fix_water"},{"n":"Honey, bath","d":"1/3 cup (113g); 1/4 cup (85g) barley malt syrup also published","g":113,"c":"sweetener","s":"sweet_honey","q":"bath"}]},{"id":"tpl-sourdough","name":"The Perfect Loaf Sourdough Bagels","source":"The Perfect Loaf (Maurizio Leo)","href":"https://www.theperfectloaf.com/sourdough-bagel/","group":"original","bagels":12,"yieldNote":"12 x 125g bagels","rows":[{"n":"High-protein flour, levain","d":"116g","g":116,"c":"flour","s":"flour_bread","q":"levain"},{"n":"Water, levain","d":"58g","g":58,"fx":"fix_water"},{"n":"Ripe sourdough starter","d":"23g","g":23,"fx":"fix_none"},{"n":"High-protein flour, dough","d":"848g","g":848,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Water, dough","d":"472g","g":472,"fx":"fix_water"},{"n":"Caster sugar","d":"29g","g":29,"c":"sweetener","s":"sweet_granulated"},{"n":"Barley malt syrup","d":"29g","g":29,"c":"malt","s":"malt_barleysyrup"},{"n":"Salt","d":"18g","g":18,"c":"salt","s":"salt_table"},{"n":"Diastatic malt","d":"7g","g":7,"c":"malt","s":"malt_diastatic"}]},{"id":"ka-sourdough","name":"King Arthur Sourdough Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/sourdough-bagels-recipe","group":"original","bagels":12,"rows":[{"n":"Bread flour","d":"7 cups (840g)","g":840,"c":"flour","s":"flour_bread"},{"n":"Water, dough","d":"1 3/4 cups plus 2 tablespoons (425g)","g":425,"fx":"fix_water"},{"n":"Ripe sourdough starter","d":"1 cup (227g)","g":227,"fx":"fix_none"},{"n":"Honey, dough","d":"3 tablespoons (63g)","g":63,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Table salt, dough","d":"1 tablespoon (18g)","g":18,"c":"salt","s":"salt_table","q":"dough"},{"n":"Water, bath","d":"about 2 quarts (2000g)","g":2000,"fx":"fix_water"},{"n":"Honey, bath","d":"1 tablespoon (21g)","g":21,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Table salt, bath","d":"1/2 teaspoon (3g)","g":3,"c":"salt","s":"salt_table","q":"bath"},{"n":"Everything, sesame, or poppy topping, optional","d":"2/3 cup (94g)","g":94,"o":1,"c":"topping","s":"top_everything","q":"optional"}]},{"id":"ba-szewczyk","name":"Bon Appetit (Szewczyk)","source":"Bon Appetit, Jesse Szewczyk","href":"https://www.bonappetit.com/recipe/homemade-bagels","group":"addition","bagels":12,"convNote":"Water 2 1/4 cups at 237g/cup. Salt grams use Diamond Crystal 3g/tsp for 1 Tbsp plus 1 1/2 tsp. Sugar divided 50g as published.","rows":[{"n":"Bread flour","d":"3 3/4 cups (469g)","g":469,"c":"flour","s":"flour_bread"},{"n":"All-purpose flour","d":"3 cups (375g)","g":375,"c":"flour","s":"flour_ap"},{"n":"Diamond Crystal kosher salt","d":"1 Tbsp. plus 1 1/2 tsp.; 2 3/4 tsp. Morton also published","g":10.5,"c":"salt","s":"salt_dckosher"},{"n":"Sugar, dough","d":"1 Tbsp. of the 4 Tbsp. (50g) divided","g":12.5,"c":"sweetener","s":"sweet_granulated","q":"dough"},{"n":"Instant yeast","d":"1 tsp.","g":3.1,"c":"yeast","s":"yeast_instant"},{"n":"Water, dough","d":"2 1/4 cups room-temperature, published in the method","g":532,"fx":"fix_water"},{"n":"Baking soda, bath","d":"1 Tbsp.","g":14,"fx":"fix_bakingsoda"},{"n":"Sugar, bath","d":"remaining 3 Tbsp. of the 4 Tbsp. (50g) divided","g":37.5,"c":"sweetener","s":"sweet_granulated","q":"bath"}]},{"id":"food52","name":"Food52 Homemade Bagels","source":"Food52","href":"https://food52.com/recipes/22934-homemade-bagels","group":"addition","bagels":8,"yieldNote":"Makes 6 to 8; 8, the smaller published piece count, is used","convNote":"Flour uses the published 1 pound weight, at 454g. Other volumes use King Arthur / roster standard weights: water 237g/cup so 1 cup plus 2 tablespoons is 267g, instant yeast 3.1g/tsp, coarse kosher salt 3g/tsp, honey 21g/tbsp, baking soda 4.6g/tsp. The 3 teaspoons of salt are divided 2 teaspoons in the dough and 1 teaspoon in the bath, as published in the method.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 7 February 2025 archive.org snapshot of this URL. The live page returned HTTP 403 and 429 (Vercel challenge) on retry. Seeds are published as \"Seeds!\" without a quantity and are omitted. Bath water is \"at least 4 inches deep\" with no volume and is omitted. The headnote allows barley malt syrup in place of honey; honey is the published formula and is used.","rows":[{"n":"Unbleached flour","d":"3 1/2 cups (1 pound / 454g)","g":454,"c":"flour","s":"flour_ap"},{"n":"Coarse kosher salt, dough","d":"2 teaspoons of the 3 teaspoons, divided","g":6,"c":"salt","s":"salt_mortonkosher","q":"dough"},{"n":"Instant yeast","d":"3/4 teaspoon","g":2.3,"c":"yeast","s":"yeast_instant"},{"n":"Honey","d":"1 tablespoon; barley malt syrup also published in the headnote","g":21,"c":"sweetener","s":"sweet_honey"},{"n":"Water, dough","d":"1 cup plus 2 tablespoons, room-temp or slightly warm","g":267,"fx":"fix_water"},{"n":"Coarse kosher salt, bath","d":"remaining 1 teaspoon of the 3 teaspoons, divided","g":3,"c":"salt","s":"salt_mortonkosher","q":"bath"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Egg white, optional wash","d":"1 egg white, optional","e":1,"o":1,"fx":"fix_egg"}]},{"id":"atk-ny","name":"ATK New York Bagels","source":"America's Test Kitchen (Andrew Janjigian)","href":"https://www.americastestkitchen.com/recipes/8358-new-york-bagels","group":"addition","bagels":8,"convNote":"Malt syrup 2 Tbsp and vital wheat gluten 4 tsp converted at 21g/tbsp and 3g/tsp. Baking soda 14g/tbsp.","rows":[{"n":"Ice water","d":"1 cup plus 2 tablespoons (9 ounces / 255 grams)","g":255,"fx":"fix_water"},{"n":"Malt syrup","d":"2 tablespoons","g":42,"c":"malt","s":"malt_barleysyrup"},{"n":"Bread flour","d":"2 2/3 cups (14 2/3 ounces / 416 grams)","g":416,"c":"flour","s":"flour_bread"},{"n":"Vital wheat gluten","d":"4 teaspoons","g":12,"fx":"fix_vwg"},{"n":"Instant or rapid-rise yeast","d":"2 teaspoons","g":6.2,"c":"yeast","s":"yeast_instant"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Cornmeal","d":"1/4 cup (1 1/4 ounces / 35 grams)","g":35,"fx":"fix_cornmeal"},{"n":"Sugar, bath","d":"1/4 cup (1 3/4 ounces / 50 grams)","g":50,"c":"sweetener","s":"sweet_granulated","q":"bath"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"bbc-kimber","name":"BBC Good Food (Edd Kimber)","source":"BBC Good Food","href":"https://www.bbcgoodfood.com/recipes/edds-bagels","group":"addition","bagels":10,"convNote":"Brown sugar 2 Tbsp at 14g. Salt 1 tsp at 6g.","notes":"Seeds of your choice are published without a quantity and are omitted.","rows":[{"n":"Fast-action dried yeast","d":"7g sachet","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Strong white flour","d":"500g","g":500,"c":"flour","s":"flour_bread"},{"n":"Light brown soft sugar","d":"2 tbsp","g":28,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Salt","d":"1 tsp, published in the method","g":6,"c":"salt","s":"salt_table"},{"n":"Lukewarm water","d":"300ml, published in the method","g":300,"fx":"fix_water"},{"n":"Bicarbonate of soda, bath","d":"1 tbsp","g":14,"fx":"fix_bakingsoda"},{"n":"Egg white, glaze","d":"1 egg white","e":1,"fx":"fix_egg"}]},{"id":"weissman","name":"Joshua Weissman New York Bagels","source":"Joshua Weissman","href":"https://www.joshuaweissman.com/recipes/the-best-homemade-new-york-bagels-recipe","group":"addition","bagels":8,"notes":"Food-grade lye is published as optional and is excluded. A large pinch of bath salt has no quantity and is omitted. Cream cheese, lox, and service garnishes are a serving suggestion, not the formula.","rows":[{"n":"Sesame seeds, everything mix","d":"3 Tbsp (27g)","g":27,"c":"topping","s":"top_sesame","q":"everything mix"},{"n":"Poppy seeds, everything mix","d":"2 Tbsp (20g)","g":20,"c":"topping","s":"top_poppy","q":"everything mix"},{"n":"Onion flakes","d":"1 Tbsp (9g)","g":9,"c":"topping","s":"top_onion"},{"n":"Minced dried garlic","d":"1/2 Tbsp (4g)","g":4,"c":"topping","s":"top_garlic"},{"n":"Flaky salt, everything mix","d":"1 Tbsp (12g)","g":12,"c":"salt","s":"salt_pretzel","q":"everything mix"},{"n":"Water, dough","d":"1.5 cups (360mL)","g":360,"fx":"fix_water"},{"n":"Instant yeast","d":"1 tsp (3g)","g":3,"c":"yeast","s":"yeast_instant"},{"n":"Barley malt syrup, dough","d":"2.5 tsp (18g)","g":18,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Bread flour","d":"4 cups (600g)","g":600,"c":"flour","s":"flour_bread"},{"n":"Fine sea salt, dough","d":"1 Tbsp (16g)","g":16,"c":"salt","s":"salt_finesea","q":"dough"},{"n":"Water, bath","d":"3 quarts (2.8L)","g":2800,"fx":"fix_water"},{"n":"Barley malt syrup, bath","d":"1.5 Tbsp (23ml)","g":31,"c":"malt","s":"malt_barleysyrup","q":"bath"}]},{"id":"lagerstrom","name":"Brian Lagerstrom New York Bagels","source":"Brian Lagerstrom","href":"https://brianlagerstrom.com/recipes/new-york-bagels/","group":"addition","bagels":12,"rows":[{"n":"Warm water, dough","d":"530g","g":530,"fx":"fix_water"},{"n":"Instant yeast","d":"3g","g":3,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"940g","g":940,"c":"flour","s":"flour_bread"},{"n":"Diastatic malt powder","d":"10g; 10 grams sugar also published as a substitute","g":10,"c":"malt","s":"malt_diastatic"},{"n":"Kosher salt","d":"20g","g":20,"c":"salt","s":"salt_dckosher"},{"n":"Water, bath","d":"3-4 L; taken at 3.5 L, the midpoint of the published range","g":3500,"fx":"fix_water"},{"n":"Molasses, bath","d":"50g","g":50,"c":"sweetener","s":"sweet_molasses","q":"bath"}]},{"id":"alexandra","name":"Alexandra's Kitchen Foolproof Chewy Bagels","source":"Alexandra's Kitchen","href":"https://alexandracooks.com/2018/08/16/very-good-bagels-easy-ish-too/","group":"addition","bagels":12,"yieldNote":"12 smaller bagels at about 105g, or 10 at 125g; 12 is used","convNote":"Heaping teaspoon of malt syrup converted at 8g; bath 'about 1/4 cup' at 85g.","rows":[{"n":"Bread, high-gluten, or all-purpose flour","d":"6 cups (768g)","g":768,"c":"flour","s":"flour_bread"},{"n":"Diamond Crystal kosher salt","d":"3 teaspoons (20g)","g":20,"c":"salt","s":"salt_dckosher"},{"n":"Instant yeast","d":"1.5 tsp (6g)","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Water","d":"2 cups (454g)","g":454,"fx":"fix_water"},{"n":"Barley malt syrup, dough","d":"1 heaping teaspoon","g":8,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Barley malt syrup, bath","d":"about 1/4 cup","g":85,"c":"malt","s":"malt_barleysyrup","q":"bath"},{"n":"Egg, wash","d":"1 egg whisked with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"bbb","name":"Bigger Bolder Baking New York-Style Bagels","source":"Bigger Bolder Baking (Gemma Stafford)","href":"https://www.biggerbolderbaking.com/easy-new-york-style-bagel-recipe/","group":"addition","bagels":8,"notes":"Optional toppings are named without quantities and are omitted.","rows":[{"n":"Bread flour","d":"3 1/2 cups (18oz/500g)","g":500,"c":"flour","s":"flour_bread"},{"n":"Instant dry yeast","d":"2 teaspoons (6g)","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 1/2 tablespoons (18.75g)","g":18.75,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"1 1/2 teaspoons (9g)","g":9,"c":"salt","s":"salt_table"},{"n":"Warm water","d":"1 1/3 cups (300ml)","g":300,"fx":"fix_water"},{"n":"Extra bread flour for kneading in","d":"3/4 cup (3 3/4oz/105g)","g":105,"c":"flour","s":"flour_bread"}]},{"id":"alton","name":"Alton Brown Bagels from Scratch","source":"Food Network / Good Eats","href":"https://www.foodnetwork.com/recipes/alton-brown/bagels-from-scratch-9873518","group":"addition","bagels":12,"rows":[{"n":"Bread flour","d":"855 grams (6 1/4 cups)","g":855,"c":"flour","s":"flour_bread"},{"n":"Filtered water, dough","d":"520 grams (2 1/4 cups)","g":520,"fx":"fix_water"},{"n":"Malt syrup, total","d":"100 grams (1/4 cup plus 1 tablespoon), of which 20g goes in the dough and 80g in the bath","g":100,"c":"malt","s":"malt_barleysyrup","q":"total"},{"n":"Fine salt, total","d":"75 grams (1/4 cup plus 1 teaspoon), of which 25g goes in the dough and 50g in the bath","g":75,"c":"salt","s":"salt_table","q":"total"},{"n":"Active dry yeast","d":"4 grams (3/4 teaspoon)","g":4,"c":"yeast","s":"yeast_activedry"}]},{"id":"black-seed","name":"Black Seed via Epicurious","source":"Epicurious / Black Seed (Dianna Daoheung)","href":"https://www.epicurious.com/recipes/food/views/plain-bagels-51237040","group":"addition","bagels":12,"convNote":"Flour 120g/cup, water 237g/cup, honey 21g/tbsp and 84g per 1/4 cup, oil 14g/tbsp, malt powder 9g/tbsp, kosher salt 3g/tsp.","rows":[{"n":"Active dry yeast","d":"1 envelope (1/4 ounce)","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Honey, total","d":"1 1/2 tablespoons plus 1/4 cup, divided","g":115,"c":"sweetener","s":"sweet_honey","q":"total"},{"n":"Non-diastatic malt powder","d":"1 tablespoon","g":9,"c":"malt","s":"malt_nondiastatic"},{"n":"Neutral oil","d":"3 tablespoons","g":42,"c":"oil","s":"oil_vegetable"},{"n":"High-gluten or bread flour","d":"9 cups","g":1080,"c":"flour","s":"flour_highgluten"},{"n":"Kosher salt","d":"2 teaspoons","g":6,"c":"salt","s":"salt_dckosher"},{"n":"Water, dough","d":"2 2/3 cups, published in the method (also in the Eater reprint of the same formula)","g":631,"fx":"fix_water"},{"n":"Water, bath","d":"4 quarts","g":3785,"fx":"fix_water"}]},{"id":"kitchn","name":"The Kitchn Homemade Bagels","source":"The Kitchn","href":"https://www.thekitchn.com/bagel-recipe-23035192","group":"addition","bagels":12,"convNote":"King Arthur weights: flour 120g/cup, water 237g/cup, brown sugar 14g/tbsp, kosher salt 3g/tsp, yeast 3.1g/tsp, baking soda 4.6g/tsp, seeds 144g/cup.","rows":[{"n":"Bread flour","d":"4 cups, plus more for kneading","g":480,"c":"flour","s":"flour_bread"},{"n":"Packed light brown sugar, dough","d":"1 tablespoon","g":14,"c":"sweetener","s":"sweet_lightbrown","q":"dough"},{"n":"Kosher salt, dough","d":"1 1/2 teaspoons","g":4.5,"c":"salt","s":"salt_dckosher","q":"dough"},{"n":"Active dry yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water, dough","d":"1 1/2 cups","g":355,"fx":"fix_water"},{"n":"Water, bath","d":"8 cups (2 quarts)","g":1893,"fx":"fix_water"},{"n":"Packed light brown sugar, bath","d":"3 tablespoons","g":42,"c":"sweetener","s":"sweet_lightbrown","q":"bath"},{"n":"Baking soda, bath","d":"1 teaspoon","g":4.6,"fx":"fix_bakingsoda"},{"n":"Kosher salt, bath","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher","q":"bath"},{"n":"Topping, optional","d":"1/2 cup everything, poppy, or sesame","g":72,"o":1,"fx":"fix_none"}]},{"id":"wapo","name":"Washington Post Best-of Bagels","source":"The Washington Post","href":"https://www.washingtonpost.com/recipes/best-bagels/","group":"addition","bagels":9,"yieldNote":"8 to 9 equal portions of about 4 ounces / 115 grams; 9 is used, matching the published nutrition basis and JSON-LD yield","convNote":"Flour 623g and water 337g are the published weights. Malt syrup 1 tablespoon plus 1 teaspoon converted at 21g/tbsp, fine salt at 6g/tsp, instant yeast at 3.1g/tsp, cornmeal at 9g/tbsp, and optional 1/2 cup toppings at 144g/cup.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 17 June 2024 archive.org snapshot of this URL. A live WebFetch returned the same title and headnote but was truncated before the ingredient list; direct curl to the live host timed out. Bath water is \"3 inches\" with no volume and is omitted. Optional toppings are published as 1/2 cup of a favorite, or an everything mix of 2 tablespoons each sesame and poppy and 1 tablespoon each caraway, salt, onion, and garlic; counted as 1/2 cup sesame.","rows":[{"n":"Bread flour","d":"623 grams (22 ounces; scant 5 cups); high-gluten flour also published","g":623,"c":"flour","s":"flour_bread"},{"n":"Barley malt syrup","d":"1 tablespoon plus 1 teaspoon","g":28,"c":"malt","s":"malt_barleysyrup"},{"n":"Fine salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Instant or rapid-rise active dry yeast","d":"1 1/2 teaspoons, preferably SAF brand","g":4.65,"c":"yeast","s":"yeast_instant"},{"n":"Warm water, dough","d":"337 grams (scant 1 1/2 cups), 80 degrees","g":337,"fx":"fix_water"},{"n":"Cornmeal, for dusting","d":"3 tablespoons","g":27,"fx":"fix_cornmeal"},{"n":"Optional toppings","d":"1/2 cup sesame, poppy, or everything; an everything mix of 2 tablespoons each sesame and poppy and 1 tablespoon each caraway, salt, onion, and garlic is also published","g":72,"o":1,"fx":"fix_none"}]},{"id":"love-lemons","name":"Love and Lemons Homemade Bagels","source":"Love and Lemons","href":"https://www.loveandlemons.com/bagel-recipe/","group":"addition","bagels":8,"convNote":"Water 237g/cup, maple 20g/tbsp, table/sea salt 6g/tsp, baking soda 4.6g/tsp. Everything seasoning is 'for sprinkling' without a quantity and is omitted.","rows":[{"n":"Maple or barley malt syrup, dough","d":"1 tablespoon","g":20,"c":"malt","s":"malt_barleysyrup","q":"dough"},{"n":"Active dry yeast","d":"1 (1/4-ounce) package / 2 1/4 teaspoons","g":7,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water, dough","d":"1 1/4 cups","g":296,"fx":"fix_water"},{"n":"Bread flour","d":"540 grams; 4 1/3 cups also published","g":540,"c":"flour","s":"flour_bread"},{"n":"Sea salt, dough","d":"2 teaspoons","g":12,"c":"salt","s":"salt_finesea","q":"dough"},{"n":"Maple syrup, bath","d":"1 1/2 tablespoons","g":30,"c":"sweetener","s":"sweet_maple","q":"bath"},{"n":"Baking soda, bath","d":"2 teaspoons","g":9.2,"fx":"fix_bakingsoda"},{"n":"Salt, bath","d":"1/2 tablespoon","g":9,"c":"salt","s":"salt_table","q":"bath"},{"n":"Egg white, optional wash","d":"1 egg white with 1 tablespoon water","e":1,"o":1,"fx":"fix_egg"}]},{"id":"bbc-allen","name":"BBC Food (Rachel Allen)","source":"BBC Food","href":"https://www.bbc.co.uk/food/recipes/bagels_47163","group":"addition","bagels":7,"convNote":"Honey 21g/tbsp, oil 14g/tbsp, molasses/treacle 20g/tbsp, salt 6g/tsp.","notes":"Fine polenta for sprinkling and optional toppings have no quantities and are omitted.","rows":[{"n":"Strong white flour","d":"450g / 1lb, plus extra for dusting","g":450,"c":"flour","s":"flour_bread"},{"n":"Salt","d":"2 tsp","g":12,"c":"salt","s":"salt_table"},{"n":"Fast-acting yeast","d":"7g sachet","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Clear honey","d":"2 tbsp","g":42,"c":"sweetener","s":"sweet_honey"},{"n":"Vegetable oil","d":"1 tbsp","g":14,"c":"oil","s":"oil_vegetable"},{"n":"Black treacle or molasses","d":"3 tbsp","g":60,"c":"sweetener","s":"sweet_molasses"},{"n":"Egg, beaten","d":"1 free-range egg","e":1,"fx":"fix_egg"}]},{"id":"nyt-montreal","name":"NYT Montreal (Marcy Goldman)","source":"NYT Cooking, Marcy Goldman-Posluns","href":"https://cooking.nytimes.com/recipes/6795-montreal-bagels","group":"addition","bagels":18,"convNote":"King Arthur weights: water 237g/cup, flour 120g/cup, oil 198g/cup, honey 337g/cup so 1/2 cup=168g and 1/3 cup=113g, yeast packets 7g each, sugar 4g/tsp, salt 6g/tsp.","notes":"Sesame or poppy seeds for sprinkling have no quantity and are omitted. 'Or more' flour is taken at the 5 cups stated.","rows":[{"n":"Water, dough","d":"1 1/2 cups, room temperature","g":355,"fx":"fix_water"},{"n":"Dry quick-rising yeast","d":"2 packages; or 1 1/2 ounces fresh yeast","g":14,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 teaspoon","g":4,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"2 1/2 teaspoons","g":15,"c":"salt","s":"salt_table"},{"n":"Whole egg","d":"1 whole egg","e":1,"fx":"fix_egg"},{"n":"Egg yolk","d":"1 egg yolk; counted as a second egg","e":1,"fx":"fix_egg"},{"n":"Oil","d":"1/4 cup","g":50,"c":"oil","s":"oil_vegetable"},{"n":"Honey, dough","d":"1/2 cup","g":168,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Bread flour","d":"5 cups or more; taken at 5 cups","g":600,"c":"flour","s":"flour_bread"},{"n":"Water, bath","d":"3 quarts","g":2839,"fx":"fix_water"},{"n":"Honey or malt syrup, bath","d":"1/3 cup","g":113,"c":"malt","s":"sweet_honey","q":"bath"}]},{"id":"fnc-montreal","name":"Food Network Canada Montreal","source":"Food Network Canada","href":"https://www.foodnetwork.ca/recipe/how-to-make-montreal-style-bagels/","group":"addition","bagels":12,"convNote":"King Arthur / roster standard weights: water 237g/cup, flour 120g/cup, oil 198g/cup so 1/4 cup is 50g, honey 337g/cup so 1/2 cup is 168g, granulated sugar 12.5g/tbsp, table salt 6g/tsp, seeds 144g/cup. Yeast uses the published 16g from two 8g packages. Bath water of 8-10 cups is taken at 9 cups, the midpoint.","notes":"Quantities were confirmed from the recipe JSON-LD and ingredient list on the 8 August 2024 archive.org snapshot of this URL. The live page returned HTTP 500 on retry. Flour \"or more if dough becomes too sticky\" is taken at the 4 1/2 cups stated. A 1 tablespoon yeast measure is also published; the two 8g packages are used. Poppy or sesame seeds are published at about 1/2 cup each; taken at 1/2 cup sesame, one topping.","rows":[{"n":"Warm water, dough","d":"1 cup","g":237,"fx":"fix_water"},{"n":"Quick-rising yeast","d":"2 x 8 g packages, or 1 tablespoon; taken at 16g, the two published packages","g":16,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 tablespoon","g":12.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Egg","d":"1 egg","e":1,"fx":"fix_egg"},{"n":"Vegetable oil","d":"1/4 cup","g":50,"c":"oil","s":"oil_vegetable"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Honey, dough","d":"1/2 cup of the 1 cup, divided","g":168,"c":"sweetener","s":"sweet_honey","q":"dough"},{"n":"Flour","d":"4 1/2 cups, or more if dough becomes too sticky; taken at 4 1/2 cups","g":540,"c":"flour","s":"flour_ap"},{"n":"Water, bath","d":"8-10 cups; taken at 9 cups, the midpoint of the published range","g":2133,"fx":"fix_water"},{"n":"Honey, bath","d":"remaining 1/2 cup of the 1 cup, divided","g":168,"c":"sweetener","s":"sweet_honey","q":"bath"},{"n":"Sesame or poppy topping","d":"about 1/2 cup each published; taken at 1/2 cup sesame","g":72,"c":"topping","s":"top_sesame"}]},{"id":"amy-bakes","name":"Amy Bakes Bread sourdough","source":"Amy Bakes Bread","href":"https://amybakesbread.com/easy-homemade-sourdough-bagels/","group":"addition","bagels":12,"notes":"The 200g ripe levain in the dough is the levain already listed, not a second flour charge. Cornmeal and toppings have no quantities and are omitted.","rows":[{"n":"Ripe sourdough starter, levain","d":"24g","g":24,"fx":"fix_none"},{"n":"Granulated sugar, levain","d":"20g","g":20,"c":"sweetener","s":"sweet_granulated","q":"levain"},{"n":"Water, levain","d":"60g","g":60,"fx":"fix_water"},{"n":"All-purpose or bread flour, levain","d":"120g","g":120,"c":"flour","s":"flour_ap","q":"levain"},{"n":"Water, dough","d":"475g","g":475,"fx":"fix_water"},{"n":"Pure maple syrup","d":"30g","g":30,"c":"sweetener","s":"sweet_maple"},{"n":"Bread flour, dough","d":"820g","g":820,"c":"flour","s":"flour_bread","q":"dough"},{"n":"Vital wheat gluten","d":"30g","g":30,"fx":"fix_vwg"},{"n":"Diastatic malt powder","d":"7g","g":7,"c":"malt","s":"malt_diastatic"},{"n":"Salt","d":"18g","g":18,"c":"salt","s":"salt_table"}]},{"id":"ka-cinnamon","name":"King Arthur Cinnamon Raisin Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/cinnamon-raisin-bagels-recipe","group":"addition","bagels":8,"notes":"Soaker water is drained and is not counted. Semolina for sprinkling has no quantity and is omitted.","rows":[{"n":"Water, raisin soaker","d":"1/2 cup (113g), hot; used to soak, then drained, and not counted as dough water retained","g":0,"fx":"fix_water"},{"n":"Raisins","d":"2/3 cup (107g)","g":107,"fx":"fix_none"},{"n":"Vietnamese cinnamon","d":"1 generous tablespoon (7g)","g":7,"fx":"fix_none"},{"n":"Water, cinnamon swirl","d":"1 tablespoon (14g)","g":14,"fx":"fix_water"},{"n":"Water, dough","d":"1 1/4 cups plus 1 tablespoon (295g)","g":295,"fx":"fix_water"},{"n":"High-gluten flour","d":"4 1/4 cups (510g)","g":510,"c":"flour","s":"flour_highgluten"},{"n":"Table salt","d":"2 teaspoons (12g)","g":12,"c":"salt","s":"salt_table"},{"n":"Barley malt syrup","d":"1 tablespoon (21g); 1 tablespoon (13g) dark brown sugar also published","g":21,"c":"malt","s":"malt_barleysyrup"},{"n":"Instant yeast","d":"1 1/2 teaspoons (5g)","g":5,"c":"yeast","s":"yeast_instant"},{"n":"Water, bath","d":"about 2 quarts (2000g)","g":2000,"fx":"fix_water"}]},{"id":"ka-ww","name":"King Arthur Whole Wheat Bagels","source":"King Arthur Baking","href":"https://www.kingarthurbaking.com/recipes/whole-wheat-bagels-recipe","group":"addition","bagels":14,"convNote":"Optional diastatic malt 1 teaspoon at 2.8g. A bread-machine half batch of 7 is also published; official yield is 14.","rows":[{"n":"Water, warm","d":"2 cups (454g)","g":454,"fx":"fix_water"},{"n":"Active dry or instant yeast","d":"1 tablespoon (11g)","g":11,"c":"yeast","s":"yeast_activedry"},{"n":"Light brown sugar","d":"1 tablespoon (14g)","g":14,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Granulated sugar","d":"1 tablespoon (11g)","g":11,"c":"sweetener","s":"sweet_granulated"},{"n":"Diastatic malt powder, optional","d":"1 teaspoon","g":2.8,"o":1,"c":"malt","s":"malt_diastatic","q":"optional"},{"n":"Bread flour","d":"3 cups (360g)","g":360,"c":"flour","s":"flour_bread"},{"n":"Golden wheat flour","d":"3 cups (340g)","g":340,"c":"flour","s":"flour_whitewheat"},{"n":"Table salt","d":"1 tablespoon (18g)","g":18,"c":"salt","s":"salt_table"}]},{"id":"gvd-pumpernickel","name":"Girl Versus Dough Pumpernickel","source":"Girl Versus Dough","href":"https://www.girlversusdough.com/pumpernickel-bagels/","group":"addition","bagels":12,"convNote":"King Arthur weights: WW 113g/cup, dark rye 106g/cup, bread 120g/cup, cocoa 85g/cup so 1/3 cup=28g, water 237g/cup, molasses 340g/cup, oil 14g/tbsp, yeast 3.1g/tsp, salt 6g/tsp, caraway and espresso 6g/tbsp.","rows":[{"n":"Whole wheat flour","d":"1 cup","g":113,"c":"flour","s":"flour_wholewheat"},{"n":"Active dry yeast","d":"4 teaspoons","g":12.4,"c":"yeast","s":"yeast_activedry"},{"n":"Warm water","d":"1 1/4 cups","g":296,"fx":"fix_water"},{"n":"Dark rye flour","d":"1 cup","g":106,"fx":"fix_none"},{"n":"Unsweetened cocoa powder","d":"1/3 cup","g":28,"fx":"fix_none"},{"n":"Caraway seeds","d":"1 tablespoon","g":6,"fx":"fix_none"},{"n":"Instant espresso granules","d":"1 tablespoon","g":6,"fx":"fix_none"},{"n":"Salt","d":"1 1/2 teaspoons","g":9,"c":"salt","s":"salt_table"},{"n":"Molasses","d":"1/2 cup","g":170,"c":"sweetener","s":"sweet_molasses"},{"n":"Vegetable oil","d":"1 tablespoon","g":14,"c":"oil","s":"oil_vegetable"},{"n":"Bread flour","d":"1 1/4 cups, plus more as needed; taken at 1 1/4 cups","g":150,"c":"flour","s":"flour_bread"}]},{"id":"atk-gf","name":"ATK Gluten-Free Bagels","source":"America's Test Kitchen","href":"https://www.americastestkitchen.com/recipes/9007-gluten-free-bagels","group":"addition","bagels":6,"convNote":"Yeast 3.1g/tsp, sugar 12.5g/tbsp, butter 14g/tbsp, molasses 7g/tsp, psyllium ~6.7g/tbsp, baking powder 4.5g/tsp, salt 6g/tsp, xanthan 3g/tsp, baking soda 14g/tbsp.","rows":[{"n":"Warm water, dough","d":"13.3 ounces (377 grams / 1 2/3 cups)","g":377,"fx":"fix_water"},{"n":"Instant or rapid-rise yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"1 tablespoon","g":12.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Unsalted butter, melted","d":"3 tablespoons","g":42,"c":"butter","s":"butter_unsalted","q":"melted"},{"n":"Molasses","d":"1 teaspoon","g":7,"c":"sweetener","s":"sweet_molasses"},{"n":"ATK all-purpose gluten-free flour blend","d":"13 1/2 ounces (383 grams / 3 cups)","g":383,"fx":"fix_none"},{"n":"Gluten-free oat flour","d":"2 ounces (57 grams / 2/3 cup)","g":57,"fx":"fix_none"},{"n":"Powdered psyllium husk","d":"1 1/2 tablespoons","g":10,"fx":"fix_none"},{"n":"Baking powder","d":"2 teaspoons","g":9,"fx":"fix_none"},{"n":"Salt","d":"1 1/2 teaspoons","g":9,"c":"salt","s":"salt_table"},{"n":"Xanthan gum","d":"1/2 teaspoon","g":1.5,"fx":"fix_none"},{"n":"Baking soda, bath","d":"1 tablespoon","g":14,"fx":"fix_bakingsoda"}]},{"id":"skinny","name":"Skinnytaste Yogurt Bagels","source":"Skinnytaste","href":"https://www.skinnytaste.com/easy-bagel-recipe/","group":"addition","bagels":4,"convNote":"Flour uses the published 5 oz weight. Yogurt 1 cup at 227g. Baking powder 4.5g/tsp, kosher salt 3g/tsp.","notes":"Optional toppings are named without quantities and are omitted. This is a no-boil yogurt dough.","rows":[{"n":"Unbleached all-purpose, whole wheat, or gluten-free mix","d":"1 cup (5 oz in weight)","g":142,"fx":"fix_none"},{"n":"Baking powder","d":"2 teaspoons","g":9,"fx":"fix_none"},{"n":"Kosher salt","d":"3/4 teaspoon","g":2.3,"c":"salt","s":"salt_dckosher"},{"n":"Non-fat Greek yogurt","d":"1 cup","g":227,"fx":"fix_none"},{"n":"Egg white or whole egg, beaten","d":"1 egg white or whole egg","e":1,"fx":"fix_egg"}]},{"id":"hbh-pretzel","name":"Half Baked Harvest Pretzel Bagels","source":"Half Baked Harvest","href":"https://www.halfbakedharvest.com/pretzel-bagels/","group":"addition","bagels":10,"convNote":"Flour 120g/cup, water 237g/cup, molasses 20g/tbsp, butter 14g/tbsp, baking soda 20g/tbsp so 1/4 cup=68g, kosher salt 3g/tsp.","notes":"Pretzel or flaky salt for topping has no quantity and is omitted.","rows":[{"n":"Warm water","d":"2 cups","g":473,"fx":"fix_water"},{"n":"Instant yeast","d":"1 packet (2 1/4 teaspoons)","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Molasses or honey","d":"1 tablespoon","g":20,"c":"sweetener","s":"sweet_molasses"},{"n":"All-purpose flour","d":"5 1/2 cups","g":660,"c":"flour","s":"flour_ap"},{"n":"Kosher salt, dough","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher","q":"dough"},{"n":"Salted butter, room temperature","d":"6 tablespoons","g":85,"c":"butter","s":"butter_salted","q":"room temperature"},{"n":"Baking soda, bath","d":"1/4 cup","g":68,"fx":"fix_bakingsoda"},{"n":"Egg, beaten","d":"1 egg","e":1,"fx":"fix_egg"}]},{"id":"okonomi","name":"Okonomi Kitchen Japanese Bagels","source":"Okonomi Kitchen","href":"https://www.okonomikitchen.com/japanese-style-bagel-recipe/","group":"addition","bagels":6,"convNote":"Malt powder 1 tsp at 3g.","notes":"The boil lists malt syrup, honey, or brown sugar without a quantity; that bath line is omitted.","rows":[{"n":"Water, dough","d":"260–268g; taken at 260g, the first published figure","g":260,"fx":"fix_water"},{"n":"Oil, optional","d":"13g","g":13,"o":1,"c":"oil","s":"oil_vegetable","q":"optional"},{"n":"Bread flour","d":"432g","g":432,"c":"flour","s":"flour_bread"},{"n":"Active dry yeast","d":"2g; a Hoshino yeast version is also published on the same page","g":2,"c":"yeast","s":"yeast_activedry"},{"n":"Malt powder","d":"1 tsp","g":3,"c":"malt","s":"malt_nondiastatic"},{"n":"Salt","d":"10g","g":10,"c":"salt","s":"salt_table"},{"n":"Brown sugar","d":"22g","g":22,"c":"sweetener","s":"sweet_lightbrown"}]},{"id":"med-jerusalem","name":"Mediterranean Dish Jerusalem Bagels","source":"The Mediterranean Dish","href":"https://www.themediterraneandish.com/jerusalem-bagel-recipe/","group":"addition","bagels":6,"convNote":"Flour 120g/cup, sugar 12.5g/tbsp, salt 6g/tsp, milk 237g/cup, yeast 3.1g/tsp, baking powder 4.5g/tsp, sesame 144g/cup, honey 21g/tbsp.","notes":"Olive oil is named without a quantity and is omitted.","rows":[{"n":"All-purpose or white bread flour","d":"4 1/2 cup","g":540,"c":"flour","s":"flour_ap"},{"n":"Sugar","d":"2 tablespoon","g":25,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"2 teaspoon","g":12,"c":"salt","s":"salt_table"},{"n":"Whole milk, warm","d":"1 1/2 cups; unsweetened almond milk also published","g":354,"fx":"fix_milk"},{"n":"Active dry yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_activedry"},{"n":"Baking powder","d":"1 teaspoon","g":4.5,"fx":"fix_none"},{"n":"Sesame seeds","d":"1 cup","g":144,"c":"topping","s":"top_sesame"},{"n":"Honey, for sesame","d":"1 to 2 tablespoons; taken at 1 tablespoon, the low end of the published range","g":21,"c":"sweetener","s":"sweet_honey","q":"for sesame"}]},{"id":"practical-egg","name":"Practical Kitchen Egg Bagels","source":"The Practical Kitchen","href":"https://thepracticalkitchen.com/homemade-egg-bagels/","group":"addition","bagels":8,"convNote":"Poppy 1/8 cup at 144g/cup.","rows":[{"n":"All-purpose flour","d":"500 grams","g":500,"c":"flour","s":"flour_ap"},{"n":"Brown sugar","d":"19 grams","g":19,"c":"sweetener","s":"sweet_lightbrown"},{"n":"Diamond Crystal kosher salt","d":"11 grams","g":11,"c":"salt","s":"salt_dckosher"},{"n":"Instant yeast","d":"6 grams","g":6,"c":"yeast","s":"yeast_instant"},{"n":"Warm water","d":"100 grams","g":100,"fx":"fix_water"},{"n":"Large eggs","d":"3 large eggs","e":3,"fx":"fix_egg"},{"n":"Large egg yolks","d":"3 large egg yolks; counted as 3 additional eggs","e":3,"fx":"fix_egg"},{"n":"Poppy seeds, optional topping","d":"1/8 cup","g":18,"o":1,"c":"topping","s":"top_poppy","q":"optional topping"}]},{"id":"iambaker-blueberry","name":"I Am Baker Blueberry Bagels","source":"I Am Baker","href":"https://iambaker.net/blueberry-bagel/","group":"addition","bagels":12,"convNote":"Flour 120g/cup, sugar 12.5g/tbsp, yeast 3.1g/tsp, kosher salt 3g/tsp, oil 14g/tbsp, fresh blueberries 140g/cup, dried blueberries 160g/cup, cornmeal 9g/tbsp.","rows":[{"n":"Warm water","d":"1 1/4 cups (296g)","g":296,"fx":"fix_water"},{"n":"Instant yeast","d":"1 tablespoon","g":9.3,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"5 cups","g":600,"c":"flour","s":"flour_bread"},{"n":"Granulated sugar","d":"3 tablespoons","g":37.5,"c":"sweetener","s":"sweet_granulated"},{"n":"Kosher salt","d":"1 teaspoon","g":3,"c":"salt","s":"salt_dckosher"},{"n":"Vegetable oil","d":"2 tablespoons","g":28,"c":"oil","s":"oil_vegetable"},{"n":"Fresh blueberries","d":"1 cup","g":140,"fx":"fix_none"},{"n":"Dried blueberries","d":"1 cup","g":160,"fx":"fix_none"},{"n":"Water, bath","d":"4 quarts","g":3785,"fx":"fix_water"},{"n":"Yellow cornmeal","d":"2 tablespoons","g":18,"fx":"fix_cornmeal"},{"n":"Egg white, wash","d":"1 egg white with 1 tablespoon water","e":1,"fx":"fix_egg"}]},{"id":"vegan-idtlc","name":"It Doesn't Taste Like Chicken Vegan","source":"It Doesn't Taste Like Chicken (Sam Turnbull)","href":"https://itdoesnttastelikechicken.com/the-best-vegan-bagels/","group":"addition","bagels":10,"convNote":"King Arthur weights: flour 120g/cup, water 237g/cup, brown sugar 14g/tbsp and 213g/cup so 1/4 cup=53g, yeast 3.1g/tsp, salt 6g/tsp, seeds 9g/tbsp.","notes":"Aquafaba (2-3 tablespoons) is the liquid from a can of chickpeas and is not counted. A yield of 8 extra-large is also published; 10 is used.","rows":[{"n":"Warm water, dough","d":"1 1/2 cups","g":355,"fx":"fix_water"},{"n":"Brown sugar, dough","d":"1 tablespoon; barley malt syrup also published","g":14,"c":"sweetener","s":"sweet_lightbrown","q":"dough"},{"n":"Instant yeast","d":"2 3/4 teaspoons","g":8.5,"c":"yeast","s":"yeast_instant"},{"n":"Bread flour","d":"4 cups","g":480,"c":"flour","s":"flour_bread"},{"n":"Salt","d":"2 teaspoons","g":12,"c":"salt","s":"salt_table"},{"n":"Water, bath","d":"8 cups (2 liters)","g":2000,"fx":"fix_water"},{"n":"Brown sugar, bath","d":"1/4 cup; barley malt syrup also published","g":53,"c":"sweetener","s":"sweet_lightbrown","q":"bath"},{"n":"Sesame, poppy, or everything topping","d":"2-3 tablespoons; taken at 2 tablespoons","g":18,"c":"topping","s":"top_sesame"}]},{"id":"se-jogold","name":"Serious Eats Jo Goldenberg","source":"Serious Eats","href":"https://www.seriouseats.com/how-to-make-homemade-bagels-a-la-jo-goldenberg-recipe","group":"addition","bagels":10,"convNote":"Sugar 12.5g/tbsp, salt 18g/tbsp, malt syrup 21g/tbsp.","rows":[{"n":"Bread flour","d":"19.25 ounces / 3 1/2 cups (530g)","g":530,"c":"flour","s":"flour_bread"},{"n":"Instant dry yeast","d":"1/4 ounce / 2 1/2 teaspoons (7g)","g":7,"c":"yeast","s":"yeast_instant"},{"n":"Sugar","d":"2 tablespoons","g":25,"c":"sweetener","s":"sweet_granulated"},{"n":"Salt","d":"1 tablespoon","g":18,"c":"salt","s":"salt_table"},{"n":"Hot water","d":"12 ounces / 1 1/2 cups (340g)","g":340,"fx":"fix_water"},{"n":"Malt syrup, bath","d":"1 1/2 tablespoons; sugar also published as a substitute","g":32,"c":"malt","s":"malt_barleysyrup","q":"bath"},{"n":"Egg, optional wash","d":"1 egg beaten with 1 teaspoon water","e":1,"o":1,"fx":"fix_egg"}]},{"id":"bodhi","name":"Bodhi Miami Grain-Free","source":"Bodhi Miami","href":"https://www.bodhimiami.com/blogs/bodhi-babe-blog/easy-homemade-bagel-recipe-grain-free","group":"addition","bagels":6,"convNote":"Coconut flour 112g/cup, baking powder 4.5g/tsp, shredded mozzarella 112g/cup, butter 14g/tbsp, cream cheese 28.35g/oz.","notes":"Optional toppings are named without quantities and are omitted. This is a bake-only, no-boil formula.","rows":[{"n":"Coconut flour","d":"1/2 cup","g":56,"fx":"fix_none"},{"n":"Baking powder","d":"4 teaspoons","g":18,"fx":"fix_none"},{"n":"Shredded mozzarella","d":"2 1/2 cups","g":280,"fx":"fix_none"},{"n":"Cream cheese","d":"2 ounces","g":57,"fx":"fix_creamcheese"},{"n":"Large eggs","d":"3 large eggs","e":3,"fx":"fix_egg"},{"n":"Melted butter","d":"4 tablespoons","g":57,"c":"butter","s":"butter_unsalted"}]}];
  var PRICES = null;
  try { PRICES = JSON.parse(document.getElementById("bn-prices").textContent); } catch (e) { PRICES = null; }
  var MON = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

  /* ---------- helpers ---------- */
  function h(tag, attrs) {
    var n = document.createElement(tag), k, i, c;
    for (k in (attrs || {})) {
      if (k === "text") n.textContent = attrs[k];
      else if (k === "class") n.className = attrs[k];
      else if (attrs[k] !== null && attrs[k] !== undefined && attrs[k] !== false) n.setAttribute(k, attrs[k] === true ? "" : attrs[k]);
    }
    function put(c) {
      if (c === null || c === undefined || c === false) return;
      if (Array.isArray(c)) { c.forEach(put); return; }
      n.appendChild(typeof c === "string" ? document.createTextNode(c) : c);
    }
    for (i = 2; i < arguments.length; i++) put(arguments[i]);
    return n;
  }
  function clear(n) { while (n.firstChild) n.removeChild(n.firstChild); }
  function fmt(n, d) { return n.toLocaleString("en-US", { minimumFractionDigits: d, maximumFractionDigits: d }); }
  function money(x) { return "$" + fmt(x, x < 1 ? 3 : 2); }
  function money2(x) { return "$" + fmt(x, 2); }
  function fmtDate(s) {
    var m = /^(\d{4})-(\d{2})-(\d{2})/.exec(s || "");
    if (m) return parseInt(m[3], 10) + " " + MON[parseInt(m[2], 10) - 1] + " " + m[1];
    var p = /^(\w+) (\d{4})$/.exec(s || "");
    return p ? p[1].slice(0, 3) + " " + p[2] : (s || "");
  }
  function fmtStamp(iso) {
    var m = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(iso || "");
    if (!m) return "";
    var hr = parseInt(m[4], 10), ap = hr >= 12 ? "PM" : "AM";
    hr = hr % 12 || 12;
    return parseInt(m[3], 10) + " " + MON[parseInt(m[2], 10) - 1] + " " + m[1] + ", " + hr + ":" + m[5] + " " + ap + " CT";
  }
  function srcShort(id) { return (PRICES && PRICES.sources[id] && PRICES.sources[id].short) || String(id).toUpperCase(); }
  function recOf(id) {
    if (!PRICES) return null;
    var o = PRICES.options[id] || PRICES.fixed[id];
    return o && o.price ? o.price : null;
  }
  function labelOf(id) {
    if (!PRICES) return id;
    var o = PRICES.options[id] || PRICES.fixed[id];
    return o ? o.label : id;
  }
  function priceText(rec) {
    if (!rec) return "";
    if (rec.unit === "each") return "$" + fmt(rec.usd_per_each, 3) + " per egg";
    return "$" + fmt(rec.usd_per_lb, 2) + " per lb";
  }
  function costOf(row, id, mult) {
    var rec = recOf(id);
    if (!rec) return null;
    if (row.e != null) return rec.usd_per_each != null ? row.e * mult * rec.usd_per_each : null;
    if (row.g != null) return rec.usd_per_g != null ? row.g * mult * rec.usd_per_g : null;
    return null;
  }
  function rowOptionId(row, sel, i) { return row.c ? (sel[i] || row.s) : row.fx; }
  function rowLabel(row, id) {
    if (!row.c) return row.n + (row.o ? ", optional" : "");
    return labelOf(id) + (row.q ? ", " + row.q : "") + (row.o && !row.q ? ", optional" : "");
  }
  /* ---------- burden rate ----------
     Burden Rate = time x (baker market hourly rate + bakery operating cost per hour).
     Baker labor hourly rate = Wisconsin minimum wage (DWD and U.S. DOL) x (1 + ECEC total benefits per hour / ECEC wages per hour),
       private industry production occupations. Total benefits in ECEC already include the legally required benefits (Social Security,
       Medicare, federal and state unemployment insurance, workers' compensation), so no payroll tax is added a second time.
     Operating cost per hour (ESTIMATE) = CBECS 2018 Food service annual electricity (kWh) and natural gas (cubic feet) per building,
       divided by annual operating hours (mean weekly hours x 52), x EIA Wisconsin commercial electricity and natural gas prices.
     Time = published hands-on time + published bake time of the recipe, times the batch multiple. */
  function laborOk() {
    var L = PRICES && PRICES.labor, O = L && L.operating, C = O && O.cbecs;
    return !!(L && L.minimum_wage && L.minimum_wage.value != null && L.ecec && L.hands_on && L.hands_on.default_minutes != null && O && C && C.weekly_hours && C.electricity && C.gas &&
      O.electricity && O.electricity.cents_per_kwh != null && O.gas && O.gas.usd_per_mcf != null);
  }
  function handsOn(fid) {
    var ho = PRICES.labor.hands_on, r = ho.formulas && ho.formulas[fid];
    if (r) return { min: r.minutes, hands: r.hands_on_min, bake: r.bake_min, published: true, text: r.text, url: r.url, total: r.total_min, stale: !!r.stale };
    var d = ho.formulas[ho.default_formula || "ka-classic"];
    return { min: ho.default_minutes, hands: d.hands_on_min, bake: d.bake_min, published: false, text: ho.default_basis, url: ho.default_url, total: d.total_min, stale: false };
  }
  function opRates() {
    var O = PRICES.labor.operating, C = O.cbecs, hrs = C.weekly_hours.value * 52;
    var kwh = C.electricity.kwh_per_building / hrs, mcf = C.gas.cf_per_building / 1000 / hrs;
    var e = kwh * O.electricity.cents_per_kwh / 100, g = mcf * O.gas.usd_per_mcf;
    return { hrs: hrs, kwh: kwh, mcf: mcf, elec: e, gas: g, perHour: e + g };
  }
  function laborCalc(f, mult) {
    if (!laborOk()) return null;
    var L = PRICES.labor, ho = handsOn(f.id), wage = L.minimum_wage.value, rate = L.ecec.benefits.value / L.ecec.wages.value, op = opRates();
    var loaded = wage * (1 + rate), minutes = ho.min * mult, hours = minutes / 60;
    var baker = hours * loaded, oper = hours * op.perHour;
    return { ho: ho, minutes: minutes, wage: wage, rate: rate, loaded: loaded, op: op, baker: baker, oper: oper, burden: baker + oper, hourly: loaded + op.perHour };
  }
  function minText(m) {
    if (m < 90) return fmt(m, m % 1 ? 1 : 0) + " min";
    return fmt(m / 60, 2) + " hr (" + fmt(m, m % 1 ? 1 : 0) + " min)";
  }
  function byId(id) { for (var i = 0; i < FORMULAS.length; i++) if (FORMULAS[i].id === id) return FORMULAS[i]; return FORMULAS[0]; }

  /* ---------- state ---------- */
  var state = { formula: "ka-classic", batch: "1", sel: {} };
  var open = null;                 // the listbox currently open: { btn, list, close }
  var root, tapeRoot, recordRoot, tapeItems = {}, tapeHead;

  function closeOpen() { if (open) { open.close(); open = null; } }
  document.addEventListener("click", function (e) { if (open && !open.wrap.contains(e.target)) closeOpen(); });
  document.addEventListener("keydown", function (e) { if (e.key === "Escape" && open) { var b = open.btn; closeOpen(); b.focus(); } });

  /* ---------- ingredient selector: the ingredient name is the control ---------- */
  function selector(row, i, current, onPick) {
    var cat = PRICES.categories[row.c], ids = cat.options;
    var wrap = h("div", { class: "bnp-sel" });
    var listId = "bnp-list-" + i;
    var btn = h("button", { type: "button", class: "bnp-sel__btn", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": listId,
      "aria-label": "Ingredient type for " + row.n + ". Current: " + labelOf(current) + ". Quantity stays fixed." });
    btn.appendChild(h("span", { class: "bnp-sel__name", text: rowLabel(row, current) }));
    btn.appendChild(h("span", { class: "bnp-sel__caret", "aria-hidden": "true", text: "\u25BE" }));
    var list = h("ul", { class: "bnp-list", role: "listbox", id: listId, tabindex: "-1", hidden: true });
    var opts = [];
    ids.forEach(function (oid) {
      var rec = recOf(oid);
      var li = h("li", { class: "bnp-opt" + (oid === current ? " is-on" : ""), role: "option", "aria-selected": oid === current ? "true" : "false", "data-oid": oid, tabindex: "-1" },
        h("span", { class: "bnp-opt__name", text: labelOf(oid) }),
        h("span", { class: "bnp-opt__price" + (rec ? "" : " is-none"), text: rec ? priceText(rec) + " \u00B7 " + srcShort(rec.source) : "No published price" }));
      li.addEventListener("click", function (e) { e.stopPropagation(); closeOpen(); onPick(oid); });
      opts.push(li); list.appendChild(li);
    });
    function focusOpt(k) { k = Math.max(0, Math.min(opts.length - 1, k)); opts[k].focus(); }
    function doOpen() {
      closeOpen();
      list.hidden = false; btn.setAttribute("aria-expanded", "true"); wrap.classList.add("is-open");
      open = { btn: btn, wrap: wrap, close: function () { list.hidden = true; btn.setAttribute("aria-expanded", "false"); wrap.classList.remove("is-open"); } };
      var cur = ids.indexOf(current); focusOpt(cur < 0 ? 0 : cur);
    }
    btn.addEventListener("click", function (e) { e.stopPropagation(); if (open && open.btn === btn) closeOpen(); else doOpen(); });
    btn.addEventListener("keydown", function (e) { if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); doOpen(); } });
    list.addEventListener("keydown", function (e) {
      var k = opts.indexOf(document.activeElement);
      if (e.key === "ArrowDown") { e.preventDefault(); focusOpt(k + 1); }
      else if (e.key === "ArrowUp") { e.preventDefault(); focusOpt(k - 1); }
      else if (e.key === "Home") { e.preventDefault(); focusOpt(0); }
      else if (e.key === "End") { e.preventDefault(); focusOpt(opts.length - 1); }
      else if (e.key === "Enter" || e.key === " ") { e.preventDefault(); if (k >= 0) { var oid = ids[k]; closeOpen(); onPick(oid); } }
      else if (e.key === "Tab") { closeOpen(); }
    });
    wrap.appendChild(btn); wrap.appendChild(list);
    return wrap;
  }

  /* ---------- total cost reveal ----------
     A scoreboard panel for the burdened total per bagel, with the per dozen and per batch figures beneath it.
     The figures count up from zero and land on exactly the value in the Burdened Cost table (the same expressions, the same
     formatting; the last frame is written from the exact value, not from the animation). With prefers-reduced-motion the final
     value is written at once and nothing moves. The animated figures are hidden from assistive technology; a visually hidden
     polite status line carries the final values only, once per change. The node is built once and moved into each new card. */
  var reveal = null, revealKey = null, revealRaf = 0, revealRunning = false, revealTimers = [];
  function buildReveal() {
    var strips = ["t", "r", "b", "l"].map(function (k) { return h("span", { class: "bnp-bulbs bnp-bulbs--" + k, "aria-hidden": "true" }); });
    var num = h("div", { class: "bnp-reveal__num", "aria-hidden": "true", text: "$0.00" });
    var dz = h("span", { class: "bnp-reveal__v", text: "$0.00" }), bt = h("span", { class: "bnp-reveal__v", text: "$0.00" });
    function cell(label, v) { return h("div", { class: "bnp-reveal__cell" }, h("span", { class: "bnp-reveal__k", text: label }), v); }
    var sr = h("p", { class: "bnp-reveal__sr", role: "status", "aria-live": "polite", "aria-atomic": "true" });
    var el = h("section", { class: "bnp-reveal", "aria-label": "Total Cost Per Bagel, Burdened" }, strips,
      h("p", { class: "bnp-reveal__label", "aria-hidden": "true", text: "Total Cost Per Bagel, Burdened" }), num,
      h("div", { class: "bnp-reveal__sub", "aria-hidden": "true" }, cell("Per Dozen", dz), cell("Per Batch", bt)),
      h("p", { class: "bnp-reveal__cap", "aria-hidden": "true", text: "Ingredients Plus Burden Rate" }), sr);
    reveal = { el: el, num: num, dz: dz, bt: bt, sr: sr };
  }
  function revealClear() {
    if (revealRaf) window.cancelAnimationFrame(revealRaf);
    revealRaf = 0; revealRunning = false;
    revealTimers.forEach(function (t) { window.clearTimeout(t); }); revealTimers = [];
    reveal.el.classList.remove("is-live"); reveal.el.classList.remove("is-landed");
  }
  function updateReveal(v) {
    if (!reveal) return;
    var R = reveal;
    if (!v) {
      revealClear(); revealKey = null;
      R.num.textContent = "\u2014"; R.dz.textContent = "\u2014"; R.bt.textContent = "\u2014";
      R.sr.textContent = "Total cost per bagel, burdened: withheld.";
      return;
    }
    var fin = [money2(v.bagel), money2(v.dozen), money2(v.batch)], key = fin.join("|");
    function setFinal() { R.num.textContent = fin[0]; R.dz.textContent = fin[1]; R.bt.textContent = fin[2]; }
    if (key === revealKey) { if (!revealRunning) setFinal(); return; }
    revealKey = key;
    revealClear();
    R.sr.textContent = "Total Cost Per Bagel, Burdened: " + fin[0] + ". Per dozen: " + fin[1] + ". Per batch: " + fin[2] + ".";
    var reduce = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
    if (reduce || !window.requestAnimationFrame) { setFinal(); return; }
    var D = 1200, t0 = null;
    revealRunning = true;
    R.el.classList.add("is-live");
    R.num.textContent = money2(0); R.dz.textContent = money2(0); R.bt.textContent = money2(0);
    function frame(ts) {
      if (t0 === null) t0 = ts;
      var p = Math.min(1, (ts - t0) / D);
      if (p >= 1) {
        revealRunning = false; revealRaf = 0; setFinal();
        R.el.classList.add("is-landed");
        revealTimers.push(window.setTimeout(function () { R.el.classList.remove("is-landed"); }, 900));
        revealTimers.push(window.setTimeout(function () { R.el.classList.remove("is-live"); }, 2600));
        return;
      }
      var e = 1 - Math.pow(1 - p, 3);
      R.num.textContent = money2(v.bagel * e); R.dz.textContent = money2(v.dozen * e); R.bt.textContent = money2(v.batch * e);
      revealRaf = window.requestAnimationFrame(frame);
    }
    revealRaf = window.requestAnimationFrame(frame);
  }

  /* ---------- the requisition panel ---------- */
  function render() {
    closeOpen();
    var f = byId(state.formula);
    var bp = parseFloat(state.batch);
    var invalid = !isFinite(bp) || bp <= 0;
    var mult = invalid ? 0 : bp;
    var bagels = invalid ? 0 : f.bagels * mult;
    clear(root);

    var card = h("div", { class: "bnp-card" });
    card.appendChild(h("h2", { class: "bnp-title", text: "Requisition Panel" }));
    card.appendChild(h("p", { class: "bnp-sub", text: "Select a formula and a batch multiple. Quantities are fixed by the published formula. Where a formula allows a variant, click the ingredient name to change its type." }));

    /* formula selector */
    var sel = h("select", { id: "bnp-formula", class: "bnp-input", "aria-label": "Approved formula" });
    [["original", "Original Eight"], ["addition", "Union Additions"]].forEach(function (g) {
      var og = h("optgroup", { label: g[1] });
      FORMULAS.forEach(function (x) { if (x.group === g[0]) og.appendChild(h("option", { value: x.id, text: x.name, selected: x.id === f.id })); });
      sel.appendChild(og);
    });
    sel.value = f.id;
    sel.addEventListener("change", function () { state.formula = sel.value; state.sel = {}; render(); });
    card.appendChild(h("label", { class: "bnp-label", for: "bnp-formula", text: "Approved Formula" }));
    card.appendChild(sel);
    card.appendChild(h("p", { class: "bnp-meta" },
      f.source + " \u00B7 " + f.bagels + " bagels at 1x" + (f.yieldNote ? ". " + f.yieldNote : "") + ". ",
      h("a", { href: f.href, target: "_blank", rel: "noreferrer", text: "Source page" })));

    /* batch */
    var inp = h("input", { id: "bnp-batch", class: "bnp-input bnp-input--num", type: "number", step: "any", min: "0", inputmode: "decimal", value: state.batch, "aria-label": "Batch multiple, any positive number" });
    inp.addEventListener("input", function () { state.batch = inp.value; renderBody(); });
    card.appendChild(h("label", { class: "bnp-label", for: "bnp-batch", text: "Batch Multiple, Any Positive Number" }));
    var bar = h("div", { class: "bnp-batch" });
    bar.appendChild(inp);
    function step(label, fn, aria) { var b = h("button", { type: "button", class: "bnp-btn", text: label, "aria-label": aria || label }); b.addEventListener("click", function () { state.batch = fn(); inp.value = state.batch; renderBody(); }); return b; }
    function cur() { var n = parseFloat(state.batch); return isFinite(n) ? n : 0; }
    bar.appendChild(step("\u22121", function () { var n = cur() - 1; return n <= 0 ? "0" : String(n); }, "Remove one batch"));
    bar.appendChild(step("+1", function () { return String(cur() + 1); }, "Add one batch"));
    [["1/2", "0.5"], ["1x", "1"], ["2x", "2"], ["3x", "3"], ["10x", "10"], ["100x", "100"]].forEach(function (p) { bar.appendChild(step(p[0], function () { return p[1]; })); });
    card.appendChild(bar);

    if (!reveal) buildReveal();
    card.appendChild(reveal.el);
    var body = h("div", { id: "bnp-body" });
    card.appendChild(body);
    root.appendChild(card);
    renderBody();
  }

  function renderBody() {
    closeOpen();
    var body = document.getElementById("bnp-body");
    if (!body) return;
    clear(body);
    var f = byId(state.formula);
    var bp = parseFloat(state.batch);
    var invalid = !isFinite(bp) || bp <= 0;
    var mult = invalid ? 0 : bp;
    if (invalid) {
      body.appendChild(h("p", { class: "bnp-warn", role: "status", text: "A batch of zero requires a Form 0 waiver. A negative batch is not a batch, and a blank or unreadable multiple is treated the same way. The requisition is withheld until a positive multiple is entered." }));
      refreshTape([]);
      updateReveal(null);
      return;
    }
    var bagels = f.bagels * mult;
    body.appendChild(h("h3", { class: "bnp-h3", text: "Requisition Lines" }));
    var ul = h("ul", { class: "bnp-lines" });
    var total = 0, baseTotal = 0, priced = 0, lines = 0, unpricedNames = [], totalG = 0, usedIds = [], changed = 0;
    f.rows.forEach(function (row, i) {
      var id = rowOptionId(row, state.sel, i);
      var baseId = row.c ? row.s : row.fx;
      var cost = costOf(row, id, mult);
      var baseCost = costOf(row, baseId, mult);
      lines++;
      if (row.g != null && row.e == null) totalG += row.g * mult;
      if (cost !== null) { total += cost; priced++; usedIds.push(id); } else unpricedNames.push(rowLabel(row, id));
      if (baseCost !== null) baseTotal += baseCost;
      if (row.c && id !== baseId) changed++;
      var li = h("li", { class: "bnp-line" + (cost === null ? " is-unpriced" : "") });
      var left = h("div", { class: "bnp-line__name" });
      if (row.c) left.appendChild(selector(row, i, id, function (oid) { state.sel[i] = oid; renderBody(); var again = document.querySelector('#bnp-body .bnp-line:nth-child(' + (i + 1) + ') .bnp-sel__btn'); if (again) again.focus(); }));
      else left.appendChild(h("span", { class: "bnp-line__fixed", text: rowLabel(row, id) }));
      var pubNote = "Published: " + row.d;
      if (row.c && id !== baseId) pubNote += ". As published: " + row.n + ".";
      else if (row.c && rowLabel(row, id).toLowerCase() !== (row.n + (row.o && !row.q ? ", optional" : "")).toLowerCase()) pubNote += ". As published: " + row.n + ".";
      left.appendChild(h("span", { class: "bnp-line__pub", text: pubNote }));
      var q = row.e != null ? fmt(row.e * mult, 2) + " each" : row.g != null ? fmt(row.g * mult, 1) + " g" : "\u2014";
      var rec = recOf(id);
      var costCell = cost !== null ? money(cost) : (row.c ? "No published price" : "Not priced");
      li.appendChild(left);
      li.appendChild(h("div", { class: "bnp-line__qty", text: q }));
      var cc = h("div", { class: "bnp-line__cost", text: costCell });
      if (cost !== null && rec) cc.appendChild(h("span", { class: "bnp-line__src", text: srcShort(rec.source) + " " + fmtDate(rec.as_of) }));
      li.appendChild(cc);
      ul.appendChild(li);
    });
    body.appendChild(ul);

    var dl = h("dl", { class: "bnp-totals" });
    function tot(k, v, strong) { dl.appendChild(h("div", { class: "bnp-totals__row" + (strong ? " is-strong" : "") }, h("dt", { text: k }), h("dd", { text: v }))); }
    tot("Bagels in This Requisition", fmt(bagels, 2) + " (" + f.bagels + " at 1x)");
    tot("Total Listed Ingredient Weight", fmt(totalG, 1) + " g (" + fmt(totalG / G_PER_LB, 2) + " lb)");
    tot("Listed Weight per Bagel", fmt(bagels > 0 ? totalG / bagels : 0, 1) + " g");
    tot("Priced Ingredient Cost", money2(total), true);
    tot("Ingredient Cost per Bagel", bagels > 0 ? money2(total / bagels) : "\u2014", true);
    tot("Lines Priced", priced + " of " + lines);
    if (changed > 0) {
      var d = total - baseTotal;
      tot("Change from Published Types", (d >= 0 ? "+" : "\u2212") + money2(Math.abs(d)) + " (" + changed + " line" + (changed === 1 ? "" : "s") + " changed, quantities unchanged)");
    }
    body.appendChild(dl);

    var lab = laborCalc(f, mult);
    body.appendChild(h("h3", { class: "bnp-h3", text: "Burdened Cost" }));
    if (lab) {
      var perDz = function (x) { return x / bagels * 12; };
      var brk = h("table", { class: "bnp-break" },
        h("thead", null, h("tr", null, h("th", { scope: "col", text: "Component" }), h("th", { scope: "col", text: "Per Bagel" }), h("th", { scope: "col", text: "Per Dozen" }), h("th", { scope: "col", text: "Per Batch" }))));
      var bb = h("tbody");
      var totalB = total + lab.burden;
      updateReveal({ bagel: totalB / bagels, dozen: totalB / bagels * 12, batch: totalB });
      [["Ingredients", total, ""], ["Burden Rate", lab.burden, "is-burden"], ["Baker Labor (Minimum Wage)", lab.baker, "is-sub"], ["Operating Cost", lab.oper, "is-sub"], ["Total", totalB, "is-total"]].forEach(function (r) {
        bb.appendChild(h("tr", { class: r[2], "data-row": r[0] },
          h("th", { scope: "row", text: r[0] }),
          h("td", { class: "is-num", "data-col": "bagel", text: money2(r[1] / bagels) }),
          h("td", { class: "is-num", "data-col": "dozen", text: money2(perDz(r[1])) }),
          h("td", { class: "is-num", "data-col": "batch", text: money2(r[1]) })));
      });
      brk.appendChild(bb);
      body.appendChild(h("div", { class: "bnp-breakwrap" }, brk));
      body.appendChild(h("p", { class: "bnp-note", text: "The batch is this requisition: " + fmt(bagels, 2) + " bagels. A dozen is twelve bagels at the same per-bagel cost. Ingredients are the priced lines above; any line without a published price is left out of every column. Burden Rate is Baker Labor plus Operating Cost." }));
      var ld = h("dl", { class: "bnp-totals bnp-labor" });
      function lrow(k, v, strong) { ld.appendChild(h("div", { class: "bnp-totals__row" + (strong ? " is-strong" : "") }, h("dt", { text: k }), h("dd", { text: v }))); }
      var OP = PRICES.labor.operating;
      lrow("Time, Hands-On Plus Bake", minText(lab.minutes) + " = " + fmt(lab.ho.hands * mult, lab.ho.hands * mult % 1 ? 1 : 0) + " hands-on + " + fmt(lab.ho.bake * mult, lab.ho.bake * mult % 1 ? 1 : 0) + " bake" + (mult === 1 ? "" : " (" + minText(lab.ho.min) + " at 1x)") + (lab.ho.published ? ", published by the formula source" : ", default"));
      lrow("Baker Labor Rate, Minimum Wage, Loaded", "$" + fmt(lab.loaded, 2) + " per hour = $" + fmt(lab.wage, 2) + " Wisconsin minimum wage \u00D7 (1 + " + fmt(lab.rate * 100, 2) + "%)");
      lrow("Operating Cost, Estimate", "$" + fmt(lab.op.perHour, 2) + " per hour ($" + fmt(lab.op.perHour / 60, 3) + " per minute) = electricity $" + fmt(lab.op.elec, 2) + " + natural gas $" + fmt(lab.op.gas, 2));
      lrow("Burden Rate per Hour", "$" + fmt(lab.hourly, 2) + " ($" + fmt(lab.hourly / 60, 3) + " per minute) = $" + fmt(lab.loaded, 2) + " + $" + fmt(lab.op.perHour, 2), true);
      body.appendChild(ld);
      body.appendChild(h("p", { class: "bnp-note" },
        lab.ho.published
          ? ["Time for this formula is the one its source page publishes: ", h("a", { href: lab.ho.url, target: "_blank", rel: "noreferrer", text: lab.ho.text }), " (total time on the page " + minText(lab.ho.total) + ", which includes unattended rising and resting that is not counted). It scales with the batch multiple."]
          : ["This formula\u2019s source page publishes no times, so a default applies: the published time of ", h("a", { href: lab.ho.url, target: "_blank", rel: "noreferrer", text: "King Arthur Bagels" }), " (" + PRICES.labor.hands_on.formulas[PRICES.labor.hands_on.default_formula].text + "). It is a fixed default per batch, not a measurement of this formula, and it scales with the batch multiple."]));
      body.appendChild(h("p", { class: "bnp-note" }, h("strong", { text: "Operating Cost is an ESTIMATE. " }),
        "It is the average energy use of a U.S. Food service building (EIA CBECS 2018: " + fmt(OP.cbecs.electricity.kwh_per_building, 0) + " kWh and " + fmt(OP.cbecs.gas.cf_per_building, 0) + " cubic feet of natural gas per building per year, covering heating, cooling, ventilation, refrigeration, cooking, hot water and lighting), spread over " + fmt(OP.hours_per_year, 0) + " operating hours a year (" + OP.cbecs.weekly_hours.value + " hours a week \u00D7 52), priced at EIA Wisconsin commercial rates (electricity " + fmt(OP.electricity.cents_per_kwh, 2) + " cents per kWh, natural gas $" + fmt(OP.gas.usd_per_mcf, 2) + " per thousand cubic feet, " + OP.electricity.period + "). It is not a measurement of any one bakery. Rent, insurance and equipment depreciation are not priced, because no clean published hourly rate exists; they are left out, not guessed."));
      body.appendChild(h("p", { class: "bnp-note" }, "Baker Labor is priced at the Wisconsin minimum wage, $" + fmt(lab.wage, 2) + " per hour (", h("a", { href: PRICES.labor.minimum_wage.dwd_url, target: "_blank", rel: "noreferrer", text: "Wisconsin DWD" }), " and ", h("a", { href: PRICES.labor.minimum_wage.dol_url, target: "_blank", rel: "noreferrer", text: "U.S. DOL" }), ", in force since " + PRICES.labor.minimum_wage.effective + ", read " + fmtDate(PRICES.labor.minimum_wage.retrieved_at) + "), plus the employer benefit load for private industry production occupations, which already includes the legally required benefits (Social Security, Medicare, unemployment insurance, workers\u2019 compensation). The minimum wage is the legal floor, not the market wage for Bakers; the BLS mean wage for Bakers in Milwaukee-Waukesha is shown under Published Prices and Sources for reference only. Every rate is listed there."));
    } else {
      updateReveal(null);
      body.appendChild(h("p", { class: "bnp-note", text: "Burden Rate is not priced: the minimum wage, benefit or energy records could not be read. The figures above are ingredients only." }));
    }
    if (unpricedNames.length) {
      body.appendChild(h("p", { class: "bnp-note" }, h("strong", { text: "Not in the total: " }), unpricedNames.join("; ") + ". These lines have no sourced price in the price record, so they are left out rather than estimated."));
    }
    if (f.notes) body.appendChild(h("p", { class: "bnp-note", text: f.notes }));
    if (f.convNote) body.appendChild(h("p", { class: "bnp-note", text: f.convNote }));
    body.appendChild(h("p", { class: "bnp-foot" },
      "Costs use the listed prices and the minimum wage, benefit and energy rates in the price record, dated and sourced line by line. They are not a quote and not an order. See ",
      h("a", { href: "#prices", text: "Published Prices and Sources" }), "."));
    var reset = h("button", { type: "button", class: "bnp-btn bnp-btn--reset", text: "Reset To Published Types" });
    reset.addEventListener("click", function () { state.sel = {}; renderBody(); });
    if (changed > 0) body.appendChild(reset);
    if (lab) { usedIds.push("labor-wage"); usedIds.push("labor-burden"); usedIds.push("op-elec"); usedIds.push("op-gas"); }
    refreshTape(usedIds, total, priced, lines, lab ? total + lab.burden : null);
  }

  /* ---------- price tape ---------- */
  function pctText(now, prev) {
    if (!prev || !isFinite(prev) || prev === 0) return "";
    var p = (now - prev) / prev * 100;
    if (Math.abs(p) < 0.005) return " UNCH";
    return (p > 0 ? " \u25B2" : " \u25BC") + fmt(Math.abs(p), 1) + "%";
  }
  function buildTape() {
    if (!PRICES || !tapeRoot) return;
    clear(tapeRoot);
    var seen = {}, items = [];
    function add(oid) {
      if (seen[oid]) return; seen[oid] = 1;
      var rec = recOf(oid), label = labelOf(oid).toUpperCase();
      if (!rec) { items.push({ oid: oid, cls: "is-none", text: label + "  NO PUBLISHED PRICE" }); return; }
      var now = rec.unit === "each" ? rec.usd_per_each : rec.usd_per_lb;
      var prev = rec.previous ? (rec.unit === "each" ? rec.previous.usd_per_each : rec.previous.usd_per_lb) : null;
      var ch = pctText(now, prev);
      items.push({ oid: oid, cls: (rec.stale ? "is-stale " : "") + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : ""),
        text: label + "  " + (rec.unit === "each" ? "$" + fmt(now, 3) + "/EA" : "$" + fmt(now, 2) + "/LB") + ch + "  " + srcShort(rec.source) + " " + fmtDate(rec.as_of).toUpperCase() + (rec.stale ? "  STALE" : "") });
    }
    Object.keys(PRICES.categories).forEach(function (c) { PRICES.categories[c].options.forEach(add); });
    Object.keys(PRICES.fixed).forEach(function (k) { if (recOf(k)) add(k); });
    if (laborOk()) {
      var MW = PRICES.labor.minimum_wage, LE = PRICES.labor.ecec;
      items.push({ oid: "labor-wage", cls: MW.stale ? "is-stale" : "", text: "WISCONSIN MINIMUM WAGE  $" + fmt(MW.value, 2) + "/HR  WI DWD AND US DOL, IN FORCE SINCE " + MW.effective.toUpperCase() + ", READ " + fmtDate(MW.retrieved_at).toUpperCase() + (MW.stale ? "  STALE" : "") });
      items.push({ oid: "labor-burden", cls: LE.stale ? "is-stale" : "", text: "EMPLOYER BENEFIT LOAD, PRODUCTION OCCUPATIONS  " + fmt(LE.benefits.value / LE.wages.value * 100, 1) + "% OF WAGES  BLS ECEC " + LE.period.toUpperCase() + (LE.stale ? "  STALE" : "") });
      var OPT = PRICES.labor.operating;
      items.push({ oid: "op-elec", cls: OPT.electricity.stale || OPT.stale ? "is-stale" : "", text: "WISCONSIN COMMERCIAL ELECTRICITY  " + fmt(OPT.electricity.cents_per_kwh, 2) + " CENTS/KWH  EIA " + OPT.electricity.period.toUpperCase() + (OPT.stale ? "  STALE" : "") });
      items.push({ oid: "op-gas", cls: OPT.gas.stale || OPT.stale ? "is-stale" : "", text: "WISCONSIN COMMERCIAL NATURAL GAS  $" + fmt(OPT.gas.usd_per_mcf, 2) + "/MCF  EIA " + OPT.gas.period.toUpperCase() + (OPT.stale ? "  STALE" : "") });
    }
    (PRICES.bls_reference || []).forEach(function (r) {
      var ch = pctText(r.value, r.prev_value);
      items.push({ oid: "bls-" + r.series, cls: "is-ref " + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : ""),
        text: r.name.toUpperCase() + "  $" + fmt(r.value, 3) + "/LB" + ch + "  BLS " + fmtDate(r.period).toUpperCase() + "  NATIONAL AVG" });
    });
    (PRICES.futures || []).forEach(function (q) {
      var ch = pctText(q.price, q.prev_close);
      items.push({ oid: "fut-" + q.symbol, cls: "is-ref " + (ch.indexOf("\u25B2") >= 0 ? "is-up" : ch.indexOf("\u25BC") >= 0 ? "is-down" : "") + (q.stale ? " is-stale" : ""),
        text: q.symbol + " " + q.name.toUpperCase() + "  " + fmt(q.price, 2) + " " + q.unit.toUpperCase() + ch + "  YF " + fmtStamp(q.quote_time).toUpperCase() + "  DELAYED, NOT COSTED" + (q.stale ? "  STALE" : "") });
    });
    var track = h("div", { class: "bnt-track", "aria-hidden": "true" });
    [0, 1].forEach(function (copy) {
      var seg = h("div", { class: "bnt-seg" });
      items.forEach(function (it) {
        var s = h("span", { class: "bnt-item " + it.cls, text: it.text });
        (tapeItems[it.oid] = tapeItems[it.oid] || []).push(s);
        seg.appendChild(s);
      });
      track.appendChild(seg);
    });
    var lane = h("div", { class: "bnt-lane" }, track);
    tapeRoot.appendChild(lane);
    window.requestAnimationFrame(function () {
      var w = track.firstChild.getBoundingClientRect().width || 3000;
      track.style.animationDuration = Math.max(60, Math.round(w / 45)) + "s";
    });
  }
  function refreshTape(usedIds, total, priced, lines, burdened) {
    var used = {}; (usedIds || []).forEach(function (i) { used[i] = 1; });
    Object.keys(tapeItems).forEach(function (k) { tapeItems[k].forEach(function (n) { n.classList.toggle("is-sel", !!used[k]); }); });
    if (tapeHead) tapeHead.textContent = priced ? "In this requisition: " + priced + " priced line" + (priced === 1 ? "" : "s") + ", " + money2(total) + (burdened !== null && burdened !== undefined ? ", " + money2(burdened) + " burdened" : "") : "No requisition in force";
  }
  function buildTapeFrame() {
    var anyStale = false;
    Object.keys(PRICES.options).concat(Object.keys(PRICES.fixed)).forEach(function (k) { var r = recOf(k); if (r && r.stale) anyStale = true; });
    var top = h("div", { class: "bnt-top" },
      h("span", { class: "bnt-brand", text: "Bagel Bakers Union of the Greater Milwaukee Area, Local 7 \u00B7 Published Price Tape" }),
      h("span", { class: "bnt-flag", text: "Dated readings. Not a live feed." }));
    tapeHead = h("span", { class: "bnt-req", "aria-live": "polite" });
    var pause = h("button", { type: "button", class: "bnt-pause", "aria-pressed": "false", text: "Pause Tape" });
    pause.addEventListener("click", function () {
      var on = tapeRoot.parentNode.classList.toggle("is-paused");
      pause.setAttribute("aria-pressed", on ? "true" : "false"); pause.textContent = on ? "Resume Tape" : "Pause Tape";
    });
    var skip = h("a", { class: "bnt-skip", href: "#prices", text: "Read the Tape as a Table" });
    var bar = h("div", { class: "bnt-bar" }, tapeHead, h("span", { class: "bnt-bar__r" }, skip, pause));
    var foot = h("div", { class: "bnt-foot" },
      "Ingredient prices read " + fmtStamp(PRICES.generated_at) + ". Listed prices carry the date they were read. BLS averages are monthly and carry their month; the minimum wage is the statutory rate and carries the date it was read, the benefit load is the quarterly ECEC, and the Wisconsin energy prices are the monthly EIA figures. Futures are delayed quotes. Highlighted items are in the requisition. WSR WebstaurantStore \u00B7 KAB King Arthur Baking \u00B7 BLS Bureau of Labor Statistics \u00B7 DWD Wisconsin Department of Workforce Development \u00B7 DOL U.S. Department of Labor \u00B7 EIA Energy Information Administration \u00B7 YF Yahoo Finance." + (anyStale ? " Items marked STALE could not be read in the last check; their last reading is shown." : ""));
    var wrap = tapeRoot;
    wrap.parentNode.insertBefore(top, wrap);
    wrap.parentNode.insertBefore(bar, wrap);
    wrap.parentNode.appendChild(foot);
  }

  /* ---------- price record ---------- */
  function recordRows(tbody, ids) {
    ids.forEach(function (oid) {
      var rec = recOf(oid), o = PRICES.options[oid] || PRICES.fixed[oid];
      var tr = h("tr", { class: rec ? "" : "is-none" });
      tr.appendChild(h("th", { scope: "row", text: o.label }));
      if (!rec) {
        tr.appendChild(h("td", { text: "No published price" }));
        tr.appendChild(h("td", { text: o.unpriced_reason || "" }));
        tr.appendChild(h("td", { text: "\u2014" }));
        tr.appendChild(h("td", { text: "\u2014" }));
        tbody.appendChild(tr); return;
      }
      tr.appendChild(h("td", { class: "is-num", text: priceText(rec) }));
      tr.appendChild(h("td", { text: (rec.source === "bls" ? "" : "$" + fmt(rec.list_price, 2) + " per ") + rec.pack_text }));
      tr.appendChild(h("td", null, h("a", { href: rec.url, target: "_blank", rel: "noreferrer", text: srcShort(rec.source) }), " " + rec.product));
      tr.appendChild(h("td", { text: fmtDate(rec.as_of) + (rec.stale ? " (stale)" : "") }));
      tbody.appendChild(tr);
    });
  }
  function table(cols, cls) {
    var thead = h("thead", null, h("tr", null, cols.map(function (c) { return h("th", { scope: "col", text: c }); })));
    var tbody = h("tbody");
    return { el: h("div", { class: "bnr-wrap" }, h("table", { class: "bnr-table" + (cls ? " " + cls : "") }, thead, tbody)), body: tbody };
  }
  function buildLaborRecord() {
    var L = PRICES.labor, W = L.wage, MW = L.minimum_wage, E = L.ecec, HO = L.hands_on, O = L.operating, C = O.cbecs, R = opRates();
    var rate = E.benefits.value / E.wages.value;
    function link(u, text) { return h("a", { href: u, target: "_blank", rel: "noreferrer", text: text }); }
    var stale = function (x) { return x ? " (stale)" : ""; };
    recordRoot.appendChild(h("h3", { class: "bnr-h3", id: "burden-rate", text: "Burden Rate" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Burden Rate is time \u00D7 (baker labor rate per hour + operating cost per hour). The baker labor rate is the Wisconsin minimum wage loaded with the employer benefit load (total benefits cost per hour divided by wages cost per hour, private industry production occupations, the occupational group that contains Bakers). Total benefits in that series already include the legally required benefits, so they are not added again. The minimum wage is the legal floor, not the market wage for Bakers; the Bureau of Labor Statistics wage for Bakers is listed for reference only and is not used in any cost. Operating cost is an ESTIMATE of what an hour of running a food service building costs in heating, cooling and the other electricity and gas it uses, from federal building energy surveys and Wisconsin commercial energy prices." }));
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Baker Labor Rate, Minimum Wage" }));
    var t = table(["Rate", "Value", "Basis", "Source", "As of"], "bnr-wide3");
    function row(tb, name, val, basis, src, asof, cls) {
      tb.body.appendChild(h("tr", { class: cls || "" }, h("th", { scope: "row", text: name }), h("td", { class: "is-num", text: val }), h("td", { text: basis }), h("td", null, src), h("td", { text: asof })));
    }
    row(t, "Wisconsin Minimum Wage", "$" + fmt(MW.value, 2) + " per hour", MW.basis + " In force since " + MW.effective + ". Used in every Baker Labor figure.", [link(MW.dwd_url, "Wisconsin DWD"), " \u00B7 ", link(MW.dol_url, "U.S. DOL")], fmtDate(MW.retrieved_at) + stale(MW.stale));
    row(t, "Bakers, Hourly Mean Wage (Reference Only)", "$" + fmt(W.mean.value, 2) + " per hour", "Occupation Bakers (SOC 51-3011), " + W.area + ". Market wage, shown for comparison. Not used in a cost. Release: " + W.release + ".", link(W.mean.url, "BLS " + W.mean.series), W.period + stale(W.stale));
    row(t, "Bakers, Hourly Median Wage", "$" + fmt(W.median.value, 2) + " per hour", "Same occupation and area. Reference only, not used in a cost.", link(W.median.url, "BLS " + W.median.series), W.period);
    row(t, "Wages and Salaries Cost per Hour", "$" + fmt(E.wages.value, 2) + " per hour", E.group + ". Release: " + E.release + ".", link(E.wages.url, "BLS " + E.wages.series), E.period + stale(E.stale));
    row(t, "Total Benefits Cost per Hour", "$" + fmt(E.benefits.value, 2) + " per hour", E.group + ". Includes the legally required benefits below.", link(E.benefits.url, "BLS " + E.benefits.series), E.period);
    row(t, "Of Which Legally Required Benefits", "$" + fmt(E.legal.value, 2) + " per hour (" + fmt(E.legal.value / E.wages.value * 100, 2) + "% of wages)", "Social Security, Medicare, federal and state unemployment insurance, workers\u2019 compensation. Already inside the benefits line above.", link(E.legal.url, "BLS " + E.legal.series), E.period);
    row(t, "Employer Benefit Load", fmt(rate * 100, 2) + "% of wages", "Total benefits cost per hour divided by wages cost per hour: $" + fmt(E.benefits.value, 2) + " \u00F7 $" + fmt(E.wages.value, 2) + ".", link(E.release_url, "BLS ECEC release"), E.period, "bnr-calc");
    row(t, "Baker Labor Rate, Minimum Wage, Loaded", "$" + fmt(MW.value * (1 + rate), 2) + " per hour", "$" + fmt(MW.value, 2) + " \u00D7 (1 + " + fmt(rate * 100, 2) + "%). Worked out in the page from the lines above.", "\u2014", E.period, "bnr-calc");
    recordRoot.appendChild(t.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Operating Cost per Hour, Estimate" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "ESTIMATE. The Energy Information Administration\u2019s Commercial Buildings Energy Consumption Survey (CBECS 2018, the newest published, released 2022) reports the average yearly electricity and natural gas use of a Food service building, which is a building where food is prepared and sold, and the average hours it operates. Dividing a year of use by a year of operating hours gives use per hour. Pricing that at the EIA Wisconsin commercial rates gives dollars per hour. The 2018 use is combined with current prices, and no bakery in particular was measured. Heating, cooling, ventilation, refrigeration, cooking, hot water and lighting are inside these totals." }));
    var t4 = table(["Item", "Value", "Basis", "Source", "As of"], "bnr-wide3");
    row(t4, "Mean Operating Hours per Week", fmt(C.weekly_hours.value, 0) + " hours", C.activity + " buildings. " + C.weekly_hours.table + ".", link(C.weekly_hours.url, "EIA CBECS Table B1"), "2018 survey");
    row(t4, "Operating Hours per Year", fmt(R.hrs, 0) + " hours", fmt(C.weekly_hours.value, 0) + " hours a week \u00D7 52 weeks.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Electricity Use per Building", fmt(C.electricity.kwh_per_building, 0) + " kWh per year", C.activity + ". " + C.electricity.table + ".", link(C.electricity.url, "EIA CBECS Table C22"), "2018 survey");
    row(t4, "Natural Gas Use per Building", fmt(C.gas.cf_per_building, 0) + " cubic feet per year", C.activity + ", buildings using natural gas. " + C.gas.table + ".", link(C.gas.url, "EIA CBECS Table C32"), "2018 survey");
    row(t4, "Wisconsin Commercial Electricity Price", fmt(O.electricity.cents_per_kwh, 2) + " cents per kWh", O.electricity.source + ". " + O.electricity.period + "; " + O.electricity.prior_period + " was " + fmt(O.electricity.prior_year, 2) + ".", link(O.electricity.url, "EIA Table 5.6.A"), O.electricity.period + stale(O.electricity.stale || O.stale));
    row(t4, "Wisconsin Commercial Natural Gas Price", "$" + fmt(O.gas.usd_per_mcf, 2) + " per thousand cubic feet", O.gas.source + ". " + O.gas.period + (O.gas.prior_month != null ? "; " + O.gas.prior_period + " was $" + fmt(O.gas.prior_month, 2) : "") + ".", link(O.gas.url, "EIA Natural Gas Prices"), O.gas.period + stale(O.gas.stale || O.stale));
    row(t4, "Electricity per Hour", "$" + fmt(R.elec, 2) + " ($" + fmt(R.elec / 60, 3) + " per minute)", fmt(R.kwh, 2) + " kWh per hour \u00D7 " + fmt(O.electricity.cents_per_kwh, 2) + " cents. Worked out in the page.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Natural Gas per Hour", "$" + fmt(R.gas, 2) + " ($" + fmt(R.gas / 60, 3) + " per minute)", fmt(R.mcf, 4) + " thousand cubic feet per hour \u00D7 $" + fmt(O.gas.usd_per_mcf, 2) + ". Worked out in the page.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Operating Cost per Hour, Estimate", "$" + fmt(R.perHour, 2) + " ($" + fmt(R.perHour / 60, 3) + " per minute)", "Electricity plus natural gas.", "\u2014", "Worked out", "bnr-calc");
    row(t4, "Not Priced: " + O.unpriced.join(", "), "Not priced", O.unpriced_reason, "\u2014", "\u2014");
    recordRoot.appendChild(t4.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Time per Batch" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Time is the recipe\u2019s published hands-on time plus its published bake time, using the midpoint where a range is given. Unattended rising, resting and chilling time, which is most of the published total time, is not counted. King Arthur Baking\u2019s recipe pages state these times. The other source pages state none in a form this record can read, so every other formula uses the default below, which is the published time of the King Arthur Bagels formula. Time is fixed for one batch and scales with the batch multiple. It is not a measurement of any other formula." }));
    var t3 = table(["Formula", "Minutes Counted", "Basis", "Source"], "bnr-wide3");
    var pub = FORMULAS.filter(function (x) { return HO.formulas[x.id]; });
    pub.forEach(function (x) {
      var r = HO.formulas[x.id];
      t3.body.appendChild(h("tr", null, h("th", { scope: "row", text: x.name }), h("td", { class: "is-num", text: fmt(r.minutes, 1) + " min" }), h("td", { text: "Published by the source page: " + r.text + "; total time on the page " + fmt(r.total_min, 0) + " min" + stale(r.stale) }), h("td", null, link(r.url, "Recipe page"))));
    });
    t3.body.appendChild(h("tr", { class: "bnr-calc" }, h("th", { scope: "row", text: "Every Other Formula (" + (FORMULAS.length - pub.length) + ")" }), h("td", { class: "is-num", text: fmt(HO.default_minutes, 1) + " min" }), h("td", { text: "Default. " + HO.default_basis + "." }), h("td", null, link(HO.default_url, "King Arthur Bagels"))));
    recordRoot.appendChild(t3.el);
  }
  function buildRecord() {
    if (!PRICES || !recordRoot) return;
    clear(recordRoot);
    recordRoot.appendChild(h("h2", { class: "bnr-h2", id: "prices", text: "Published Prices and Sources" }));
    recordRoot.appendChild(h("p", { class: "bnr-p", text: "Every price and rate on this page is a published figure with a source and a date. Every figure is read from its source; the one estimate, Operating Cost, is labeled as such and its basis is shown. If a type has no published price, the panel says so and leaves the line out of the total." }));
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "How Prices Are Kept Current" }));
    var how = h("ul", { class: "bnr-list" });
    [
      "The Union rewrites this record by reading each source again. The ingredient prices were last read " + fmtStamp(PRICES.generated_at) + ". Nothing on this page refreshes itself in your browser.",
      "Listed prices (WSR, KAB) are the price shown on the product page that day, divided by the weight of the listed pack. Dairy and other perishable listings can change more than once a day.",
      "Burden Rate inputs change on the schedule of their source: the Wisconsin minimum wage only when the law changes (it has been $7.25 since July 24, 2009), the ECEC benefit load once a quarter (published about three months after the quarter closes), the Wisconsin commercial electricity and natural gas prices once a month, and the CBECS building use figures only when a new survey is published (the 2018 survey is the newest).",
      "BLS figures are national monthly average retail prices. The newest month is published about two weeks after month-end, so they move once a month.",
      "Futures quotes (YF) are delayed exchange quotes shown for reference. They are never used in a cost.",
      "A source that cannot be read keeps its last reading, marked STALE with its date. The tape does not refresh itself in your browser. This page makes no outside requests and keeps nothing about you."
    ].forEach(function (t) { how.appendChild(h("li", { text: t })); });
    recordRoot.appendChild(how);

    if (laborOk()) buildLaborRecord();
    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "Price Record by Ingredient Type" }));
    var t1 = table(["Type", "Price", "Basis", "Source and product", "As of"]);
    Object.keys(PRICES.categories).forEach(function (c) {
      var cat = PRICES.categories[c];
      t1.body.appendChild(h("tr", { class: "bnr-group" }, h("th", { colspan: "5", scope: "colgroup", text: cat.label })));
      recordRows(t1.body, cat.options);
    });
    t1.body.appendChild(h("tr", { class: "bnr-group" }, h("th", { colspan: "5", scope: "colgroup", text: "Lines Without a Selector" })));
    recordRows(t1.body, Object.keys(PRICES.fixed));
    recordRoot.appendChild(t1.el);

    recordRoot.appendChild(h("h3", { class: "bnr-h3", text: "National Averages and Futures, Reference Only" }));
    var t2 = table(["Series", "Latest", "Prior", "Source", "As of"]);
    (PRICES.bls_reference || []).forEach(function (r) {
      t2.body.appendChild(h("tr", null, h("th", { scope: "row", text: r.name + ", " + r.unit_text }), h("td", { class: "is-num", text: "$" + fmt(r.value, 3) }),
        h("td", { class: "is-num", text: r.prev_value ? "$" + fmt(r.prev_value, 3) + " (" + fmtDate(r.prev_period) + ")" : "\u2014" }),
        h("td", null, h("a", { href: r.url, target: "_blank", rel: "noreferrer", text: "BLS " + r.series })), h("td", { text: fmtDate(r.period) })));
    });
    (PRICES.futures || []).forEach(function (q) {
      t2.body.appendChild(h("tr", null, h("th", { scope: "row", text: q.name + " (" + q.symbol + "), " + q.unit_text }), h("td", { class: "is-num", text: fmt(q.price, 2) }),
        h("td", { class: "is-num", text: fmt(q.prev_close, 2) + " (prior close)" }),
        h("td", null, h("a", { href: q.url, target: "_blank", rel: "noreferrer", text: "YF " + q.symbol })), h("td", { text: fmtStamp(q.quote_time) + (q.stale ? " (stale)" : "") })));
    });
    recordRoot.appendChild(t2.el);
    var w = PRICES.weight_chart;
    recordRoot.appendChild(h("p", { class: "bnr-p bnr-small" },
      "Where a pack is sold by volume, its weight is taken from the ", h("a", { href: w.url, target: "_blank", rel: "noreferrer", text: w.name }),
      " (molasses 340 g per cup, maple syrup 312 g per cup, milk 227 g per cup). Egg lines are costed at one whole egg for each egg named, at the BLS price per dozen divided by twelve. Formula quantities are unchanged from the published formulas."));
  }

  function mount(panelEl, tapeEl, recordEl) {
    if (!PRICES) { panelEl.textContent = "The price record could not be read. The calculator is unavailable."; return; }
    root = panelEl; tapeRoot = tapeEl; recordRoot = recordEl;
    buildTapeFrame(); buildTape(); buildRecord(); render();
  }
  return { mount: mount, _state: state };
})();

Back to the Bagel Calculator.