@doenet/v06-to-v07 0.7.26-dev.551 → 0.7.26-dev.552

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38632,7 +38632,7 @@ class Indent {
38632
38632
  }
38633
38633
  const chrome$1 = "# Viewer chrome: buttons, panel headers, and other UI the reader interacts\n# with. Rendered on the main thread and selected by `uiLocale`.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`submit-button`, `answer-status.correct`).\n#\n# This catalog is the source of truth for every other locale: `lint:i18n`\n# rejects a translation that defines a key missing here. Run\n# `npm run codegen -w @doenet/i18n` after editing.\n\n\n## Answer submission — the check-work button and the status it reports.\n\nanswer-checking = Checking...\nanswer-submitting = Submitting...\n\n# Announced to a screen reader while the submission is in flight. Separate\n# from the button's own text, which is abbreviated.\nanswer-checking-status = Checking answer\nanswer-submitting-status = Submitting answer\n\nanswer-correct = Correct\nanswer-incorrect = Incorrect\n\n# Shown instead of a correctness verdict when the activity withholds\n# correctness: the response was recorded, nothing is claimed about it.\nanswer-response-saved = Response Saved\n\n# Partial credit. `-credit` is used when repeated attempts reduce the credit\n# available, `-correct` when they do not, and `-short` on a button too narrow\n# for a word.\nanswer-percent-credit = { $percent }% Credit\nanswer-percent-correct = { $percent }% Correct\nanswer-percent-short = { $percent } %\n\nmax-credit-available = Max credit available: { $percent }%\n\n# Fluent formats `{ $count }` with `Intl.NumberFormat`, so a four-digit\n# attempt count renders as \"1,000\" where the hand-built string said \"1000\".\n# That is the one place English output is not byte-identical to what this\n# replaced, and grouping is the locale-correct rendering, so it stands.\nattempts-remaining =\n { $count ->\n [0] no attempts remaining\n [one] { $count } attempt remaining\n *[other] { $count } attempts remaining\n }\n\n# Appended to an input's accessible name once its response has been graded,\n# so a screen reader reports the verdict along with the field.\nvalidation-correct = (Correct)\nvalidation-incorrect = (Incorrect)\nvalidation-partially-correct = (Partially correct)\n\n# Tooltip on the badge that reports how many responses have been submitted to\n# one answer, shown only to a host that asked for it. `$answerId` is the\n# answer's authored name and is never translated.\nanswer-show-responses =\n { $count ->\n [one] Show { $count } response to { $answerId }\n *[other] Show { $count } responses to { $answerId }\n }\n\n\n## Disclosure panels\n\nfeedback-heading = Feedback\n\n# Follows a disclosure panel's own heading — \"Solution (click to open)\" — and\n# is shared by `<solution>`, `<hint>`, and a collapsible `<section>`. The whole\n# parenthetical is one message: where the word for open or close falls inside\n# it is the translator's business.\ncollapsible-click-to-open = (click to open)\ncollapsible-click-to-close = (click to close)\n\n# Placeholder inside a panel that has been opened before its contents have\n# arrived from the core. Shared by `<solution>` and a collapsible `<section>`.\ncollapsible-initializing = Initializing...\n\n# Tooltip on a footnote marker, naming what activating it will do.\nfootnote-show = Show footnote\nfootnote-hide = Hide footnote\n\n# Tooltip on the ⓘ affordance that reveals an input's description.\ndescription-more-information = more information\n\n\n## Controls\n\nslider-previous = Prev\nslider-next = Next\n\nkeyboard-open = Open Keyboard\nkeyboard-close = Close Keyboard\n\n# Accessible name of the button that drops one selected choice from an inline\n# `<choiceInput selectMultiple>`. The button itself is drawn as a bare cross,\n# so `$choice` — the choice's own text, which is never translated — is the\n# only thing that says which chip it belongs to.\nchoice-input-remove-choice = Remove { $choice }\n\n# Accessible names of a matrix input's size controls, whose visible labels are\n# the symbols `r-` `r+` `c-` `c+`.\nmatrix-remove-row = Remove row\nmatrix-add-row = Add row\nmatrix-remove-column = Remove column\nmatrix-add-column = Add column\n\n# Modes and actions of the subset-of-reals input's control strip. The button\n# that selects all of the reals is the symbol `R`, not a word, and stays in\n# place.\nsubset-add-remove-points = Add/Remove points\nsubset-toggle-points-intervals = Toggle points and intervals\nsubset-move-points = Move Points\nsubset-clear = Clear\n\n# Buttons that edit an orbital diagram: rows hold boxes, boxes hold up to\n# three spin arrows.\norbital-add-row = Add Row\norbital-remove-row = Remove Row\norbital-add-box = Add Box\norbital-remove-box = Remove Box\norbital-add-up-arrow = Add Up Arrow\norbital-add-down-arrow = Add Down Arrow\norbital-remove-arrow = Remove Arrow\n\n# Accessible name of the text field naming one row of an orbital diagram,\n# counting from 1.\norbital-row-label = Label for row { $row }\n\n# Labels the answer column of a pretzel exercise's grid.\npretzel-answer = Answer\n\n# Caption above the table a `<summaryStatistics>` renders. `$column` is the\n# authored name of the data column being summarized and is never translated.\n# The table's own headings (`mean`, `stdev`, `quartile1`, …) are the statistic\n# ids an author references, not prose, and stay in place.\nsummary-statistics-caption = Summary statistics of { $column }\n\n\n## Math input\n\n# Accessible name of the popover that previews the typed expression, and of\n# the rendered expression inside it.\nmath-input-preview-region = math expression preview\nmath-input-preview = Preview\nmath-input-invalid-expression = Invalid expression:\n\n\n## Document status\n\n# Shown while the core is still starting up and nothing can be rendered yet.\nviewer-initializing = Initializing...\n\n\n## Errors\n\n# Prefixes an error message wherever one is shown in place of content: an\n# `<error>` the core reported, the error boundary's fallback, and the\n# placeholder left where a renderer chunk failed to load.\nerror-heading = Error\n\n# Follows the error's own message inside that box, saying where in the source\n# the error was found. $span selects the sentence — one line or a range of\n# them — as a key rather than a phrase, so a translation is free to reorder the\n# whole of it. $startLine and $endLine are line numbers, and arrive as text\n# rather than as numbers so that line 1234 is not grouped as \"1,234\": a line\n# number is an identifier, not a quantity.\nerror-found-at =\n { $span ->\n [line] Found on line { $startLine }.\n *[lines] Found on lines { $startLine }–{ $endLine }.\n }\n\n# Banner above a document that compiled with at least one error in it.\ndocument-contains-errors = This document contains errors!\n\n# Headings of the tooltip the editor shows over a squiggle, naming what kind\n# of diagnostic it is. `-information` and `-hint` are styled identically but\n# are two different words; `-hint` is unreachable today, since nothing Doenet\n# raises is an LSP hint, and is here so the set is complete.\ndiagnostic-heading-error = Error\ndiagnostic-heading-warning = Warning\ndiagnostic-heading-information = Info\ndiagnostic-heading-hint = Hint\n\n# Headings of the same tooltip over an accessibility diagnostic, which says\n# what kind of problem it is rather than how severe. Level 1 is a failure\n# against the WCAG AA success criteria; level 2 is Doenet's own advice, which\n# no standard requires.\naccessibility-heading-level-1 = WCAG AA Accessibility Violation\naccessibility-heading-level-2 = Accessibility alert\n\n# Shown in place of the document when a renderer threw and the error boundary\n# caught it.\nsomething-went-wrong = Something went wrong.\n\n# Shown in place of a single renderer whose code chunk never arrived.\nrenderer-load-failed = a renderer failed to load. Please reload the page.\n\n# Shown in place of the document when the core worker could not be started\n# after retries, rather than leaving the pane blank.\ncore-start-failed = This document could not be started. Please reload the page.\n\n# Replaces `core-start-failed` when several documents were starting at the\n# same time — counted across every same-origin tab, so not necessarily all on\n# the page the reader sees. Naming the contention keeps the reader from\n# concluding the service is broken.\ncore-start-failed-busy = This document could not be started. Several documents were starting at once, which can take longer on a slower device. Reloading the page may help once the other documents have finished.\n\n# Shown for a core-start failure the reader can still retry, next to the\n# button that does it (`core-start-retry`). It leaves out the advice to\n# reload that the messages above carry: the button is the cheaper action,\n# and a reader told to reload will reload the whole page — restarting every\n# other document on it, which is what produced the failure in the first\n# place on a page that was already busy.\ncore-start-failed-retry = This document could not be started.\n\n# The contended variant of `core-start-failed-retry`, named for the same\n# reason `core-start-failed-busy` is: a reader who is told that several\n# documents were starting at once has a reason to try again in a moment\n# rather than concluding the service is broken.\ncore-start-failed-busy-retry = This document could not be started. Several documents were starting at once, which can take longer on a slower device.\n\n# Label of the button that starts a failed document over without reloading\n# the page. Offered once per document; a retry that fails too falls back to\n# `core-start-failed` / `core-start-failed-busy`, which advise the reload.\ncore-start-retry = Try again\n\n# Shown beside a document that is on screen and working, when the host\n# answered `SPLICE.getState` with an error and so the document started\n# without the reader's saved work (#1741). The host's own wording follows\n# this lead-in, so it says what was lost rather than why.\nsaved-state-unavailable = Your saved work could not be loaded.\n";
38634
38634
  const content = '# Worker-generated content: style descriptions ("thick red line"), boolean\n# words, and other prose the core computes into the document. Selected by\n# `documentLocale`, which follows the content\'s language rather than the\n# reader\'s UI language.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`color.blue`, `noun.line-segment`).\n\n\n## Style vocabulary\n##\n## The words the style pipeline derives from a component\'s numeric and\n## enumerated style values. A word an author writes directly — `lineColorWord`,\n## `markerStyleWord`, and their siblings — passes through untranslated: the\n## author chose those words, and rewriting them would be a surprise. So does a\n## CSS named color asked for by name ("rebeccapurple"), which\n## `resolveColorWord` deliberately preserves.\n##\n## Every adjective here is handed `$gender`, the grammatical gender of the noun\n## it describes (see `noun-gender`), and `$role`, the syntactic position the\n## phrase it belongs to is going into. English has no agreement and ignores\n## both; a language that inflects selects on them.\n##\n## `$role` is one of:\n##\n## standalone the phrase stands on its own, which is where all but\n## the three below are\n## border-clause inside `style-border-clause`, behind its preposition\n## background-clause the background colour inside `style-text`, behind its\n## preposition\n## text-clause the text colour beside it, inside `style-text`\n##\n## The last three exist because those words are rendered in two places each —\n## once alone, as `borderStyleDescription`, `backgroundColor` and `textColor`\n## report them, and once embedded in a clause. A language that inflects for\n## case needs a different form in each, and no amount of `$gender` can say\n## which is wanted. Which case a position governs is the catalog\'s business:\n## `border-clause` is a dative in German, an instrumental in Russian and\n## Polish, and nothing at all in a language that does not inflect.\n\n# The canonical color families a color value resolves to.\ncolor =\n .black = black\n .white = white\n .gray = gray\n .red = red\n .orange = orange\n .yellow = yellow\n .green = green\n .cyan = cyan\n .blue = blue\n .purple = purple\n .pink = pink\n .brown = brown\n\n# Stroke widths. Only the extremes are named — a middling width is described by\n# its color alone.\nline-width =\n .thick = thick\n .thin = thin\n\n# Dash patterns. A solid stroke is described by its color alone.\nline-style =\n .dashed = dashed\n .dotted = dotted\n\n# Patterns a shape\'s interior can be filled with. A solid fill is described by\n# its color alone.\nfill-style =\n .horizontal = horizontal lines\n .vertical = vertical lines\n .diagonal = diagonal lines\n .backdiagonal = reverse diagonal lines\n .dots = dots\n .diamonds = diamonds\n\n# The things being described. The shapes a point can be drawn as ("square",\n# "cross") are nouns too: a point\'s description names its marker shape rather\n# than always saying "point".\nnoun =\n .line = line\n .line-segment = line segment\n .ray = ray\n .vector = vector\n .curve = curve\n .function = function\n .slope-field = slope field\n .vector-field = vector field\n .parabola = parabola\n .polyline = polyline\n .polygon = polygon\n .triangle = triangle\n .rectangle = rectangle\n .circle = circle\n .region = region\n .point = point\n .square = square\n .diamond = diamond\n .cross = cross\n .plus = plus\n\n# A regular polygon names its side count, so it is a message of its own rather\n# than one of `noun`\'s attributes.\n#\n# `$part` splits the noun where a language needs it split: `head` is the word\n# the adjectives attach to, `tail` a complement that follows them. English\n# folds the side count into the head and has no tail; Spanish says "polígono\n# regular" and puts "de 5 lados" after the adjectives, so that they stay beside\n# the noun they agree with. `style-with-noun` and `style-filled-with-noun`\n# place the two halves.\n#\n# `$numSides` is a real number, so it is formatted by the locale\'s own rules —\n# a 1000-gon reads "1,000-sided" here and "de 1000 lados" in Spanish. That is\n# the number-formatting policy in the README, and the one place a description\n# is not character-for-character what the pre-catalog code produced.\nnoun-regular-polygon =\n { $part ->\n [tail] { "" }\n *[head] { $numSides }-sided regular polygon\n }\n\n# The grammatical gender of the noun being described, passed to every adjective\n# describing it so that translations can agree. English has no grammatical\n# gender, so every noun answers the same and the answer goes unused.\n#\n# `$noun` is one of `noun`\'s attribute names, `regular-polygon` for the shape\n# `noun-regular-polygon` names, or the head of a phrase the description builds\n# without naming it as a noun: `border`, `fill`, `text`, or `background`. A\n# word this message does not list falls to its default gender — which is also\n# what an author\'s own `markerStyleWord` gets, since the catalog has never seen\n# it.\nnoun-gender = neuter\n\n\n## Style composition\n##\n## `$parts` names which pieces the style actually supplies, so that a\n## translation can order and inflect each combination on its own terms instead\n## of substituting into a fixed English frame. An absent piece is a different\n## branch, never an empty placeable.\n\n# The adjectives describing a stroke: its width, its dash pattern, and its\n# color. Also describes a shape\'s border, where the color is dropped when it\n# matches the fill it surrounds.\nstyle-stroke =\n { $parts ->\n [width-style-color] { $width } { $lineStyle } { $color }\n [width-color] { $width } { $color }\n [style-color] { $lineStyle } { $color }\n [width-style] { $width } { $lineStyle }\n [width] { $width }\n [style] { $lineStyle }\n *[color] { $color }\n }\n\n# A style description followed by what it describes: "thick red line".\n#\n# `$nounTail` is the noun\'s trailing complement, for the nouns whose\n# translation splits around the adjectives (see `noun-regular-polygon`).\n# English has none today, so it only ever selects `noun` for itself — the other\n# variant is still what a partly-translated locale falls back to, and dropping\n# it would drop that locale\'s side count.\n#\n# The phrase it builds is never governed by anything, so its `$role` is always\n# `standalone`.\nstyle-with-noun =\n { $parts ->\n [noun-tail] { $description } { $noun } { $nounTail }\n *[noun] { $description } { $noun }\n }\n\n# The word marking a shape as filled.\n#\n# A key of its own, looked up by the code and handed to the messages below as\n# `$filled`, rather than literal text inside them: a language that inflects it\n# has to agree it with the shape. Referencing it from those messages would not\n# do — a term reference (`{ -filled }`) gets an empty scope and never sees\n# `$gender`, and a message reference resolves only inside its own bundle, so a\n# locale that translated `style-filled` but not this word would render the\n# reference literally instead of falling back to English.\n#\n# Said only of the shape itself, so its `$role` is always `standalone`.\nstyle-filled-word = filled\n\n# A filled shape, and the pattern its interior is drawn with, if any.\nstyle-filled =\n { $parts ->\n [pattern] { $filled } { $color } with { $pattern }\n *[plain] { $filled } { $color }\n }\n\n# The same, naming the shape: "filled blue circle with diamonds".\n#\n# The `-tail` variants carry the noun\'s trailing complement, as\n# `style-with-noun` does.\nstyle-filled-with-noun =\n { $parts ->\n [pattern] { $filled } { $color } { $noun } with { $pattern }\n [plain-tail] { $filled } { $color } { $noun } { $nounTail }\n [pattern-tail] { $filled } { $color } { $noun } { $nounTail } with { $pattern }\n *[plain] { $filled } { $color } { $noun }\n }\n\n# The border clause appended to a filled shape: "with a thick red border".\n#\n# `$parts` carries two distinctions English cares about: whether a fill pattern\n# was already mentioned, which makes this a further clause ("and") rather than\n# the first ("with"), and whether the surrounding description named the shape,\n# which is where English wants an article.\nstyle-border-clause =\n { $parts ->\n [with-article] with a { $border } border\n [and] and { $border } border\n [and-article] and a { $border } border\n *[with] with { $border } border\n }\n\n# How a shape\'s interior is filled, on its own: "blue diamonds".\nstyle-fill =\n { $parts ->\n [pattern] { $color } { $pattern }\n *[plain] { $color }\n }\n\nstyle-unfilled = unfilled\n\n# How a piece of text is styled: its color, and the background behind it.\n#\n# The only composition message with no `$role`: its two words sit in two\n# different positions, so they arrive already inflected for `text-clause` and\n# `background-clause` respectively and no one token would describe them both.\nstyle-text =\n { $parts ->\n [background] { $color } with a { $background } background\n *[plain] { $color }\n }\n\n# What `backgroundColor` answers when nothing is drawn behind the text.\nstyle-background-none = none\n\n\n## Boolean words\n##\n## What a `<boolean>` or `<booleanInput>` *displays*.\n##\n## Not what it parses or serializes. `true` and `false` are DoenetML syntax —\n## an author writes them in the source, `<award>` compares against them, and\n## saved state stores them — so they stay English everywhere, in every\n## language, exactly as `<` stays `<`. Only the word the reader sees moves.\n##\n## The consequence is that a value has two spellings in a translated document,\n## and both have to be accepted where one is read back in: see\n## `booleanFromWord` in the worker.\n\nboolean-true = true\nboolean-false = false\n\n\n## Answer buttons\n##\n## The default text on an answer\'s submit button. Only the *default* is\n## translated: an author who writes `submitLabel="Ready?"` gets "Ready?" in\n## every locale, because they chose those words for their document and a\n## translation of it is not Doenet\'s to make.\n\n# Shown when the answer will report whether the response was right.\nanswer-submit-label = Check Work\n\n# Shown when it will not — the reader submits, and is told nothing more.\nanswer-submit-label-no-correctness = Submit Response\n\n\n## Sectional blocks\n##\n## The word a sectional block calls itself, which the reader sees in its\n## heading and on a `<solution>`\'s reveal control. Keyed by the element the\n## author writes, so `<subsection>` and `<subsubsection>` share `.section` —\n## they are all called a section.\n##\n## An author who writes `renameTo` has named the block themselves, and that\n## name passes through in every language.\n\nsection-name =\n .activity = Activity\n .aside = Aside\n .cascade = Cascade\n .definition = Definition\n .example = Example\n .exercise = Exercise\n .exercises = Exercises\n .given-answer = Answer\n .note = Note\n .objectives = Objectives\n .paragraphs = Paragraphs\n .part = Part\n .problem = Problem\n .problems = Problems\n .proof = Proof\n .question = Question\n .section = Section\n .solution = Solution\n .task = Task\n .theorem = Theorem\n\n# The heading a section builds for itself: "Example 2", "Section 1.3: Limits".\n#\n# `$parts` names which pieces are present and whether a `<title>` follows, so\n# that a translation orders and punctuates each combination on its own terms\n# rather than substituting into an English frame. English puts the word first\n# and separates a title with a colon — or with a period when the heading is a\n# bare number — and none of that is a given.\n#\n# The `-title` variants end in the separator, because what follows them is the\n# title child, rendered separately. Fluent trims trailing whitespace, so the\n# separator is written as a string literal to keep its space.\n#\n# `$sectionNumber` arrives as text ("2", "1.3") rather than as a number: it is\n# an identifier made of counters, and it is not the catalog\'s to reformat.\nsection-title-prefix =\n { $parts ->\n [name] { $sectionName }\n [number] { $sectionNumber }\n [name-title] { $sectionName }{ ": " }\n [number-title] { $sectionNumber }{ ". " }\n [name-number-title] { $sectionName } { $sectionNumber }{ ": " }\n *[name-number] { $sectionName } { $sectionNumber }\n }\n\n# The heading a `<hint>` shows when the author gave it no `<title>`.\nhint-title = Hint\n\n\n## Tables and figures\n##\n## The name a `<table>` or `<figure>` gives itself, which the renderer sets in\n## bold at the head of the title or caption: "Table 2", "Figure 3". An\n## unnumbered one is named by the bare word.\n##\n## The word and the number are one message rather than a word the code\n## concatenates a number onto, so that a language which orders or punctuates\n## them differently can say so.\n##\n## `$enumeration` arrives as text rather than as a number: it identifies the\n## table, so the thousandth one is "Table 1000" and not "Table 1,000".\n##\n## The `-title` and `-caption` branches end in the separator joining the name\n## to the authored title or caption, which the renderer used to write as a\n## literal `": "` of its own. That child is arbitrary marked-up content\n## rendered after this string rather than an argument passed into it, so where\n## it sits is the one thing a translation cannot reorder — the same shape\n## `section-title-prefix` has.\n\ntable-name =\n { $parts ->\n [numbered] Table { $enumeration }\n [numbered-title] Table { $enumeration }{ ": " }\n [unnumbered-title] Table{ ": " }\n *[unnumbered] Table\n }\n\nfigure-name =\n { $parts ->\n [numbered] Figure { $enumeration }\n [numbered-caption] Figure { $enumeration }{ ": " }\n [unnumbered-caption] Figure{ ": " }\n *[unnumbered] Figure\n }\n\n\n## Paginator controls\n##\n## The strip of controls that steps through a `<paginator>`\'s pages. All three\n## words are author-overridable attributes, so only the default is translated.\n\npaginator-previous = Previous\npaginator-next = Next\npaginator-page = Page\n\n# The status between the two buttons: "Page 3 of 5".\n#\n# Composed in the worker rather than in the renderer so that the whole of it is\n# in one language: `$pageLabel` is the `pageLabel` attribute, which an author\n# may have written themselves, and the words joining it to the counts have to\n# sit beside it in the same tongue.\n#\n# The two counts arrive as text, for the same reason `$enumeration` does above.\npaginator-page-status = { $pageLabel } { $currentPage } of { $numPages }\n\n\n## Piecewise functions\n##\n## `<piecewiseFunction>` renders each branch\'s domain as mathematics and writes\n## these three words around it: "if 1 < x < 2 or 4 < x < 5", and "otherwise"\n## for the branch that catches what the others leave. The inequalities are\n## notation and stay as they are; these are prose, and are read aloud as prose.\n##\n## `or` is the only conjunction the core composes into content. Everything else\n## that reads as "a, b, and c" is a diagnostic, and those are joined by\n## `Intl.ListFormat` at the moment the reader\'s language is known rather than\n## by a catalog word (see `DiagnosticListArg`).\n\npiecewise-condition-or = or\n\n# Introduces the domain a branch applies on; the mathematics follows it.\npiecewise-condition-if = if\n\n# The last branch, which applies wherever none of the earlier ones do.\npiecewise-condition-otherwise = otherwise\n\n\n## Chemistry\n##\n## The names the chemistry components generate. Symbols (`H`, `Fe`), formulas,\n## and anything an author\'s `<award>` compares against by value stay as they\n## are; only what is displayed as prose is here.\n##\n## Element names are keyed by symbol, which is the identifier the atom database\n## is read through and is itself never translated.\n##\n## An element\'s periodic group, its phase at STP and its metal category are not\n## here. They are enumerated values an author\'s `<award>` compares against —\n## `$atom.groupName = Noble Gas` — and translating one would break that\n## comparison the moment a document declared a language (#1577).\n\nelement-name =\n .h = Hydrogen\n .he = Helium\n .li = Lithium\n .be = Beryllium\n .b = Boron\n .c = Carbon\n .n = Nitrogen\n .o = Oxygen\n .f = Fluorine\n .ne = Neon\n .na = Sodium\n .mg = Magnesium\n .al = Aluminum\n .si = Silicon\n .p = Phosphorus\n .s = Sulfur\n .cl = Chlorine\n .ar = Argon\n .k = Potassium\n .ca = Calcium\n .sc = Scandium\n .ti = Titanium\n .v = Vanadium\n .cr = Chromium\n .mn = Manganese\n .fe = Iron\n .co = Cobalt\n .ni = Nickel\n .cu = Copper\n .zn = Zinc\n .ga = Gallium\n .ge = Germanium\n .as = Arsenic\n .se = Selenium\n .br = Bromine\n .kr = Krypton\n .rb = Rubidium\n .sr = Strontium\n .y = Yttrium\n .zr = Zirconium\n .nb = Niobium\n .mo = Molybdenum\n .tc = Technetium\n .ru = Ruthenium\n .rh = Rhodium\n .pd = Palladium\n .ag = Silver\n .cd = Cadmium\n .in = Indium\n .sn = Tin\n .sb = Antimony\n .te = Tellurium\n .i = Iodine\n .xe = Xenon\n .cs = Cesium\n .ba = Barium\n .la = Lanthanum\n .ce = Cerium\n .pr = Praseodymium\n .nd = Neodymium\n .pm = Promethium\n .sm = Samarium\n .eu = Europium\n .gd = Gadolinium\n .tb = Terbium\n .dy = Dysprosium\n .ho = Holmium\n .er = Erbium\n .tm = Thulium\n .yb = Ytterbium\n .lu = Lutetium\n .hf = Hafnium\n .ta = Tantalum\n .w = Tungsten\n .re = Rhenium\n .os = Osmium\n .ir = Iridium\n .pt = Platinum\n .au = Gold\n .hg = Mercury\n .tl = Thallium\n .pb = Lead\n .bi = Bismuth\n .po = Polonium\n .at = Astatine\n .rn = Radon\n .fr = Francium\n .ra = Radium\n .ac = Actinium\n .th = Thorium\n .pa = Protactinium\n .u = Uranium\n .np = Neptunium\n .pu = Plutonium\n .am = Americium\n .cm = Curium\n .bk = Berkelium\n .cf = Californium\n .es = Einsteinium\n .fm = Fermium\n .md = Mendelevium\n .no = Nobelium\n .lr = Lawrencium\n .rf = Rutherfordium\n .db = Dubnium\n .sg = Seaborgium\n .bh = Bohrium\n .hs = Hassium\n .mt = Meitnerium\n .ds = Darmstadtium\n .rg = Roentgenium\n .cn = Copernicium\n .nh = Nihonium\n .fl = Flerovium\n .mc = Moscovium\n .lv = Livermorium\n .ts = Tennessine\n .og = Oganesson\n\n# The name an anion takes, for the elements that have one.\n#\n# English derives these — strip a trailing "ine", add "ide", with a small table\n# for the words that rule does not fit — but that is English morphology, not a\n# fact about anions. So each language supplies the names it uses. An element\n# with no entry here is called by its own name, which is also what the English\n# rule does for everything it does not match.\nelement-anion-name =\n .h = Hydride\n .c = Carbide\n .n = Nitride\n .o = Oxide\n .f = Fluoride\n .p = Phosphide\n .s = Sulfide\n .cl = Chloride\n .br = Bromide\n .i = Iodide\n .at = Astatide\n .ts = Tennesside\n\n# A transition metal\'s ion, named with its oxidation state: "Iron (II)".\n#\n# The Roman numeral is IUPAC notation and is the same in every language. Where\n# it sits and how it is punctuated is not, which is why this is a message and\n# not a suffix the code appends.\nion-name-oxidation-state = { $name } ({ $numeral })\n\n# Shown in place of a chemical symbol or formula that names nothing. Rendered\n# into mathematics as well as into text, so the brackets around it are added by\n# the code — inside `\\text{}` for the LaTeX form — and are not part of the\n# message.\nchemistry-invalid-symbol = Invalid Chemical Symbol\nchemistry-invalid-ionic-compound = Invalid Ionic Compound\n\n## Inputs embedded in math\n\n# Names the gap an input fills when it is drawn inside a typeset expression, so\n# that a screen reader reads "x equals blank plus 3" rather than skipping over\n# it. Written into the mathematics itself and never shown on screen, so keep it\n# to a word or two.\nmath-embedded-input-blank = blank\n\n# The same, when one expression has more than one gap, so that a reader can tell\n# which one they have reached.\nmath-embedded-input-blank-ordinal = blank { $ordinal } of { $total }\n';
38635
- const diagnostics = '# Errors and warnings surfaced to the reader or author. Produced by the worker\n# but addressed to whoever is looking at the screen, so these are selected by\n# `uiLocale`, not `documentLocale`.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`invalid-attribute-value`).\n#\n# Reached by stable diagnostic code rather than by a literal `t("key")` call:\n# `DIAGNOSTIC_CODES` in `src/diagnostics.ts` maps `doenet-w0001` to the id\n# below, and `lint:i18n` treats that registry as the call site. Adding a\n# message here without registering a code for it fails the lint as an orphan.\n#\n# Translators: `through`, `endpoint`, `midpointOffset`, `numDimensions` and the\n# like are DoenetML attribute names. They are part of the language, not prose,\n# and must be left in English exactly as written.\n\n## `<lineSegment>`\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoints =\n { $attributesCount ->\n [one] { $attributes } is ignored when two endpoints are specified\n *[other] { $attributes } are ignored when two endpoints are specified\n }\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoint-and-midpoint =\n { $attributesCount ->\n [one] { $attributes } is ignored when an endpoint and a midpoint are both specified\n *[other] { $attributes } are ignored when an endpoint and a midpoint are both specified\n }\n\nline-segment-midpoint-offset-without-midpoint = midpointOffset has no effect without a midpoint\n\n## `<line>`\n\nline-points-undetermined-dimensions = Line through points of undetermined dimensions.\n\nline-points-too-few-dimensions = Line must be through points of at least two dimensions.\n\n# $variables is a bare enumeration of variable names, not an "and" list.\nline-points-depend-on-variables = Line is through points that depend on variables: { $variables }.\n\nline-equation-invalid-format = Invalid format for equation of line in variables { $variable1 } and { $variable2 }.\n\n## `<ray>`\n\nray-overprescribed-through = Ray is prescribed by through, endpoint, and direction. Ignoring specified through.\n\nray-dimension-mismatch = numDimensions mismatch in ray.\n\n## `<vector>`\n\nvector-overprescribed-head = Vector is prescribed by head, tail, and displacement. Ignoring specified head.\n\nvector-dimension-mismatch = numDimensions mismatch in vector.\n\n## Attracting and constraining\n\n# $component is the DoenetML tag of the child that was named, e.g. "polygon".\nattract-to-without-nearest-point = Cannot attract to a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\nconstrain-to-without-nearest-point = Cannot constrain to a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\nconstrain-to-interior-without-nearest-point = Cannot constrain to interior of a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\n## `<choiceInput>`\n\n# Translators: `labelPosition` is an attribute name and stays in English.\nchoice-input-label-position-ignored = labelPosition is ignored for non-inline choiceInput\n\n## Ordering children by index\n##\n## These name the component in prose rather than as a tag, matching how the\n## messages have always read. The component names stay in English; the nouns\n## around them are prose and should be translated.\n\nchoice-input-indices-count-mismatch = Ignoring indices specified for choiceInput as number of indices doesn\'t match number of choice children.\n\npretzel-indices-count-mismatch = Ignoring indices specified for problem as number of indices doesn\'t match number of problem children.\n\nshuffle-indices-count-mismatch = Ignoring indices specified for shuffle as number of indices doesn\'t match number of components.\n\n# $component is `choiceInput`, `pretzel` or `shuffle` — a DoenetML component\n# name, so it stays in English.\nindices-ignored-out-of-range = Ignoring indices specified for { $component } as some indices out of range.\n\npretzel-indices-repeated = Ignoring indices specified for pretzel as some indices are repeated.\n\npretzel-circuit-first-index = Ignoring indices specified for pretzel in circuit mode as the first index must be 1.\n\n## `<shuffle>` and `<sort>`\n\n# $component is `shuffle` or `sort`. These two components accept the same\n# children and fail the same ways, so they share their messages.\nstring-children-need-type = For `<{ $component }>` to work with string children, a `type` attribute must be specified.\n\n# $type is what the author wrote; math, text, number and boolean are attribute\n# values and stay in English.\ninvalid-type-defaulting-to-math = Invalid type { $type } for { $component } component. Must be one of math, text, number, or boolean. Defaulting to math.\n\n# $value is the string child that could not be used.\nstring-not-valid-component-to-arrange = String "{ $value }" is not a valid component to { $component }. Ignoring.\n\n## Types and variables\n\ninvalid-type-defaulting-to-number = Invalid type { $type }, setting type to number.\n\ninvalid-variable-value = Invalid value of a variable: `{ $value }`\n\n## Variants\n\n# $index is what the author wrote, reproduced verbatim rather than as a number:\n# it reached this message precisely because it was not one.\nvariant-index-must-be-number = Variant index { $index } must be a number\n\nvariant-index-must-be-integer = Variant index { $index } must be an integer\n\n## `<sideBySide>`\n\n# $component is `sideBySide` or `sbsGroup`.\nside-by-side-absolute-widths = `<{ $component }>` is not implemented for absolute measurements. Setting widths to relative.\n\nside-by-side-absolute-margins = `<{ $component }>` is not implemented for absolute measurements. Setting margins to relative.\n\nside-by-side-no-block-child = Invalid `<{ $component }>`: it must have at least one block child.\n\n## `<label>`\n\n# Translators: `for` is an attribute name and stays in English.\nlabel-for-ignored-on-graphical = The `for` attribute on graphical `<label>` is ignored.\n\nlabel-for-must-resolve-to-one = The `for` attribute on `<label>` must resolve to exactly one component.\n\nlabel-for-unresolved = The `for` attribute on `<label>` could not be resolved to a component.\n\nlabel-for-answer-with-authored-inputs = The `for` attribute on `<label>` references an `<answer>` with explicitly authored inputs; reference the input directly.\n\nlabel-for-answer-without-input = The `for` attribute on `<label>` references an `<answer>` without an input to label.\n\nlabel-for-must-reference-input-or-answer = The `for` attribute on `<label>` must reference an input or an answer.\n\n## Accessibility\n\n# $component is a DoenetML tag, e.g. "graph" or "image".\naccessibility-short-description-or-decorative = For accessibility, `<{ $component }>` must either have a short description or be specified as decorative.\n\naccessibility-video-short-description = For accessibility, `<video>` must have a short description.\n\naccessibility-input-short-description-or-label = For accessibility, `<{ $component }>` must have a short description or a label.\n\n# The companion to the message above, for the input an `<answer>` creates on the\n# author\'s behalf. Two messages rather than one with the subject passed in: the\n# subject is a phrase here, not a name, and a phrase handed over as an argument\n# would never reach a translator.\naccessibility-answer-input-short-description-or-label = For accessibility, an `<answer>` creating an input must have a short description or a label.\n\naccessibility-short-description-contains-math = Short descriptions should not contain math components such as `<{ $component }>`. Spell out any math with words.\n\n# $colorName is an attribute name and stays in English. $ratio and $threshold\n# are contrast ratios; $mode says which theme the shortfall was measured in,\n# and is `dark` or `light`.\naccessibility-section-title-insufficient-contrast =\n { $mode ->\n [dark] { $colorName } has insufficient contrast for the section heading text (dark mode) ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n *[other] { $colorName } has insufficient contrast for the section heading text ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n }\n\n## `<circle>`\n\n# $count is the number of through points.\ncircle-through-points-non-numerical = Haven\'t implemented `<circle>` through { $count } points in case where the points don\'t have numerical values.\n\ncircle-too-many-through-points = Cannot calculate circle through more than 3 points.\n\ncircle-overprescribed-radius-center-points = Cannot calculate circle with specified radius, center and through points.\n\ncircle-center-with-multiple-points = Cannot calculate circle with specified center through more than 1 point.\n\n# $distance and $radius arrive as strings, not numbers: $radius is the author\'s\n# own value echoed back for diagnosis, and formatting it as a quantity would\n# round a radius of 0.0001 away to 0.\ncircle-radius-too-small = Cannot calculate circle: given that the distance between the two points is { $distance }, the specified radius { $radius } is too small.\n\ncircle-radius-with-many-points = Cannot create circle through more than two points with a specified radius.\n\ncircle-invalid-center-or-through-points = Invalid center or through points of circle.\n\ncircle-radius-center-with-multiple-points = Cannot calculate radius of circle with specified center through more than 1 point.\n\ncircle-change-radius-non-numerical = Cannot change radius of circle with non-numerical through points\n\ncircle-radius-with-points-non-numerical = Cannot create circle through more than one point with specified radius when don\'t have numerical values.\n\ncircle-change-center-non-numerical = Haven\'t implemented changing center of circle through points with non numerical values.\n\n## `<function>`\n\n# Two independent counts in one sentence, so the variants multiply out. A\n# select\'s variants each need their own line, so the inner one spans lines too;\n# that is safe because newlines inside a placeable never reach the rendered\n# value. Only text continuing onto a further line would.\nfunction-domain-insufficient-dimensions =\n { $intervals ->\n [one] Insufficient dimensions for domain for function. Domain has { $intervals } interval but the function has { $inputs ->\n [one] { $inputs } input\n *[other] { $inputs } inputs\n }.\n *[other] Insufficient dimensions for domain for function. Domain has { $intervals } intervals but the function has { $inputs ->\n [one] { $inputs } input\n *[other] { $inputs } inputs\n }.\n }\n\nfunction-domain-invalid-format = Invalid format for domain for function.\n\n# $type is what was being read off the point. It selects the wording rather\n# than being substituted into it: "maximum", "slope" and the rest are English\n# nouns, and a noun handed over as an argument would never reach a translator.\n# The catch-all reproduces the pre-catalog behavior for a value not listed here.\nfunction-ignoring-non-numerical =\n { $type ->\n [maximum] Ignoring non-numerical maximum of function.\n [minimum] Ignoring non-numerical minimum of function.\n [extremum] Ignoring non-numerical extremum of function.\n [point] Ignoring non-numerical point of function.\n [slope] Ignoring non-numerical slope of function.\n *[other] Ignoring non-numerical { $type } of function.\n }\n\nfunction-ignoring-empty =\n { $type ->\n [maximum] Ignoring empty maximum of function.\n [minimum] Ignoring empty minimum of function.\n [extremum] Ignoring empty extremum of function.\n [point] Ignoring empty point of function.\n *[other] Ignoring empty { $type } of function.\n }\n\nfunction-points-too-close = Function contains two points with locations too close together. Can\'t define function.\n\nfunction-iterates-input-output-mismatch =\n { $inputs ->\n [one] Function iterates are possible only if the number of inputs of the function is equal to the number of outputs. This function has { $inputs } input and { $outputs ->\n [one] { $outputs } output\n *[other] { $outputs } outputs\n }.\n *[other] Function iterates are possible only if the number of inputs of the function is equal to the number of outputs. This function has { $inputs } inputs and { $outputs ->\n [one] { $outputs } output\n *[other] { $outputs } outputs\n }.\n }\n\n## `<sequence>`\n\nsequence-invalid-length = Invalid length of sequence. Must be a non-negative integer.\n\n# $type is a sequence type: number, letters, or math.\nsequence-invalid-step = Invalid step of sequence. Must be a number for sequence of type { $type }.\n\n# $attribute is `from` or `to` — an attribute name, so it stays in English.\nsequence-invalid-endpoint-number = Invalid "{ $attribute }" of number sequence. Must be a number.\n\nsequence-invalid-endpoint-letters = Invalid "{ $attribute }" of letters sequence. Must be a letter combination.\n\nsequence-invalid-endpoint = Invalid "{ $attribute }" of sequence.\n\nselect-from-sequence-coprime-not-numbers = coprime ignored since not selecting numbers\n\nselect-from-sequence-coprime-with-exclude-combinations = coprime ignored since excludeCombinations specified\n\n## Resolving a `target`\n##\n## Raised by the components that take a `target` attribute. They resolve it\n## through the same code and fail the same two ways, so they share these two\n## messages rather than spelling each one out per component: $source is the tag\n## of the component that raised it, part of the DoenetML language, so it stays\n## in English.\n\ntarget-not-found = Invalid target for `<{ $source }>`: cannot find target.\n\n# $property is the state variable that was looked for; $component is the tag it\n# was looked for on.\ntarget-state-variable-not-found = Invalid target for `<{ $source }>`: cannot find a state variable named "{ $property }" on a `<{ $component }>`.\n\n## `<odeSystem>`\n\node-system-variables-match-independent = Variables of `<odeSystem>` must be different than independent variable.\n\node-system-duplicate-variable-names = Can\'t define ODE RHS functions with duplicate dependent variable names.\n\node-system-rhs-function-error = Cannot define ODE RHS function. Error creating mathjs function.\n\n## `<angle>`, `<parabola>`, and `<intersection>`\n\n# $count is how many line children were found.\nangle-too-many-lines = Cannot define an angle between { $count } lines\n\nangle-invalid-through-point = Invalid point in through of `<angle>`\n\nparabola-vertex-too-many-points = Haven\'t implemented parabola with vertex through more than 1 point.\n\nparabola-too-many-points = Haven\'t implemented parabola through more than 3 points.\n\nintersection-too-many-items = Haven\'t implemented intersection for more than two items\n\n## Other math components\n\nionic-compound-not-two-ions = Have not implemented ionic compound for anything other than two ions.\n\nionic-compound-needs-cation-and-anion = Ionic compound implemented only for one cation and one anion.\n\n# $equation is the equation as the author wrote it.\nsolve-equations-cannot-evaluate = Cannot solve equation as could not evaluate equation: { $equation }\n\n# Translators: `operandNumber` is an attribute name and stays in English.\nmath-operators-operand-number-required = Must specify a operandNumber when extracting a math operand.\n\neigen-decomposition-failed = Could not calculate eigenvalues of matrix\n\n## `<matchesPattern>`\n\n# Translators: `parameters` is an attribute name and stays in English.\n# $parameters lists the parameters as the author wrote them;\n# $parametersCount is how many there were.\nmatches-pattern-parameter-not-in-pattern =\n { $parametersCount ->\n [one] `<matchesPattern>`: the parameter { $parameters } does not occur in the pattern, so it will always match a blank.\n *[other] `<matchesPattern>`: the parameters { $parameters } do not occur in the pattern, so they will always match a blank.\n }\n\n## `<graph>`\n\n# Translators: grid is an attribute name and none, medium and dense are its\n# values; all four stay in English, as does the example. $grid is the value the\n# author wrote, reproduced verbatim — it reached this message precisely because\n# it was not one of the forms listed.\ngraph-grid-invalid = `<graph>`: cannot interpret grid="{ $grid }". It must be none, medium, dense, or two positive numbers separated by a space, such as grid="1 0.5". No grid is drawn.\n\n## `<slopeField>` and `<vectorField>`\n\n# $component is the field\'s tag and $alternative the sibling field component\'s,\n# or `none` when the function would not suit it either; both are DoenetML tags\n# and stay in English, as do the example expressions. $expected is how many\n# outputs the component needs, $found how many the given function has. What a\n# field draws a mark from is the function\'s outputs, so the wrong number of\n# them means there is nothing to draw — and the author almost always wanted the\n# other component.\nfield-function-wrong-num-outputs =\n `<{ $component }>` needs a function with { $expected ->\n [one] one output, the slope y\' at each point, such as `y - x`\n *[other] two outputs, the vector at each point, such as `(y, -x)`\n }, but the function it was given has { $found ->\n [one] { $found } output\n *[other] { $found } outputs\n }. { $alternative ->\n [none] Nothing is drawn.\n *[other] `<{ $alternative }>` is the component for that function. Nothing is drawn.\n }\n\n# Translators: retired. `function` is an attribute name and stays in English.\n# It warned that a field had been given its function both as an attribute and\n# inside the component; the attribute no longer exists, so the two can no\n# longer disagree. Kept because diagnostic codes are never reused.\nfield-function-attribute-ignored-with-child = The `function` attribute is ignored because the function is also given inside the component; the one inside is used. Give the function only one of the two ways.\n\n# Translators: `variables` and `function` are a DoenetML attribute and tag and\n# stay in English, as does $component, the field\'s own tag. The attribute names\n# the inputs of an expression written directly inside the component; when there\n# is no such expression there is nothing for it to name, and $reason says which\n# of the two ways that happened.\nfield-variables-ignored =\n `<{ $component }>`: the `variables` attribute names the variables of an expression written directly inside the component. { $reason ->\n [function-child] The function here is given as a `<function>` child, which names its own variables, so `variables` is ignored.\n *[no-expression] No such expression is given here, so `variables` is ignored.\n }\n\n## PreFigure renderer\n\n# Translators: xLabelPosition, yLabelPosition and their values are attribute\n# names and stay in English, as does the renderer\'s name.\nprefigure-x-label-position-unsupported = `<graph>`: xLabelPosition="left" is not supported in prefigure renderer; using right-position behavior.\n\nprefigure-y-label-position-unsupported = `<graph>`: yLabelPosition="bottom" is not supported in prefigure renderer; using top-position behavior.\n\nprefigure-invalid-axis-bounds = `<graph>`: invalid axis bounds for prefigure conversion; using default bbox (-10,-10,10,10).\n\nprefigure-invalid-width = `<graph>`: invalid width for prefigure conversion; using default diagram width 425.\n\nprefigure-invalid-aspect-ratio = `<graph>`: invalid aspectRatio for prefigure conversion; using default aspect ratio 1.\n\n# Translators: the renderer\'s name, prefigure, stays in English. "grid" here is\n# the coordinate grid itself rather than the attribute that asks for one, so it\n# is prose and is translated.\nprefigure-grid-spacing-too-fine = `<graph>`: the grid spacing is too fine for the axis limits; the grid is omitted in the prefigure renderer.\n\nprefigure-annotations-not-rendered = `<graph>`: annotations will not be rendered when not using the PreFigure renderer.\n\nmultiple-annotations-children = Multiple `<annotations>` children found in `<graph>`; all but the last one are ignored.\n\n## Referring to other components\n##\n## `<updateValue>`\'s own "cannot find target" messages are not here: it\n## resolves a target the same way `<animateFromSequence>` does and fails the\n## same ways, so the two share `target-not-found` and\n## `target-state-variable-not-found` above.\n\ncopy-unrecognized-component-type = Cannot extend or copy an unrecognized component type: { $type }.\n\ncopy-prop-not-found = Could not find prop { $property } on a component of type { $component }\n\ncollect-no-source = No source found for collect.\n\ncollect-invalid-component-type = Cannot collect components of type `<{ $component }>` as it is an invalid component type.\n\n# $reference is the reference exactly as the author wrote it, `$` and all —\n# the `$p.styleDescription[1]` of `<text extend="$p.styleDescription[1]" />`.\n# An index only means something applied to an array, and the thing named here\n# is not one. The reference is quoted back rather than explained because the\n# text in front of the author is the only part of this they can act on: the\n# state variable and component index the core knows about are its own business\n# and go to the console instead.\nreference-index-unavailable = Cannot reference index `{ $reference }`\n\n## `<callAction>`\n\n# $action is the `actionName` the author asked for, part of the DoenetML\n# language, so it stays in English. $reference is the `target` as written.\ncomponent-action-unavailable = Cannot call { $action } on component `{ $reference }`\n\n## `<dataFrame>`\n\n# $componentIdx is an internal index, passed as a string so it is not grouped\n# like a quantity; the odd spacing before the colon is reproduced from the\n# original message.\ndata-frame-inconsistent-row-lengths = Data has invalid shape. Rows has inconsistent lengths. Found in componentIdx :{ $componentIdx }\n\ndata-frame-duplicate-column-names = Data has duplicate column names. Found in componentIdx :{ $componentIdx }\n\ndata-frame-missing-column-name = Data is missing a column name. Found in componentIdx :{ $componentIdx }\n\n## `<answer>` and scoring\n\nanswer-award-depends-on-own-response = An award for this answer is based on the answer tag\'s own submitted response, which will lead to unexpected behavior.\n\n# Translators: maxNumAttempts and sectionWideCheckWork are attribute names.\nanswer-max-num-attempts-in-section-wide-check-work = Setting `maxNumAttempts` on an `<answer>` inside a container with `sectionWideCheckWork` has no effect, as the number of attempts is controlled by the container. Set `maxNumAttempts` on the container instead.\n\nnested-section-wide-check-work-max-num-attempts = Setting `maxNumAttempts` on a container with `sectionWideCheckWork` that is inside another container with `sectionWideCheckWork` has no effect, as the number of attempts is controlled by the outer container. Set `maxNumAttempts` on the outer container instead.\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nanswer-attributes-need-symbolic-equality =\n { $attributesCount ->\n [one] The { $attributes } attribute will have no effect without symbolicEquality set.\n *[other] The { $attributes } attributes will have no effect without symbolicEquality set.\n }\n\nanswer-invalid-type = Invalid type for answer: { $type }\n\n## `<module>`, `<conditionalContent>`, `<slider>`, `<pretzel>`\n\nmodule-attribute-child-needs-name = Since the component `<{ $component }>` does not have a name, it cannot be used for a module attribute\n\nmodule-attribute-name-already-defined = The component `<{ $component } name="{ $name }">` cannot be used as an attribute for a module because the `<module>` component type already has a "{ $name }" attribute defined.\n\nconditional-content-condition-ignored = Attribute `condition` is ignored on a `<conditionalContent>` component with case or else children.\n\nslider-markers-type-mismatch = Markers type doesn\'t match slider type.\n\npretzel-problem-needs-statement-and-answer = Invalid pretzel: each `<problem>` must contain one `<statement>` and one `<answer>`.\n\npretzel-circuit-first-problem-distractor = Invalid pretzel: in mode="circuit", the first `<problem>` cannot be a distractor.\n\n## Attribute values\n\n# $values is a list of the values that were rejected, each already in\n# backticks; $valuesCount is how many there were.\nattribute-invalid-values =\n { $valuesCount ->\n [one] Invalid value { $values } for attribute `{ $attribute }`; ignoring.\n *[other] Invalid values { $values } for attribute `{ $attribute }`; ignoring.\n }\n\nattribute-must-be-references = Invalid value `{ $value }` for attribute `{ $attribute }`. Attribute must be composed of references that begin with a `$`.\n\n# $names is a list of the rejected names, each already in single quotes.\nmath-input-invalid-function-names = <mathInput>: ignored invalid function name(s) in { $attribute }: { $names }. Each name\'s display segment must be at least 2 characters (letters or dashes); an optional `|<mathspeak alternative>` suffix may follow.\n\n## Building components from the source\n\n# Raised while the source is being turned into components, by throwing rather\n# than by building a record: the thrower is caught, the component becomes an\n# `_error`, and the diagnostic is re-raised from it.\n\ncomponent-type-invalid = Invalid component type: `<{ $componentType }>`\n\nattribute-repeated = Cannot repeat attribute { $attribute }.\n\nattribute-invalid-for-component = Invalid attribute "{ $attribute }" for a component of type `<{ $componentType }>`.\n\n## Style definition contrast\n\n# $context names the pair being compared, $mode which colour scheme it was\n# rendered in. Both are symbolic — the phrase is chosen here so a translator\n# can rewrite it, rather than being handed over already in English.\nstyle-definition-insufficient-contrast =\n Style definition { $styleNumber } has insufficient contrast for { $context ->\n [text-on-background] text color against background color\n [high-contrast] high-contrast color against the canvas\n [line] line color against the canvas\n [marker] marker color against the canvas\n *[text-on-canvas] text color against the canvas\n }{ $mode ->\n [dark] { " (dark mode)" }\n *[light] { "" }\n } ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n\n# $suggestion says whether a concrete replacement colour could be computed.\n# The attribute names and colour values in the `available` branch are\n# DoenetML source, not prose, and stay as they are in every language.\nstyle-definition-dark-mode-text-background-contrast =\n Although style definition { $styleNumber } has specified colors that provide sufficient contrast for light mode, the dark-mode colors derived from these values have insufficient contrast for the text color against the background color ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1). { $suggestion ->\n [available] To ensure sufficient contrast in dark mode, either increase the light-mode contrast (e.g., set { $lightAttribute }="{ $lightColor }") or override the dark-mode color (e.g., set { $darkAttribute }="{ $darkColor }").\n *[none] To ensure sufficient contrast in dark mode, increase the light-mode contrast or override the derived colors with textColorDarkMode and/or backgroundColorDarkMode.\n }\n\nstyle-definition-dark-mode-text-canvas-contrast =\n Although style definition { $styleNumber } has a specified text color that provides sufficient contrast for light mode, the dark-mode text color derived from this value has insufficient contrast against the canvas ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1). { $suggestion ->\n [available] To ensure sufficient contrast in dark mode, either increase the light-mode contrast (e.g., set textColor="{ $lightColor }") or override the dark-mode color (e.g., set textColorDarkMode="{ $darkColor }").\n *[none] To ensure sufficient contrast in dark mode, increase the light-mode contrast or override the derived color with textColorDarkMode.\n }\n\nsection-multiple-style-palettes = A section can select only one <stylePalette>; using the last one.\n\n## Unique variants\n\n# Explanations of why a component\'s unique variants could not be worked out.\n# $component is the tag that could not be analyzed and stays as written; the\n# reason is a separate message per situation, so a host can tell them apart by\n# code and a translator sees a whole sentence rather than a fragment.\n\nvariant-num-to-select-not-non-negative-integer = cannot determine unique variants of { $component } as numToSelect isn\'t a non-negative integer.\n\nvariant-num-to-select-not-constant-number = cannot determine unique variants of { $component } as numToSelect isn\'t constant number.\n\nvariant-with-replacement-not-constant-boolean = cannot determine unique variants of { $component } as withReplacement isn\'t constant boolean.\n\nvariant-select-weight-disables-unique = Unique variants for select disabled if have an option with selectWeight or selectForVariants specified\n\nvariant-coprime-undetermined = cannot determine unique variants of { $component } as cannot determine coprime is always false.\n\n# $attribute is an attribute name (`from`, `to`, `step`, `sort`, `length`) and\n# stays as written.\nvariant-attribute-not-constant = cannot determine unique variants of { $component } as { $attribute } isn\'t a constant.\n\nvariant-attribute-not-number = cannot determine unique variants of { $component } as { $attribute } isn\'t a number.\n\n# $type is the sequence type the component was declared with. $expected names\n# what the value had to be, symbolically, because which one applies depends on\n# both the type and the attribute.\nvariant-attribute-wrong-type-for-sequence =\n cannot determine unique variants of { $component } of { $type } type as { $attribute } isn\'t { $expected ->\n [letters-combination] a combination of letters\n [math-expression] a valid math expression\n [integer] an integer\n *[number] a number\n }.\n\nvariant-length-not-integer = cannot determine unique variants of { $component } as length isn\'t an integer.\n\nvariant-sort-not-implemented = have not implemented unique variants of a { $component } with sort\n\nvariant-exclude-combinations-not-implemented = have not implemented unique variants of a { $component } with excludeCombinations\n\nvariant-math-exclude-not-implemented = have not implemented unique variants of a { $component } of type math with exclude\n\nvariant-non-constant-exclude-not-implemented = have not implemented unique variants of a { $component } with non-constant exclude\n\n## PreFigure conversion\n\n# $subject identifies the component the warning is about, already written as\n# `<tag>` or `<tag> (name)`. It is composed in code rather than here because\n# Fluent terms cannot take a variable as an argument, so a shared subject\n# fragment cannot be parameterized from the catalog. It holds only a tag name,\n# a component name and punctuation — never a word — which is why a descendant\n# with no type reads `<?>` rather than `<unknown>`.\n\nprefigure-descendant-unsupported = { $subject }: unsupported in graph prefigure renderer; descendant skipped.\n\nprefigure-descendant-invalid-geometry = { $subject }: non-finite or incomplete geometry; descendant skipped.\n\nprefigure-curve-label-omitted = { $subject }: labels are not supported on converted curve elements; label omitted.\n\nprefigure-curve-unsupported-definition-type = { $subject }: unsupported curve function definition type \'{ $definitionType }\'; descendant skipped.\n\nprefigure-region-flip-functions-unsupported = { $subject }: unsupported flipFunctions attribute on regionBetweenCurves; descendant skipped.\n\nprefigure-region-non-formula-child = { $subject }: only formula-typed child functions are supported on regionBetweenCurves; descendant skipped.\n\n# $labelKind says which family of object carried the label, since the advice\n# is the same but the object is not.\nprefigure-label-position-unsupported =\n { $subject }: unsupported labelPosition \'{ $labelPosition }\' for { $labelKind ->\n [line-family] line-family label\n *[point] point label\n }; default PreFigure alignment used.\n\nprefigure-fill-style-unsupported = { $subject }: fill style \'{ $fillStyle }\' is unsupported by PreFigure; falling back to a solid fill.\n\nprefigure-line-style-unknown = { $subject }: unknown line style \'{ $lineStyle }\' omitted from PreFigure output.\n\nprefigure-marker-style-mapped-to-diamond = { $subject }: marker style \'{ $markerStyle }\' mapped to PreFigure style \'diamond\'.\n\nprefigure-marker-style-unsupported = { $subject }: marker style \'{ $markerStyle }\' is unsupported by PreFigure; default style used.\n\n## PreFigure annotations\n\nannotation-ref-unresolvable = `<annotation>`: invalid `ref`; cannot resolve target. Annotation omitted.\n\nannotation-ref-multiple-targets = `<annotation>`: `ref` resolved to multiple targets; using the first target.\n\nannotation-ref-outside-graph = `<annotation>`: invalid `ref`; target is outside the containing graph. Annotation omitted.\n\nannotation-ref-unsupported-target = `<annotation>`: invalid `ref`; target is not a supported graphical object in prefigure conversion. Annotation omitted.\n\nannotation-text-missing = `<annotation>`: missing or empty `text`; emitting empty text.\n\n## Composites and references\n\n# $componentType is the type the composite was asked to create, when it is\n# known; `none` when the composite did not say.\ncomposite-circular-dependency =\n { $componentType ->\n [none] Circular dependency detected.\n *[other] Circular dependency detected involving `<{ $componentType }>` component.\n }\n\n# $reference is the reference as the author wrote it, already carrying its `$`.\nreference-no-referent = No referent found for reference: `{ $reference }`\n\nreference-multiple-referents = Multiple referents found for reference: `{ $reference }`\n\n## Children that do not match\n\nchildren-invalid-attribute-format = Invalid format for attribute { $attribute } of `<{ $componentType }>`.\n\n# $children is the list of child types that did not match, already joined.\nchildren-invalid = Invalid children for `<{ $componentType }>`: Found invalid children: { $children }\n\n## Falling back to a default\n\nattribute-value-invalid-using-default = Invalid value `{ $value }` for attribute `{ $attribute }`, using value `{ $default }`\n\n## Loading a DoenetML version\n\n# $fallback is the version that will be used instead, or `none` when the\n# embedding page named a standalone bundle of its own.\ndoenetml-version-not-found =\n { $fallback ->\n [none] DoenetML version { $version } not found.\n *[other] DoenetML version { $version } not found. Falling back to version { $fallback }\n }\n\n## Reading the DoenetML\n\n# The parser\'s own diagnostics: what the author sees before anything runs, and\n# for a beginner usually the first Doenet message they ever read.\n#\n# The parser writes its English beside the code rather than rendering it from\n# here, because `@doenet/parser` is inside the language-server bundle and a\n# catalog there is dead weight on the editor\'s critical path\n# (`packages/lsp/scripts/check-server-bundle.mjs` fails if one arrives). The\n# two copies are held together by a test in that package, which parses a\n# corpus and asserts every coded error renders to exactly what the parser\n# wrote — so a message edited here without its counterpart fails there.\n#\n# $tag, $value, $attribute and their relatives quote the author\'s own source\n# back at them and stay exactly as written. The `Invalid DoenetML: ` opening is\n# repeated in each message instead of being a shared term: a term a locale\n# forgets to define renders as its own name, and a prefix on fifteen messages\n# is not worth that failure mode.\n\nparse-invalid-doenetml = Invalid DoenetML: { $content }\n\nparse-tag-missing-close-tag = Invalid DoenetML: The tag `{ $tag }` has no closing tag. Expected a self-closing tag or a `</{ $tagName }>` tag.\n\nparse-tag-error = Invalid DoenetML: Error in tag `<{ $tagName }>`\n\nparse-attribute-missing-value = Invalid DoenetML: Invalid attribute `{ $attribute }` appears to be missing a value.\n\nparse-attribute-invalid = Invalid DoenetML: Invalid attribute `{ $attribute }`\n\nparse-attribute-value-invalid = Invalid DoenetML: Invalid attribute value `{ $value }`\n\n# $quote is the quote character that would balance the pair: `"` or `\'`.\nparse-attribute-value-quote-mismatch = Invalid DoenetML: Invalid attribute value `{ $value }`. The quote marks do not match. You appear to be missing a `{ $quote }`\n\nparse-open-tag-name-missing = Invalid DoenetML: Found a tag without a tag name, e.g. `<`\n\nparse-tag-not-closed = Invalid DoenetML: Tag `{ $tag }` was not closed (a `>` appears to be missing).\n\nparse-self-closing-tag-name-missing = Invalid DoenetML: Found a tag without a tag name `<{ $content }>`\n\nparse-self-closing-tag-not-closed = Invalid DoenetML: Tag `{ $tag }` was not closed (`/>` appears to be missing).\n\nparse-tag-invalid-attributes = Invalid DoenetML: Tag `{ $tag }` is not valid. It may have incorrect attributes.\n\nparse-close-tag-name-missing = Invalid DoenetML: Found a closing tag without a tag name, e.g. `</`\n\n# $attribute is the attribute name and $value the unquoted token that followed\n# it, shown reassembled the way the author should have written it.\nparse-attribute-value-unquoted = Attribute values must be enclosed in quotes: `{ $attribute }="{ $value }"`\n\nparse-close-tag-without-open-tag = Invalid DoenetML: Found closing tag `{ $tag }`, but no corresponding opening tag\n\nparse-close-tag-mismatched = Invalid DoenetML: Mismatched closing tag. Expected `</{ $expected }>`. Found `{ $found }`\n\n# The conversion\'s fall-through: the syntax tree held a node shape it has no\n# case for. Reaching an author means the grammar and the conversion have gone\n# out of step, which is a bug in Doenet rather than in their document — hence\n# `parser-` rather than the `parse-` of every message above, which is about\n# what the author wrote. They are still the one looking at it, so it is\n# translated like any other error. $node is the node\'s own name and stays as\n# it is.\nparser-node-unconvertible = Could not convert node { $node } to Dast node.\n\n## Names\n\n# $reason says which rule the name broke, as a key rather than a phrase, so the\n# whole sentence is translatable rather than assembled from two halves.\nname-attribute-invalid =\n Invalid attribute name=\'{ $name }\'. { $reason ->\n [characters] Names can contain only letters, numbers, underscores or hyphens.\n *[start] Names must start with a letter.\n }\n\ncomponent-name-invalid-start = Invalid component name "{ $name }". Names must start with a letter.\n\n## `<answer>` sugar\n\nanswer-video-watched-missing-video = Answer with type videoWatched must have a video attribute\n\nanswer-video-watched-video-not-reference = Answer with type videoWatched must have video attribute that is a reference\n\nanswer-name-not-single-text = Answer name attribute must have a single text child\n\n## Referencing another document\n\n# $attribute is the attribute the URI was written in (`copyFrom`, `extend`, …)\n# and stays as written; $uri is the author\'s own value.\n\nexternal-doenetml-recursion-limit = Unable to retrieve external DoenetML due to too many levels of recursion. Is there a circular reference?\n\nexternal-doenetml-unavailable = Unable to retrieve DoenetML from { $attribute }="{ $uri }"\n\nexternal-doenetml-type-mismatch = Invalid DoenetML retrieved from { $attribute }="{ $uri }": it did not match the component type "{ $componentType }"\n\n## Deprecated syntax\n\n# $from and $to are attribute names and $component a tag name; all three stay\n# as written. $component is `none` for a rename that applies to every component\n# accepting the attribute, where naming one would be wrong.\n#\n# The `[deprecation]` opening is a literal marker shared by all four messages,\n# not a word: leave it as it is.\n\ndeprecated-attribute-renamed =\n { $component ->\n [none] [deprecation] Attribute `{ $from }` is deprecated; use `{ $to }` instead.\n *[other] [deprecation] Attribute `{ $from }` on `<{ $component }>` is deprecated; use `{ $to }` instead.\n }\n\ndeprecated-attribute-renamed-conflict =\n { $component ->\n [none] [deprecation] Attribute `{ $from }` is deprecated and ignored because `{ $to }` is also specified.\n *[other] [deprecation] Attribute `{ $from }` on `<{ $component }>` is deprecated and ignored because `{ $to }` is also specified.\n }\n\ndeprecated-attribute-ignored = [deprecation] Attribute `{ $attribute }` on `<{ $component }>` is deprecated and ignored.\n\n# An attribute replaced by a child element rather than by another attribute:\n# $attribute and $component stay as written, and so does $child, which is the\n# tag name of the child to write instead.\n\ndeprecated-attribute-to-child = [deprecation] Attribute `{ $attribute }` on `<{ $component }>` is deprecated; use a `<{ $child }>` child instead.\n\n# One value of an attribute is deprecated while the attribute itself stays:\n# $value is what the author wrote and $to what to write instead, with\n# $attribute and $component naming where. All four stay as written.\n\ndeprecated-attribute-value-renamed = [deprecation] Value `{ $value }` of attribute `{ $attribute }` on `<{ $component }>` is deprecated; use `{ $to }` instead.\n\n\n## Language coverage\n\n# `<pluralize>` runs an English part-of-speech model over its text and puts the\n# nouns in the plural. There is no equivalent for an arbitrary language — a\n# correct plural needs that language\'s own morphology, and often its\n# dictionary — so in a document written in anything else the word is left as\n# the author typed it, and this says so rather than silently doing nothing.\n#\n# Raised only when there is nothing else to fall back on: a `pluralForm` is the\n# author supplying their own language\'s plural, and that is honored in every\n# language, which is why this can recommend it.\n#\n# $locale is the document\'s language tag, as declared.\npluralize-english-only = `<pluralize>` can only pluralize English, so its text is left unchanged in a document written in { $locale }. Write the plural form directly, or set it with the `pluralForm` attribute.\n\n\n## Checking against the schema\n\n# What the editor draws a squiggle under: the language server\'s own check of\n# the document against the DoenetML schema, run on every keystroke and\n# answered before anything is evaluated. A beginner meets these first, and\n# usually only these, because a document that does not pass them rarely gets\n# as far as producing a diagnostic from the core.\n#\n# `@doenet/lsp-tools` writes its English beside the code rather than rendering\n# it from here, for the same reason `@doenet/parser` does: it is inside the\n# language-server bundle, which `@doenet/codemirror` embeds verbatim and\n# starts as a blob worker, and a catalog on the editor\'s critical path is what\n# `packages/lsp/scripts/check-server-bundle.mjs` exists to reject. The two\n# copies are held together by a test in that package, which runs the checker\n# over a corpus and asserts every coded violation renders to exactly what the\n# checker wrote — so a message edited here without its counterpart fails\n# there.\n#\n# $tag, $parent and $attribute quote the author\'s own source back at them and\n# stay exactly as written; the angle brackets and backticks around them are\n# punctuation this catalog supplies, not part of the name.\n\nschema-element-unrecognized = Element `<{ $tag }>` is not a recognized Doenet element.\n\nschema-element-not-allowed-at-root = Element `<{ $tag }>` is not allowed at the root of the document.\n\nschema-element-not-allowed-inside = Element `<{ $tag }>` is not allowed inside of `<{ $parent }>`.\n\nschema-attribute-unrecognized = Element `<{ $tag }>` doesn\'t have an attribute called `{ $attribute }`.\n\n# $allowed is the attribute\'s permitted values, each already in double quotes\n# and joined for the reader\'s language. $isList says whether the attribute\n# takes several of them at once: one situation, two sentences, because the\n# reader has to be told they are choosing a whole list rather than a value.\nschema-attribute-value-not-allowed =\n { $isList ->\n [true] Attribute `{ $attribute }` of element `<{ $tag }>` must be a list whose items are each one of: { $allowed }\n *[other] Attribute `{ $attribute }` of element `<{ $tag }>` must be one of: { $allowed }\n }\n\n\n## The `<select>` family\'s error boxes\n##\n## The messages that replace the whole component with a red box rather than\n## warning beside it: nothing can be selected, so there is nothing to render.\n## They were the last uncoded `_error` path in the worker (#1581).\n##\n## Counts arrive as numbers rather than as text, so a language that agrees a\n## noun with them can select on them. English does not agree here — it says\n## "1 options" today and these messages reproduce it exactly, because the box\'s\n## text is what the existing suites pin.\n##\n## Being numbers, they are grouped: a count of 1500 renders as "1,500" in\n## English where the concatenated sentence these replaced wrote "1500". That is\n## the one way the English moved, and it moved in the right direction — these\n## are quantities, not identifiers like a line or a section number, which is\n## the distinction that decides between a number and a string everywhere in\n## these catalogs.\n##\n## Translators: component and attribute names — `selectFromSequence`,\n## `selectPrimeNumbers`, `from`, `to`, `step` — are DoenetML identifiers, not\n## words. They are written into these messages as they stand and must be left\n## in English exactly as written.\n\nselect-variant-name-option-count-mismatch = Invalid variant name for select. Variant name { $variantName } appears in { $numOptions } options but number to select is { $numToSelect }.\n\nselect-variant-name-without-options = Some variants are specified for select but no options are specified for possible variant name: { $variantName }.\n\nselect-variant-name-not-possible = Variant name { $variantName } that is specified for select is not a possible variant name.\n\nselect-too-few-options = Cannot select { $numToSelect } components from only { $numOptions }.\n\nselect-from-sequence-too-few-values = Cannot select { $numToSelect } values from a sequence of length { $length }.\n\nselect-from-sequence-indices-count-mismatch = Number of indices specified for select must match number to select\n\nselect-from-sequence-indices-not-integers = All indices specified for select must be integers\n\nselect-from-sequence-index-excluded = Specified index of selectfromsequence that was excluded\n\nselect-from-sequence-indices-excluded-combination = Specified indices of selectfromsequence that was an excluded combination\n\nselect-from-sequence-coprime-not-positive-integers = Cannot select coprime combinations as not selecting positive integers.\n\n# Translators: from, to and step are attribute names. They are written into\n# the message rather than passed in because these three never vary — an\n# argument is for a name that changes from one call to the next.\nselect-from-sequence-coprime-common-factor = Cannot select coprime numbers. All possible values share a common factor. (Specified values of "from" or "to" must be coprime with "step".)\n\nselect-from-sequence-coprime-single-number = Cannot select coprime combinations from a single number that is not 1.\n\nselect-from-sequence-excluded-too-many-combinations = Excluded over 70% of combinations in selectFromSequence\n\n# The sibling of `select-from-sequence-coprime-common-factor`, and a different\n# situation rather than a rewording of it: that one is decided up front, from\n# the sequence\'s own arithmetic. This one is what is left after two hundred\n# draws found no coprime combination among values that could have supplied one.\nselect-from-sequence-coprime-none-found = Could not select coprime numbers. All possible values share a common factor.\n\nselect-from-sequence-too-few-unique-values = Cannot select { $numToSelect } unique values from sequence of length { $numPossibleValues }\n\nselect-prime-numbers-too-few-values = Cannot select { $numToSelect } values from a list of primes of length { $numValues }\n\nselect-prime-numbers-values-count-mismatch = Number of values specified for select must match number to select\n\nselect-prime-numbers-values-not-prime = All values specified for select prime number must be in the list of primes\n\nselect-prime-numbers-values-excluded-combination = Specified values of selectPrimeNumbers was an excluded combination\n\nselect-prime-numbers-excluded-too-many-combinations = Excluded over 70% of combinations in selectPrimeNumbers\n\n# Both flukes are shared by `<selectFromSequence>` and `<selectPrimeNumbers>`,\n# which say the same thing in the same words. Neither is reachable in practice\n# — each follows two hundred independent draws — but an unreachable box is\n# still a box, and it renders in whatever language the rest of the page does.\nselect-random-combination-fluke = By extremely unlikely fluke, couldn\'t select combination of random values\n\nselect-random-value-fluke = By extremely unlikely fluke, couldn\'t select random value\n\n## Inputs embedded in math\n\n# Translators: $component is the input\'s own DoenetML tag and stays in English,\n# as do the attribute names `inline`, `expanded` and `width`. An input written\n# inside `<m>` is drawn in the place it is written, inside the typeset\n# expression, which makes room for it as it grows. That needs a control small\n# enough to sit in a line of mathematics, with a width the expression can\n# measure, in an expression that is not drawn on a graph; $reason says which of\n# those this input fails. When it fails, the input is not shown at all, and the\n# expression is typeset with the input\'s value in its place — a text input\'s\n# text, a math input\'s mathematics — or with nothing there for a choice input.\nmath-embedded-input-shape-unsuitable =\n { $reason ->\n [not-inline] This `<{ $component }>` is not shown because it is inside math and is not `inline`. Add `inline` so it becomes a drop-down list, which fits inside an expression.\n [expanded] This `<{ $component }>` is not shown because it is inside math and is `expanded`. Remove `expanded`; a multi-line box does not fit inside an expression.\n [on-graph] This `<{ $component }>` is not shown because it is inside math drawn on a graph, which has no room for an input.\n *[relative-width] This `<{ $component }>` is not shown because it is inside math and has a relative width. Give the width in absolute units, such as `px`, instead.\n }\n\n## `<sampleRandomNumbers>` and `<selectRandomNumbers>`\n##\n## Translators: `mean`, `standardDeviation`, `variance`, `numTotal`,\n## `numSuccesses`, `numDraws`, `numTrials`, `probability` and `numSamples` are\n## DoenetML attribute names. They are written into these messages as they stand\n## and must be left in English exactly as written. Each of these names the\n## attribute the author has to change, so a message that translated one would\n## point at an attribute that does not exist.\n\n# The spread reaches the sampler as a standard deviation however it was written,\n# so a negative `variance` arrives here as a `standardDeviation` of NaN and the\n# message has to name both for the author to know what to edit.\nsample-gaussian-parameters-invalid =\n Invalid mean ({ $mean }) or standardDeviation ({ $standardDeviation }) for a gaussian random variable. The mean must be a finite number, and the standardDeviation (or the variance it is derived from) must be finite and non-negative. No numbers can be sampled.\n\n# These three attributes are the only ones with no default, so leaving one out is\n# the commonest way to reach this message. Each arrives either as the number the\n# author wrote or as `not-set` for an attribute they left off entirely; translate\n# the "not set" wording, but leave the `not-set` key that selects it untouched.\nsample-hypergeometric-parameters-invalid =\n Invalid numTotal ({ $numTotal ->\n [not-set] not set\n *[other] { $numTotal }\n }), numSuccesses ({ $numSuccesses ->\n [not-set] not set\n *[other] { $numSuccesses }\n }), or numDraws ({ $numDraws ->\n [not-set] not set\n *[other] { $numDraws }\n }) for a hypergeometric random variable. numTotal must be a positive whole number, and numSuccesses and numDraws must be non-negative whole numbers no larger than numTotal. All three must also stay below about nine quadrillion, past which whole numbers can no longer be counted exactly.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-hypergeometric-draws-too-many =\n Drawing { $numDraws } items from a population of { $numTotal } would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numDraws, or bring it closer to numTotal.\n\nsample-binomial-parameters-invalid =\n Invalid numTrials ({ $numTrials }) or probability ({ $probability }) for a binomial random variable. numTrials must be a non-negative whole number below about nine quadrillion, past which whole numbers can no longer be counted exactly, and probability must be between 0 and 1.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-binomial-trials-too-many =\n Running { $numTrials } trials would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numTrials.\n\nsample-poisson-mean-invalid =\n Invalid mean ({ $mean }) for a poisson random variable. The mean must be a finite, non-negative number.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-poisson-mean-too-large =\n A poisson mean of { $mean } would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce the mean.\n\n# $distribution names the distribution being sampled, e.g. "binomial" or\n# "multivariate hypergeometric"; $draws is roughly how many random draws each value\n# needs. Raised by `<sampleRandomNumbers>`, `<selectRandomNumbers>` and\n# `<sampleMultivariateRandomNumber>`, which count values with `numSamples`,\n# `numToSelect` and one vector respectively, so the wording names no attribute.\nsample-distribution-slow =\n Each value from this { $distribution } distribution needs about { $draws } random draws, so sampling may be slow. Reduce the distribution\'s parameters, or ask for fewer values, if the page feels sluggish.\n\n## List index operators\n\n# Raised by the index-returning list operators (`<indexOf>`, `<searchSorted>`)\n# when no `target` was given. $component names the tag the author wrote.\nindex-operator-missing-target =\n `{ $component }` has no `target` to look for, so it cannot report a position and gives 0.\n\n# Raised when the operator had no values to look through — an empty list, or one\n# whose only children were references that produced nothing.\nindex-operator-no-values =\n `{ $component }` has no values to look through, so it gives 0, which is not the index of any item.\n## `<sampleMultivariateRandomNumber>`\n##\n## Translators: `type`, `numInCategories` and `numDraws` are DoenetML attribute\n## names, and `hypergeometric` is one of the values `type` takes. They are written\n## into these messages as they stand and must be left in English exactly as\n## written. Each names the attribute the author has to change, so a message that\n## translated one would point at an attribute that does not exist.\n\n# Neither attribute has a default that names a population — numDraws has none at\n# all, and numInCategories falls back to a list with no categories in it — so\n# leaving one out is the commonest way to reach this message. Each arrives either\n# as the value the author wrote or as `not-set`: for numDraws when it is missing,\n# and for numInCategories when it names no categories, whether it was left off or\n# written empty. Translate the "not set" wording, but leave the `not-set` key that\n# selects it untouched.\nsample-multivariate-parameters-invalid =\n Invalid numInCategories ({ $numInCategories ->\n [not-set] not set\n *[other] { $numInCategories }\n }) or numDraws ({ $numDraws ->\n [not-set] not set\n *[other] { $numDraws }\n }) for a multivariate hypergeometric random variable. numInCategories must list at least one category, each a non-negative whole number, and numDraws must be a non-negative whole number no larger than their total. Each category, that total, and numDraws must also stay below about nine quadrillion, past which whole numbers can no longer be counted exactly.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\n# Drawing nearly the whole population is as cheap as drawing almost none of it, so\n# raising numDraws is a fix as well as lowering it. "could need" rather than "would\n# need": each category is counted at the most its draw could cost, so the count\n# these parameters are refused on is an upper bound on the work they really take.\nsample-multivariate-draws-too-many =\n Drawing { $numDraws } items from a population of { $numTotal } split into { $numCategories } categories could need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numDraws, bring it closer to numTotal, or use fewer categories.\n\n# `type` has no default, so this is what leaving it off gets. A type the attribute\n# does not recognize falls back to no type at all and reaches this message too,\n# after a separate one naming the value that was rejected — hence "no distribution\n# was named" rather than wording that assumes the attribute is missing.\nsample-multivariate-type-not-specified =\n No multivariate distribution was named for this random variable, so nothing was sampled. Give the type attribute the name of a distribution, such as `type="hypergeometric"`.\n\n## Counting operators\n\n# Raised by `<tally>` when the author named `categories` explicitly and some\n# values matched none of them, so those values were not counted anywhere. Info\n# rather than a warning: a list fed by an input legitimately holds\n# non-categories while a student is typing. It deliberately does not say how\n# many such values there were: the diagnostics queue is append-only and\n# deduplicates by message, so a count would leave one permanent entry behind\n# for every number of stray values the list passed through while being typed.\ntally-values-outside-categories =\n Some values matched none of the declared categories, so they were not counted.\n\n# Raised by `<tally>` when `categories` names the same category more than once.\n# A warning rather than info: unlike a stray value, a repeated category is a\n# property of what the author wrote, so it stays true of a settled document. The\n# message says what the counts will be, since the behavior is defensible but not\n# what an author who repeated a category by accident expects.\ntally-repeated-category =\n `categories` names the same category more than once. Each count reports the values equal to its own category, so the repeated ones all report the same number.\n\n# Raised by `<binCounts>` when no `bins` attribute was given, so there are no\n# intervals to count into. $component names the tag the author wrote.\nbin-counts-missing-bins =\n `{ $component }` has no `bins` cut points, so there are no intervals to count into and it gives no counts.\n\n# Raised by `<binCounts>` when `bins` held fewer than the two cut points needed\n# to define a single interval. $count is how many were given, and can be 0 or 1,\n# so the sentence is worded to read for both without forking on the number.\nbin-counts-too-few-cut-points =\n `bins` needs at least 2 cut points to define an interval, but received { $count }.\n\n# Raised by `<binCounts>` when its values are not all numeric, so they cannot be\n# placed between numeric cut points. $component names the tag the author wrote.\nbin-counts-values-not-numeric =\n `{ $component }` can only count numeric values into bins, but not every value it was given is numeric. All counts are 0.\n\n# Raised by `<binCounts>` when the `bins` cut points do not climb: one is\n# smaller than the one before it, so a bin would run backwards and its count\n# would come out negative, or one is not a number at all, which has the same\n# effect. Equal adjacent cut points are accepted, so the message says "at least\n# as large as" rather than "increasing": what is rejected is a decrease, not a\n# failure to strictly increase. Between two interior cut points that names an\n# empty bin; at either end the outermost-edge rule can still put a value in it.\nbin-counts-cut-points-decreasing =\n Each `bins` cut point must be a number at least as large as the one before it, but one is not a number or is smaller than its predecessor, so no counts were produced.\n';
38635
+ const diagnostics = '# Errors and warnings surfaced to the reader or author. Produced by the worker\n# but addressed to whoever is looking at the screen, so these are selected by\n# `uiLocale`, not `documentLocale`.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`invalid-attribute-value`).\n#\n# Reached by stable diagnostic code rather than by a literal `t("key")` call:\n# `DIAGNOSTIC_CODES` in `src/diagnostics.ts` maps `doenet-w0001` to the id\n# below, and `lint:i18n` treats that registry as the call site. Adding a\n# message here without registering a code for it fails the lint as an orphan.\n#\n# Translators: `through`, `endpoint`, `midpointOffset`, `numDimensions` and the\n# like are DoenetML attribute names. They are part of the language, not prose,\n# and must be left in English exactly as written.\n\n## `<lineSegment>`\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoints =\n { $attributesCount ->\n [one] { $attributes } is ignored when two endpoints are specified\n *[other] { $attributes } are ignored when two endpoints are specified\n }\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nline-segment-attributes-ignored-with-endpoint-and-midpoint =\n { $attributesCount ->\n [one] { $attributes } is ignored when an endpoint and a midpoint are both specified\n *[other] { $attributes } are ignored when an endpoint and a midpoint are both specified\n }\n\nline-segment-midpoint-offset-without-midpoint = midpointOffset has no effect without a midpoint\n\n## `<line>`\n\nline-points-undetermined-dimensions = Line through points of undetermined dimensions.\n\nline-points-too-few-dimensions = Line must be through points of at least two dimensions.\n\n# $variables is a bare enumeration of variable names, not an "and" list.\nline-points-depend-on-variables = Line is through points that depend on variables: { $variables }.\n\nline-equation-invalid-format = Invalid format for equation of line in variables { $variable1 } and { $variable2 }.\n\n## `<ray>`\n\nray-overprescribed-through = Ray is prescribed by through, endpoint, and direction. Ignoring specified through.\n\nray-dimension-mismatch = numDimensions mismatch in ray.\n\n## `<vector>`\n\nvector-overprescribed-head = Vector is prescribed by head, tail, and displacement. Ignoring specified head.\n\nvector-dimension-mismatch = numDimensions mismatch in vector.\n\n## Attracting and constraining\n\n# $component is the DoenetML tag of the child that was named, e.g. "polygon".\nattract-to-without-nearest-point = Cannot attract to a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\nconstrain-to-without-nearest-point = Cannot constrain to a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\nconstrain-to-interior-without-nearest-point = Cannot constrain to interior of a `<{ $component }>` as it doesn\'t have a nearestPoint state variable.\n\n## `<choiceInput>`\n\n# Translators: `labelPosition` is an attribute name and stays in English.\nchoice-input-label-position-ignored = labelPosition is ignored for non-inline choiceInput\n\n## Ordering children by index\n##\n## These name the component in prose rather than as a tag, matching how the\n## messages have always read. The component names stay in English; the nouns\n## around them are prose and should be translated.\n\nchoice-input-indices-count-mismatch = Ignoring indices specified for choiceInput as number of indices doesn\'t match number of choice children.\n\npretzel-indices-count-mismatch = Ignoring indices specified for problem as number of indices doesn\'t match number of problem children.\n\nshuffle-indices-count-mismatch = Ignoring indices specified for shuffle as number of indices doesn\'t match number of components.\n\n# $component is `choiceInput`, `pretzel` or `shuffle` — a DoenetML component\n# name, so it stays in English.\nindices-ignored-out-of-range = Ignoring indices specified for { $component } as some indices out of range.\n\npretzel-indices-repeated = Ignoring indices specified for pretzel as some indices are repeated.\n\npretzel-circuit-first-index = Ignoring indices specified for pretzel in circuit mode as the first index must be 1.\n\n## `<shuffle>` and `<sort>`\n\n# $component is `shuffle` or `sort`. These two components accept the same\n# children and fail the same ways, so they share their messages.\nstring-children-need-type = For `<{ $component }>` to work with string children, a `type` attribute must be specified.\n\n# $type is what the author wrote; math, text, number and boolean are attribute\n# values and stay in English.\ninvalid-type-defaulting-to-math = Invalid type { $type } for { $component } component. Must be one of math, text, number, or boolean. Defaulting to math.\n\n# $value is the string child that could not be used.\nstring-not-valid-component-to-arrange = String "{ $value }" is not a valid component to { $component }. Ignoring.\n\n## Types and variables\n\ninvalid-type-defaulting-to-number = Invalid type { $type }, setting type to number.\n\ninvalid-variable-value = Invalid value of a variable: `{ $value }`\n\n## Variants\n\n# $index is what the author wrote, reproduced verbatim rather than as a number:\n# it reached this message precisely because it was not one.\nvariant-index-must-be-number = Variant index { $index } must be a number\n\nvariant-index-must-be-integer = Variant index { $index } must be an integer\n\n## `<sideBySide>`\n\n# $component is `sideBySide` or `sbsGroup`.\nside-by-side-absolute-widths = `<{ $component }>` is not implemented for absolute measurements. Setting widths to relative.\n\nside-by-side-absolute-margins = `<{ $component }>` is not implemented for absolute measurements. Setting margins to relative.\n\nside-by-side-no-block-child = Invalid `<{ $component }>`: it must have at least one block child.\n\n## `<label>`\n\n# Translators: `for` is an attribute name and stays in English.\nlabel-for-ignored-on-graphical = The `for` attribute on graphical `<label>` is ignored.\n\nlabel-for-must-resolve-to-one = The `for` attribute on `<label>` must resolve to exactly one component.\n\nlabel-for-unresolved = The `for` attribute on `<label>` could not be resolved to a component.\n\nlabel-for-answer-with-authored-inputs = The `for` attribute on `<label>` references an `<answer>` with explicitly authored inputs; reference the input directly.\n\nlabel-for-answer-without-input = The `for` attribute on `<label>` references an `<answer>` without an input to label.\n\nlabel-for-must-reference-input-or-answer = The `for` attribute on `<label>` must reference an input or an answer.\n\n## Accessibility\n\n# $component is a DoenetML tag, e.g. "graph" or "image".\naccessibility-short-description-or-decorative = For accessibility, `<{ $component }>` must either have a short description or be specified as decorative.\n\naccessibility-video-short-description = For accessibility, `<video>` must have a short description.\n\naccessibility-input-short-description-or-label = For accessibility, `<{ $component }>` must have a short description or a label.\n\n# The companion to the message above, for the input an `<answer>` creates on the\n# author\'s behalf. Two messages rather than one with the subject passed in: the\n# subject is a phrase here, not a name, and a phrase handed over as an argument\n# would never reach a translator.\naccessibility-answer-input-short-description-or-label = For accessibility, an `<answer>` creating an input must have a short description or a label.\n\naccessibility-short-description-contains-math = Short descriptions should not contain math components such as `<{ $component }>`. Spell out any math with words.\n\n# $colorName is an attribute name and stays in English. $ratio and $threshold\n# are contrast ratios; $mode says which theme the shortfall was measured in,\n# and is `dark` or `light`.\naccessibility-section-title-insufficient-contrast =\n { $mode ->\n [dark] { $colorName } has insufficient contrast for the section heading text (dark mode) ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n *[other] { $colorName } has insufficient contrast for the section heading text ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n }\n\n## `<circle>`\n\n# $count is the number of through points.\ncircle-through-points-non-numerical = Haven\'t implemented `<circle>` through { $count } points in case where the points don\'t have numerical values.\n\ncircle-too-many-through-points = Cannot calculate circle through more than 3 points.\n\ncircle-overprescribed-radius-center-points = Cannot calculate circle with specified radius, center and through points.\n\ncircle-center-with-multiple-points = Cannot calculate circle with specified center through more than 1 point.\n\n# $distance and $radius arrive as strings, not numbers: $radius is the author\'s\n# own value echoed back for diagnosis, and formatting it as a quantity would\n# round a radius of 0.0001 away to 0.\ncircle-radius-too-small = Cannot calculate circle: given that the distance between the two points is { $distance }, the specified radius { $radius } is too small.\n\ncircle-radius-with-many-points = Cannot create circle through more than two points with a specified radius.\n\ncircle-invalid-center-or-through-points = Invalid center or through points of circle.\n\ncircle-radius-center-with-multiple-points = Cannot calculate radius of circle with specified center through more than 1 point.\n\ncircle-change-radius-non-numerical = Cannot change radius of circle with non-numerical through points\n\ncircle-radius-with-points-non-numerical = Cannot create circle through more than one point with specified radius when don\'t have numerical values.\n\ncircle-change-center-non-numerical = Haven\'t implemented changing center of circle through points with non numerical values.\n\n## `<function>`\n\n# Two independent counts in one sentence, so the variants multiply out. A\n# select\'s variants each need their own line, so the inner one spans lines too;\n# that is safe because newlines inside a placeable never reach the rendered\n# value. Only text continuing onto a further line would.\nfunction-domain-insufficient-dimensions =\n { $intervals ->\n [one] Insufficient dimensions for domain for function. Domain has { $intervals } interval but the function has { $inputs ->\n [one] { $inputs } input\n *[other] { $inputs } inputs\n }.\n *[other] Insufficient dimensions for domain for function. Domain has { $intervals } intervals but the function has { $inputs ->\n [one] { $inputs } input\n *[other] { $inputs } inputs\n }.\n }\n\nfunction-domain-invalid-format = Invalid format for domain for function.\n\n# $type is what was being read off the point. It selects the wording rather\n# than being substituted into it: "maximum", "slope" and the rest are English\n# nouns, and a noun handed over as an argument would never reach a translator.\n# The catch-all reproduces the pre-catalog behavior for a value not listed here.\nfunction-ignoring-non-numerical =\n { $type ->\n [maximum] Ignoring non-numerical maximum of function.\n [minimum] Ignoring non-numerical minimum of function.\n [extremum] Ignoring non-numerical extremum of function.\n [point] Ignoring non-numerical point of function.\n [slope] Ignoring non-numerical slope of function.\n *[other] Ignoring non-numerical { $type } of function.\n }\n\nfunction-ignoring-empty =\n { $type ->\n [maximum] Ignoring empty maximum of function.\n [minimum] Ignoring empty minimum of function.\n [extremum] Ignoring empty extremum of function.\n [point] Ignoring empty point of function.\n *[other] Ignoring empty { $type } of function.\n }\n\nfunction-points-too-close = Function contains two points with locations too close together. Can\'t define function.\n\nfunction-iterates-input-output-mismatch =\n { $inputs ->\n [one] Function iterates are possible only if the number of inputs of the function is equal to the number of outputs. This function has { $inputs } input and { $outputs ->\n [one] { $outputs } output\n *[other] { $outputs } outputs\n }.\n *[other] Function iterates are possible only if the number of inputs of the function is equal to the number of outputs. This function has { $inputs } inputs and { $outputs ->\n [one] { $outputs } output\n *[other] { $outputs } outputs\n }.\n }\n\n## `<sequence>`\n\nsequence-invalid-length = Invalid length of sequence. Must be a non-negative integer.\n\n# $type is a sequence type: number, letters, or math.\nsequence-invalid-step = Invalid step of sequence. Must be a number for sequence of type { $type }.\n\n# $attribute is `from` or `to` — an attribute name, so it stays in English.\nsequence-invalid-endpoint-number = Invalid "{ $attribute }" of number sequence. Must be a number.\n\nsequence-invalid-endpoint-letters = Invalid "{ $attribute }" of letters sequence. Must be a letter combination.\n\nsequence-invalid-endpoint = Invalid "{ $attribute }" of sequence.\n\nselect-from-sequence-coprime-not-numbers = coprime ignored since not selecting numbers\n\nselect-from-sequence-coprime-with-exclude-combinations = coprime ignored since excludeCombinations specified\n\n## Resolving a `target`\n##\n## Raised by the components that take a `target` attribute. They resolve it\n## through the same code and fail the same two ways, so they share these two\n## messages rather than spelling each one out per component: $source is the tag\n## of the component that raised it, part of the DoenetML language, so it stays\n## in English.\n\ntarget-not-found = Invalid target for `<{ $source }>`: cannot find target.\n\n# $property is the state variable that was looked for; $component is the tag it\n# was looked for on.\ntarget-state-variable-not-found = Invalid target for `<{ $source }>`: cannot find a state variable named "{ $property }" on a `<{ $component }>`.\n\n## `<odeSystem>`\n\node-system-variables-match-independent = Variables of `<odeSystem>` must be different than independent variable.\n\node-system-duplicate-variable-names = Can\'t define ODE RHS functions with duplicate dependent variable names.\n\node-system-rhs-function-error = Cannot define ODE RHS function. Error creating mathjs function.\n\n## `<angle>`, `<parabola>`, and `<intersection>`\n\n# $count is how many line children were found.\nangle-too-many-lines = Cannot define an angle between { $count } lines\n\nangle-invalid-through-point = Invalid point in through of `<angle>`\n\nparabola-vertex-too-many-points = Haven\'t implemented parabola with vertex through more than 1 point.\n\nparabola-too-many-points = Haven\'t implemented parabola through more than 3 points.\n\nintersection-too-many-items = Haven\'t implemented intersection for more than two items\n\n## Other math components\n\nionic-compound-not-two-ions = Have not implemented ionic compound for anything other than two ions.\n\nionic-compound-needs-cation-and-anion = Ionic compound implemented only for one cation and one anion.\n\n# $equation is the equation as the author wrote it.\nsolve-equations-cannot-evaluate = Cannot solve equation as could not evaluate equation: { $equation }\n\n# Translators: `operandNumber` is an attribute name and stays in English.\nmath-operators-operand-number-required = Must specify a operandNumber when extracting a math operand.\n\neigen-decomposition-failed = Could not calculate eigenvalues of matrix\n\n## `<matchesPattern>`\n\n# Translators: `parameters` is an attribute name and stays in English.\n# $parameters lists the parameters as the author wrote them;\n# $parametersCount is how many there were.\nmatches-pattern-parameter-not-in-pattern =\n { $parametersCount ->\n [one] `<matchesPattern>`: the parameter { $parameters } does not occur in the pattern, so it will always match a blank.\n *[other] `<matchesPattern>`: the parameters { $parameters } do not occur in the pattern, so they will always match a blank.\n }\n\n## `<graph>`\n\n# Translators: grid is an attribute name and none, medium and dense are its\n# values; all four stay in English, as does the example. $grid is the value the\n# author wrote, reproduced verbatim — it reached this message precisely because\n# it was not one of the forms listed.\ngraph-grid-invalid = `<graph>`: cannot interpret grid="{ $grid }". It must be none, medium, dense, or two positive numbers separated by a space, such as grid="1 0.5". No grid is drawn.\n\n## `<slopeField>` and `<vectorField>`\n\n# $component is the field\'s tag and $alternative the sibling field component\'s,\n# or `none` when the function would not suit it either; both are DoenetML tags\n# and stay in English, as do the example expressions. $expected is how many\n# outputs the component needs, $found how many the given function has. What a\n# field draws a mark from is the function\'s outputs, so the wrong number of\n# them means there is nothing to draw — and the author almost always wanted the\n# other component.\nfield-function-wrong-num-outputs =\n `<{ $component }>` needs a function with { $expected ->\n [one] one output, the slope y\' at each point, such as `y - x`\n *[other] two outputs, the vector at each point, such as `(y, -x)`\n }, but the function it was given has { $found ->\n [one] { $found } output\n *[other] { $found } outputs\n }. { $alternative ->\n [none] Nothing is drawn.\n *[other] `<{ $alternative }>` is the component for that function. Nothing is drawn.\n }\n\n# Translators: retired. `function` is an attribute name and stays in English.\n# It warned that a field had been given its function both as an attribute and\n# inside the component; the attribute no longer exists, so the two can no\n# longer disagree. Kept because diagnostic codes are never reused.\nfield-function-attribute-ignored-with-child = The `function` attribute is ignored because the function is also given inside the component; the one inside is used. Give the function only one of the two ways.\n\n# Translators: `variables` and `function` are a DoenetML attribute and tag and\n# stay in English, as does $component, the field\'s own tag. The attribute names\n# the inputs of an expression written directly inside the component; when there\n# is no such expression there is nothing for it to name, and $reason says which\n# of the two ways that happened.\nfield-variables-ignored =\n `<{ $component }>`: the `variables` attribute names the variables of an expression written directly inside the component. { $reason ->\n [function-child] The function here is given as a `<function>` child, which names its own variables, so `variables` is ignored.\n *[no-expression] No such expression is given here, so `variables` is ignored.\n }\n\n## PreFigure renderer\n\n# Translators: xLabelPosition, yLabelPosition and their values are attribute\n# names and stay in English, as does the renderer\'s name.\nprefigure-x-label-position-unsupported = `<graph>`: xLabelPosition="left" is not supported in prefigure renderer; using right-position behavior.\n\nprefigure-y-label-position-unsupported = `<graph>`: yLabelPosition="bottom" is not supported in prefigure renderer; using top-position behavior.\n\nprefigure-invalid-axis-bounds = `<graph>`: invalid axis bounds for prefigure conversion; using default bbox (-10,-10,10,10).\n\nprefigure-invalid-width = `<graph>`: invalid width for prefigure conversion; using default diagram width 425.\n\nprefigure-invalid-aspect-ratio = `<graph>`: invalid aspectRatio for prefigure conversion; using default aspect ratio 1.\n\n# Translators: the renderer\'s name, prefigure, stays in English. "grid" here is\n# the coordinate grid itself rather than the attribute that asks for one, so it\n# is prose and is translated.\nprefigure-grid-spacing-too-fine = `<graph>`: the grid spacing is too fine for the axis limits; the grid is omitted in the prefigure renderer.\n\nprefigure-annotations-not-rendered = `<graph>`: annotations will not be rendered when not using the PreFigure renderer.\n\nmultiple-annotations-children = Multiple `<annotations>` children found in `<graph>`; all but the last one are ignored.\n\n## Referring to other components\n##\n## `<updateValue>`\'s own "cannot find target" messages are not here: it\n## resolves a target the same way `<animateFromSequence>` does and fails the\n## same ways, so the two share `target-not-found` and\n## `target-state-variable-not-found` above.\n\ncopy-unrecognized-component-type = Cannot extend or copy an unrecognized component type: { $type }.\n\ncopy-prop-not-found = Could not find prop { $property } on a component of type { $component }\n\ncollect-no-source = No source found for collect.\n\ncollect-invalid-component-type = Cannot collect components of type `<{ $component }>` as it is an invalid component type.\n\n# $reference is the reference exactly as the author wrote it, `$` and all —\n# the `$p.styleDescription[1]` of `<text extend="$p.styleDescription[1]" />`.\n# An index only means something applied to an array, and the thing named here\n# is not one. The reference is quoted back rather than explained because the\n# text in front of the author is the only part of this they can act on: the\n# state variable and component index the core knows about are its own business\n# and go to the console instead.\nreference-index-unavailable = Cannot reference index `{ $reference }`\n\n## `<callAction>`\n\n# $action is the `actionName` the author asked for, part of the DoenetML\n# language, so it stays in English. $reference is the `target` as written.\ncomponent-action-unavailable = Cannot call { $action } on component `{ $reference }`\n\n## `<dataFrame>`\n\n# $componentIdx is an internal index, passed as a string so it is not grouped\n# like a quantity; the odd spacing before the colon is reproduced from the\n# original message.\ndata-frame-inconsistent-row-lengths = Data has invalid shape. Rows has inconsistent lengths. Found in componentIdx :{ $componentIdx }\n\ndata-frame-duplicate-column-names = Data has duplicate column names. Found in componentIdx :{ $componentIdx }\n\ndata-frame-missing-column-name = Data is missing a column name. Found in componentIdx :{ $componentIdx }\n\n## `<answer>` and scoring\n\nanswer-award-depends-on-own-response = An award for this answer is based on the answer tag\'s own submitted response, which will lead to unexpected behavior.\n\n# Translators: maxNumAttempts and sectionWideCheckWork are attribute names.\nanswer-max-num-attempts-in-section-wide-check-work = Setting `maxNumAttempts` on an `<answer>` inside a container with `sectionWideCheckWork` has no effect, as the number of attempts is controlled by the container. Set `maxNumAttempts` on the container instead.\n\nnested-section-wide-check-work-max-num-attempts = Setting `maxNumAttempts` on a container with `sectionWideCheckWork` that is inside another container with `sectionWideCheckWork` has no effect, as the number of attempts is controlled by the outer container. Set `maxNumAttempts` on the outer container instead.\n\n# $attributes is a list of attribute names; $attributesCount is its length.\nanswer-attributes-need-symbolic-equality =\n { $attributesCount ->\n [one] The { $attributes } attribute will have no effect without symbolicEquality set.\n *[other] The { $attributes } attributes will have no effect without symbolicEquality set.\n }\n\nanswer-invalid-type = Invalid type for answer: { $type }\n\n## `<module>`, `<conditionalContent>`, `<slider>`, `<pretzel>`\n\nmodule-attribute-child-needs-name = Since the component `<{ $component }>` does not have a name, it cannot be used for a module attribute\n\nmodule-attribute-name-already-defined = The component `<{ $component } name="{ $name }">` cannot be used as an attribute for a module because the `<module>` component type already has a "{ $name }" attribute defined.\n\nconditional-content-condition-ignored = Attribute `condition` is ignored on a `<conditionalContent>` component with case or else children.\n\nslider-markers-type-mismatch = Markers type doesn\'t match slider type.\n\npretzel-problem-needs-statement-and-answer = Invalid pretzel: each `<problem>` must contain one `<statement>` and one `<answer>`.\n\npretzel-circuit-first-problem-distractor = Invalid pretzel: in mode="circuit", the first `<problem>` cannot be a distractor.\n\n## Attribute values\n\n# $values is a list of the values that were rejected, each already in\n# backticks; $valuesCount is how many there were.\nattribute-invalid-values =\n { $valuesCount ->\n [one] Invalid value { $values } for attribute `{ $attribute }`; ignoring.\n *[other] Invalid values { $values } for attribute `{ $attribute }`; ignoring.\n }\n\nattribute-must-be-references = Invalid value `{ $value }` for attribute `{ $attribute }`. Attribute must be composed of references that begin with a `$`.\n\n# $names is a list of the rejected names, each already in single quotes.\nmath-input-invalid-function-names = <mathInput>: ignored invalid function name(s) in { $attribute }: { $names }. Each name\'s display segment must be at least 2 characters (letters or dashes); an optional `|<mathspeak alternative>` suffix may follow.\n\n## Building components from the source\n\n# Raised while the source is being turned into components, by throwing rather\n# than by building a record: the thrower is caught, the component becomes an\n# `_error`, and the diagnostic is re-raised from it.\n\ncomponent-type-invalid = Invalid component type: `<{ $componentType }>`\n\nattribute-repeated = Cannot repeat attribute { $attribute }.\n\nattribute-invalid-for-component = Invalid attribute "{ $attribute }" for a component of type `<{ $componentType }>`.\n\n## Style definition contrast\n\n# $context names the pair being compared, $mode which colour scheme it was\n# rendered in. Both are symbolic — the phrase is chosen here so a translator\n# can rewrite it, rather than being handed over already in English.\nstyle-definition-insufficient-contrast =\n Style definition { $styleNumber } has insufficient contrast for { $context ->\n [text-on-background] text color against background color\n [high-contrast] high-contrast color against the canvas\n [line] line color against the canvas\n [marker] marker color against the canvas\n *[text-on-canvas] text color against the canvas\n }{ $mode ->\n [dark] { " (dark mode)" }\n *[light] { "" }\n } ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1).\n\n# $suggestion says whether a concrete replacement colour could be computed.\n# The attribute names and colour values in the `available` branch are\n# DoenetML source, not prose, and stay as they are in every language.\nstyle-definition-dark-mode-text-background-contrast =\n Although style definition { $styleNumber } has specified colors that provide sufficient contrast for light mode, the dark-mode colors derived from these values have insufficient contrast for the text color against the background color ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1). { $suggestion ->\n [available] To ensure sufficient contrast in dark mode, either increase the light-mode contrast (e.g., set { $lightAttribute }="{ $lightColor }") or override the dark-mode color (e.g., set { $darkAttribute }="{ $darkColor }").\n *[none] To ensure sufficient contrast in dark mode, increase the light-mode contrast or override the derived colors with textColorDarkMode and/or backgroundColorDarkMode.\n }\n\nstyle-definition-dark-mode-text-canvas-contrast =\n Although style definition { $styleNumber } has a specified text color that provides sufficient contrast for light mode, the dark-mode text color derived from this value has insufficient contrast against the canvas ({ NUMBER($ratio, minimumFractionDigits: 2, maximumFractionDigits: 2) }:1; requires at least { $threshold }:1). { $suggestion ->\n [available] To ensure sufficient contrast in dark mode, either increase the light-mode contrast (e.g., set textColor="{ $lightColor }") or override the dark-mode color (e.g., set textColorDarkMode="{ $darkColor }").\n *[none] To ensure sufficient contrast in dark mode, increase the light-mode contrast or override the derived color with textColorDarkMode.\n }\n\nsection-multiple-style-palettes = A section can select only one <stylePalette>; using the last one.\n\n## Unique variants\n\n# Explanations of why a component\'s unique variants could not be worked out.\n# $component is the tag that could not be analyzed and stays as written; the\n# reason is a separate message per situation, so a host can tell them apart by\n# code and a translator sees a whole sentence rather than a fragment.\n\nvariant-num-to-select-not-non-negative-integer = cannot determine unique variants of { $component } as numToSelect isn\'t a non-negative integer.\n\nvariant-num-to-select-not-constant-number = cannot determine unique variants of { $component } as numToSelect isn\'t constant number.\n\nvariant-with-replacement-not-constant-boolean = cannot determine unique variants of { $component } as withReplacement isn\'t constant boolean.\n\nvariant-select-weight-disables-unique = Unique variants for select disabled if have an option with selectWeight or selectForVariants specified\n\nvariant-coprime-undetermined = cannot determine unique variants of { $component } as cannot determine coprime is always false.\n\n# $attribute is an attribute name (`from`, `to`, `step`, `sort`, `length`) and\n# stays as written.\nvariant-attribute-not-constant = cannot determine unique variants of { $component } as { $attribute } isn\'t a constant.\n\nvariant-attribute-not-number = cannot determine unique variants of { $component } as { $attribute } isn\'t a number.\n\n# $type is the sequence type the component was declared with. $expected names\n# what the value had to be, symbolically, because which one applies depends on\n# both the type and the attribute.\nvariant-attribute-wrong-type-for-sequence =\n cannot determine unique variants of { $component } of { $type } type as { $attribute } isn\'t { $expected ->\n [letters-combination] a combination of letters\n [math-expression] a valid math expression\n [integer] an integer\n *[number] a number\n }.\n\nvariant-length-not-integer = cannot determine unique variants of { $component } as length isn\'t an integer.\n\nvariant-sort-not-implemented = have not implemented unique variants of a { $component } with sort\n\nvariant-exclude-combinations-not-implemented = have not implemented unique variants of a { $component } with excludeCombinations\n\nvariant-math-exclude-not-implemented = have not implemented unique variants of a { $component } of type math with exclude\n\nvariant-non-constant-exclude-not-implemented = have not implemented unique variants of a { $component } with non-constant exclude\n\n## PreFigure conversion\n\n# $subject identifies the component the warning is about, already written as\n# `<tag>` or `<tag> (name)`. It is composed in code rather than here because\n# Fluent terms cannot take a variable as an argument, so a shared subject\n# fragment cannot be parameterized from the catalog. It holds only a tag name,\n# a component name and punctuation — never a word — which is why a descendant\n# with no type reads `<?>` rather than `<unknown>`.\n\nprefigure-descendant-unsupported = { $subject }: unsupported in graph prefigure renderer; descendant skipped.\n\nprefigure-descendant-invalid-geometry = { $subject }: non-finite or incomplete geometry; descendant skipped.\n\nprefigure-curve-label-omitted = { $subject }: labels are not supported on converted curve elements; label omitted.\n\nprefigure-curve-unsupported-definition-type = { $subject }: unsupported curve function definition type \'{ $definitionType }\'; descendant skipped.\n\nprefigure-region-flip-functions-unsupported = { $subject }: unsupported flipFunctions attribute on regionBetweenCurves; descendant skipped.\n\nprefigure-region-non-formula-child = { $subject }: only formula-typed child functions are supported on regionBetweenCurves; descendant skipped.\n\n# $labelKind says which family of object carried the label, since the advice\n# is the same but the object is not.\nprefigure-label-position-unsupported =\n { $subject }: unsupported labelPosition \'{ $labelPosition }\' for { $labelKind ->\n [line-family] line-family label\n *[point] point label\n }; default PreFigure alignment used.\n\nprefigure-fill-style-unsupported = { $subject }: fill style \'{ $fillStyle }\' is unsupported by PreFigure; falling back to a solid fill.\n\nprefigure-line-style-unknown = { $subject }: unknown line style \'{ $lineStyle }\' omitted from PreFigure output.\n\nprefigure-marker-style-mapped-to-diamond = { $subject }: marker style \'{ $markerStyle }\' mapped to PreFigure style \'diamond\'.\n\nprefigure-marker-style-unsupported = { $subject }: marker style \'{ $markerStyle }\' is unsupported by PreFigure; default style used.\n\n## PreFigure annotations\n\nannotation-ref-unresolvable = `<annotation>`: invalid `ref`; cannot resolve target. Annotation omitted.\n\nannotation-ref-multiple-targets = `<annotation>`: `ref` resolved to multiple targets; using the first target.\n\nannotation-ref-outside-graph = `<annotation>`: invalid `ref`; target is outside the containing graph. Annotation omitted.\n\nannotation-ref-unsupported-target = `<annotation>`: invalid `ref`; target is not a supported graphical object in prefigure conversion. Annotation omitted.\n\nannotation-text-missing = `<annotation>`: missing or empty `text`; emitting empty text.\n\n## Composites and references\n\n# $componentType is the type the composite was asked to create, when it is\n# known; `none` when the composite did not say.\ncomposite-circular-dependency =\n { $componentType ->\n [none] Circular dependency detected.\n *[other] Circular dependency detected involving `<{ $componentType }>` component.\n }\n\n# $reference is the reference as the author wrote it, already carrying its `$`.\nreference-no-referent = No referent found for reference: `{ $reference }`\n\nreference-multiple-referents = Multiple referents found for reference: `{ $reference }`\n\n## Children that do not match\n\nchildren-invalid-attribute-format = Invalid format for attribute { $attribute } of `<{ $componentType }>`.\n\n# $children is the list of child types that did not match, already joined.\nchildren-invalid = Invalid children for `<{ $componentType }>`: Found invalid children: { $children }\n\n## Falling back to a default\n\nattribute-value-invalid-using-default = Invalid value `{ $value }` for attribute `{ $attribute }`, using value `{ $default }`\n\n## Loading a DoenetML version\n\n# $fallback is the version that will be used instead, or `none` when the\n# embedding page named a standalone bundle of its own.\ndoenetml-version-not-found =\n { $fallback ->\n [none] DoenetML version { $version } not found.\n *[other] DoenetML version { $version } not found. Falling back to version { $fallback }\n }\n\n## Reading the DoenetML\n\n# The parser\'s own diagnostics: what the author sees before anything runs, and\n# for a beginner usually the first Doenet message they ever read.\n#\n# The parser writes its English beside the code rather than rendering it from\n# here, because `@doenet/parser` is inside the language-server bundle and a\n# catalog there is dead weight on the editor\'s critical path\n# (`packages/lsp/scripts/check-server-bundle.mjs` fails if one arrives). The\n# two copies are held together by a test in that package, which parses a\n# corpus and asserts every coded error renders to exactly what the parser\n# wrote — so a message edited here without its counterpart fails there.\n#\n# $tag, $value, $attribute and their relatives quote the author\'s own source\n# back at them and stay exactly as written. The `Invalid DoenetML: ` opening is\n# repeated in each message instead of being a shared term: a term a locale\n# forgets to define renders as its own name, and a prefix on fifteen messages\n# is not worth that failure mode.\n\nparse-invalid-doenetml = Invalid DoenetML: { $content }\n\nparse-tag-missing-close-tag = Invalid DoenetML: The tag `{ $tag }` has no closing tag. Expected a self-closing tag or a `</{ $tagName }>` tag.\n\nparse-tag-error = Invalid DoenetML: Error in tag `<{ $tagName }>`\n\nparse-attribute-missing-value = Invalid DoenetML: Invalid attribute `{ $attribute }` appears to be missing a value.\n\nparse-attribute-invalid = Invalid DoenetML: Invalid attribute `{ $attribute }`\n\nparse-attribute-value-invalid = Invalid DoenetML: Invalid attribute value `{ $value }`\n\n# $quote is the quote character that would balance the pair: `"` or `\'`.\nparse-attribute-value-quote-mismatch = Invalid DoenetML: Invalid attribute value `{ $value }`. The quote marks do not match. You appear to be missing a `{ $quote }`\n\nparse-open-tag-name-missing = Invalid DoenetML: Found a tag without a tag name, e.g. `<`\n\nparse-tag-not-closed = Invalid DoenetML: Tag `{ $tag }` was not closed (a `>` appears to be missing).\n\nparse-self-closing-tag-name-missing = Invalid DoenetML: Found a tag without a tag name `<{ $content }>`\n\nparse-self-closing-tag-not-closed = Invalid DoenetML: Tag `{ $tag }` was not closed (`/>` appears to be missing).\n\nparse-tag-invalid-attributes = Invalid DoenetML: Tag `{ $tag }` is not valid. It may have incorrect attributes.\n\nparse-close-tag-name-missing = Invalid DoenetML: Found a closing tag without a tag name, e.g. `</`\n\n# $attribute is the attribute name and $value the unquoted token that followed\n# it, shown reassembled the way the author should have written it.\nparse-attribute-value-unquoted = Attribute values must be enclosed in quotes: `{ $attribute }="{ $value }"`\n\nparse-close-tag-without-open-tag = Invalid DoenetML: Found closing tag `{ $tag }`, but no corresponding opening tag\n\nparse-close-tag-mismatched = Invalid DoenetML: Mismatched closing tag. Expected `</{ $expected }>`. Found `{ $found }`\n\n# The conversion\'s fall-through: the syntax tree held a node shape it has no\n# case for. Reaching an author means the grammar and the conversion have gone\n# out of step, which is a bug in Doenet rather than in their document — hence\n# `parser-` rather than the `parse-` of every message above, which is about\n# what the author wrote. They are still the one looking at it, so it is\n# translated like any other error. $node is the node\'s own name and stays as\n# it is.\nparser-node-unconvertible = Could not convert node { $node } to Dast node.\n\n## Names\n\n# $reason says which rule the name broke, as a key rather than a phrase, so the\n# whole sentence is translatable rather than assembled from two halves.\nname-attribute-invalid =\n Invalid attribute name=\'{ $name }\'. { $reason ->\n [characters] Names can contain only letters, numbers, underscores or hyphens.\n *[start] Names must start with a letter.\n }\n\ncomponent-name-invalid-start = Invalid component name "{ $name }". Names must start with a letter.\n\n## `<answer>` sugar\n\nanswer-video-watched-missing-video = Answer with type videoWatched must have a video attribute\n\nanswer-video-watched-video-not-reference = Answer with type videoWatched must have video attribute that is a reference\n\nanswer-name-not-single-text = Answer name attribute must have a single text child\n\n## Referencing another document\n\n# $attribute is the attribute the URI was written in (`copyFrom`, `extend`, …)\n# and stays as written; $uri is the author\'s own value.\n\nexternal-doenetml-recursion-limit = Unable to retrieve external DoenetML due to too many levels of recursion. Is there a circular reference?\n\nexternal-doenetml-unavailable = Unable to retrieve DoenetML from { $attribute }="{ $uri }"\n\nexternal-doenetml-type-mismatch = Invalid DoenetML retrieved from { $attribute }="{ $uri }": it did not match the component type "{ $componentType }"\n\n## Deprecated syntax\n\n# $from and $to are attribute names and $component a tag name; all three stay\n# as written. $component is `none` for a rename that applies to every component\n# accepting the attribute, where naming one would be wrong.\n#\n# The `[deprecation]` opening is a literal marker shared by all four messages,\n# not a word: leave it as it is.\n\ndeprecated-attribute-renamed =\n { $component ->\n [none] [deprecation] Attribute `{ $from }` is deprecated; use `{ $to }` instead.\n *[other] [deprecation] Attribute `{ $from }` on `<{ $component }>` is deprecated; use `{ $to }` instead.\n }\n\ndeprecated-attribute-renamed-conflict =\n { $component ->\n [none] [deprecation] Attribute `{ $from }` is deprecated and ignored because `{ $to }` is also specified.\n *[other] [deprecation] Attribute `{ $from }` on `<{ $component }>` is deprecated and ignored because `{ $to }` is also specified.\n }\n\ndeprecated-attribute-ignored = [deprecation] Attribute `{ $attribute }` on `<{ $component }>` is deprecated and ignored.\n\n# An attribute replaced by a child element rather than by another attribute:\n# $attribute and $component stay as written, and so does $child, which is the\n# tag name of the child to write instead.\n\ndeprecated-attribute-to-child = [deprecation] Attribute `{ $attribute }` on `<{ $component }>` is deprecated; use a `<{ $child }>` child instead.\n\n# One value of an attribute is deprecated while the attribute itself stays:\n# $value is what the author wrote and $to what to write instead, with\n# $attribute and $component naming where. All four stay as written.\n\ndeprecated-attribute-value-renamed = [deprecation] Value `{ $value }` of attribute `{ $attribute }` on `<{ $component }>` is deprecated; use `{ $to }` instead.\n\n\n## Language coverage\n\n# `<pluralize>` runs an English part-of-speech model over its text and puts the\n# nouns in the plural. There is no equivalent for an arbitrary language — a\n# correct plural needs that language\'s own morphology, and often its\n# dictionary — so in a document written in anything else the word is left as\n# the author typed it, and this says so rather than silently doing nothing.\n#\n# Raised only when there is nothing else to fall back on: a `pluralForm` is the\n# author supplying their own language\'s plural, and that is honored in every\n# language, which is why this can recommend it.\n#\n# $locale is the document\'s language tag, as declared.\npluralize-english-only = `<pluralize>` can only pluralize English, so its text is left unchanged in a document written in { $locale }. Write the plural form directly, or set it with the `pluralForm` attribute.\n\n\n## Checking against the schema\n\n# What the editor draws a squiggle under: the language server\'s own check of\n# the document against the DoenetML schema, run on every keystroke and\n# answered before anything is evaluated. A beginner meets these first, and\n# usually only these, because a document that does not pass them rarely gets\n# as far as producing a diagnostic from the core.\n#\n# `@doenet/lsp-tools` writes its English beside the code rather than rendering\n# it from here, for the same reason `@doenet/parser` does: it is inside the\n# language-server bundle, which `@doenet/codemirror` embeds verbatim and\n# starts as a blob worker, and a catalog on the editor\'s critical path is what\n# `packages/lsp/scripts/check-server-bundle.mjs` exists to reject. The two\n# copies are held together by a test in that package, which runs the checker\n# over a corpus and asserts every coded violation renders to exactly what the\n# checker wrote — so a message edited here without its counterpart fails\n# there.\n#\n# $tag, $parent and $attribute quote the author\'s own source back at them and\n# stay exactly as written; the angle brackets and backticks around them are\n# punctuation this catalog supplies, not part of the name.\n\nschema-element-unrecognized = Element `<{ $tag }>` is not a recognized Doenet element.\n\nschema-element-not-allowed-at-root = Element `<{ $tag }>` is not allowed at the root of the document.\n\nschema-element-not-allowed-inside = Element `<{ $tag }>` is not allowed inside of `<{ $parent }>`.\n\nschema-attribute-unrecognized = Element `<{ $tag }>` doesn\'t have an attribute called `{ $attribute }`.\n\n# $allowed is the attribute\'s permitted values, each already in double quotes\n# and joined for the reader\'s language. $isList says whether the attribute\n# takes several of them at once: one situation, two sentences, because the\n# reader has to be told they are choosing a whole list rather than a value.\nschema-attribute-value-not-allowed =\n { $isList ->\n [true] Attribute `{ $attribute }` of element `<{ $tag }>` must be a list whose items are each one of: { $allowed }\n *[other] Attribute `{ $attribute }` of element `<{ $tag }>` must be one of: { $allowed }\n }\n\n\n## The `<select>` family\'s error boxes\n##\n## The messages that replace the whole component with a red box rather than\n## warning beside it: nothing can be selected, so there is nothing to render.\n## They were the last uncoded `_error` path in the worker (#1581).\n##\n## Counts arrive as numbers rather than as text, so a language that agrees a\n## noun with them can select on them. English does not agree here — it says\n## "1 options" today and these messages reproduce it exactly, because the box\'s\n## text is what the existing suites pin.\n##\n## Being numbers, they are grouped: a count of 1500 renders as "1,500" in\n## English where the concatenated sentence these replaced wrote "1500". That is\n## the one way the English moved, and it moved in the right direction — these\n## are quantities, not identifiers like a line or a section number, which is\n## the distinction that decides between a number and a string everywhere in\n## these catalogs.\n##\n## Translators: component and attribute names — `selectFromSequence`,\n## `selectPrimeNumbers`, `from`, `to`, `step` — are DoenetML identifiers, not\n## words. They are written into these messages as they stand and must be left\n## in English exactly as written.\n\nselect-variant-name-option-count-mismatch = Invalid variant name for select. Variant name { $variantName } appears in { $numOptions } options but number to select is { $numToSelect }.\n\nselect-variant-name-without-options = Some variants are specified for select but no options are specified for possible variant name: { $variantName }.\n\nselect-variant-name-not-possible = Variant name { $variantName } that is specified for select is not a possible variant name.\n\nselect-too-few-options = Cannot select { $numToSelect } components from only { $numOptions }.\n\nselect-from-sequence-too-few-values = Cannot select { $numToSelect } values from a sequence of length { $length }.\n\nselect-from-sequence-indices-count-mismatch = Number of indices specified for select must match number to select\n\nselect-from-sequence-indices-not-integers = All indices specified for select must be integers\n\nselect-from-sequence-index-excluded = Specified index of selectfromsequence that was excluded\n\nselect-from-sequence-indices-excluded-combination = Specified indices of selectfromsequence that was an excluded combination\n\nselect-from-sequence-coprime-not-positive-integers = Cannot select coprime combinations as not selecting positive integers.\n\n# Translators: from, to and step are attribute names. They are written into\n# the message rather than passed in because these three never vary — an\n# argument is for a name that changes from one call to the next.\nselect-from-sequence-coprime-common-factor = Cannot select coprime numbers. All possible values share a common factor. (Specified values of "from" or "to" must be coprime with "step".)\n\nselect-from-sequence-coprime-single-number = Cannot select coprime combinations from a single number that is not 1.\n\nselect-from-sequence-excluded-too-many-combinations = Excluded over 70% of combinations in selectFromSequence\n\n# The sibling of `select-from-sequence-coprime-common-factor`, and a different\n# situation rather than a rewording of it: that one is decided up front, from\n# the sequence\'s own arithmetic. This one is what is left after two hundred\n# draws found no coprime combination among values that could have supplied one.\nselect-from-sequence-coprime-none-found = Could not select coprime numbers. All possible values share a common factor.\n\nselect-from-sequence-too-few-unique-values = Cannot select { $numToSelect } unique values from sequence of length { $numPossibleValues }\n\nselect-prime-numbers-too-few-values = Cannot select { $numToSelect } values from a list of primes of length { $numValues }\n\nselect-prime-numbers-values-count-mismatch = Number of values specified for select must match number to select\n\nselect-prime-numbers-values-not-prime = All values specified for select prime number must be in the list of primes\n\nselect-prime-numbers-values-excluded-combination = Specified values of selectPrimeNumbers was an excluded combination\n\nselect-prime-numbers-excluded-too-many-combinations = Excluded over 70% of combinations in selectPrimeNumbers\n\n# Both flukes are shared by `<selectFromSequence>` and `<selectPrimeNumbers>`,\n# which say the same thing in the same words. Neither is reachable in practice\n# — each follows two hundred independent draws — but an unreachable box is\n# still a box, and it renders in whatever language the rest of the page does.\nselect-random-combination-fluke = By extremely unlikely fluke, couldn\'t select combination of random values\n\nselect-random-value-fluke = By extremely unlikely fluke, couldn\'t select random value\n\n## Inputs embedded in math\n\n# Translators: $component is the input\'s own DoenetML tag and stays in English,\n# as do the attribute names `inline`, `expanded` and `width`. An input written\n# inside `<m>` is drawn in the place it is written, inside the typeset\n# expression, which makes room for it as it grows. That needs a control small\n# enough to sit in a line of mathematics, with a width the expression can\n# measure, in an expression that is not drawn on a graph; $reason says which of\n# those this input fails. When it fails, the input is not shown at all, and the\n# expression is typeset with the input\'s value in its place — a text input\'s\n# text, a math input\'s mathematics — or with nothing there for a choice input.\nmath-embedded-input-shape-unsuitable =\n { $reason ->\n [not-inline] This `<{ $component }>` is not shown because it is inside math and is not `inline`. Add `inline` so it becomes a drop-down list, which fits inside an expression.\n [expanded] This `<{ $component }>` is not shown because it is inside math and is `expanded`. Remove `expanded`; a multi-line box does not fit inside an expression.\n [on-graph] This `<{ $component }>` is not shown because it is inside math drawn on a graph, which has no room for an input.\n *[relative-width] This `<{ $component }>` is not shown because it is inside math and has a relative width. Give the width in absolute units, such as `px`, instead.\n }\n\n## `<sampleRandomNumbers>` and `<selectRandomNumbers>`\n##\n## Translators: `mean`, `standardDeviation`, `variance`, `numTotal`,\n## `numSuccesses`, `numDraws`, `numTrials`, `probability` and `numSamples` are\n## DoenetML attribute names. They are written into these messages as they stand\n## and must be left in English exactly as written. Each of these names the\n## attribute the author has to change, so a message that translated one would\n## point at an attribute that does not exist.\n\n# The spread reaches the sampler as a standard deviation however it was written,\n# so a negative `variance` arrives here as a `standardDeviation` of NaN and the\n# message has to name both for the author to know what to edit.\nsample-gaussian-parameters-invalid =\n Invalid mean ({ $mean }) or standardDeviation ({ $standardDeviation }) for a gaussian random variable. The mean must be a finite number, and the standardDeviation (or the variance it is derived from) must be finite and non-negative. No numbers can be sampled.\n\n# These three attributes are the only ones with no default, so leaving one out is\n# the commonest way to reach this message. Each arrives either as the number the\n# author wrote or as `not-set` for an attribute they left off entirely; translate\n# the "not set" wording, but leave the `not-set` key that selects it untouched.\nsample-hypergeometric-parameters-invalid =\n Invalid numTotal ({ $numTotal ->\n [not-set] not set\n *[other] { $numTotal }\n }), numSuccesses ({ $numSuccesses ->\n [not-set] not set\n *[other] { $numSuccesses }\n }), or numDraws ({ $numDraws ->\n [not-set] not set\n *[other] { $numDraws }\n }) for a hypergeometric random variable. numTotal must be a positive whole number, and numSuccesses and numDraws must be non-negative whole numbers no larger than numTotal. All three must also stay below about nine quadrillion, past which whole numbers can no longer be counted exactly.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-hypergeometric-draws-too-many =\n Drawing { $numDraws } items from a population of { $numTotal } would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numDraws, or bring it closer to numTotal.\n\nsample-binomial-parameters-invalid =\n Invalid numTrials ({ $numTrials }) or probability ({ $probability }) for a binomial random variable. numTrials must be a non-negative whole number below about nine quadrillion, past which whole numbers can no longer be counted exactly, and probability must be between 0 and 1.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-binomial-trials-too-many =\n Running { $numTrials } trials would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numTrials.\n\nsample-poisson-mean-invalid =\n Invalid mean ({ $mean }) for a poisson random variable. The mean must be a finite, non-negative number.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\nsample-poisson-mean-too-large =\n A poisson mean of { $mean } would need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce the mean.\n\n# $distribution names the distribution being sampled, e.g. "binomial" or\n# "multivariate hypergeometric"; $draws is roughly how many random draws each value\n# needs. Raised by `<sampleRandomNumbers>`, `<selectRandomNumbers>` and\n# `<sampleMultivariateRandomNumber>`, which count values with `numSamples`,\n# `numToSelect` and one vector respectively, so the wording names no attribute.\nsample-distribution-slow =\n Each value from this { $distribution } distribution needs about { $draws } random draws, so sampling may be slow. Reduce the distribution\'s parameters, or ask for fewer values, if the page feels sluggish.\n\n## List index operators\n\n# Raised by the index-returning list operators (`<indexOf>`, `<searchSorted>`)\n# when no `target` was given. $component names the tag the author wrote.\nindex-operator-missing-target =\n `{ $component }` has no `target` to look for, so it cannot report a position and gives 0.\n\n# Raised when the operator had no values to look through — an empty list, or one\n# whose only children were references that produced nothing.\nindex-operator-no-values =\n `{ $component }` has no values to look through, so it gives 0, which is not the index of any item.\n## `<sampleMultivariateRandomNumber>`\n##\n## Translators: `type`, `numInCategories` and `numDraws` are DoenetML attribute\n## names, and `hypergeometric` is one of the values `type` takes. They are written\n## into these messages as they stand and must be left in English exactly as\n## written. Each names the attribute the author has to change, so a message that\n## translated one would point at an attribute that does not exist.\n\n# Neither attribute has a default that names a population — numDraws has none at\n# all, and numInCategories falls back to a list with no categories in it — so\n# leaving one out is the commonest way to reach this message. Each arrives either\n# as the value the author wrote or as `not-set`: for numDraws when it is missing,\n# and for numInCategories when it names no categories, whether it was left off or\n# written empty. Translate the "not set" wording, but leave the `not-set` key that\n# selects it untouched.\nsample-multivariate-parameters-invalid =\n Invalid numInCategories ({ $numInCategories ->\n [not-set] not set\n *[other] { $numInCategories }\n }) or numDraws ({ $numDraws ->\n [not-set] not set\n *[other] { $numDraws }\n }) for a multivariate hypergeometric random variable. numInCategories must list at least one category, each a non-negative whole number, and numDraws must be a non-negative whole number no larger than their total. Each category, that total, and numDraws must also stay below about nine quadrillion, past which whole numbers can no longer be counted exactly.\n\n# $maxDraws is the largest number of random draws allowed for a single sample.\n# Drawing nearly the whole population is as cheap as drawing almost none of it, so\n# raising numDraws is a fix as well as lowering it. "could need" rather than "would\n# need": each category is counted at the most its draw could cost, so the count\n# these parameters are refused on is an upper bound on the work they really take.\nsample-multivariate-draws-too-many =\n Drawing { $numDraws } items from a population of { $numTotal } split into { $numCategories } categories could need more than { $maxDraws } random draws for each sample, which would stop the page from responding. Reduce numDraws, bring it closer to numTotal, or use fewer categories.\n\n# `type` has no default, so this is what leaving it off gets. A type the attribute\n# does not recognize falls back to no type at all and reaches this message too,\n# after a separate one naming the value that was rejected — hence "no distribution\n# was named" rather than wording that assumes the attribute is missing.\nsample-multivariate-type-not-specified =\n No multivariate distribution was named for this random variable, so nothing was sampled. Give the type attribute the name of a distribution, such as `type="hypergeometric"`.\n\n## Counting operators\n\n# Raised by `<tally>` when the author named `categories` explicitly and some\n# values matched none of them, so those values were not counted anywhere. Info\n# rather than a warning: a list fed by an input legitimately holds\n# non-categories while a student is typing. It deliberately does not say how\n# many such values there were: the diagnostics queue is append-only and\n# deduplicates by message, so a count would leave one permanent entry behind\n# for every number of stray values the list passed through while being typed.\ntally-values-outside-categories =\n Some values matched none of the declared categories, so they were not counted.\n\n# Raised by `<tally>` when `categories` names the same category more than once.\n# A warning rather than info: unlike a stray value, a repeated category is a\n# property of what the author wrote, so it stays true of a settled document. The\n# message says what the counts will be, since the behavior is defensible but not\n# what an author who repeated a category by accident expects.\ntally-repeated-category =\n `categories` names the same category more than once. Each count reports the values equal to its own category, so the repeated ones all report the same number.\n\n# Raised by `<binCounts>` when no `bins` attribute was given, so there are no\n# intervals to count into. $component names the tag the author wrote.\nbin-counts-missing-bins =\n `{ $component }` has no `bins` cut points, so there are no intervals to count into and it gives no counts.\n\n# Raised by `<binCounts>` when `bins` held fewer than the two cut points needed\n# to define a single interval. $count is how many were given, and can be 0 or 1,\n# so the sentence is worded to read for both without forking on the number.\nbin-counts-too-few-cut-points =\n `bins` needs at least 2 cut points to define an interval, but received { $count }.\n\n# Raised by `<binCounts>` when its values are not all numeric, so they cannot be\n# placed between numeric cut points. $component names the tag the author wrote.\nbin-counts-values-not-numeric =\n `{ $component }` can only count numeric values into bins, but not every value it was given is numeric. All counts are 0.\n\n# Raised by `<binCounts>` when the `bins` cut points do not climb: one is\n# smaller than the one before it, so a bin would run backwards and its count\n# would come out negative, or one is not a number at all, which has the same\n# effect. Equal adjacent cut points are accepted, so the message says "at least\n# as large as" rather than "increasing": what is rejected is a decrease, not a\n# failure to strictly increase. Between two interior cut points that names an\n# empty bin; at either end the outermost-edge rule can still put a value in it.\nbin-counts-cut-points-decreasing =\n Each `bins` cut point must be a number at least as large as the one before it, but one is not a number or is smaller than its predecessor, so no counts were produced.\n\n## Charts\n\n# Raised by `<barChart>` when a value is not a finite number, so it gets no bar.\n# The alternative reading of a missing bar is a value of zero, which the author\n# cannot distinguish by looking, so the absence is stated rather than left to be\n# inferred. No count: the queue is append-only and deduplicates by message, and\n# the number of such values changes as an input is typed into.\nbar-chart-values-not-drawable =\n `<barChart>` draws no bar for a value that is not a finite number, so those places on the chart are empty rather than zero.\n\n# Raised by `<barChart>` when `barWidth` is outside the (0, 1] range a fraction\n# of a bar\'s slot can take. $barWidth is what the author wrote.\nbar-chart-bar-width-invalid =\n `barWidth` must be greater than 0 and at most 1, but { $barWidth } was given. Using 0.8 instead.\n';
38636
38636
  const editor = '# Editor and language-server surfaces: the footer, the diagnostics panel, the\n# variant picker, the accessibility button, and the context-help panel beside\n# them. Selected by `uiLocale`.\n#\n# The editor binds to *one* language, and it is the one the viewer below it\n# resolved rather than the one the surrounding host chrome uses: the panel\n# lists diagnostics rendered down there, where an authored `<document lang>` is\n# known, and a footer in one language above a panel in another reads worse than\n# either choice on its own (#1580).\n#\n# The LSP ships bundled with its DoenetML version, so these catalogs are\n# version-correct rather than always-latest.\n#\n# Message ids are lower-kebab-case Fluent identifiers, optionally with a\n# single `.attribute` suffix (`format-document`).\n\n\n## The viewer\'s controls\n##\n## `editor-update-viewer` names the button that recompiles the document. Its\n## word depends on whether the source changed or only the document\'s state\n## did, which is a distinction the code makes and a `$action` says: the button\n## is otherwise identical, and splitting it into two messages would let the two\n## drift.\n##\n## The keyboard hint is a separate branch rather than text appended after the\n## title, because where a shortcut sits in a sentence is not the same in every\n## language. `$shortcut` is a key combination and stays as written.\n##\n## The tooltip takes the word as `$word` rather than referencing the message\n## above it: a message reference resolves only inside its own bundle, so a\n## locale that translated the tooltip but not the word would render the\n## reference literally instead of falling back to English. This is the shape\n## `paginator-page-status` already uses.\n\n# Button label. "Update" recompiles after a source edit; "Reset" reverts\n# only the document\'s live state to match — same button, different verb.\n# Keep both forms short enough to fit a toolbar button.\neditor-update-viewer =\n { $action ->\n [reset] Reset\n *[update] Update\n }\n\n# Tooltip on the button above. { $word } is that button\'s own current label\n# ("Update" or "Reset"), so this reads as e.g. "Update Viewer" or\n# "Reset Viewer". { $shortcut } appends the keyboard shortcut when one exists.\neditor-update-viewer-title =\n { $shortcut ->\n [none] { $word } Viewer\n *[other] { $word } Viewer { $shortcut }\n }\n\n\n## The variant picker\n\n# Label for the variant picker control itself (a noun, like a field label).\neditor-variant = Variant\n\n# Placeholder text shown in the empty filter input, before the user types\n# anything — not a button or instruction.\neditor-variant-filter = Filter...\n\n# Button/action label: advances to the next variant in the list.\neditor-variant-next = Select next variant\n\n# Button/action label: goes back to the previous variant in the list.\neditor-variant-previous = Select previous variant\n\n\n## The accessibility status button\n##\n## `WCAG AA` is the name of the standard and is not translated, the way\n## `accessibility-heading-level-1` already leaves it.\n##\n## The tooltip and the label are separate messages rather than one with an\n## extra clause: the label counts the violations and the tooltip does not, and\n## a screen reader and a hover are different audiences.\n##\n## `$action` is whether clicking opens or closes the report — an interpolated\n## English verb before this, which no locale could reach and which no language\n## has to place where English does.\n\neditor-accessibility-title =\n { $status ->\n [violations] WCAG AA accessibility violation identified. Click to { $action ->\n [close] close\n *[open] open\n } accessibility report.\n [advisories] Click to { $action ->\n [close] close\n *[open] open\n } accessibility report. No WCAG AA violations were found, but additional accessibility recommendations are available.\n *[clean] Click to { $action ->\n [close] close\n *[open] open\n } accessibility report. No accessibility issues were found.\n }\n\neditor-accessibility-label =\n { $status ->\n [violations] WCAG AA accessibility violation identified. { $count ->\n [one] { $count } WCAG AA violation\n *[other] { $count } WCAG AA violations\n } found. Click to { $action ->\n [close] close\n *[open] open\n } accessibility report.\n [advisories] No WCAG AA violations identified. { $count ->\n [one] { $count } additional accessibility recommendation\n *[other] { $count } additional accessibility recommendations\n } found. Click to { $action ->\n [close] close\n *[open] open\n } accessibility report.\n *[clean] No WCAG AA violations identified. Click to { $action ->\n [close] close\n *[open] open\n } accessibility report.\n }\n\n# The word on the button itself, beside the icon, when there are violations.\neditor-accessibility-badge = WCAG\n\n\n## The footer\n##\n## `$version` is a version number and stays as written.\n\neditor-version-title = DoenetML version { $version }\n\neditor-tab-help = Context-sensitive help\n# The word beside the icon on that tab, which has room for one word.\neditor-tab-help-short = Context\neditor-tab-errors = Errors\neditor-tab-warnings = Warnings\neditor-tab-info = Info\neditor-tab-accessibility = Accessibility\neditor-tab-responses = Submitted responses\n\n# A tab\'s accessible name when it carries a count: "Errors: 3".\neditor-tab-with-count = { $label }: { $count }\n\neditor-options = Editor options\neditor-format-as-doenetml = Format as DoenetML\neditor-format-as-xml = Format as XML\n\n\n## The diagnostics panel\n\n# Where in the source a diagnostic was found. `$line` arrives as text, not as a\n# number: it identifies the line, so line 1234 is "#1234" and not "#1,234".\neditor-diagnostic-line = Line #{ $line }\n\neditor-no-errors = No Errors\neditor-no-warnings = No Warnings\neditor-no-info = No Info Diagnostics\n\neditor-show-info-annotations = Show info diagnostics in editor\neditor-show-accessibility-annotations = Show accessibility diagnostics in editor\n\n# Links into the documentation, which has no translated pages yet. The words\n# move; where they point does not (#1580).\neditor-accessibility-learn-more = Learn how Doenet approaches accessibility\n\n# The heading over the WCAG AA failures. The standard\'s name is a link, so it\n# arrives as an argument rather than being written into the sentence — the\n# brackets around it are this catalog\'s punctuation, and the link is the code\'s.\neditor-accessibility-violations-heading = Accessibility violations ({ $standard })\n\neditor-accessibility-other-heading = Other accessibility issues\neditor-none-found = None found\n\n\n## Submitted responses\n\neditor-no-responses = No submitted responses yet\neditor-response-answer-id = Answer Id\neditor-response-response = Response\neditor-response-credit = Credit\neditor-response-submitted = Submitted\n\n\n## The context-help panel\n##\n## The panel beside the diagnostics, which explains whatever the cursor is on.\n## It is the last of the surfaces the header above names.\n##\n## Several of these sentences have marked-up fragments in them — an element\n## name in `<code>`, a link, a rendered piece of inline markdown. Those arrive\n## as arguments and are put back as React nodes after the message is formatted,\n## so a translation owns the whole sentence including where each fragment sits\n## and the punctuation around it. A translation that drops one simply renders\n## without it rather than losing the sentence.\n##\n## Element names, attribute names and `styleNumber` are DoenetML identifiers\n## and stay as written. The descriptions and summaries the panel shows come\n## from the schema, which is generated from the documentation and is not\n## translated, and the values it resolves — a color\'s derived word, a\n## function name, a type — come from the language server in the same state.\n## What is here is the panel\'s own prose around them (#1580).\n\nhelp-placeholder = Place cursor on a tag name, attribute, or { $ref } for documentation.\n\nhelp-unsupported-ref-chain = Help for multi-part references like { $example } is not yet supported.\n\nhelp-unresolved-ref =\n { $reason ->\n [notFound] No referent found for reference: { $ref }.\n [multiple] Multiple referents found for reference: { $ref }.\n *[indeterminate] A referent for { $ref } could not be determined.\n }\n\n# Both links end in an arrow, which is direction rather than punctuation and is\n# the same in every language this ships in — but it is inside the message, so a\n# language written right to left can turn it around.\nhelp-learn-about-references = Learn about references →\nhelp-reference-page = Reference page →\n\n# What can go where the cursor is. Two selectors joined: where the cursor sits,\n# and what the schema allows there.\nhelp-suggestions-header =\n { $location ->\n [inside] Inside { $element }\n *[top] At the top level\n }{ $allowed ->\n [none] { " — nothing goes here." }\n [text] { " — type text here." }\n [text-and-components] { " — type text here, or try:" }\n *[components] { " — things to try:" }\n }\n\n# `$shortcut` is a key combination and stays as written. `$total` is a real\n# count, so a language that agrees a noun with it can select on it.\nhelp-suggestions-footer = Press { $shortcut } to see all { $total } components.\n\n# An element\'s name joined to its one-line summary. `$name` is empty where the\n# panel has already printed the name beside this — a suggestion in the list —\n# and only the separator is wanted, so the message has to read as punctuation\n# on its own.\nhelp-name-summary = { $name } — { $summary }\n\n# `$line` is text, not a number: it identifies a line, so line 1234 is "1234"\n# and not "1,234". `none` is how a position that is not known selects a\n# sentence without one rather than substituting an empty parenthesis.\nhelp-ref-is-reference =\n { $line ->\n [none] { $ref } is a reference to { $target }.\n *[other] { $ref } is a reference to { $target } (line { $line }).\n }\n\nhelp-ref-derived-from =\n { $line ->\n [none] Introduced by { $owner } as { $role }.\n *[other] Introduced by { $owner } on line { $line } as { $role }.\n }\n\nhelp-property-is-reference =\n { $line ->\n [none] { $ref } is a reference to the { $property } property of { $element }.\n *[other] { $ref } is a reference to the { $property } property of { $element } (line { $line }).\n }\n\n# The badge on the title row saying what kind of thing the panel is explaining.\nhelp-kind-attribute = attribute\nhelp-kind-snippet = snippet\nhelp-kind-array-entry = array entry\n\nhelp-default = Default:\nhelp-active-default = Active default:\n\n# Appended after the active default\'s value. `styleNumber` is the attribute\'s\n# own name and stays as written; the space and brackets around it do not.\nhelp-style-number-annotation = { " " }(styleNumber { $styleNumber })\n\nhelp-allowed-values =\n { $perItem ->\n [true] Allowed values (one per item):\n *[other] Allowed values:\n }\n\n# Heading for values the editor offers without requiring: the attribute accepts\n# others too, and nothing warns about them. Distinct from `help-allowed-values`\n# so a translation can pick a word that suggests rather than constrains.\nhelp-suggested-values = Suggested values:\n\nhelp-inserts = Inserts:\n\nhelp-coordinates =\n { $count ->\n [one] Coordinate:\n *[other] Coordinates:\n }\n\nhelp-type = Type:\n\nhelp-resolved-style = Resolved style (styleNumber { $styleNumber }):\n\nhelp-resolved-function-names = Resolved function names:\nhelp-reset-list = Reset list on this input:\nhelp-added-on-input = Added on this input:\nhelp-removed-on-input = Removed on this input:\n\n# The three names are attributes an author writes, so they stay as written.\nhelp-reset-overrides = { $reset } overrides { $additional } and { $removed }.\n\n# Length syntax for a `componentSize` attribute (`width`, `height`). The values\n# listed alongside this label are examples the panel renders as chips.\nhelp-accepted-sizes = Accepted sizes:\nhelp-size-units = A bare number is pixels. A percentage is a share of the width around the component.\n\n# For a `height`, which is offered no percentage: the note must not raise a form\n# the attribute does not support.\nhelp-size-units-absolute = A bare number is pixels.\n\n# For a width that picks a named `size` preset (`<graph>`, `<image>`, `<video>`):\n# a percentage there is a share of the largest width any component may take, not\n# of the space around this one.\nhelp-size-units-preset = A bare number is pixels, and a percentage is a share of the widest a component can be.\n\n# For a side-by-side `width`, which is offered no absolute form: the same rule,\n# the other way round.\nhelp-size-units-relative = A percentage is a share of the width around the component.\n\n# `size` names a sibling attribute an author writes, so it stays as written.\nhelp-size-snaps-to-preset = This width picks the nearest { $size } preset rather than being used exactly.\n';
38637
38637
  const CATALOG_NAMESPACES = [
38638
38638
  "chrome",
@@ -42885,6 +42885,8 @@ const DIAGNOSTIC_CODES = {
42885
42885
  "doenet-w0140": "bin-counts-values-not-numeric",
42886
42886
  "doenet-w0141": "bin-counts-cut-points-decreasing",
42887
42887
  "doenet-w0142": "tally-repeated-category",
42888
+ "doenet-w0143": "bar-chart-bar-width-invalid",
42889
+ "doenet-w0144": "bar-chart-values-not-drawable",
42888
42890
  "doenet-e0001": "pretzel-circuit-first-problem-distractor",
42889
42891
  "doenet-e0002": "component-type-invalid",
42890
42892
  "doenet-e0003": "attribute-repeated",
@@ -47291,7 +47293,7 @@ async function cidFromArrayBuffer(data) {
47291
47293
  await crypto.subtle.digest("SHA-256", new Uint8Array());
47292
47294
  digest = (data2) => crypto.subtle.digest("SHA-256", data2);
47293
47295
  } catch (e22) {
47294
- const sha256 = (await import("./sha256-DT5xJ2Hv-BKf1gPKZ-BIVxkAku.js").then((n2) => n2.s)).default;
47296
+ const sha256 = (await import("./sha256-DT5xJ2Hv-0zW5w2Y1-BaHkM60c.js").then((n2) => n2.s)).default;
47295
47297
  digest = (data2) => sha256(data2, {
47296
47298
  asBytes: true
47297
47299
  });
@@ -53963,11 +53965,24 @@ function expandAttribute({
53963
53965
  }
53964
53966
  }
53965
53967
  if (attrDef.copyComponentAttributesForCreatedComponent) {
53968
+ const lowerCaseMapping = {};
53969
+ for (const authorSpelling in allUnflattenedAttributes) {
53970
+ lowerCaseMapping[authorSpelling.toLowerCase()] = authorSpelling;
53971
+ }
53966
53972
  for (let attrName of attrDef.copyComponentAttributesForCreatedComponent) {
53967
- if (allUnflattenedAttributes[attrName]) {
53968
- unflattenedComponentAttributes[attrName] = JSON.parse(
53969
- JSON.stringify(allUnflattenedAttributes[attrName])
53970
- );
53973
+ const authorSpelling = lowerCaseMapping[attrName.toLowerCase()];
53974
+ if (authorSpelling !== void 0) {
53975
+ unflattenedComponentAttributes[attrName] = {
53976
+ ...JSON.parse(
53977
+ JSON.stringify(
53978
+ allUnflattenedAttributes[authorSpelling]
53979
+ )
53980
+ ),
53981
+ // The declared spelling, not the author's, so that
53982
+ // the copy is indistinguishable from one written
53983
+ // out on the created component.
53984
+ name: attrName
53985
+ };
53971
53986
  }
53972
53987
  }
53973
53988
  }
@@ -91190,15 +91205,11 @@ function returnBreakStringsIntoTypeSugarInstruction(componentName) {
91190
91205
  }
91191
91206
  return { replacementFunction: breakStringsMacrosIntoTypeBySpaces };
91192
91207
  }
91193
- function returnListTypeAttribute({
91194
- readsTarget = false,
91195
- alsoReads = null
91196
- } = {}) {
91208
+ function returnListTypeAttribute({ readsTarget = false } = {}) {
91197
91209
  const base = "Component type to interpret bare string children as.";
91198
- const attributeItAlsoReads = readsTarget ? "target" : alsoReads;
91199
91210
  return {
91200
91211
  createPrimitiveOfType: "string",
91201
- description: attributeItAlsoReads ? `${base} Also decides how \`${attributeItAlsoReads}\` is read, since it has no type of its own.` : base,
91212
+ description: readsTarget ? `${base} Also decides how \`target\` is read, since it has no type of its own.` : base,
91202
91213
  highlighted: true,
91203
91214
  validValues: [
91204
91215
  {
@@ -91717,20 +91728,8 @@ class CountingBaseListOperator extends CompositeComponent {
91717
91728
  // Since the operator treats each child as a separate argument,
91718
91729
  // composites with no replacement should be ignored.
91719
91730
  static descendantCompositesMustHaveAReplacement = false;
91720
- // Named by a subclass whose own attribute is a
91721
- // `_componentListWithSelectableType` and so is read by `type` as well —
91722
- // `<tally>`'s `categories`. The reference pages show the `type`
91723
- // description, and an author who cannot see that it governs their
91724
- // categories writes `categories="apple fig"` without `type="text"` and
91725
- // gets a numeric reading that matches nothing, silently.
91726
- static typeAlsoReads = null;
91727
91731
  static createAttributesObject() {
91728
91732
  let attributes = super.createAttributesObject();
91729
- attributes.type = {
91730
- ...returnListTypeAttribute({ alsoReads: this.typeAlsoReads }),
91731
- createStateVariable: "type",
91732
- defaultValue: null
91733
- };
91734
91733
  Object.assign(attributes, returnPassThroughAttributeDeclarations());
91735
91734
  attributes.asList = {
91736
91735
  createPrimitiveOfType: "boolean",
@@ -91741,15 +91740,11 @@ class CountingBaseListOperator extends CompositeComponent {
91741
91740
  };
91742
91741
  return attributes;
91743
91742
  }
91744
- // Include children that can be added due to sugar
91743
+ // Include children that can be added due to sugar. What bare strings are
91744
+ // read *as* is left to the subclass: `<binCounts>` can only ever count
91745
+ // numbers, so it reads them the way `<sum>` does, while `<tally>` counts
91746
+ // values of any comparable type and so has to be told which.
91745
91747
  static additionalSchemaChildren = ["string"];
91746
- static returnSugarInstructions() {
91747
- let sugarInstructions = super.returnSugarInstructions();
91748
- sugarInstructions.push(
91749
- returnBreakStringsIntoTypeSugarInstruction(this.componentType)
91750
- );
91751
- return sugarInstructions;
91752
- }
91753
91748
  static returnChildGroups() {
91754
91749
  return [
91755
91750
  {
@@ -91905,21 +91900,53 @@ function distinctValues(values2, numeric2) {
91905
91900
  }
91906
91901
  class Tally extends CountingBaseListOperator {
91907
91902
  static componentType = "tally";
91908
- static typeAlsoReads = "categories";
91909
91903
  static componentDocs = {
91910
91904
  summary: "How many times each category appears in a list"
91911
91905
  };
91912
91906
  static createAttributesObject() {
91913
91907
  let attributes = super.createAttributesObject();
91908
+ attributes.type = {
91909
+ ...returnListTypeAttribute(),
91910
+ description: "Component type to interpret bare string children as, which they require. Also overrides how `categories` is read, which is otherwise text."
91911
+ };
91914
91912
  attributes.categories = {
91915
91913
  createComponentOfType: "_componentListWithSelectableType",
91914
+ // The type reaches the categories twice over, and both routes have
91915
+ // to agree: the sugar that wraps the bare strings reads the
91916
+ // attribute written here, while the state variable that reads the
91917
+ // wrapped values back resolves `type` on the parent. So the
91918
+ // default is declared in both places — `text` below, and `text`
91919
+ // again on the `type` state variable — and an explicit `type` is
91920
+ // copied down here so that it still wins on both routes.
91921
+ attributesForCreatedComponent: { type: "text" },
91922
+ copyComponentAttributesForCreatedComponent: ["type"],
91916
91923
  description: "The categories to count, in the order the counts are reported. Omit to count the distinct values present, in sorted order.",
91917
91924
  highlighted: true
91918
91925
  };
91919
91926
  return attributes;
91920
91927
  }
91928
+ static returnSugarInstructions() {
91929
+ let sugarInstructions = super.returnSugarInstructions();
91930
+ sugarInstructions.push(
91931
+ returnBreakStringsIntoTypeSugarInstruction(this.componentType)
91932
+ );
91933
+ return sugarInstructions;
91934
+ }
91921
91935
  static returnStateVariableDefinitions() {
91922
91936
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
91937
+ stateVariableDefinitions.type = {
91938
+ returnDependencies: () => ({
91939
+ typeAttr: {
91940
+ dependencyType: "attributePrimitive",
91941
+ attributeName: "type"
91942
+ }
91943
+ }),
91944
+ definition({ dependencyValues }) {
91945
+ return {
91946
+ setValue: { type: dependencyValues.typeAttr ?? "text" }
91947
+ };
91948
+ }
91949
+ };
91923
91950
  stateVariableDefinitions.countValues = {
91924
91951
  returnDependencies: () => ({
91925
91952
  categoriesAttr: {
@@ -91990,7 +92017,7 @@ class Tally extends CountingBaseListOperator {
91990
92017
  }
91991
92018
  }
91992
92019
  function tallyValues({ values: values2, numeric: numeric2, declaredCategories, declaredType }) {
91993
- const comparableCategories = declaredCategories === null ? distinctValues(values2, numeric2) : declaredCategories.map(comparableValueFromRaw);
92020
+ const comparableCategories = declaredCategories === null ? distinctValues(values2, numeric2) : declaredCategories.map((raw) => comparableCategory(raw, numeric2));
91994
92021
  const counts = comparableCategories.map(() => 0);
91995
92022
  let anyUncounted = false;
91996
92023
  for (const value of values2) {
@@ -92036,6 +92063,19 @@ function tallyValues({ values: values2, numeric: numeric2, declaredCategories, d
92036
92063
  }
92037
92064
  return { counts, labels, diagnostics: diagnostics2 };
92038
92065
  }
92066
+ function comparableCategory(raw, numeric2) {
92067
+ const value = comparableValueFromRaw(raw);
92068
+ if (!numeric2 || value === null || typeof raw !== "string") {
92069
+ return value;
92070
+ }
92071
+ let numericalValue;
92072
+ try {
92073
+ numericalValue = Context.fromText(raw).evaluate_to_constant();
92074
+ } catch (e32) {
92075
+ return value;
92076
+ }
92077
+ return typeof numericalValue === "number" && !Number.isNaN(numericalValue) ? { numericalValue, textValue: raw, isNumeric: true } : value;
92078
+ }
92039
92079
  function labelComponentType({ declaredType, comparableCategories, numeric: numeric2 }) {
92040
92080
  if (declaredType !== null) {
92041
92081
  return declaredType === "letters" ? "text" : declaredType;
@@ -92075,6 +92115,13 @@ class BinCounts extends CountingBaseListOperator {
92075
92115
  };
92076
92116
  return attributes;
92077
92117
  }
92118
+ static returnSugarInstructions() {
92119
+ let sugarInstructions = super.returnSugarInstructions();
92120
+ sugarInstructions.push(
92121
+ returnBreakStringsIntoMathsBySpacesSugarInstruction()
92122
+ );
92123
+ return sugarInstructions;
92124
+ }
92078
92125
  static returnStateVariableDefinitions() {
92079
92126
  let stateVariableDefinitions = super.returnStateVariableDefinitions();
92080
92127
  stateVariableDefinitions.countValues = {
@@ -92229,6 +92276,1885 @@ const CountOperators = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defi
92229
92276
  BinCounts,
92230
92277
  Tally
92231
92278
  }, Symbol.toStringTag, { value: "Module" }));
92279
+ function returnSizeAttributes({ componentName }) {
92280
+ return {
92281
+ width: {
92282
+ createComponentOfType: "componentSize",
92283
+ description: `Explicit width of the ${componentName} (overrides size).`
92284
+ },
92285
+ size: {
92286
+ createComponentOfType: "text",
92287
+ createStateVariable: "specifiedSize",
92288
+ defaultValue: "medium",
92289
+ toLowerCase: true,
92290
+ validValues: [
92291
+ { value: "tiny", description: "About 1/12 the full width." },
92292
+ { value: "small", description: "About 30% of the full width." },
92293
+ { value: "medium", description: "About half the full width." },
92294
+ { value: "large", description: "About 70% of the full width." },
92295
+ { value: "full", description: "The full available width." }
92296
+ ],
92297
+ description: `Named size preset for the ${componentName}.`
92298
+ }
92299
+ };
92300
+ }
92301
+ function returnSizeStateVariableDefinitions({ componentName }) {
92302
+ return {
92303
+ size: {
92304
+ description: `The size of the ${componentName}.`,
92305
+ public: true,
92306
+ defaultValue: "medium",
92307
+ hasEssential: true,
92308
+ shadowingInstructions: {
92309
+ createComponentOfType: "text"
92310
+ },
92311
+ returnDependencies: () => ({
92312
+ specifiedSize: {
92313
+ dependencyType: "stateVariable",
92314
+ variableName: "specifiedSize"
92315
+ },
92316
+ widthAttr: {
92317
+ dependencyType: "attributeComponent",
92318
+ attributeName: "width",
92319
+ variableNames: ["componentSize"]
92320
+ }
92321
+ }),
92322
+ definition({ dependencyValues, usedDefault }) {
92323
+ const defaultSize = "medium";
92324
+ if (!usedDefault.specifiedSize) {
92325
+ return {
92326
+ setValue: { size: dependencyValues.specifiedSize }
92327
+ };
92328
+ } else if (dependencyValues.widthAttr) {
92329
+ let componentSize = dependencyValues.widthAttr.stateValues.componentSize;
92330
+ if (componentSize === null) {
92331
+ return {
92332
+ setValue: { size: defaultSize }
92333
+ };
92334
+ }
92335
+ let { isAbsolute, size: widthSize } = componentSize;
92336
+ let size2;
92337
+ if (isAbsolute) {
92338
+ for (let [
92339
+ ind,
92340
+ pixels
92341
+ ] of orderedWidthMidpoints.entries()) {
92342
+ if (widthSize <= pixels) {
92343
+ size2 = sizePossibilities[ind];
92344
+ break;
92345
+ }
92346
+ }
92347
+ if (!size2) {
92348
+ size2 = defaultSize;
92349
+ }
92350
+ } else {
92351
+ for (let [
92352
+ ind,
92353
+ percent
92354
+ ] of orderedPercentWidthMidpoints.entries()) {
92355
+ if (widthSize <= percent) {
92356
+ size2 = sizePossibilities[ind];
92357
+ break;
92358
+ }
92359
+ }
92360
+ if (!size2) {
92361
+ size2 = defaultSize;
92362
+ }
92363
+ }
92364
+ return {
92365
+ setValue: { size: size2 }
92366
+ };
92367
+ } else {
92368
+ return {
92369
+ useEssentialOrDefaultValue: { size: true }
92370
+ };
92371
+ }
92372
+ }
92373
+ },
92374
+ width: {
92375
+ description: `The width of the ${componentName}.`,
92376
+ public: true,
92377
+ forRenderer: true,
92378
+ shadowingInstructions: {
92379
+ createComponentOfType: "componentSize"
92380
+ },
92381
+ returnDependencies: () => ({
92382
+ size: {
92383
+ dependencyType: "stateVariable",
92384
+ variableName: "size"
92385
+ }
92386
+ }),
92387
+ definition({ dependencyValues }) {
92388
+ let width = {
92389
+ isAbsolute: true,
92390
+ size: widthsBySize[dependencyValues.size]
92391
+ };
92392
+ return {
92393
+ setValue: { width }
92394
+ };
92395
+ }
92396
+ }
92397
+ };
92398
+ }
92399
+ function returnAxisLabelChildGroup({ axis }) {
92400
+ return {
92401
+ group: `${axis}Labels`,
92402
+ componentTypes: [`${axis}Label`]
92403
+ };
92404
+ }
92405
+ function returnAxisLabelStateVariableDefinitions({ axis }) {
92406
+ const labelVar = `${axis}Label`;
92407
+ const hasLatexVar = `${axis}LabelHasLatex`;
92408
+ const childGroup = `${axis}Labels`;
92409
+ return {
92410
+ [labelVar]: {
92411
+ description: `The ${axis}-axis label text.`,
92412
+ forRenderer: true,
92413
+ public: true,
92414
+ shadowingInstructions: {
92415
+ createComponentOfType: "label",
92416
+ addStateVariablesShadowingStateVariables: {
92417
+ hasLatex: {
92418
+ stateVariableToShadow: hasLatexVar
92419
+ }
92420
+ }
92421
+ },
92422
+ hasEssential: true,
92423
+ defaultValue: "",
92424
+ additionalStateVariablesDefined: [
92425
+ {
92426
+ variableName: hasLatexVar,
92427
+ forRenderer: true
92428
+ }
92429
+ ],
92430
+ returnDependencies: () => ({
92431
+ labelChild: {
92432
+ dependencyType: "child",
92433
+ childGroups: [childGroup],
92434
+ variableNames: ["value", "hasLatex"]
92435
+ }
92436
+ }),
92437
+ definition({ dependencyValues }) {
92438
+ if (dependencyValues.labelChild.length > 0) {
92439
+ const labelChild = dependencyValues.labelChild[dependencyValues.labelChild.length - 1];
92440
+ return {
92441
+ setValue: {
92442
+ [labelVar]: labelChild.stateValues.value,
92443
+ [hasLatexVar]: labelChild.stateValues.hasLatex
92444
+ }
92445
+ };
92446
+ } else {
92447
+ return {
92448
+ useEssentialOrDefaultValue: { [labelVar]: true },
92449
+ setValue: { [hasLatexVar]: false }
92450
+ };
92451
+ }
92452
+ },
92453
+ inverseDefinition({
92454
+ desiredStateVariableValues,
92455
+ dependencyValues
92456
+ }) {
92457
+ if (typeof desiredStateVariableValues[labelVar] !== "string") {
92458
+ return { success: false };
92459
+ }
92460
+ if (dependencyValues.labelChild.length > 0) {
92461
+ const lastLabelInd = dependencyValues.labelChild.length - 1;
92462
+ return {
92463
+ success: true,
92464
+ instructions: [
92465
+ {
92466
+ setDependency: "labelChild",
92467
+ desiredValue: desiredStateVariableValues[labelVar],
92468
+ childIndex: lastLabelInd,
92469
+ variableIndex: 0
92470
+ }
92471
+ ]
92472
+ };
92473
+ } else {
92474
+ return {
92475
+ success: true,
92476
+ instructions: [
92477
+ {
92478
+ setEssentialValue: labelVar,
92479
+ value: desiredStateVariableValues[labelVar]
92480
+ }
92481
+ ]
92482
+ };
92483
+ }
92484
+ }
92485
+ }
92486
+ };
92487
+ }
92488
+ function escapeXml(value) {
92489
+ return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
92490
+ }
92491
+ function asFiniteNumber(value) {
92492
+ return Number.isFinite(value) ? Number(value) : null;
92493
+ }
92494
+ function formatNumber$1(value) {
92495
+ const num = asFiniteNumber(value);
92496
+ return num === null ? null : `${num}`;
92497
+ }
92498
+ function formatPoint(point2) {
92499
+ if (!Array.isArray(point2) || point2.length < 2) {
92500
+ return null;
92501
+ }
92502
+ const x2 = formatNumber$1(point2[0]);
92503
+ const y2 = formatNumber$1(point2[1]);
92504
+ if (x2 === null || y2 === null) {
92505
+ return null;
92506
+ }
92507
+ return `(${x2},${y2})`;
92508
+ }
92509
+ function extractFinitePoint(point2) {
92510
+ if (!Array.isArray(point2) || point2.length < 2) {
92511
+ return null;
92512
+ }
92513
+ const x2 = asFiniteNumber(point2[0]);
92514
+ const y2 = asFiniteNumber(point2[1]);
92515
+ if (x2 === null || y2 === null) {
92516
+ return null;
92517
+ }
92518
+ return [x2, y2];
92519
+ }
92520
+ function extractFinitePointPair(points) {
92521
+ if (!Array.isArray(points) || points.length < 2) {
92522
+ return null;
92523
+ }
92524
+ const point1 = extractFinitePoint(points[0]);
92525
+ const point2 = extractFinitePoint(points[1]);
92526
+ if (point1 === null || point2 === null) {
92527
+ return null;
92528
+ }
92529
+ return [point1, point2];
92530
+ }
92531
+ function sanitizeHandle(value) {
92532
+ return String(value).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
92533
+ }
92534
+ function createStableHandle(descendant, index2, usedHandles) {
92535
+ const stem = sanitizeHandle(`${descendant.componentType}_${index2}`);
92536
+ let handle = stem || `graphical_${index2}`;
92537
+ let suffix = 1;
92538
+ while (usedHandles.has(handle)) {
92539
+ suffix += 1;
92540
+ handle = `${stem}_${suffix}`;
92541
+ }
92542
+ usedHandles.add(handle);
92543
+ return handle;
92544
+ }
92545
+ function warningSubjectForDescendant(descendant) {
92546
+ if (descendant?.componentName) {
92547
+ return `<${descendant.componentType}> (${descendant.componentName})`;
92548
+ }
92549
+ return `<${descendant?.componentType ?? "?"}>`;
92550
+ }
92551
+ function pushWarning({
92552
+ diagnostics: diagnostics2,
92553
+ code,
92554
+ args,
92555
+ position: position2
92556
+ }) {
92557
+ diagnostics2.push(
92558
+ codedDiagnostic({ type: "warning", code, args, position: position2 })
92559
+ );
92560
+ }
92561
+ function sortDescendantsByOrder(a2, b2) {
92562
+ if (Number.isFinite(a2.componentIdx) && Number.isFinite(b2.componentIdx)) {
92563
+ return a2.componentIdx - b2.componentIdx;
92564
+ }
92565
+ return String(a2.componentName ?? "").localeCompare(
92566
+ String(b2.componentName ?? "")
92567
+ );
92568
+ }
92569
+ function normalizeLineClipInputs({
92570
+ point1,
92571
+ point2,
92572
+ bounds
92573
+ }) {
92574
+ if (!Array.isArray(point1) || !Array.isArray(point2) || point1.length < 2 || point2.length < 2 || !Array.isArray(bounds) || bounds.length < 4) {
92575
+ return null;
92576
+ }
92577
+ const x0 = asFiniteNumber(point1[0]);
92578
+ const y0 = asFiniteNumber(point1[1]);
92579
+ const x1 = asFiniteNumber(point2[0]);
92580
+ const y1 = asFiniteNumber(point2[1]);
92581
+ const bxMin = asFiniteNumber(bounds[0]);
92582
+ const byMin = asFiniteNumber(bounds[1]);
92583
+ const bxMax = asFiniteNumber(bounds[2]);
92584
+ const byMax = asFiniteNumber(bounds[3]);
92585
+ if (x0 === null || y0 === null || x1 === null || y1 === null || bxMin === null || byMin === null || bxMax === null || byMax === null) {
92586
+ return null;
92587
+ }
92588
+ const dx = x1 - x0;
92589
+ const dy = y1 - y0;
92590
+ if (dx === 0 && dy === 0) {
92591
+ return null;
92592
+ }
92593
+ return { x0, y0, dx, dy, bxMin, byMin, bxMax, byMax };
92594
+ }
92595
+ function clipLineLikeToBounds({
92596
+ point1,
92597
+ point2,
92598
+ bounds,
92599
+ tMin,
92600
+ tMax
92601
+ }) {
92602
+ const inputs = normalizeLineClipInputs({ point1, point2, bounds });
92603
+ if (!inputs) {
92604
+ return null;
92605
+ }
92606
+ const { x0, y0, dx, dy, bxMin, byMin, bxMax, byMax } = inputs;
92607
+ let clippedTMin = tMin;
92608
+ let clippedTMax = tMax;
92609
+ const updateRange = (p0, delta, minBound, maxBound) => {
92610
+ if (delta !== 0) {
92611
+ let ta2 = (minBound - p0) / delta;
92612
+ let tb = (maxBound - p0) / delta;
92613
+ if (ta2 > tb) {
92614
+ [ta2, tb] = [tb, ta2];
92615
+ }
92616
+ clippedTMin = Math.max(clippedTMin, ta2);
92617
+ clippedTMax = Math.min(clippedTMax, tb);
92618
+ return clippedTMin <= clippedTMax;
92619
+ }
92620
+ return p0 >= minBound && p0 <= maxBound;
92621
+ };
92622
+ if (!updateRange(x0, dx, bxMin, bxMax)) {
92623
+ return null;
92624
+ }
92625
+ if (!updateRange(y0, dy, byMin, byMax)) {
92626
+ return null;
92627
+ }
92628
+ return [
92629
+ [x0 + clippedTMin * dx, y0 + clippedTMin * dy],
92630
+ [x0 + clippedTMax * dx, y0 + clippedTMax * dy]
92631
+ ];
92632
+ }
92633
+ const PREFIGURE_DARK_AXIS_COLOR = "#ffffff";
92634
+ function darkModeAxisStrokeAttr(darkMode) {
92635
+ return darkMode ? ` stroke="${PREFIGURE_DARK_AXIS_COLOR}"` : "";
92636
+ }
92637
+ const prefigurePointAlignmentByLabelPosition = {
92638
+ upperright: "ne",
92639
+ upperleft: "nw",
92640
+ lowerright: "se",
92641
+ lowerleft: "sw",
92642
+ top: "n",
92643
+ bottom: "s",
92644
+ left: "w",
92645
+ right: "e"
92646
+ };
92647
+ function normalizeKey(value) {
92648
+ return String(value).toLowerCase().replace(/[^a-z0-9]+/g, "");
92649
+ }
92650
+ const THEME_AWARE_LABEL_COLOR_ATTR = 'color="currentColor"';
92651
+ const LABEL_EDGE_PADDING_RATIO = 0.02;
92652
+ const LINE_LABEL_ENDPOINT_INSET_RATIO = 0.05;
92653
+ const LINE_LABEL_ENDPOINT_INSET_PIXELS = 12;
92654
+ const KNOWN_LINE_POSITIONS = /* @__PURE__ */ new Set([
92655
+ "left",
92656
+ "upperleft",
92657
+ "lowerleft",
92658
+ "right",
92659
+ "upperright",
92660
+ "lowerright",
92661
+ "center",
92662
+ "top",
92663
+ "bottom"
92664
+ ]);
92665
+ function formatLocation(value) {
92666
+ const rounded = Number(value.toFixed(6));
92667
+ return `${rounded}`;
92668
+ }
92669
+ function clamp01(value) {
92670
+ return Math.min(1, Math.max(0, value));
92671
+ }
92672
+ function getPreferredDirectionForLabelPosition(labelPosition) {
92673
+ switch (normalizeKey(labelPosition ?? "")) {
92674
+ case "right":
92675
+ return [1, 0];
92676
+ case "left":
92677
+ return [-1, 0];
92678
+ case "top":
92679
+ return [0, 1];
92680
+ case "bottom":
92681
+ return [0, -1];
92682
+ case "upperright":
92683
+ return [1 / Math.SQRT2, 1 / Math.SQRT2];
92684
+ case "upperleft":
92685
+ return [-1 / Math.SQRT2, 1 / Math.SQRT2];
92686
+ case "lowerright":
92687
+ return [1 / Math.SQRT2, -1 / Math.SQRT2];
92688
+ case "lowerleft":
92689
+ return [-1 / Math.SQRT2, -1 / Math.SQRT2];
92690
+ default:
92691
+ return null;
92692
+ }
92693
+ }
92694
+ function biasFromPreferredDirection(preferredDirection, ep1, ep2) {
92695
+ const dx = ep2[0] - ep1[0];
92696
+ const dy = ep2[1] - ep1[1];
92697
+ const segmentLength = Math.hypot(dx, dy);
92698
+ if (!(segmentLength > 0)) {
92699
+ return 0;
92700
+ }
92701
+ const tx = dx / segmentLength;
92702
+ const ty = dy / segmentLength;
92703
+ const agreement = tx * preferredDirection[0] + ty * preferredDirection[1];
92704
+ return Math.max(-1, Math.min(1, Math.SQRT2 * agreement));
92705
+ }
92706
+ function chooseEndpointBiasForLabelPosition(labelPosition, ep1, ep2) {
92707
+ const pos = normalizeKey(labelPosition ?? "");
92708
+ if (!KNOWN_LINE_POSITIONS.has(pos) || pos === "center") {
92709
+ return null;
92710
+ }
92711
+ const preferredDirection = getPreferredDirectionForLabelPosition(pos);
92712
+ if (!preferredDirection) {
92713
+ return null;
92714
+ }
92715
+ return biasFromPreferredDirection(preferredDirection, ep1, ep2);
92716
+ }
92717
+ function lineLabelAnchorPoint({
92718
+ ep1,
92719
+ ep2,
92720
+ location
92721
+ }) {
92722
+ return [
92723
+ ep1[0] + (ep2[0] - ep1[0]) * location,
92724
+ ep1[1] + (ep2[1] - ep1[1]) * location
92725
+ ];
92726
+ }
92727
+ function getGraphBounds(graphBounds) {
92728
+ const bounds = Array.isArray(graphBounds) ? graphBounds : null;
92729
+ if (!bounds || bounds.length !== 4) {
92730
+ return null;
92731
+ }
92732
+ const [xMin, yMin, xMax, yMax] = bounds;
92733
+ if (!Number.isFinite(xMin) || !Number.isFinite(yMin) || !Number.isFinite(xMax) || !Number.isFinite(yMax) || !(xMax > xMin) || !(yMax > yMin)) {
92734
+ return null;
92735
+ }
92736
+ return { xMin, yMin, xMax, yMax };
92737
+ }
92738
+ function getGraphDimensions(graphDimensions) {
92739
+ const dims = Array.isArray(graphDimensions) ? graphDimensions : null;
92740
+ if (!dims || dims.length !== 2) {
92741
+ return null;
92742
+ }
92743
+ const [width, height] = dims;
92744
+ if (!Number.isFinite(width) || !Number.isFinite(height) || !(width > 0) || !(height > 0)) {
92745
+ return null;
92746
+ }
92747
+ return { width, height };
92748
+ }
92749
+ function getLineTangent(ep1, ep2) {
92750
+ const dx = ep2[0] - ep1[0];
92751
+ const dy = ep2[1] - ep1[1];
92752
+ const length = Math.hypot(dx, dy);
92753
+ if (!(length > 0)) {
92754
+ return null;
92755
+ }
92756
+ return [dx / length, dy / length];
92757
+ }
92758
+ function estimateLabelMetrics(labelText, labelHasLatex) {
92759
+ const raw = typeof labelText === "string" ? labelText.trim() : "";
92760
+ const visibleLength = raw.length;
92761
+ let effectiveLength = visibleLength;
92762
+ if (labelHasLatex) {
92763
+ const latexRuns = (raw.match(/\\\(|\\\)|<m>|<\/m>/g) ?? []).length;
92764
+ effectiveLength += latexRuns * 3;
92765
+ }
92766
+ return {
92767
+ width: Math.min(6, Math.max(0.9, effectiveLength * 0.27)),
92768
+ height: 1
92769
+ };
92770
+ }
92771
+ function getLineAlignmentCandidates(labelPosition, location, preferNorth = true) {
92772
+ const pos = normalizeKey(labelPosition ?? "");
92773
+ if (!pos || !KNOWN_LINE_POSITIONS.has(pos)) {
92774
+ return null;
92775
+ }
92776
+ const h2 = location >= 0.5 ? "w" : "e";
92777
+ const oppositeH = h2 === "w" ? "e" : "w";
92778
+ const primary = preferNorth ? "n" : "s";
92779
+ const secondary = preferNorth ? "s" : "n";
92780
+ if (pos === "center") {
92781
+ return ["n", "s", `n${h2}`, `s${h2}`, `n${oppositeH}`, `s${oppositeH}`];
92782
+ }
92783
+ return [
92784
+ primary,
92785
+ `${primary}${h2}`,
92786
+ secondary,
92787
+ `${secondary}${h2}`,
92788
+ `${primary}${oppositeH}`,
92789
+ `${secondary}${oppositeH}`
92790
+ ];
92791
+ }
92792
+ function getAlignmentExtents(tangent, alignment, metrics) {
92793
+ const normal2 = [-tangent[1], tangent[0]];
92794
+ const width = metrics?.width ?? 1.2;
92795
+ const height = metrics?.height ?? 1;
92796
+ let minT = -width / 2;
92797
+ let maxT = width / 2;
92798
+ let minN = -height / 2;
92799
+ let maxN = height / 2;
92800
+ switch (alignment) {
92801
+ case "n":
92802
+ minN = 0;
92803
+ maxN = height;
92804
+ break;
92805
+ case "s":
92806
+ minN = -height;
92807
+ maxN = 0;
92808
+ break;
92809
+ case "e":
92810
+ minT = 0;
92811
+ maxT = width;
92812
+ break;
92813
+ case "w":
92814
+ minT = -width;
92815
+ maxT = 0;
92816
+ break;
92817
+ case "ne":
92818
+ minT = 0;
92819
+ maxT = width;
92820
+ minN = 0;
92821
+ maxN = height;
92822
+ break;
92823
+ case "nw":
92824
+ minT = -width;
92825
+ maxT = 0;
92826
+ minN = 0;
92827
+ maxN = height;
92828
+ break;
92829
+ case "se":
92830
+ minT = 0;
92831
+ maxT = width;
92832
+ minN = -height;
92833
+ maxN = 0;
92834
+ break;
92835
+ case "sw":
92836
+ minT = -width;
92837
+ maxT = 0;
92838
+ minN = -height;
92839
+ maxN = 0;
92840
+ break;
92841
+ }
92842
+ const points = [
92843
+ [
92844
+ tangent[0] * minT + normal2[0] * minN,
92845
+ tangent[1] * minT + normal2[1] * minN
92846
+ ],
92847
+ [
92848
+ tangent[0] * minT + normal2[0] * maxN,
92849
+ tangent[1] * minT + normal2[1] * maxN
92850
+ ],
92851
+ [
92852
+ tangent[0] * maxT + normal2[0] * minN,
92853
+ tangent[1] * maxT + normal2[1] * minN
92854
+ ],
92855
+ [
92856
+ tangent[0] * maxT + normal2[0] * maxN,
92857
+ tangent[1] * maxT + normal2[1] * maxN
92858
+ ]
92859
+ ];
92860
+ return {
92861
+ minX: Math.min(...points.map((point2) => point2[0])),
92862
+ maxX: Math.max(...points.map((point2) => point2[0])),
92863
+ minY: Math.min(...points.map((point2) => point2[1])),
92864
+ maxY: Math.max(...points.map((point2) => point2[1]))
92865
+ };
92866
+ }
92867
+ function computeAlignmentOverflowAt({
92868
+ anchor,
92869
+ tangent,
92870
+ alignment,
92871
+ graphBounds,
92872
+ labelMetrics
92873
+ }) {
92874
+ const bounds = getGraphBounds(graphBounds);
92875
+ if (!bounds) {
92876
+ return { overflowAmount: 0 };
92877
+ }
92878
+ const { xMin, yMin, xMax, yMax } = bounds;
92879
+ const width = xMax - xMin;
92880
+ const height = yMax - yMin;
92881
+ const edgePaddingX = width * LABEL_EDGE_PADDING_RATIO;
92882
+ const edgePaddingY = height * LABEL_EDGE_PADDING_RATIO;
92883
+ const extents = getAlignmentExtents(tangent, alignment, labelMetrics);
92884
+ const projectedLeft = anchor[0] + extents.minX;
92885
+ const projectedRight = anchor[0] + extents.maxX;
92886
+ const projectedBottom = anchor[1] + extents.minY;
92887
+ const projectedTop = anchor[1] + extents.maxY;
92888
+ const overflowLeft = Math.max(0, xMin + edgePaddingX - projectedLeft);
92889
+ const overflowRight = Math.max(0, projectedRight - (xMax - edgePaddingX));
92890
+ const overflowBottom = Math.max(0, yMin + edgePaddingY - projectedBottom);
92891
+ const overflowTop = Math.max(0, projectedTop - (yMax - edgePaddingY));
92892
+ const overflowAmount = overflowLeft + overflowRight + overflowBottom + overflowTop;
92893
+ return { overflowAmount };
92894
+ }
92895
+ function evaluateLineAlignmentOverflow({
92896
+ alignment,
92897
+ ep1,
92898
+ ep2,
92899
+ location,
92900
+ graphBounds,
92901
+ labelMetrics
92902
+ }) {
92903
+ const tangent = getLineTangent(ep1, ep2);
92904
+ if (!tangent) {
92905
+ return { overflowAmount: 0 };
92906
+ }
92907
+ const anchor = lineLabelAnchorPoint({ ep1, ep2, location });
92908
+ return computeAlignmentOverflowAt({
92909
+ anchor,
92910
+ tangent,
92911
+ alignment,
92912
+ graphBounds,
92913
+ labelMetrics
92914
+ });
92915
+ }
92916
+ function getLineLabelAlignment({
92917
+ labelPosition,
92918
+ location,
92919
+ ep1,
92920
+ ep2,
92921
+ graphBounds,
92922
+ labelText,
92923
+ labelHasLatex
92924
+ }) {
92925
+ const tangent = getLineTangent(ep1, ep2);
92926
+ const preferredDirection = getPreferredDirectionForLabelPosition(labelPosition);
92927
+ const preferNorth = preferredDirection && tangent ? -tangent[1] * preferredDirection[0] + tangent[0] * preferredDirection[1] >= 0 : true;
92928
+ const candidates = getLineAlignmentCandidates(
92929
+ labelPosition,
92930
+ location,
92931
+ preferNorth
92932
+ );
92933
+ if (!candidates?.length) {
92934
+ return null;
92935
+ }
92936
+ const labelMetrics = estimateLabelMetrics(labelText, labelHasLatex);
92937
+ let bestAlignment = candidates[0];
92938
+ let minimumOverflow = Number.POSITIVE_INFINITY;
92939
+ for (const candidate of candidates) {
92940
+ const result2 = evaluateLineAlignmentOverflow({
92941
+ alignment: candidate,
92942
+ ep1,
92943
+ ep2,
92944
+ location,
92945
+ graphBounds,
92946
+ labelMetrics
92947
+ });
92948
+ if (result2.overflowAmount === 0) {
92949
+ return candidate;
92950
+ }
92951
+ if (result2.overflowAmount < minimumOverflow) {
92952
+ bestAlignment = candidate;
92953
+ minimumOverflow = result2.overflowAmount;
92954
+ }
92955
+ }
92956
+ return bestAlignment;
92957
+ }
92958
+ function orientEndpointsForLineLabel(p1Raw, p2Raw) {
92959
+ if (p1Raw[0] > p2Raw[0] || p1Raw[0] === p2Raw[0] && p1Raw[1] > p2Raw[1]) {
92960
+ return [p2Raw, p1Raw];
92961
+ }
92962
+ return [p1Raw, p2Raw];
92963
+ }
92964
+ function labelMarkup({
92965
+ label,
92966
+ labelHasLatex
92967
+ }) {
92968
+ if (typeof label !== "string") {
92969
+ return null;
92970
+ }
92971
+ const text = label.trim();
92972
+ if (!text) {
92973
+ return null;
92974
+ }
92975
+ if (labelHasLatex) {
92976
+ const openDelimiters = (text.match(/\\\(/g) ?? []).length;
92977
+ const closeDelimiters = (text.match(/\\\)/g) ?? []).length;
92978
+ if (openDelimiters > 0 && openDelimiters === closeDelimiters) {
92979
+ return escapeXml(text).replace(/\\\(/g, "<m>").replace(/\\\)/g, "</m>");
92980
+ }
92981
+ return `<m>${escapeXml(text)}</m>`;
92982
+ }
92983
+ return escapeXml(text);
92984
+ }
92985
+ const POINT_ALIGNMENT_CANDIDATES = {
92986
+ n: ["n", "nw", "ne", "w", "e", "sw", "se", "s"],
92987
+ ne: ["ne", "n", "e", "nw", "se", "w", "s", "sw"],
92988
+ e: ["e", "ne", "se", "n", "s", "nw", "sw", "w"],
92989
+ se: ["se", "e", "s", "ne", "sw", "n", "w", "nw"],
92990
+ s: ["s", "se", "sw", "e", "w", "ne", "nw", "n"],
92991
+ sw: ["sw", "s", "w", "se", "nw", "e", "n", "ne"],
92992
+ w: ["w", "nw", "sw", "n", "s", "ne", "se", "e"],
92993
+ nw: ["nw", "n", "w", "ne", "sw", "e", "s", "se"]
92994
+ };
92995
+ function getPointAlignmentCandidates(labelPosition) {
92996
+ const key = normalizeKey(labelPosition ?? "");
92997
+ const primary = prefigurePointAlignmentByLabelPosition[key];
92998
+ if (!primary) return null;
92999
+ return POINT_ALIGNMENT_CANDIDATES[primary] ?? null;
93000
+ }
93001
+ function getPointLabelAlignment({
93002
+ labelPosition,
93003
+ point: point2,
93004
+ graphBounds,
93005
+ labelText,
93006
+ labelHasLatex
93007
+ }) {
93008
+ const candidates = getPointAlignmentCandidates(labelPosition);
93009
+ if (!candidates?.length) return null;
93010
+ const tangent = [1, 0];
93011
+ const labelMetrics = estimateLabelMetrics(labelText, labelHasLatex);
93012
+ let bestAlignment = candidates[0];
93013
+ let minimumOverflow = Number.POSITIVE_INFINITY;
93014
+ for (const candidate of candidates) {
93015
+ const { overflowAmount } = computeAlignmentOverflowAt({
93016
+ anchor: point2,
93017
+ tangent,
93018
+ alignment: candidate,
93019
+ graphBounds,
93020
+ labelMetrics
93021
+ });
93022
+ if (overflowAmount === 0) {
93023
+ return candidate;
93024
+ }
93025
+ if (overflowAmount < minimumOverflow) {
93026
+ bestAlignment = candidate;
93027
+ minimumOverflow = overflowAmount;
93028
+ }
93029
+ }
93030
+ return bestAlignment;
93031
+ }
93032
+ function pointLabelAttributes({
93033
+ stateValues,
93034
+ diagnostics: diagnostics2,
93035
+ warningPrefix,
93036
+ warningPosition
93037
+ }) {
93038
+ const label = labelMarkup({
93039
+ label: stateValues?.label,
93040
+ labelHasLatex: stateValues?.labelHasLatex
93041
+ });
93042
+ if (!label) {
93043
+ return null;
93044
+ }
93045
+ const attrs = [THEME_AWARE_LABEL_COLOR_ATTR];
93046
+ const rawPosition = stateValues?.labelPosition;
93047
+ if (rawPosition) {
93048
+ const rawXs = stateValues?.numericalXs;
93049
+ const pointCoord = Array.isArray(rawXs) && rawXs.length >= 2 && Number.isFinite(rawXs[0]) && Number.isFinite(rawXs[1]) ? [Number(rawXs[0]), Number(rawXs[1])] : null;
93050
+ const directAlignment = prefigurePointAlignmentByLabelPosition[normalizeKey(rawPosition)];
93051
+ if (directAlignment) {
93052
+ const alignment = pointCoord !== null && stateValues?.graphBounds ? getPointLabelAlignment({
93053
+ labelPosition: rawPosition,
93054
+ point: pointCoord,
93055
+ graphBounds: stateValues.graphBounds,
93056
+ labelText: stateValues?.label,
93057
+ labelHasLatex: stateValues?.labelHasLatex
93058
+ }) ?? directAlignment : directAlignment;
93059
+ attrs.push(`alignment="${escapeXml(alignment)}"`);
93060
+ } else {
93061
+ pushWarning({
93062
+ diagnostics: diagnostics2,
93063
+ code: "doenet-w0090",
93064
+ args: {
93065
+ subject: warningPrefix,
93066
+ labelPosition: rawPosition,
93067
+ labelKind: "point"
93068
+ },
93069
+ position: warningPosition
93070
+ });
93071
+ }
93072
+ }
93073
+ return { attrs, label };
93074
+ }
93075
+ function locationFromBiasWithInsetRatio({
93076
+ bias,
93077
+ insetRatio
93078
+ }) {
93079
+ const clampedBias = Math.max(-1, Math.min(1, bias));
93080
+ const clampedInset = clamp01(Math.min(0.5, insetRatio));
93081
+ const span = Math.max(0, 0.5 - clampedInset);
93082
+ return clamp01(0.5 + clampedBias * span);
93083
+ }
93084
+ function locationFromBiasWithAbsoluteEndpointOffset({
93085
+ bias,
93086
+ ep1,
93087
+ ep2,
93088
+ graphBounds,
93089
+ graphDimensions
93090
+ }) {
93091
+ const bounds = getGraphBounds(graphBounds);
93092
+ const dims = getGraphDimensions(graphDimensions);
93093
+ const dx = ep2[0] - ep1[0];
93094
+ const dy = ep2[1] - ep1[1];
93095
+ const segmentLength = Math.hypot(dx, dy);
93096
+ const graphWidth = bounds ? bounds.xMax - bounds.xMin : 0;
93097
+ const graphHeight = bounds ? bounds.yMax - bounds.yMin : 0;
93098
+ const shouldUseRelativeInsetFallback = !bounds || !dims || !(segmentLength > 0) || !(graphWidth > 0) || !(graphHeight > 0);
93099
+ if (shouldUseRelativeInsetFallback) {
93100
+ return locationFromBiasWithInsetRatio({
93101
+ bias,
93102
+ insetRatio: LINE_LABEL_ENDPOINT_INSET_RATIO
93103
+ });
93104
+ }
93105
+ const tx = dx / segmentLength;
93106
+ const ty = dy / segmentLength;
93107
+ const unitsPerPixelAlongLine = Math.hypot(
93108
+ tx * (graphWidth / dims.width),
93109
+ ty * (graphHeight / dims.height)
93110
+ );
93111
+ const absoluteOffset = LINE_LABEL_ENDPOINT_INSET_PIXELS * unitsPerPixelAlongLine;
93112
+ const insetRatio = Math.min(0.45, clamp01(absoluteOffset / segmentLength));
93113
+ const location = locationFromBiasWithInsetRatio({
93114
+ bias,
93115
+ insetRatio
93116
+ });
93117
+ return location;
93118
+ }
93119
+ function lineLabelLocationValue(labelPosition, ep1, ep2, options = {}) {
93120
+ const endpointBias = chooseEndpointBiasForLabelPosition(
93121
+ labelPosition,
93122
+ ep1,
93123
+ ep2
93124
+ );
93125
+ if (endpointBias === null) {
93126
+ return null;
93127
+ }
93128
+ if (options.absoluteEndpointOffset) {
93129
+ return locationFromBiasWithAbsoluteEndpointOffset({
93130
+ bias: endpointBias,
93131
+ ep1,
93132
+ ep2,
93133
+ graphBounds: options.graphBounds,
93134
+ graphDimensions: options.graphDimensions
93135
+ });
93136
+ }
93137
+ return locationFromBiasWithInsetRatio({
93138
+ bias: endpointBias,
93139
+ insetRatio: LINE_LABEL_ENDPOINT_INSET_RATIO
93140
+ });
93141
+ }
93142
+ function getLabelForLine({
93143
+ stateValues,
93144
+ ep1,
93145
+ ep2,
93146
+ diagnostics: diagnostics2,
93147
+ warningPrefix,
93148
+ warningPosition
93149
+ }) {
93150
+ const label = labelMarkup({
93151
+ label: stateValues?.label,
93152
+ labelHasLatex: stateValues?.labelHasLatex
93153
+ });
93154
+ if (!label) {
93155
+ return {
93156
+ labelAttrs: [],
93157
+ label: null
93158
+ };
93159
+ }
93160
+ const labelAttrs = [THEME_AWARE_LABEL_COLOR_ATTR];
93161
+ const rawPosition = stateValues?.labelPosition;
93162
+ const normalizedPosition = normalizeKey(rawPosition ?? "");
93163
+ const overrideLocRaw = stateValues?.lineLabelLocationOverride;
93164
+ const overrideLoc = Number(overrideLocRaw);
93165
+ const hasOverrideLoc = Number.isFinite(overrideLoc);
93166
+ const baseLoc = hasOverrideLoc ? clamp01(overrideLoc) : lineLabelLocationValue(rawPosition, ep1, ep2, {
93167
+ absoluteEndpointOffset: stateValues?.lineLabelAbsoluteEndpointOffset === true,
93168
+ graphBounds: stateValues?.graphBounds,
93169
+ graphDimensions: stateValues?.graphDimensions
93170
+ });
93171
+ let location = 0.5;
93172
+ if (baseLoc !== null && Number.isFinite(baseLoc)) {
93173
+ location = baseLoc;
93174
+ labelAttrs.push(
93175
+ `label-location="${escapeXml(formatLocation(location))}"`
93176
+ );
93177
+ }
93178
+ const alignmentLocationRaw = stateValues?.lineLabelAlignmentLocationOverride;
93179
+ const alignmentLocation = Number.isFinite(Number(alignmentLocationRaw)) ? Number(alignmentLocationRaw) : location;
93180
+ if (rawPosition) {
93181
+ const alignment = getLineLabelAlignment({
93182
+ labelPosition: rawPosition,
93183
+ location: alignmentLocation,
93184
+ ep1,
93185
+ ep2,
93186
+ graphBounds: stateValues?.graphBounds,
93187
+ labelText: stateValues?.label,
93188
+ labelHasLatex: stateValues?.labelHasLatex
93189
+ });
93190
+ if (alignment) {
93191
+ labelAttrs.push(`alignment="${escapeXml(alignment)}"`);
93192
+ } else if (!KNOWN_LINE_POSITIONS.has(normalizedPosition)) {
93193
+ pushWarning({
93194
+ diagnostics: diagnostics2,
93195
+ code: "doenet-w0090",
93196
+ args: {
93197
+ subject: warningPrefix,
93198
+ labelPosition: rawPosition,
93199
+ labelKind: "line-family"
93200
+ },
93201
+ position: warningPosition
93202
+ });
93203
+ }
93204
+ }
93205
+ return { labelAttrs, label };
93206
+ }
93207
+ const prefigureFillPatternByFillStyle = {
93208
+ horizontal: "horizontal",
93209
+ vertical: "vertical",
93210
+ diagonal: "diagonal",
93211
+ backdiagonal: "backdiagonal",
93212
+ dots: "dot",
93213
+ diamonds: "diamond"
93214
+ };
93215
+ const prefigureDashByLineStyle = {
93216
+ solid: null,
93217
+ dashed: "9 9",
93218
+ dotted: "4 4"
93219
+ };
93220
+ const prefigurePointStyleByMarkerStyle = {
93221
+ circle: "circle",
93222
+ square: "box",
93223
+ box: "box",
93224
+ diamond: "diamond",
93225
+ cross: "cross",
93226
+ plus: "plus",
93227
+ "double-circle": "double-circle"
93228
+ };
93229
+ function resolveSelectedStyleForTheme(selectedStyle, darkMode) {
93230
+ if (!selectedStyle || !darkMode) {
93231
+ return selectedStyle;
93232
+ }
93233
+ const pickDark = (darkKey, lightValue) => {
93234
+ const darkValue = selectedStyle[darkKey];
93235
+ return typeof darkValue === "string" ? darkValue : lightValue;
93236
+ };
93237
+ return {
93238
+ ...selectedStyle,
93239
+ lineColor: pickDark("lineColorDarkMode", selectedStyle.lineColor),
93240
+ lineColorWord: pickDark(
93241
+ "lineColorWordDarkMode",
93242
+ selectedStyle.lineColorWord
93243
+ ),
93244
+ fillColor: pickDark("fillColorDarkMode", selectedStyle.fillColor),
93245
+ fillColorWord: pickDark(
93246
+ "fillColorWordDarkMode",
93247
+ selectedStyle.fillColorWord
93248
+ ),
93249
+ markerColor: pickDark("markerColorDarkMode", selectedStyle.markerColor),
93250
+ markerColorWord: pickDark(
93251
+ "markerColorWordDarkMode",
93252
+ selectedStyle.markerColorWord
93253
+ )
93254
+ };
93255
+ }
93256
+ function styleAttributes({
93257
+ selectedStyle,
93258
+ diagnostics: diagnostics2,
93259
+ warningPrefix,
93260
+ warningPosition,
93261
+ includeFill = true
93262
+ }) {
93263
+ const attrs = [];
93264
+ const stroke = selectedStyle?.lineColor ?? selectedStyle?.lineColorWord;
93265
+ if (stroke) {
93266
+ attrs.push(`stroke="${escapeXml(stroke)}"`);
93267
+ }
93268
+ const thickness = formatNumber$1(selectedStyle?.lineWidth);
93269
+ if (thickness !== null) {
93270
+ attrs.push(`thickness="${escapeXml(thickness)}"`);
93271
+ }
93272
+ if (includeFill) {
93273
+ const fillStyle = selectedStyle?.fillStyle;
93274
+ const prefigurePattern = fillStyle && fillStyle !== "solid" ? prefigureFillPatternByFillStyle[fillStyle] : void 0;
93275
+ const fill = selectedStyle?.fillColor ?? selectedStyle?.fillColorWord;
93276
+ if (prefigurePattern !== void 0) {
93277
+ attrs.push(`fill-pattern="${escapeXml(prefigurePattern)}"`);
93278
+ if (fill) {
93279
+ attrs.push(`fill="${escapeXml(fill)}"`);
93280
+ }
93281
+ const fillPatternOpacity = formatNumber$1(
93282
+ selectedStyle?.fillPatternOpacity
93283
+ );
93284
+ if (fillPatternOpacity !== null) {
93285
+ attrs.push(`fill-opacity="${escapeXml(fillPatternOpacity)}"`);
93286
+ }
93287
+ } else {
93288
+ if (fill) {
93289
+ attrs.push(`fill="${escapeXml(fill)}"`);
93290
+ }
93291
+ const fillOpacity = formatNumber$1(selectedStyle?.fillOpacity);
93292
+ if (fillOpacity !== null) {
93293
+ attrs.push(`fill-opacity="${escapeXml(fillOpacity)}"`);
93294
+ }
93295
+ if (fillStyle && fillStyle !== "solid") {
93296
+ pushWarning({
93297
+ diagnostics: diagnostics2,
93298
+ code: "doenet-w0091",
93299
+ args: { subject: warningPrefix, fillStyle },
93300
+ position: warningPosition
93301
+ });
93302
+ }
93303
+ }
93304
+ }
93305
+ const lineOpacity = formatNumber$1(selectedStyle?.lineOpacity);
93306
+ if (lineOpacity !== null) {
93307
+ attrs.push(`stroke-opacity="${escapeXml(lineOpacity)}"`);
93308
+ }
93309
+ const lineStyle = selectedStyle?.lineStyle;
93310
+ if (lineStyle) {
93311
+ const dash = prefigureDashByLineStyle[lineStyle];
93312
+ if (dash) {
93313
+ attrs.push(`dash="${escapeXml(dash)}"`);
93314
+ } else if (!(lineStyle in prefigureDashByLineStyle)) {
93315
+ pushWarning({
93316
+ diagnostics: diagnostics2,
93317
+ code: "doenet-w0092",
93318
+ args: { subject: warningPrefix, lineStyle },
93319
+ position: warningPosition
93320
+ });
93321
+ }
93322
+ }
93323
+ return attrs;
93324
+ }
93325
+ function pointStyleAttributes({
93326
+ selectedStyle,
93327
+ diagnostics: diagnostics2,
93328
+ warningPrefix,
93329
+ warningPosition,
93330
+ includeFill = true
93331
+ }) {
93332
+ const attrs = [];
93333
+ const markerStyle = selectedStyle?.markerStyle;
93334
+ if (markerStyle) {
93335
+ const markerStyleString = String(markerStyle);
93336
+ const mappedStyle = prefigurePointStyleByMarkerStyle[markerStyleString];
93337
+ if (mappedStyle) {
93338
+ attrs.push(`style="${escapeXml(mappedStyle)}"`);
93339
+ } else if (markerStyleString.slice(0, 8) === "triangle") {
93340
+ attrs.push('style="diamond"');
93341
+ pushWarning({
93342
+ diagnostics: diagnostics2,
93343
+ code: "doenet-w0093",
93344
+ args: {
93345
+ subject: warningPrefix,
93346
+ markerStyle: markerStyleString
93347
+ },
93348
+ position: warningPosition
93349
+ });
93350
+ } else {
93351
+ pushWarning({
93352
+ diagnostics: diagnostics2,
93353
+ code: "doenet-w0094",
93354
+ args: {
93355
+ subject: warningPrefix,
93356
+ markerStyle: markerStyleString
93357
+ },
93358
+ position: warningPosition
93359
+ });
93360
+ }
93361
+ }
93362
+ const size2 = formatNumber$1(selectedStyle?.markerSize);
93363
+ if (size2 !== null) {
93364
+ attrs.push(`size="${escapeXml(size2)}"`);
93365
+ }
93366
+ const color = selectedStyle?.markerColor ?? selectedStyle?.markerColorWord ?? null;
93367
+ if (color) {
93368
+ if (includeFill) {
93369
+ attrs.push(`fill="${escapeXml(color)}"`);
93370
+ }
93371
+ attrs.push(`stroke="${escapeXml(color)}"`);
93372
+ }
93373
+ const opacity = formatNumber$1(selectedStyle?.markerOpacity);
93374
+ if (opacity !== null) {
93375
+ if (includeFill) {
93376
+ attrs.push(`fill-opacity="${escapeXml(opacity)}"`);
93377
+ }
93378
+ attrs.push(`stroke-opacity="${escapeXml(opacity)}"`);
93379
+ }
93380
+ const thickness = formatNumber$1(selectedStyle?.lineWidth);
93381
+ if (thickness !== null) {
93382
+ attrs.push(`thickness="${escapeXml(thickness)}"`);
93383
+ }
93384
+ return attrs;
93385
+ }
93386
+ const CHART_MARGINS_BOTTOM_RIGHT_TOP = [30, 12, 16];
93387
+ const AXIS_LABEL_MARGIN_BASE = 14;
93388
+ const AXIS_LABEL_MARGIN_PER_CHARACTER = 9;
93389
+ function fitMargins(available, near, far) {
93390
+ const total = near + far;
93391
+ const budget = Math.max(Math.floor(available / 2), 0);
93392
+ if (!Number.isFinite(available) || total <= budget || total <= 0) {
93393
+ return [near, far];
93394
+ }
93395
+ const scale = budget / total;
93396
+ return [Math.floor(near * scale), Math.floor(far * scale)];
93397
+ }
93398
+ const MAX_TICKS_MEASURED = 64;
93399
+ function widestTickLabelLength(firstTick, lastTick, step) {
93400
+ const asDrawn = (value) => Number.isFinite(value) ? snapNumber(value).toLocaleString("en-US", {
93401
+ maximumFractionDigits: 20
93402
+ }).length : 1;
93403
+ let widest = Math.max(asDrawn(firstTick), asDrawn(lastTick), 1);
93404
+ if (Number.isFinite(step) && step > 0) {
93405
+ const numTicks = Math.min(
93406
+ Math.floor((lastTick - firstTick) / step),
93407
+ MAX_TICKS_MEASURED
93408
+ );
93409
+ for (let ind = 1; ind < numTicks; ind++) {
93410
+ widest = Math.max(widest, asDrawn(firstTick + ind * step));
93411
+ }
93412
+ }
93413
+ return widest;
93414
+ }
93415
+ const TARGET_TICK_INTERVALS = 5;
93416
+ function snapNumber(value) {
93417
+ return Number.isFinite(value) ? Number(value.toPrecision(12)) : value;
93418
+ }
93419
+ function niceTickStep(span, minStep) {
93420
+ if (Number.isNaN(span) || span <= 0) {
93421
+ return Math.max(minStep, 1);
93422
+ }
93423
+ if (!Number.isFinite(span)) {
93424
+ return Math.max(
93425
+ minStep,
93426
+ snapNumber(Number.MAX_VALUE / TARGET_TICK_INTERVALS)
93427
+ );
93428
+ }
93429
+ const rough = span / TARGET_TICK_INTERVALS;
93430
+ const magnitude = 10 ** Math.floor(Math.log10(rough));
93431
+ if (!(magnitude > 0)) {
93432
+ return Math.max(minStep, rough) || Number.MIN_VALUE;
93433
+ }
93434
+ const normalized = rough / magnitude;
93435
+ let step;
93436
+ if (normalized <= 1) {
93437
+ step = 1;
93438
+ } else if (normalized <= 2) {
93439
+ step = 2;
93440
+ } else if (normalized <= 5) {
93441
+ step = 5;
93442
+ } else {
93443
+ step = 10;
93444
+ }
93445
+ return Math.max(minStep, snapNumber(step * magnitude));
93446
+ }
93447
+ function tickAtOrBeyond(value, step, direction) {
93448
+ const ratio = snapNumber(value / step);
93449
+ const index2 = direction === 1 ? Math.ceil(ratio) : Math.floor(ratio);
93450
+ return snapNumber(index2 * step);
93451
+ }
93452
+ function nextTickBeyond(value, step, direction) {
93453
+ const rounded = tickAtOrBeyond(value, step, direction);
93454
+ const beyond = rounded === snapNumber(value) ? snapNumber(rounded + direction * step) : rounded;
93455
+ return Number.isFinite(beyond) ? beyond : value;
93456
+ }
93457
+ function computeBarChartGeometry({
93458
+ values: values2,
93459
+ labels,
93460
+ barWidth,
93461
+ yMinAttr,
93462
+ yMaxAttr
93463
+ }) {
93464
+ const drawable = values2.map((value) => Number.isFinite(value));
93465
+ let largest = 0;
93466
+ let smallest = 0;
93467
+ let anyDrawable = false;
93468
+ for (const [ind, value] of values2.entries()) {
93469
+ if (!drawable[ind]) {
93470
+ continue;
93471
+ }
93472
+ if (!anyDrawable) {
93473
+ largest = value;
93474
+ smallest = value;
93475
+ anyDrawable = true;
93476
+ } else {
93477
+ largest = Math.max(largest, value);
93478
+ smallest = Math.min(smallest, value);
93479
+ }
93480
+ }
93481
+ const reachAbove = Math.max(0, largest);
93482
+ const reachBelow = Math.min(0, smallest);
93483
+ const wholeValues = values2.every(
93484
+ (value, ind) => !drawable[ind] || Number.isInteger(value)
93485
+ );
93486
+ const minStep = wholeValues ? 1 : 0;
93487
+ function autoBoundsFor(step) {
93488
+ return [
93489
+ reachBelow >= 0 ? 0 : nextTickBeyond(reachBelow, step, -1),
93490
+ reachAbove <= 0 ? step : nextTickBeyond(reachAbove, step, 1)
93491
+ ];
93492
+ }
93493
+ const [firstMin, firstMax] = autoBoundsFor(
93494
+ niceTickStep(reachAbove - reachBelow || 1, minStep)
93495
+ );
93496
+ const [autoYMin, autoYMax] = autoBoundsFor(
93497
+ niceTickStep(firstMax - firstMin, minStep)
93498
+ );
93499
+ let yMin = yMinAttr ?? autoYMin;
93500
+ let yMax = yMaxAttr ?? autoYMax;
93501
+ if (!Number.isFinite(yMin) || !Number.isFinite(yMax) || !(yMin < yMax)) {
93502
+ yMin = autoYMin;
93503
+ yMax = autoYMax;
93504
+ }
93505
+ const tickStep = niceTickStep(
93506
+ yMax - yMin,
93507
+ wholeValues && Number.isInteger(yMin) && Number.isInteger(yMax) ? 1 : 0
93508
+ );
93509
+ const halfWidth = barWidth / 2;
93510
+ const bars = [];
93511
+ const slots = [];
93512
+ values2.forEach((value, ind) => {
93513
+ const center = ind + 1;
93514
+ const label = labels[ind] ?? String(center);
93515
+ slots.push({ center, label });
93516
+ if (drawable[ind]) {
93517
+ bars.push({
93518
+ center,
93519
+ label,
93520
+ value,
93521
+ lowerLeft: [center - halfWidth, Math.min(0, value)],
93522
+ dimensions: [barWidth, Math.abs(value)]
93523
+ });
93524
+ }
93525
+ });
93526
+ return {
93527
+ bars,
93528
+ slots,
93529
+ // Every slot still counts toward the width, drawn or not, so a chart
93530
+ // with a gap in it keeps its remaining bars under their categories.
93531
+ //
93532
+ // The box ends one unit past the last bar's *center*, which is where
93533
+ // the gap beyond the last bar comes out the same size as the gap before
93534
+ // the first one: both are `1 - barWidth/2`. Ending half a unit past the
93535
+ // center instead leaves the last bar six times closer to the frame than
93536
+ // the first at the default width, and flush against it at `barWidth="1"`.
93537
+ bounds: [0, yMin, values2.length + 1, yMax],
93538
+ tickStep,
93539
+ undrawnValues: drawable.filter((canDraw) => !canDraw).length
93540
+ };
93541
+ }
93542
+ function createBarChartPrefigureXML({
93543
+ geometry,
93544
+ widthPx,
93545
+ heightPx,
93546
+ xLabel,
93547
+ xLabelHasLatex,
93548
+ yLabel,
93549
+ yLabelHasLatex,
93550
+ selectedStyle,
93551
+ displayValues,
93552
+ shortDescription,
93553
+ darkMode = false
93554
+ }) {
93555
+ const diagnostics2 = [];
93556
+ const [xMin, yMin, xMax, yMax] = geometry.bounds;
93557
+ const bbox = `(${formatNumber$1(xMin)},${formatNumber$1(yMin)},${formatNumber$1(xMax)},${formatNumber$1(yMax)})`;
93558
+ const step = geometry.tickStep;
93559
+ const firstTick = tickAtOrBeyond(yMin, step, 1);
93560
+ const lastTick = tickAtOrBeyond(yMax, step, -1);
93561
+ const vlabels = `(${formatNumber$1(firstTick)},${formatNumber$1(step)},${formatNumber$1(lastTick)})`;
93562
+ const [wantedBottom, wantedRight, wantedTop] = CHART_MARGINS_BOTTOM_RIGHT_TOP;
93563
+ const wantedLeft = AXIS_LABEL_MARGIN_BASE + AXIS_LABEL_MARGIN_PER_CHARACTER * widestTickLabelLength(firstTick, lastTick, step);
93564
+ const [marginLeft, marginRight] = fitMargins(
93565
+ widthPx,
93566
+ wantedLeft,
93567
+ wantedRight
93568
+ );
93569
+ const [marginBottom, marginTop] = fitMargins(
93570
+ heightPx,
93571
+ wantedBottom,
93572
+ wantedTop
93573
+ );
93574
+ const innerWidth = widthPx - marginLeft - marginRight;
93575
+ const innerHeight = heightPx - marginBottom - marginTop;
93576
+ const dimensions = `(${formatNumber$1(innerWidth)},${formatNumber$1(innerHeight)})`;
93577
+ const margins = `[${marginLeft},${marginBottom},${marginRight},${marginTop}]`;
93578
+ const strokeAttr = darkModeAxisStrokeAttr(darkMode);
93579
+ const axisLabelElements = [];
93580
+ const xLabelText = labelMarkup({
93581
+ label: xLabel,
93582
+ labelHasLatex: xLabelHasLatex
93583
+ });
93584
+ if (xLabelText) {
93585
+ axisLabelElements.push(
93586
+ `<xlabel alignment="nw" ${THEME_AWARE_LABEL_COLOR_ATTR}>${xLabelText}</xlabel>`
93587
+ );
93588
+ }
93589
+ const yLabelText = labelMarkup({
93590
+ label: yLabel,
93591
+ labelHasLatex: yLabelHasLatex
93592
+ });
93593
+ if (yLabelText) {
93594
+ axisLabelElements.push(
93595
+ `<ylabel alignment="se" ${THEME_AWARE_LABEL_COLOR_ATTR}>${yLabelText}</ylabel>`
93596
+ );
93597
+ }
93598
+ const axesInner = axisLabelElements.join("");
93599
+ const axesAttrs = `axes="all" decorations="no" vlabels="${escapeXml(vlabels)}"${strokeAttr}`;
93600
+ const axesElement = axesInner ? `<axes ${axesAttrs}>${axesInner}</axes>` : `<axes ${axesAttrs} />`;
93601
+ const barAttrs = styleAttributes({
93602
+ selectedStyle,
93603
+ diagnostics: diagnostics2,
93604
+ warningPrefix: "<barChart>"
93605
+ }).join(" ");
93606
+ const elements = [];
93607
+ const annotationElements = [];
93608
+ for (const slot of geometry.slots) {
93609
+ elements.push(
93610
+ `<tick-mark axis="horizontal" location="${formatNumber$1(slot.center)}"${strokeAttr} ${THEME_AWARE_LABEL_COLOR_ATTR}>${escapeXml(slot.label)}</tick-mark>`
93611
+ );
93612
+ }
93613
+ for (const bar of geometry.bars) {
93614
+ const handle = `bar-${bar.center}`;
93615
+ const lowerLeft = `(${formatNumber$1(bar.lowerLeft[0])},${formatNumber$1(bar.lowerLeft[1])})`;
93616
+ const barDimensions = `(${formatNumber$1(bar.dimensions[0])},${formatNumber$1(bar.dimensions[1])})`;
93617
+ elements.push(
93618
+ `<rectangle at="${escapeXml(handle)}" lower-left="${escapeXml(lowerLeft)}" dimensions="${escapeXml(barDimensions)}"${barAttrs ? ` ${barAttrs}` : ""} />`
93619
+ );
93620
+ if (displayValues) {
93621
+ const alignment = bar.value < 0 ? "south" : "north";
93622
+ const anchor = `(${formatNumber$1(bar.center)},${formatNumber$1(bar.value)})`;
93623
+ elements.push(
93624
+ `<label anchor="${escapeXml(anchor)}" alignment="${alignment}" ${THEME_AWARE_LABEL_COLOR_ATTR}>${escapeXml(formatNumber$1(bar.value) ?? "")}</label>`
93625
+ );
93626
+ }
93627
+ annotationElements.push(
93628
+ `<annotation ref="${escapeXml(handle)}" text="${escapeXml(`${bar.label}: ${formatNumber$1(bar.value)}`)}" />`
93629
+ );
93630
+ }
93631
+ const figureAnnotationText = shortDescription ? ` text="${escapeXml(shortDescription)}"` : "";
93632
+ const annotationsElement = `<annotations><annotation ref="figure"${figureAnnotationText}>${annotationElements.join("")}</annotation></annotations>`;
93633
+ const xml = `<diagram dimensions="${escapeXml(dimensions)}" margins="${escapeXml(margins)}"><coordinates bbox="${escapeXml(bbox)}">${axesElement}${elements.join("")}</coordinates>${annotationsElement}</diagram>`;
93634
+ return { xml, diagnostics: diagnostics2 };
93635
+ }
93636
+ function returnShortDescriptionStateVariableDefinition({
93637
+ componentType,
93638
+ componentName
93639
+ }) {
93640
+ return {
93641
+ shortDescription: {
93642
+ description: `A short accessibility description of the ${componentName}.`,
93643
+ forRenderer: true,
93644
+ public: true,
93645
+ shadowingInstructions: {
93646
+ createComponentOfType: "text"
93647
+ },
93648
+ returnDependencies: () => ({
93649
+ shortDescriptionChild: {
93650
+ dependencyType: "child",
93651
+ childGroups: ["shortDescriptions"],
93652
+ variableNames: ["text"]
93653
+ },
93654
+ decorative: {
93655
+ dependencyType: "stateVariable",
93656
+ variableName: "decorative"
93657
+ }
93658
+ }),
93659
+ definition({ dependencyValues }) {
93660
+ const children = dependencyValues.shortDescriptionChild;
93661
+ const shortDescription = children.length > 0 ? children[children.length - 1].stateValues.text.trim() : "";
93662
+ const diagnostics2 = [];
93663
+ if (shortDescription === "" && !dependencyValues.decorative) {
93664
+ diagnostics2.push(
93665
+ codedDiagnostic({
93666
+ type: "accessibility",
93667
+ level: 1,
93668
+ code: "doenet-a0001",
93669
+ args: { component: componentType }
93670
+ })
93671
+ );
93672
+ }
93673
+ return {
93674
+ setValue: { shortDescription },
93675
+ sendDiagnostics: diagnostics2
93676
+ };
93677
+ }
93678
+ }
93679
+ };
93680
+ }
93681
+ const DEFAULT_ASPECT_RATIO = 1.5;
93682
+ const DEFAULT_BAR_WIDTH = 0.8;
93683
+ class BarChart extends BlockComponent {
93684
+ constructor(args) {
93685
+ super(args);
93686
+ Object.assign(this.actions, {
93687
+ recordVisibilityChange: this.recordVisibilityChange.bind(this)
93688
+ });
93689
+ }
93690
+ static componentType = "barChart";
93691
+ static componentDocs = {
93692
+ summary: "A bar chart of a list of values, one bar per value."
93693
+ };
93694
+ static createAttributesObject() {
93695
+ let attributes = super.createAttributesObject();
93696
+ Object.assign(
93697
+ attributes,
93698
+ returnSizeAttributes({ componentName: "bar chart" })
93699
+ );
93700
+ attributes.aspectRatio = {
93701
+ description: "Aspect ratio (width / height) for the bar chart.",
93702
+ createComponentOfType: "number",
93703
+ createStateVariable: "aspectRatioAttr",
93704
+ defaultValue: DEFAULT_ASPECT_RATIO
93705
+ };
93706
+ attributes.categories = {
93707
+ createComponentOfType: "textList",
93708
+ description: "The label under each bar. Defaults to the bar's position, 1, 2, 3 and so on.",
93709
+ highlighted: true
93710
+ };
93711
+ attributes.barWidth = {
93712
+ description: "How much of each bar's slot the bar fills: greater than 0 and at most 1, so a bar may fill its slot but must have some width. The rest is the gap to the next bar.",
93713
+ createComponentOfType: "number",
93714
+ createStateVariable: "barWidthAttr",
93715
+ defaultValue: DEFAULT_BAR_WIDTH
93716
+ };
93717
+ attributes.yMin = {
93718
+ description: "Lowest value shown on the vertical axis. Defaults to 0, or to the first tick past the smallest value when some are negative, so that bar does not touch the bottom of the frame. Ignored, along with `yMax`, unless it is a finite number below it.",
93719
+ createComponentOfType: "number",
93720
+ createStateVariable: "yMinAttr",
93721
+ defaultValue: null
93722
+ };
93723
+ attributes.yMax = {
93724
+ description: "Highest value shown on the vertical axis. Defaults to the next tick above the tallest bar. Ignored, along with `yMin`, unless it is a finite number above it.",
93725
+ createComponentOfType: "number",
93726
+ createStateVariable: "yMaxAttr",
93727
+ defaultValue: null
93728
+ };
93729
+ attributes.displayValues = {
93730
+ description: "Whether to print each bar's value at its far end — above a bar that rises, below one that falls.",
93731
+ createComponentOfType: "boolean",
93732
+ createStateVariable: "displayValues",
93733
+ defaultValue: false,
93734
+ public: true
93735
+ };
93736
+ attributes.showBorder = {
93737
+ description: "Whether to render a border around the bar chart.",
93738
+ createComponentOfType: "boolean",
93739
+ createStateVariable: "showBorder",
93740
+ defaultValue: true,
93741
+ public: true,
93742
+ forRenderer: true
93743
+ };
93744
+ attributes.displayMode = {
93745
+ description: "How to size the bar chart.",
93746
+ createComponentOfType: "text",
93747
+ createStateVariable: "displayMode",
93748
+ validValues: [
93749
+ {
93750
+ value: "block",
93751
+ description: "Display as a block element on its own line."
93752
+ },
93753
+ {
93754
+ value: "inline",
93755
+ description: "Render inline with surrounding text."
93756
+ }
93757
+ ],
93758
+ defaultValue: "block",
93759
+ toLowerCase: true,
93760
+ forRenderer: true,
93761
+ public: true
93762
+ };
93763
+ attributes.horizontalAlign = {
93764
+ description: "Horizontal alignment of the bar chart within its container.",
93765
+ createComponentOfType: "text",
93766
+ createStateVariable: "horizontalAlign",
93767
+ validValues: [
93768
+ {
93769
+ value: "center",
93770
+ description: "Center the chart horizontally."
93771
+ },
93772
+ {
93773
+ value: "left",
93774
+ description: "Align the chart to the left edge."
93775
+ },
93776
+ {
93777
+ value: "right",
93778
+ description: "Align the chart to the right edge."
93779
+ }
93780
+ ],
93781
+ defaultValue: "center",
93782
+ toLowerCase: true,
93783
+ forRenderer: true,
93784
+ public: true
93785
+ };
93786
+ attributes.decorative = {
93787
+ description: "Whether the chart is purely decorative (excluded from a11y tree).",
93788
+ createPrimitiveOfType: "boolean",
93789
+ createStateVariable: "decorative",
93790
+ defaultValue: false,
93791
+ public: true,
93792
+ forRenderer: true
93793
+ };
93794
+ return attributes;
93795
+ }
93796
+ /**
93797
+ * No `annotations` group, unlike `<graph>`: a chart writes its own
93798
+ * annotations out of the bars it drew, so an authored `<annotations>` child
93799
+ * would have nothing to describe and would be silently dropped. Better that
93800
+ * it be reported as a child this is not.
93801
+ */
93802
+ // Include children that can be added by the sugar below.
93803
+ static additionalSchemaChildren = ["string"];
93804
+ /**
93805
+ * Bare numbers are read as bar heights: `<barChart>41 63 18</barChart>`.
93806
+ * Unconditional, with nothing to consult — a bar height is a number
93807
+ * whatever else the chart is doing, and the categories are labels that no
93808
+ * reading of the values touches. Broken into maths rather than numbers, as
93809
+ * `<sum>` and `<mean>` do, so that `1/2` is half rather than `NaN`.
93810
+ */
93811
+ static returnSugarInstructions() {
93812
+ let sugarInstructions = super.returnSugarInstructions();
93813
+ sugarInstructions.push(
93814
+ returnBreakStringsIntoMathsBySpacesSugarInstruction()
93815
+ );
93816
+ return sugarInstructions;
93817
+ }
93818
+ static returnChildGroups() {
93819
+ return [
93820
+ returnAxisLabelChildGroup({ axis: "x" }),
93821
+ returnAxisLabelChildGroup({ axis: "y" }),
93822
+ {
93823
+ group: "shortDescriptions",
93824
+ componentTypes: ["shortDescription"]
93825
+ },
93826
+ {
93827
+ group: "numbers",
93828
+ componentTypes: ["number"]
93829
+ },
93830
+ {
93831
+ group: "maths",
93832
+ componentTypes: ["math"]
93833
+ }
93834
+ ];
93835
+ }
93836
+ static returnStateVariableDefinitions() {
93837
+ let stateVariableDefinitions = super.returnStateVariableDefinitions();
93838
+ Object.assign(
93839
+ stateVariableDefinitions,
93840
+ returnSelectedStyleStateVariableDefinition(),
93841
+ returnSizeStateVariableDefinitions({ componentName: "bar chart" }),
93842
+ returnAxisLabelStateVariableDefinitions({ axis: "x" }),
93843
+ returnAxisLabelStateVariableDefinitions({ axis: "y" })
93844
+ );
93845
+ stateVariableDefinitions.aspectRatio = {
93846
+ description: "The aspect ratio (width / height) of the bar chart.",
93847
+ public: true,
93848
+ forRenderer: true,
93849
+ shadowingInstructions: {
93850
+ createComponentOfType: "number"
93851
+ },
93852
+ returnDependencies: () => ({
93853
+ aspectRatioAttr: {
93854
+ dependencyType: "stateVariable",
93855
+ variableName: "aspectRatioAttr"
93856
+ }
93857
+ }),
93858
+ definition({ dependencyValues }) {
93859
+ const requested = dependencyValues.aspectRatioAttr;
93860
+ const heightAtWidest = widthsBySize.full / requested;
93861
+ const aspectRatio = Number.isFinite(requested) && requested > 0 && Number.isFinite(heightAtWidest) ? requested : DEFAULT_ASPECT_RATIO;
93862
+ return { setValue: { aspectRatio } };
93863
+ }
93864
+ };
93865
+ stateVariableDefinitions.barWidth = {
93866
+ description: "How much of its slot each bar fills: greater than 0 and at most 1.",
93867
+ public: true,
93868
+ shadowingInstructions: {
93869
+ createComponentOfType: "number"
93870
+ },
93871
+ returnDependencies: () => ({
93872
+ barWidthAttr: {
93873
+ dependencyType: "stateVariable",
93874
+ variableName: "barWidthAttr"
93875
+ }
93876
+ }),
93877
+ definition({ dependencyValues }) {
93878
+ const requested = dependencyValues.barWidthAttr;
93879
+ if (requested > 0 && requested <= 1) {
93880
+ return { setValue: { barWidth: requested } };
93881
+ }
93882
+ return {
93883
+ setValue: { barWidth: DEFAULT_BAR_WIDTH },
93884
+ sendDiagnostics: [
93885
+ codedDiagnostic({
93886
+ type: "warning",
93887
+ code: "doenet-w0143",
93888
+ args: { barWidth: String(requested) }
93889
+ })
93890
+ ]
93891
+ };
93892
+ }
93893
+ };
93894
+ stateVariableDefinitions.hasAuthorAnnotations = {
93895
+ description: "Whether the bar chart carries annotations to navigate. Always true: they are generated from the bars.",
93896
+ public: true,
93897
+ forRenderer: true,
93898
+ shadowingInstructions: {
93899
+ createComponentOfType: "boolean"
93900
+ },
93901
+ returnDependencies: () => ({}),
93902
+ definition: () => ({ setValue: { hasAuthorAnnotations: true } })
93903
+ };
93904
+ Object.assign(
93905
+ stateVariableDefinitions,
93906
+ returnShortDescriptionStateVariableDefinition({
93907
+ componentType: "barChart",
93908
+ componentName: "bar chart"
93909
+ })
93910
+ );
93911
+ stateVariableDefinitions.barValues = {
93912
+ description: "The value of each bar, in order.",
93913
+ public: true,
93914
+ isArray: true,
93915
+ entryPrefixes: ["barValue"],
93916
+ shadowingInstructions: {
93917
+ createComponentOfType: "number"
93918
+ },
93919
+ returnArraySizeDependencies: () => ({
93920
+ valueChildren: {
93921
+ dependencyType: "child",
93922
+ childGroups: ["numbers", "maths"],
93923
+ variableNames: ["value"]
93924
+ }
93925
+ }),
93926
+ returnArraySize({ dependencyValues }) {
93927
+ return [dependencyValues.valueChildren.length];
93928
+ },
93929
+ returnArrayDependenciesByKey: () => ({
93930
+ globalDependencies: {
93931
+ valueChildren: {
93932
+ dependencyType: "child",
93933
+ childGroups: ["numbers", "maths"],
93934
+ variableNames: ["value"]
93935
+ }
93936
+ }
93937
+ }),
93938
+ arrayDefinitionByKey({ globalDependencyValues, arrayKeys }) {
93939
+ const barValues = {};
93940
+ for (const arrayKey of arrayKeys) {
93941
+ const child = globalDependencyValues.valueChildren[arrayKey];
93942
+ const value = child?.stateValues.value;
93943
+ barValues[arrayKey] = typeof value?.evaluate_to_constant === "function" ? value.evaluate_to_constant() : value;
93944
+ }
93945
+ return { setValue: { barValues } };
93946
+ }
93947
+ };
93948
+ stateVariableDefinitions.categories = {
93949
+ description: "The label under each bar, in order.",
93950
+ public: true,
93951
+ isArray: true,
93952
+ entryPrefixes: ["category"],
93953
+ shadowingInstructions: {
93954
+ createComponentOfType: "text"
93955
+ },
93956
+ returnArraySizeDependencies: () => ({
93957
+ barValues: {
93958
+ dependencyType: "stateVariable",
93959
+ variableName: "barValues"
93960
+ }
93961
+ }),
93962
+ returnArraySize({ dependencyValues }) {
93963
+ return [dependencyValues.barValues.length];
93964
+ },
93965
+ returnArrayDependenciesByKey: () => ({
93966
+ globalDependencies: {
93967
+ categoriesAttr: {
93968
+ dependencyType: "attributeComponent",
93969
+ attributeName: "categories",
93970
+ variableNames: ["texts"]
93971
+ }
93972
+ }
93973
+ }),
93974
+ arrayDefinitionByKey({ globalDependencyValues, arrayKeys }) {
93975
+ const declared = globalDependencyValues.categoriesAttr?.stateValues.texts;
93976
+ const categories = {};
93977
+ for (const arrayKey of arrayKeys) {
93978
+ const ind = Number(arrayKey);
93979
+ const declaredLabel = declared?.[ind];
93980
+ categories[arrayKey] = declaredLabel === void 0 ? String(ind + 1) : declaredLabel;
93981
+ }
93982
+ return { setValue: { categories } };
93983
+ }
93984
+ };
93985
+ stateVariableDefinitions.chartGeometry = {
93986
+ description: "The bars and bounding box of the chart, in data coordinates.",
93987
+ returnDependencies: () => ({
93988
+ barValues: {
93989
+ dependencyType: "stateVariable",
93990
+ variableName: "barValues"
93991
+ },
93992
+ categories: {
93993
+ dependencyType: "stateVariable",
93994
+ variableName: "categories"
93995
+ },
93996
+ barWidth: {
93997
+ dependencyType: "stateVariable",
93998
+ variableName: "barWidth"
93999
+ },
94000
+ yMinAttr: {
94001
+ dependencyType: "stateVariable",
94002
+ variableName: "yMinAttr"
94003
+ },
94004
+ yMaxAttr: {
94005
+ dependencyType: "stateVariable",
94006
+ variableName: "yMaxAttr"
94007
+ }
94008
+ }),
94009
+ definition({ dependencyValues }) {
94010
+ const geometry = computeBarChartGeometry({
94011
+ values: dependencyValues.barValues,
94012
+ labels: dependencyValues.categories,
94013
+ barWidth: dependencyValues.barWidth,
94014
+ yMinAttr: dependencyValues.yMinAttr,
94015
+ yMaxAttr: dependencyValues.yMaxAttr
94016
+ });
94017
+ return {
94018
+ setValue: { chartGeometry: geometry },
94019
+ // A value that is not a finite number gets no bar. Saying
94020
+ // so matters because the alternative reading of a missing
94021
+ // bar is a value of zero, and the author cannot tell the
94022
+ // two apart by looking. The message carries no count, so
94023
+ // the append-only diagnostics queue holds one of it however
94024
+ // often the values change.
94025
+ sendDiagnostics: geometry.undrawnValues > 0 ? [
94026
+ codedDiagnostic({
94027
+ type: "warning",
94028
+ code: "doenet-w0144"
94029
+ })
94030
+ ] : []
94031
+ };
94032
+ }
94033
+ };
94034
+ stateVariableDefinitions.yMin = {
94035
+ description: "The lowest value shown on the vertical axis.",
94036
+ public: true,
94037
+ shadowingInstructions: {
94038
+ createComponentOfType: "number"
94039
+ },
94040
+ additionalStateVariablesDefined: [
94041
+ {
94042
+ variableName: "yMax",
94043
+ description: "The highest value shown on the vertical axis.",
94044
+ public: true,
94045
+ shadowingInstructions: {
94046
+ createComponentOfType: "number"
94047
+ }
94048
+ }
94049
+ ],
94050
+ returnDependencies: () => ({
94051
+ chartGeometry: {
94052
+ dependencyType: "stateVariable",
94053
+ variableName: "chartGeometry"
94054
+ }
94055
+ }),
94056
+ definition({ dependencyValues }) {
94057
+ const [, yMin, , yMax] = dependencyValues.chartGeometry.bounds;
94058
+ return { setValue: { yMin, yMax } };
94059
+ }
94060
+ };
94061
+ stateVariableDefinitions.prefigureXML = {
94062
+ description: "The PreFigure-formatted XML rendered for this bar chart.",
94063
+ public: true,
94064
+ forRenderer: true,
94065
+ shadowingInstructions: {
94066
+ createComponentOfType: "text"
94067
+ },
94068
+ returnDependencies: () => ({
94069
+ chartGeometry: {
94070
+ dependencyType: "stateVariable",
94071
+ variableName: "chartGeometry"
94072
+ },
94073
+ width: {
94074
+ dependencyType: "stateVariable",
94075
+ variableName: "width"
94076
+ },
94077
+ aspectRatio: {
94078
+ dependencyType: "stateVariable",
94079
+ variableName: "aspectRatio"
94080
+ },
94081
+ xLabel: {
94082
+ dependencyType: "stateVariable",
94083
+ variableName: "xLabel"
94084
+ },
94085
+ xLabelHasLatex: {
94086
+ dependencyType: "stateVariable",
94087
+ variableName: "xLabelHasLatex"
94088
+ },
94089
+ yLabel: {
94090
+ dependencyType: "stateVariable",
94091
+ variableName: "yLabel"
94092
+ },
94093
+ yLabelHasLatex: {
94094
+ dependencyType: "stateVariable",
94095
+ variableName: "yLabelHasLatex"
94096
+ },
94097
+ displayValues: {
94098
+ dependencyType: "stateVariable",
94099
+ variableName: "displayValues"
94100
+ },
94101
+ shortDescription: {
94102
+ dependencyType: "stateVariable",
94103
+ variableName: "shortDescription"
94104
+ },
94105
+ selectedStyle: {
94106
+ dependencyType: "stateVariable",
94107
+ variableName: "selectedStyle"
94108
+ },
94109
+ document: {
94110
+ dependencyType: "ancestor",
94111
+ componentType: "document",
94112
+ variableNames: ["theme"]
94113
+ }
94114
+ }),
94115
+ definition({ dependencyValues }) {
94116
+ const darkMode = dependencyValues.document?.stateValues.theme === "dark";
94117
+ const widthPx = dependencyValues.width?.size ?? 425;
94118
+ const { xml, diagnostics: diagnostics2 } = createBarChartPrefigureXML({
94119
+ geometry: dependencyValues.chartGeometry,
94120
+ widthPx,
94121
+ heightPx: widthPx / dependencyValues.aspectRatio,
94122
+ xLabel: dependencyValues.xLabel,
94123
+ xLabelHasLatex: dependencyValues.xLabelHasLatex,
94124
+ yLabel: dependencyValues.yLabel,
94125
+ yLabelHasLatex: dependencyValues.yLabelHasLatex,
94126
+ selectedStyle: resolveSelectedStyleForTheme(
94127
+ dependencyValues.selectedStyle,
94128
+ darkMode
94129
+ ),
94130
+ displayValues: dependencyValues.displayValues,
94131
+ shortDescription: dependencyValues.shortDescription,
94132
+ darkMode
94133
+ });
94134
+ return {
94135
+ setValue: { prefigureXML: xml },
94136
+ sendDiagnostics: diagnostics2
94137
+ };
94138
+ }
94139
+ };
94140
+ return stateVariableDefinitions;
94141
+ }
94142
+ /**
94143
+ * Records the chart scrolling into and out of the viewport, the same event
94144
+ * `<graph>`, `<image>` and the other framed block components record, so a
94145
+ * chart is not a hole in an activity's record of what was looked at.
94146
+ */
94147
+ recordVisibilityChange({ isVisible }) {
94148
+ this.coreFunctions.requestRecordEvent({
94149
+ verb: "visibilityChanged",
94150
+ object: {
94151
+ componentIdx: this.componentIdx,
94152
+ componentType: this.componentType
94153
+ },
94154
+ result: { isVisible }
94155
+ });
94156
+ }
94157
+ }
92232
94158
  function returnLabelAttributes() {
92233
94159
  return {
92234
94160
  labelIsName: {
@@ -156126,721 +158052,6 @@ const GRAPH_CONTROL_DESCENDANT_CONFIGS = [
156126
158052
  }
156127
158053
  }
156128
158054
  ];
156129
- function escapeXml(value) {
156130
- return String(value).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
156131
- }
156132
- function asFiniteNumber(value) {
156133
- return Number.isFinite(value) ? Number(value) : null;
156134
- }
156135
- function formatNumber$1(value) {
156136
- const num = asFiniteNumber(value);
156137
- return num === null ? null : `${num}`;
156138
- }
156139
- function formatPoint(point2) {
156140
- if (!Array.isArray(point2) || point2.length < 2) {
156141
- return null;
156142
- }
156143
- const x2 = formatNumber$1(point2[0]);
156144
- const y2 = formatNumber$1(point2[1]);
156145
- if (x2 === null || y2 === null) {
156146
- return null;
156147
- }
156148
- return `(${x2},${y2})`;
156149
- }
156150
- function extractFinitePoint(point2) {
156151
- if (!Array.isArray(point2) || point2.length < 2) {
156152
- return null;
156153
- }
156154
- const x2 = asFiniteNumber(point2[0]);
156155
- const y2 = asFiniteNumber(point2[1]);
156156
- if (x2 === null || y2 === null) {
156157
- return null;
156158
- }
156159
- return [x2, y2];
156160
- }
156161
- function extractFinitePointPair(points) {
156162
- if (!Array.isArray(points) || points.length < 2) {
156163
- return null;
156164
- }
156165
- const point1 = extractFinitePoint(points[0]);
156166
- const point2 = extractFinitePoint(points[1]);
156167
- if (point1 === null || point2 === null) {
156168
- return null;
156169
- }
156170
- return [point1, point2];
156171
- }
156172
- function sanitizeHandle(value) {
156173
- return String(value).toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
156174
- }
156175
- function createStableHandle(descendant, index2, usedHandles) {
156176
- const stem = sanitizeHandle(`${descendant.componentType}_${index2}`);
156177
- let handle = stem || `graphical_${index2}`;
156178
- let suffix = 1;
156179
- while (usedHandles.has(handle)) {
156180
- suffix += 1;
156181
- handle = `${stem}_${suffix}`;
156182
- }
156183
- usedHandles.add(handle);
156184
- return handle;
156185
- }
156186
- function warningSubjectForDescendant(descendant) {
156187
- if (descendant?.componentName) {
156188
- return `<${descendant.componentType}> (${descendant.componentName})`;
156189
- }
156190
- return `<${descendant?.componentType ?? "?"}>`;
156191
- }
156192
- function pushWarning({
156193
- diagnostics: diagnostics2,
156194
- code,
156195
- args,
156196
- position: position2
156197
- }) {
156198
- diagnostics2.push(
156199
- codedDiagnostic({ type: "warning", code, args, position: position2 })
156200
- );
156201
- }
156202
- function sortDescendantsByOrder(a2, b2) {
156203
- if (Number.isFinite(a2.componentIdx) && Number.isFinite(b2.componentIdx)) {
156204
- return a2.componentIdx - b2.componentIdx;
156205
- }
156206
- return String(a2.componentName ?? "").localeCompare(
156207
- String(b2.componentName ?? "")
156208
- );
156209
- }
156210
- function normalizeLineClipInputs({
156211
- point1,
156212
- point2,
156213
- bounds
156214
- }) {
156215
- if (!Array.isArray(point1) || !Array.isArray(point2) || point1.length < 2 || point2.length < 2 || !Array.isArray(bounds) || bounds.length < 4) {
156216
- return null;
156217
- }
156218
- const x0 = asFiniteNumber(point1[0]);
156219
- const y0 = asFiniteNumber(point1[1]);
156220
- const x1 = asFiniteNumber(point2[0]);
156221
- const y1 = asFiniteNumber(point2[1]);
156222
- const bxMin = asFiniteNumber(bounds[0]);
156223
- const byMin = asFiniteNumber(bounds[1]);
156224
- const bxMax = asFiniteNumber(bounds[2]);
156225
- const byMax = asFiniteNumber(bounds[3]);
156226
- if (x0 === null || y0 === null || x1 === null || y1 === null || bxMin === null || byMin === null || bxMax === null || byMax === null) {
156227
- return null;
156228
- }
156229
- const dx = x1 - x0;
156230
- const dy = y1 - y0;
156231
- if (dx === 0 && dy === 0) {
156232
- return null;
156233
- }
156234
- return { x0, y0, dx, dy, bxMin, byMin, bxMax, byMax };
156235
- }
156236
- function clipLineLikeToBounds({
156237
- point1,
156238
- point2,
156239
- bounds,
156240
- tMin,
156241
- tMax
156242
- }) {
156243
- const inputs = normalizeLineClipInputs({ point1, point2, bounds });
156244
- if (!inputs) {
156245
- return null;
156246
- }
156247
- const { x0, y0, dx, dy, bxMin, byMin, bxMax, byMax } = inputs;
156248
- let clippedTMin = tMin;
156249
- let clippedTMax = tMax;
156250
- const updateRange = (p0, delta, minBound, maxBound) => {
156251
- if (delta !== 0) {
156252
- let ta2 = (minBound - p0) / delta;
156253
- let tb = (maxBound - p0) / delta;
156254
- if (ta2 > tb) {
156255
- [ta2, tb] = [tb, ta2];
156256
- }
156257
- clippedTMin = Math.max(clippedTMin, ta2);
156258
- clippedTMax = Math.min(clippedTMax, tb);
156259
- return clippedTMin <= clippedTMax;
156260
- }
156261
- return p0 >= minBound && p0 <= maxBound;
156262
- };
156263
- if (!updateRange(x0, dx, bxMin, bxMax)) {
156264
- return null;
156265
- }
156266
- if (!updateRange(y0, dy, byMin, byMax)) {
156267
- return null;
156268
- }
156269
- return [
156270
- [x0 + clippedTMin * dx, y0 + clippedTMin * dy],
156271
- [x0 + clippedTMax * dx, y0 + clippedTMax * dy]
156272
- ];
156273
- }
156274
- const prefigurePointAlignmentByLabelPosition = {
156275
- upperright: "ne",
156276
- upperleft: "nw",
156277
- lowerright: "se",
156278
- lowerleft: "sw",
156279
- top: "n",
156280
- bottom: "s",
156281
- left: "w",
156282
- right: "e"
156283
- };
156284
- function normalizeKey(value) {
156285
- return String(value).toLowerCase().replace(/[^a-z0-9]+/g, "");
156286
- }
156287
- const THEME_AWARE_LABEL_COLOR_ATTR = 'color="currentColor"';
156288
- const LABEL_EDGE_PADDING_RATIO = 0.02;
156289
- const LINE_LABEL_ENDPOINT_INSET_RATIO = 0.05;
156290
- const LINE_LABEL_ENDPOINT_INSET_PIXELS = 12;
156291
- const KNOWN_LINE_POSITIONS = /* @__PURE__ */ new Set([
156292
- "left",
156293
- "upperleft",
156294
- "lowerleft",
156295
- "right",
156296
- "upperright",
156297
- "lowerright",
156298
- "center",
156299
- "top",
156300
- "bottom"
156301
- ]);
156302
- function formatLocation(value) {
156303
- const rounded = Number(value.toFixed(6));
156304
- return `${rounded}`;
156305
- }
156306
- function clamp01(value) {
156307
- return Math.min(1, Math.max(0, value));
156308
- }
156309
- function getPreferredDirectionForLabelPosition(labelPosition) {
156310
- switch (normalizeKey(labelPosition ?? "")) {
156311
- case "right":
156312
- return [1, 0];
156313
- case "left":
156314
- return [-1, 0];
156315
- case "top":
156316
- return [0, 1];
156317
- case "bottom":
156318
- return [0, -1];
156319
- case "upperright":
156320
- return [1 / Math.SQRT2, 1 / Math.SQRT2];
156321
- case "upperleft":
156322
- return [-1 / Math.SQRT2, 1 / Math.SQRT2];
156323
- case "lowerright":
156324
- return [1 / Math.SQRT2, -1 / Math.SQRT2];
156325
- case "lowerleft":
156326
- return [-1 / Math.SQRT2, -1 / Math.SQRT2];
156327
- default:
156328
- return null;
156329
- }
156330
- }
156331
- function biasFromPreferredDirection(preferredDirection, ep1, ep2) {
156332
- const dx = ep2[0] - ep1[0];
156333
- const dy = ep2[1] - ep1[1];
156334
- const segmentLength = Math.hypot(dx, dy);
156335
- if (!(segmentLength > 0)) {
156336
- return 0;
156337
- }
156338
- const tx = dx / segmentLength;
156339
- const ty = dy / segmentLength;
156340
- const agreement = tx * preferredDirection[0] + ty * preferredDirection[1];
156341
- return Math.max(-1, Math.min(1, Math.SQRT2 * agreement));
156342
- }
156343
- function chooseEndpointBiasForLabelPosition(labelPosition, ep1, ep2) {
156344
- const pos = normalizeKey(labelPosition ?? "");
156345
- if (!KNOWN_LINE_POSITIONS.has(pos) || pos === "center") {
156346
- return null;
156347
- }
156348
- const preferredDirection = getPreferredDirectionForLabelPosition(pos);
156349
- if (!preferredDirection) {
156350
- return null;
156351
- }
156352
- return biasFromPreferredDirection(preferredDirection, ep1, ep2);
156353
- }
156354
- function lineLabelAnchorPoint({
156355
- ep1,
156356
- ep2,
156357
- location
156358
- }) {
156359
- return [
156360
- ep1[0] + (ep2[0] - ep1[0]) * location,
156361
- ep1[1] + (ep2[1] - ep1[1]) * location
156362
- ];
156363
- }
156364
- function getGraphBounds(graphBounds) {
156365
- const bounds = Array.isArray(graphBounds) ? graphBounds : null;
156366
- if (!bounds || bounds.length !== 4) {
156367
- return null;
156368
- }
156369
- const [xMin, yMin, xMax, yMax] = bounds;
156370
- if (!Number.isFinite(xMin) || !Number.isFinite(yMin) || !Number.isFinite(xMax) || !Number.isFinite(yMax) || !(xMax > xMin) || !(yMax > yMin)) {
156371
- return null;
156372
- }
156373
- return { xMin, yMin, xMax, yMax };
156374
- }
156375
- function getGraphDimensions(graphDimensions) {
156376
- const dims = Array.isArray(graphDimensions) ? graphDimensions : null;
156377
- if (!dims || dims.length !== 2) {
156378
- return null;
156379
- }
156380
- const [width, height] = dims;
156381
- if (!Number.isFinite(width) || !Number.isFinite(height) || !(width > 0) || !(height > 0)) {
156382
- return null;
156383
- }
156384
- return { width, height };
156385
- }
156386
- function getLineTangent(ep1, ep2) {
156387
- const dx = ep2[0] - ep1[0];
156388
- const dy = ep2[1] - ep1[1];
156389
- const length = Math.hypot(dx, dy);
156390
- if (!(length > 0)) {
156391
- return null;
156392
- }
156393
- return [dx / length, dy / length];
156394
- }
156395
- function estimateLabelMetrics(labelText, labelHasLatex) {
156396
- const raw = typeof labelText === "string" ? labelText.trim() : "";
156397
- const visibleLength = raw.length;
156398
- let effectiveLength = visibleLength;
156399
- if (labelHasLatex) {
156400
- const latexRuns = (raw.match(/\\\(|\\\)|<m>|<\/m>/g) ?? []).length;
156401
- effectiveLength += latexRuns * 3;
156402
- }
156403
- return {
156404
- width: Math.min(6, Math.max(0.9, effectiveLength * 0.27)),
156405
- height: 1
156406
- };
156407
- }
156408
- function getLineAlignmentCandidates(labelPosition, location, preferNorth = true) {
156409
- const pos = normalizeKey(labelPosition ?? "");
156410
- if (!pos || !KNOWN_LINE_POSITIONS.has(pos)) {
156411
- return null;
156412
- }
156413
- const h2 = location >= 0.5 ? "w" : "e";
156414
- const oppositeH = h2 === "w" ? "e" : "w";
156415
- const primary = preferNorth ? "n" : "s";
156416
- const secondary = preferNorth ? "s" : "n";
156417
- if (pos === "center") {
156418
- return ["n", "s", `n${h2}`, `s${h2}`, `n${oppositeH}`, `s${oppositeH}`];
156419
- }
156420
- return [
156421
- primary,
156422
- `${primary}${h2}`,
156423
- secondary,
156424
- `${secondary}${h2}`,
156425
- `${primary}${oppositeH}`,
156426
- `${secondary}${oppositeH}`
156427
- ];
156428
- }
156429
- function getAlignmentExtents(tangent, alignment, metrics) {
156430
- const normal2 = [-tangent[1], tangent[0]];
156431
- const width = metrics?.width ?? 1.2;
156432
- const height = metrics?.height ?? 1;
156433
- let minT = -width / 2;
156434
- let maxT = width / 2;
156435
- let minN = -height / 2;
156436
- let maxN = height / 2;
156437
- switch (alignment) {
156438
- case "n":
156439
- minN = 0;
156440
- maxN = height;
156441
- break;
156442
- case "s":
156443
- minN = -height;
156444
- maxN = 0;
156445
- break;
156446
- case "e":
156447
- minT = 0;
156448
- maxT = width;
156449
- break;
156450
- case "w":
156451
- minT = -width;
156452
- maxT = 0;
156453
- break;
156454
- case "ne":
156455
- minT = 0;
156456
- maxT = width;
156457
- minN = 0;
156458
- maxN = height;
156459
- break;
156460
- case "nw":
156461
- minT = -width;
156462
- maxT = 0;
156463
- minN = 0;
156464
- maxN = height;
156465
- break;
156466
- case "se":
156467
- minT = 0;
156468
- maxT = width;
156469
- minN = -height;
156470
- maxN = 0;
156471
- break;
156472
- case "sw":
156473
- minT = -width;
156474
- maxT = 0;
156475
- minN = -height;
156476
- maxN = 0;
156477
- break;
156478
- }
156479
- const points = [
156480
- [
156481
- tangent[0] * minT + normal2[0] * minN,
156482
- tangent[1] * minT + normal2[1] * minN
156483
- ],
156484
- [
156485
- tangent[0] * minT + normal2[0] * maxN,
156486
- tangent[1] * minT + normal2[1] * maxN
156487
- ],
156488
- [
156489
- tangent[0] * maxT + normal2[0] * minN,
156490
- tangent[1] * maxT + normal2[1] * minN
156491
- ],
156492
- [
156493
- tangent[0] * maxT + normal2[0] * maxN,
156494
- tangent[1] * maxT + normal2[1] * maxN
156495
- ]
156496
- ];
156497
- return {
156498
- minX: Math.min(...points.map((point2) => point2[0])),
156499
- maxX: Math.max(...points.map((point2) => point2[0])),
156500
- minY: Math.min(...points.map((point2) => point2[1])),
156501
- maxY: Math.max(...points.map((point2) => point2[1]))
156502
- };
156503
- }
156504
- function computeAlignmentOverflowAt({
156505
- anchor,
156506
- tangent,
156507
- alignment,
156508
- graphBounds,
156509
- labelMetrics
156510
- }) {
156511
- const bounds = getGraphBounds(graphBounds);
156512
- if (!bounds) {
156513
- return { overflowAmount: 0 };
156514
- }
156515
- const { xMin, yMin, xMax, yMax } = bounds;
156516
- const width = xMax - xMin;
156517
- const height = yMax - yMin;
156518
- const edgePaddingX = width * LABEL_EDGE_PADDING_RATIO;
156519
- const edgePaddingY = height * LABEL_EDGE_PADDING_RATIO;
156520
- const extents = getAlignmentExtents(tangent, alignment, labelMetrics);
156521
- const projectedLeft = anchor[0] + extents.minX;
156522
- const projectedRight = anchor[0] + extents.maxX;
156523
- const projectedBottom = anchor[1] + extents.minY;
156524
- const projectedTop = anchor[1] + extents.maxY;
156525
- const overflowLeft = Math.max(0, xMin + edgePaddingX - projectedLeft);
156526
- const overflowRight = Math.max(0, projectedRight - (xMax - edgePaddingX));
156527
- const overflowBottom = Math.max(0, yMin + edgePaddingY - projectedBottom);
156528
- const overflowTop = Math.max(0, projectedTop - (yMax - edgePaddingY));
156529
- const overflowAmount = overflowLeft + overflowRight + overflowBottom + overflowTop;
156530
- return { overflowAmount };
156531
- }
156532
- function evaluateLineAlignmentOverflow({
156533
- alignment,
156534
- ep1,
156535
- ep2,
156536
- location,
156537
- graphBounds,
156538
- labelMetrics
156539
- }) {
156540
- const tangent = getLineTangent(ep1, ep2);
156541
- if (!tangent) {
156542
- return { overflowAmount: 0 };
156543
- }
156544
- const anchor = lineLabelAnchorPoint({ ep1, ep2, location });
156545
- return computeAlignmentOverflowAt({
156546
- anchor,
156547
- tangent,
156548
- alignment,
156549
- graphBounds,
156550
- labelMetrics
156551
- });
156552
- }
156553
- function getLineLabelAlignment({
156554
- labelPosition,
156555
- location,
156556
- ep1,
156557
- ep2,
156558
- graphBounds,
156559
- labelText,
156560
- labelHasLatex
156561
- }) {
156562
- const tangent = getLineTangent(ep1, ep2);
156563
- const preferredDirection = getPreferredDirectionForLabelPosition(labelPosition);
156564
- const preferNorth = preferredDirection && tangent ? -tangent[1] * preferredDirection[0] + tangent[0] * preferredDirection[1] >= 0 : true;
156565
- const candidates = getLineAlignmentCandidates(
156566
- labelPosition,
156567
- location,
156568
- preferNorth
156569
- );
156570
- if (!candidates?.length) {
156571
- return null;
156572
- }
156573
- const labelMetrics = estimateLabelMetrics(labelText, labelHasLatex);
156574
- let bestAlignment = candidates[0];
156575
- let minimumOverflow = Number.POSITIVE_INFINITY;
156576
- for (const candidate of candidates) {
156577
- const result2 = evaluateLineAlignmentOverflow({
156578
- alignment: candidate,
156579
- ep1,
156580
- ep2,
156581
- location,
156582
- graphBounds,
156583
- labelMetrics
156584
- });
156585
- if (result2.overflowAmount === 0) {
156586
- return candidate;
156587
- }
156588
- if (result2.overflowAmount < minimumOverflow) {
156589
- bestAlignment = candidate;
156590
- minimumOverflow = result2.overflowAmount;
156591
- }
156592
- }
156593
- return bestAlignment;
156594
- }
156595
- function orientEndpointsForLineLabel(p1Raw, p2Raw) {
156596
- if (p1Raw[0] > p2Raw[0] || p1Raw[0] === p2Raw[0] && p1Raw[1] > p2Raw[1]) {
156597
- return [p2Raw, p1Raw];
156598
- }
156599
- return [p1Raw, p2Raw];
156600
- }
156601
- function labelMarkup({
156602
- label,
156603
- labelHasLatex
156604
- }) {
156605
- if (typeof label !== "string") {
156606
- return null;
156607
- }
156608
- const text = label.trim();
156609
- if (!text) {
156610
- return null;
156611
- }
156612
- if (labelHasLatex) {
156613
- const openDelimiters = (text.match(/\\\(/g) ?? []).length;
156614
- const closeDelimiters = (text.match(/\\\)/g) ?? []).length;
156615
- if (openDelimiters > 0 && openDelimiters === closeDelimiters) {
156616
- return escapeXml(text).replace(/\\\(/g, "<m>").replace(/\\\)/g, "</m>");
156617
- }
156618
- return `<m>${escapeXml(text)}</m>`;
156619
- }
156620
- return escapeXml(text);
156621
- }
156622
- const POINT_ALIGNMENT_CANDIDATES = {
156623
- n: ["n", "nw", "ne", "w", "e", "sw", "se", "s"],
156624
- ne: ["ne", "n", "e", "nw", "se", "w", "s", "sw"],
156625
- e: ["e", "ne", "se", "n", "s", "nw", "sw", "w"],
156626
- se: ["se", "e", "s", "ne", "sw", "n", "w", "nw"],
156627
- s: ["s", "se", "sw", "e", "w", "ne", "nw", "n"],
156628
- sw: ["sw", "s", "w", "se", "nw", "e", "n", "ne"],
156629
- w: ["w", "nw", "sw", "n", "s", "ne", "se", "e"],
156630
- nw: ["nw", "n", "w", "ne", "sw", "e", "s", "se"]
156631
- };
156632
- function getPointAlignmentCandidates(labelPosition) {
156633
- const key = normalizeKey(labelPosition ?? "");
156634
- const primary = prefigurePointAlignmentByLabelPosition[key];
156635
- if (!primary) return null;
156636
- return POINT_ALIGNMENT_CANDIDATES[primary] ?? null;
156637
- }
156638
- function getPointLabelAlignment({
156639
- labelPosition,
156640
- point: point2,
156641
- graphBounds,
156642
- labelText,
156643
- labelHasLatex
156644
- }) {
156645
- const candidates = getPointAlignmentCandidates(labelPosition);
156646
- if (!candidates?.length) return null;
156647
- const tangent = [1, 0];
156648
- const labelMetrics = estimateLabelMetrics(labelText, labelHasLatex);
156649
- let bestAlignment = candidates[0];
156650
- let minimumOverflow = Number.POSITIVE_INFINITY;
156651
- for (const candidate of candidates) {
156652
- const { overflowAmount } = computeAlignmentOverflowAt({
156653
- anchor: point2,
156654
- tangent,
156655
- alignment: candidate,
156656
- graphBounds,
156657
- labelMetrics
156658
- });
156659
- if (overflowAmount === 0) {
156660
- return candidate;
156661
- }
156662
- if (overflowAmount < minimumOverflow) {
156663
- bestAlignment = candidate;
156664
- minimumOverflow = overflowAmount;
156665
- }
156666
- }
156667
- return bestAlignment;
156668
- }
156669
- function pointLabelAttributes({
156670
- stateValues,
156671
- diagnostics: diagnostics2,
156672
- warningPrefix,
156673
- warningPosition
156674
- }) {
156675
- const label = labelMarkup({
156676
- label: stateValues?.label,
156677
- labelHasLatex: stateValues?.labelHasLatex
156678
- });
156679
- if (!label) {
156680
- return null;
156681
- }
156682
- const attrs = [THEME_AWARE_LABEL_COLOR_ATTR];
156683
- const rawPosition = stateValues?.labelPosition;
156684
- if (rawPosition) {
156685
- const rawXs = stateValues?.numericalXs;
156686
- const pointCoord = Array.isArray(rawXs) && rawXs.length >= 2 && Number.isFinite(rawXs[0]) && Number.isFinite(rawXs[1]) ? [Number(rawXs[0]), Number(rawXs[1])] : null;
156687
- const directAlignment = prefigurePointAlignmentByLabelPosition[normalizeKey(rawPosition)];
156688
- if (directAlignment) {
156689
- const alignment = pointCoord !== null && stateValues?.graphBounds ? getPointLabelAlignment({
156690
- labelPosition: rawPosition,
156691
- point: pointCoord,
156692
- graphBounds: stateValues.graphBounds,
156693
- labelText: stateValues?.label,
156694
- labelHasLatex: stateValues?.labelHasLatex
156695
- }) ?? directAlignment : directAlignment;
156696
- attrs.push(`alignment="${escapeXml(alignment)}"`);
156697
- } else {
156698
- pushWarning({
156699
- diagnostics: diagnostics2,
156700
- code: "doenet-w0090",
156701
- args: {
156702
- subject: warningPrefix,
156703
- labelPosition: rawPosition,
156704
- labelKind: "point"
156705
- },
156706
- position: warningPosition
156707
- });
156708
- }
156709
- }
156710
- return { attrs, label };
156711
- }
156712
- function locationFromBiasWithInsetRatio({
156713
- bias,
156714
- insetRatio
156715
- }) {
156716
- const clampedBias = Math.max(-1, Math.min(1, bias));
156717
- const clampedInset = clamp01(Math.min(0.5, insetRatio));
156718
- const span = Math.max(0, 0.5 - clampedInset);
156719
- return clamp01(0.5 + clampedBias * span);
156720
- }
156721
- function locationFromBiasWithAbsoluteEndpointOffset({
156722
- bias,
156723
- ep1,
156724
- ep2,
156725
- graphBounds,
156726
- graphDimensions
156727
- }) {
156728
- const bounds = getGraphBounds(graphBounds);
156729
- const dims = getGraphDimensions(graphDimensions);
156730
- const dx = ep2[0] - ep1[0];
156731
- const dy = ep2[1] - ep1[1];
156732
- const segmentLength = Math.hypot(dx, dy);
156733
- const graphWidth = bounds ? bounds.xMax - bounds.xMin : 0;
156734
- const graphHeight = bounds ? bounds.yMax - bounds.yMin : 0;
156735
- const shouldUseRelativeInsetFallback = !bounds || !dims || !(segmentLength > 0) || !(graphWidth > 0) || !(graphHeight > 0);
156736
- if (shouldUseRelativeInsetFallback) {
156737
- return locationFromBiasWithInsetRatio({
156738
- bias,
156739
- insetRatio: LINE_LABEL_ENDPOINT_INSET_RATIO
156740
- });
156741
- }
156742
- const tx = dx / segmentLength;
156743
- const ty = dy / segmentLength;
156744
- const unitsPerPixelAlongLine = Math.hypot(
156745
- tx * (graphWidth / dims.width),
156746
- ty * (graphHeight / dims.height)
156747
- );
156748
- const absoluteOffset = LINE_LABEL_ENDPOINT_INSET_PIXELS * unitsPerPixelAlongLine;
156749
- const insetRatio = Math.min(0.45, clamp01(absoluteOffset / segmentLength));
156750
- const location = locationFromBiasWithInsetRatio({
156751
- bias,
156752
- insetRatio
156753
- });
156754
- return location;
156755
- }
156756
- function lineLabelLocationValue(labelPosition, ep1, ep2, options = {}) {
156757
- const endpointBias = chooseEndpointBiasForLabelPosition(
156758
- labelPosition,
156759
- ep1,
156760
- ep2
156761
- );
156762
- if (endpointBias === null) {
156763
- return null;
156764
- }
156765
- if (options.absoluteEndpointOffset) {
156766
- return locationFromBiasWithAbsoluteEndpointOffset({
156767
- bias: endpointBias,
156768
- ep1,
156769
- ep2,
156770
- graphBounds: options.graphBounds,
156771
- graphDimensions: options.graphDimensions
156772
- });
156773
- }
156774
- return locationFromBiasWithInsetRatio({
156775
- bias: endpointBias,
156776
- insetRatio: LINE_LABEL_ENDPOINT_INSET_RATIO
156777
- });
156778
- }
156779
- function getLabelForLine({
156780
- stateValues,
156781
- ep1,
156782
- ep2,
156783
- diagnostics: diagnostics2,
156784
- warningPrefix,
156785
- warningPosition
156786
- }) {
156787
- const label = labelMarkup({
156788
- label: stateValues?.label,
156789
- labelHasLatex: stateValues?.labelHasLatex
156790
- });
156791
- if (!label) {
156792
- return {
156793
- labelAttrs: [],
156794
- label: null
156795
- };
156796
- }
156797
- const labelAttrs = [THEME_AWARE_LABEL_COLOR_ATTR];
156798
- const rawPosition = stateValues?.labelPosition;
156799
- const normalizedPosition = normalizeKey(rawPosition ?? "");
156800
- const overrideLocRaw = stateValues?.lineLabelLocationOverride;
156801
- const overrideLoc = Number(overrideLocRaw);
156802
- const hasOverrideLoc = Number.isFinite(overrideLoc);
156803
- const baseLoc = hasOverrideLoc ? clamp01(overrideLoc) : lineLabelLocationValue(rawPosition, ep1, ep2, {
156804
- absoluteEndpointOffset: stateValues?.lineLabelAbsoluteEndpointOffset === true,
156805
- graphBounds: stateValues?.graphBounds,
156806
- graphDimensions: stateValues?.graphDimensions
156807
- });
156808
- let location = 0.5;
156809
- if (baseLoc !== null && Number.isFinite(baseLoc)) {
156810
- location = baseLoc;
156811
- labelAttrs.push(
156812
- `label-location="${escapeXml(formatLocation(location))}"`
156813
- );
156814
- }
156815
- const alignmentLocationRaw = stateValues?.lineLabelAlignmentLocationOverride;
156816
- const alignmentLocation = Number.isFinite(Number(alignmentLocationRaw)) ? Number(alignmentLocationRaw) : location;
156817
- if (rawPosition) {
156818
- const alignment = getLineLabelAlignment({
156819
- labelPosition: rawPosition,
156820
- location: alignmentLocation,
156821
- ep1,
156822
- ep2,
156823
- graphBounds: stateValues?.graphBounds,
156824
- labelText: stateValues?.label,
156825
- labelHasLatex: stateValues?.labelHasLatex
156826
- });
156827
- if (alignment) {
156828
- labelAttrs.push(`alignment="${escapeXml(alignment)}"`);
156829
- } else if (!KNOWN_LINE_POSITIONS.has(normalizedPosition)) {
156830
- pushWarning({
156831
- diagnostics: diagnostics2,
156832
- code: "doenet-w0090",
156833
- args: {
156834
- subject: warningPrefix,
156835
- labelPosition: rawPosition,
156836
- labelKind: "line-family"
156837
- },
156838
- position: warningPosition
156839
- });
156840
- }
156841
- }
156842
- return { labelAttrs, label };
156843
- }
156844
158055
  const PREFIGURE_DARK_GRID_COLOR = "#666666";
156845
158056
  const PREFIGURE_GRID_DELTA = {
156846
158057
  2: 0.1,
@@ -156962,185 +158173,6 @@ function gridElementFromGrid({
156962
158173
  const spacings = `((${xTriple.join(",")}),(${yTriple.join(",")}))`;
156963
158174
  return `<grid spacings="${escapeXml(spacings)}"${strokeAttr} />`;
156964
158175
  }
156965
- const prefigureFillPatternByFillStyle = {
156966
- horizontal: "horizontal",
156967
- vertical: "vertical",
156968
- diagonal: "diagonal",
156969
- backdiagonal: "backdiagonal",
156970
- dots: "dot",
156971
- diamonds: "diamond"
156972
- };
156973
- const prefigureDashByLineStyle = {
156974
- solid: null,
156975
- dashed: "9 9",
156976
- dotted: "4 4"
156977
- };
156978
- const prefigurePointStyleByMarkerStyle = {
156979
- circle: "circle",
156980
- square: "box",
156981
- box: "box",
156982
- diamond: "diamond",
156983
- cross: "cross",
156984
- plus: "plus",
156985
- "double-circle": "double-circle"
156986
- };
156987
- function resolveSelectedStyleForTheme(selectedStyle, darkMode) {
156988
- if (!selectedStyle || !darkMode) {
156989
- return selectedStyle;
156990
- }
156991
- const pickDark = (darkKey, lightValue) => {
156992
- const darkValue = selectedStyle[darkKey];
156993
- return typeof darkValue === "string" ? darkValue : lightValue;
156994
- };
156995
- return {
156996
- ...selectedStyle,
156997
- lineColor: pickDark("lineColorDarkMode", selectedStyle.lineColor),
156998
- lineColorWord: pickDark(
156999
- "lineColorWordDarkMode",
157000
- selectedStyle.lineColorWord
157001
- ),
157002
- fillColor: pickDark("fillColorDarkMode", selectedStyle.fillColor),
157003
- fillColorWord: pickDark(
157004
- "fillColorWordDarkMode",
157005
- selectedStyle.fillColorWord
157006
- ),
157007
- markerColor: pickDark("markerColorDarkMode", selectedStyle.markerColor),
157008
- markerColorWord: pickDark(
157009
- "markerColorWordDarkMode",
157010
- selectedStyle.markerColorWord
157011
- )
157012
- };
157013
- }
157014
- function styleAttributes({
157015
- selectedStyle,
157016
- diagnostics: diagnostics2,
157017
- warningPrefix,
157018
- warningPosition,
157019
- includeFill = true
157020
- }) {
157021
- const attrs = [];
157022
- const stroke = selectedStyle?.lineColor ?? selectedStyle?.lineColorWord;
157023
- if (stroke) {
157024
- attrs.push(`stroke="${escapeXml(stroke)}"`);
157025
- }
157026
- const thickness = formatNumber$1(selectedStyle?.lineWidth);
157027
- if (thickness !== null) {
157028
- attrs.push(`thickness="${escapeXml(thickness)}"`);
157029
- }
157030
- if (includeFill) {
157031
- const fillStyle = selectedStyle?.fillStyle;
157032
- const prefigurePattern = fillStyle && fillStyle !== "solid" ? prefigureFillPatternByFillStyle[fillStyle] : void 0;
157033
- const fill = selectedStyle?.fillColor ?? selectedStyle?.fillColorWord;
157034
- if (prefigurePattern !== void 0) {
157035
- attrs.push(`fill-pattern="${escapeXml(prefigurePattern)}"`);
157036
- if (fill) {
157037
- attrs.push(`fill="${escapeXml(fill)}"`);
157038
- }
157039
- const fillPatternOpacity = formatNumber$1(
157040
- selectedStyle?.fillPatternOpacity
157041
- );
157042
- if (fillPatternOpacity !== null) {
157043
- attrs.push(`fill-opacity="${escapeXml(fillPatternOpacity)}"`);
157044
- }
157045
- } else {
157046
- if (fill) {
157047
- attrs.push(`fill="${escapeXml(fill)}"`);
157048
- }
157049
- const fillOpacity = formatNumber$1(selectedStyle?.fillOpacity);
157050
- if (fillOpacity !== null) {
157051
- attrs.push(`fill-opacity="${escapeXml(fillOpacity)}"`);
157052
- }
157053
- if (fillStyle && fillStyle !== "solid") {
157054
- pushWarning({
157055
- diagnostics: diagnostics2,
157056
- code: "doenet-w0091",
157057
- args: { subject: warningPrefix, fillStyle },
157058
- position: warningPosition
157059
- });
157060
- }
157061
- }
157062
- }
157063
- const lineOpacity = formatNumber$1(selectedStyle?.lineOpacity);
157064
- if (lineOpacity !== null) {
157065
- attrs.push(`stroke-opacity="${escapeXml(lineOpacity)}"`);
157066
- }
157067
- const lineStyle = selectedStyle?.lineStyle;
157068
- if (lineStyle) {
157069
- const dash = prefigureDashByLineStyle[lineStyle];
157070
- if (dash) {
157071
- attrs.push(`dash="${escapeXml(dash)}"`);
157072
- } else if (!(lineStyle in prefigureDashByLineStyle)) {
157073
- pushWarning({
157074
- diagnostics: diagnostics2,
157075
- code: "doenet-w0092",
157076
- args: { subject: warningPrefix, lineStyle },
157077
- position: warningPosition
157078
- });
157079
- }
157080
- }
157081
- return attrs;
157082
- }
157083
- function pointStyleAttributes({
157084
- selectedStyle,
157085
- diagnostics: diagnostics2,
157086
- warningPrefix,
157087
- warningPosition,
157088
- includeFill = true
157089
- }) {
157090
- const attrs = [];
157091
- const markerStyle = selectedStyle?.markerStyle;
157092
- if (markerStyle) {
157093
- const markerStyleString = String(markerStyle);
157094
- const mappedStyle = prefigurePointStyleByMarkerStyle[markerStyleString];
157095
- if (mappedStyle) {
157096
- attrs.push(`style="${escapeXml(mappedStyle)}"`);
157097
- } else if (markerStyleString.slice(0, 8) === "triangle") {
157098
- attrs.push('style="diamond"');
157099
- pushWarning({
157100
- diagnostics: diagnostics2,
157101
- code: "doenet-w0093",
157102
- args: {
157103
- subject: warningPrefix,
157104
- markerStyle: markerStyleString
157105
- },
157106
- position: warningPosition
157107
- });
157108
- } else {
157109
- pushWarning({
157110
- diagnostics: diagnostics2,
157111
- code: "doenet-w0094",
157112
- args: {
157113
- subject: warningPrefix,
157114
- markerStyle: markerStyleString
157115
- },
157116
- position: warningPosition
157117
- });
157118
- }
157119
- }
157120
- const size2 = formatNumber$1(selectedStyle?.markerSize);
157121
- if (size2 !== null) {
157122
- attrs.push(`size="${escapeXml(size2)}"`);
157123
- }
157124
- const color = selectedStyle?.markerColor ?? selectedStyle?.markerColorWord ?? null;
157125
- if (color) {
157126
- if (includeFill) {
157127
- attrs.push(`fill="${escapeXml(color)}"`);
157128
- }
157129
- attrs.push(`stroke="${escapeXml(color)}"`);
157130
- }
157131
- const opacity = formatNumber$1(selectedStyle?.markerOpacity);
157132
- if (opacity !== null) {
157133
- if (includeFill) {
157134
- attrs.push(`fill-opacity="${escapeXml(opacity)}"`);
157135
- }
157136
- attrs.push(`stroke-opacity="${escapeXml(opacity)}"`);
157137
- }
157138
- const thickness = formatNumber$1(selectedStyle?.lineWidth);
157139
- if (thickness !== null) {
157140
- attrs.push(`thickness="${escapeXml(thickness)}"`);
157141
- }
157142
- return attrs;
157143
- }
157144
158176
  function convertPointToPrefigure({
157145
158177
  sv,
157146
158178
  handle,
@@ -158855,7 +159887,6 @@ function pushUnsupportedAxisPositionWarnings({
158855
159887
  );
158856
159888
  }
158857
159889
  }
158858
- const PREFIGURE_DARK_AXIS_COLOR = "#ffffff";
158859
159890
  function axesElementFromLabels({
158860
159891
  dependencyValues,
158861
159892
  axesMode,
@@ -158880,7 +159911,7 @@ function axesElementFromLabels({
158880
159911
  `<ylabel alignment="se" ${THEME_AWARE_LABEL_COLOR_ATTR}>${yLabel}</ylabel>`
158881
159912
  );
158882
159913
  }
158883
- const strokeAttr = darkMode ? ` stroke="${PREFIGURE_DARK_AXIS_COLOR}"` : "";
159914
+ const strokeAttr = darkModeAxisStrokeAttr(darkMode);
158884
159915
  if (axisLabelElements.length > 0) {
158885
159916
  return `<axes axes="${axesMode}"${strokeAttr}>${axisLabelElements.join("")}</axes>`;
158886
159917
  }
@@ -159564,24 +160595,10 @@ let Graph$1 = class Graph extends BlockComponent {
159564
160595
  defaultValue: 10,
159565
160596
  description: "Maximum value displayed on the y axis."
159566
160597
  };
159567
- attributes.width = {
159568
- createComponentOfType: "componentSize",
159569
- description: "Explicit width of the graph (overrides size)."
159570
- };
159571
- attributes.size = {
159572
- createComponentOfType: "text",
159573
- createStateVariable: "specifiedSize",
159574
- defaultValue: "medium",
159575
- toLowerCase: true,
159576
- validValues: [
159577
- { value: "tiny", description: "About 1/12 the full width." },
159578
- { value: "small", description: "About 30% of the full width." },
159579
- { value: "medium", description: "About half the full width." },
159580
- { value: "large", description: "About 70% of the full width." },
159581
- { value: "full", description: "The full available width." }
159582
- ],
159583
- description: "Named size preset for the graph."
159584
- };
160598
+ Object.assign(
160599
+ attributes,
160600
+ returnSizeAttributes({ componentName: "graph" })
160601
+ );
159585
160602
  attributes.aspectRatio = {
159586
160603
  createComponentOfType: "number",
159587
160604
  description: "Aspect ratio (width / height) for the graph."
@@ -159897,14 +160914,8 @@ let Graph$1 = class Graph extends BlockComponent {
159897
160914
  }
159898
160915
  static returnChildGroups() {
159899
160916
  return [
159900
- {
159901
- group: "xLabels",
159902
- componentTypes: ["xLabel"]
159903
- },
159904
- {
159905
- group: "yLabels",
159906
- componentTypes: ["yLabel"]
159907
- },
160917
+ returnAxisLabelChildGroup({ axis: "x" }),
160918
+ returnAxisLabelChildGroup({ axis: "y" }),
159908
160919
  {
159909
160920
  group: "shortDescriptions",
159910
160921
  componentTypes: ["shortDescription"]
@@ -159954,47 +160965,13 @@ let Graph$1 = class Graph extends BlockComponent {
159954
160965
  stateVariableDefinitions,
159955
160966
  returnNumberDisplayStateVariableDefinitions()
159956
160967
  );
159957
- stateVariableDefinitions.shortDescription = {
159958
- description: "A short accessibility description of the graph.",
159959
- forRenderer: true,
159960
- public: true,
159961
- shadowingInstructions: {
159962
- createComponentOfType: "text"
159963
- },
159964
- returnDependencies: () => ({
159965
- shortDescriptionChild: {
159966
- dependencyType: "child",
159967
- childGroups: ["shortDescriptions"],
159968
- variableNames: ["text"]
159969
- },
159970
- decorative: {
159971
- dependencyType: "stateVariable",
159972
- variableName: "decorative"
159973
- }
159974
- }),
159975
- definition({ dependencyValues }) {
159976
- let shortDescription = "";
159977
- const diagnostics2 = [];
159978
- if (dependencyValues.shortDescriptionChild.length > 0) {
159979
- const shortDescriptionChild = dependencyValues.shortDescriptionChild[dependencyValues.shortDescriptionChild.length - 1];
159980
- shortDescription = shortDescriptionChild.stateValues.text.trim();
159981
- }
159982
- if (shortDescription === "" && !dependencyValues.decorative) {
159983
- diagnostics2.push(
159984
- codedDiagnostic({
159985
- type: "accessibility",
159986
- level: 1,
159987
- code: "doenet-a0001",
159988
- args: { component: "graph" }
159989
- })
159990
- );
159991
- }
159992
- return {
159993
- setValue: { shortDescription },
159994
- sendDiagnostics: diagnostics2
159995
- };
159996
- }
159997
- };
160968
+ Object.assign(
160969
+ stateVariableDefinitions,
160970
+ returnShortDescriptionStateVariableDefinition({
160971
+ componentType: "graph",
160972
+ componentName: "graph"
160973
+ })
160974
+ );
159998
160975
  stateVariableDefinitions.descriptionChildInd = {
159999
160976
  forRenderer: true,
160000
160977
  returnDependencies: () => ({
@@ -160038,158 +161015,11 @@ let Graph$1 = class Graph extends BlockComponent {
160038
161015
  };
160039
161016
  }
160040
161017
  };
160041
- stateVariableDefinitions.xLabel = {
160042
- description: "The x-axis label text.",
160043
- forRenderer: true,
160044
- public: true,
160045
- shadowingInstructions: {
160046
- createComponentOfType: "label",
160047
- addStateVariablesShadowingStateVariables: {
160048
- hasLatex: {
160049
- stateVariableToShadow: "xLabelHasLatex"
160050
- }
160051
- }
160052
- },
160053
- hasEssential: true,
160054
- defaultValue: "",
160055
- additionalStateVariablesDefined: [
160056
- {
160057
- variableName: "xLabelHasLatex",
160058
- forRenderer: true
160059
- }
160060
- ],
160061
- returnDependencies: () => ({
160062
- xLabelChild: {
160063
- dependencyType: "child",
160064
- childGroups: ["xLabels"],
160065
- variableNames: ["value", "hasLatex"]
160066
- }
160067
- }),
160068
- definition({ dependencyValues }) {
160069
- if (dependencyValues.xLabelChild.length > 0) {
160070
- let xLabelChild = dependencyValues.xLabelChild[dependencyValues.xLabelChild.length - 1];
160071
- return {
160072
- setValue: {
160073
- xLabel: xLabelChild.stateValues.value,
160074
- xLabelHasLatex: xLabelChild.stateValues.hasLatex
160075
- }
160076
- };
160077
- } else {
160078
- return {
160079
- useEssentialOrDefaultValue: { xLabel: true },
160080
- setValue: { xLabelHasLatex: false }
160081
- };
160082
- }
160083
- },
160084
- inverseDefinition({
160085
- desiredStateVariableValues,
160086
- dependencyValues
160087
- }) {
160088
- if (typeof desiredStateVariableValues.xLabel !== "string") {
160089
- return { success: false };
160090
- }
160091
- if (dependencyValues.xLabelChild.length > 0) {
160092
- let lastLabelInd = dependencyValues.xLabelChild.length - 1;
160093
- return {
160094
- success: true,
160095
- instructions: [
160096
- {
160097
- setDependency: "xLabelChild",
160098
- desiredValue: desiredStateVariableValues.xLabel,
160099
- childIndex: lastLabelInd,
160100
- variableIndex: 0
160101
- }
160102
- ]
160103
- };
160104
- } else {
160105
- return {
160106
- success: true,
160107
- instructions: [
160108
- {
160109
- setEssentialValue: "xLabel",
160110
- value: desiredStateVariableValues.xLabel
160111
- }
160112
- ]
160113
- };
160114
- }
160115
- }
160116
- };
160117
- stateVariableDefinitions.yLabel = {
160118
- description: "The y-axis label text.",
160119
- forRenderer: true,
160120
- public: true,
160121
- shadowingInstructions: {
160122
- createComponentOfType: "label",
160123
- addStateVariablesShadowingStateVariables: {
160124
- hasLatex: {
160125
- stateVariableToShadow: "yLabelHasLatex"
160126
- }
160127
- }
160128
- },
160129
- hasEssential: true,
160130
- defaultValue: "",
160131
- additionalStateVariablesDefined: [
160132
- {
160133
- variableName: "yLabelHasLatex",
160134
- forRenderer: true
160135
- }
160136
- ],
160137
- returnDependencies: () => ({
160138
- yLabelChild: {
160139
- dependencyType: "child",
160140
- childGroups: ["yLabels"],
160141
- variableNames: ["value", "hasLatex"]
160142
- }
160143
- }),
160144
- definition({ dependencyValues }) {
160145
- if (dependencyValues.yLabelChild.length > 0) {
160146
- let yLabelChild = dependencyValues.yLabelChild[dependencyValues.yLabelChild.length - 1];
160147
- return {
160148
- setValue: {
160149
- yLabel: yLabelChild.stateValues.value,
160150
- yLabelHasLatex: yLabelChild.stateValues.hasLatex
160151
- }
160152
- };
160153
- } else {
160154
- return {
160155
- useEssentialOrDefaultValue: { yLabel: true },
160156
- setValue: { yLabelHasLatex: false }
160157
- };
160158
- }
160159
- },
160160
- inverseDefinition({
160161
- desiredStateVariableValues,
160162
- dependencyValues
160163
- }) {
160164
- if (typeof desiredStateVariableValues.yLabel !== "string") {
160165
- return { success: false };
160166
- }
160167
- if (dependencyValues.yLabelChild.length > 0) {
160168
- let lastLabelInd = dependencyValues.yLabelChild.length - 1;
160169
- return {
160170
- success: true,
160171
- instructions: [
160172
- {
160173
- setDependency: "yLabelChild",
160174
- desiredValue: desiredStateVariableValues.yLabel,
160175
- childIndex: lastLabelInd,
160176
- variableIndex: 0
160177
- }
160178
- ]
160179
- };
160180
- } else {
160181
- return {
160182
- success: true,
160183
- instructions: [
160184
- {
160185
- setEssentialValue: "yLabel",
160186
- value: desiredStateVariableValues.yLabel
160187
- }
160188
- ]
160189
- };
160190
- }
160191
- }
160192
- };
161018
+ Object.assign(
161019
+ stateVariableDefinitions,
161020
+ returnAxisLabelStateVariableDefinitions({ axis: "x" }),
161021
+ returnAxisLabelStateVariableDefinitions({ axis: "y" })
161022
+ );
160193
161023
  stateVariableDefinitions.graphicalDescendants = {
160194
161024
  forRenderer: true,
160195
161025
  returnDependencies: () => ({
@@ -160327,100 +161157,10 @@ let Graph$1 = class Graph extends BlockComponent {
160327
161157
  };
160328
161158
  }
160329
161159
  };
160330
- stateVariableDefinitions.size = {
160331
- description: "The size of the graph.",
160332
- public: true,
160333
- defaultValue: "medium",
160334
- hasEssential: true,
160335
- shadowingInstructions: {
160336
- createComponentOfType: "text"
160337
- },
160338
- returnDependencies: () => ({
160339
- specifiedSize: {
160340
- dependencyType: "stateVariable",
160341
- variableName: "specifiedSize"
160342
- },
160343
- widthAttr: {
160344
- dependencyType: "attributeComponent",
160345
- attributeName: "width",
160346
- variableNames: ["componentSize"]
160347
- }
160348
- }),
160349
- definition({ dependencyValues, usedDefault }) {
160350
- const defaultSize = "medium";
160351
- if (!usedDefault.specifiedSize) {
160352
- return {
160353
- setValue: { size: dependencyValues.specifiedSize }
160354
- };
160355
- } else if (dependencyValues.widthAttr) {
160356
- let componentSize = dependencyValues.widthAttr.stateValues.componentSize;
160357
- if (componentSize === null) {
160358
- return {
160359
- setValue: { size: defaultSize }
160360
- };
160361
- }
160362
- let { isAbsolute, size: widthSize } = componentSize;
160363
- let size2;
160364
- if (isAbsolute) {
160365
- for (let [
160366
- ind,
160367
- pixels
160368
- ] of orderedWidthMidpoints.entries()) {
160369
- if (widthSize <= pixels) {
160370
- size2 = sizePossibilities[ind];
160371
- break;
160372
- }
160373
- }
160374
- if (!size2) {
160375
- size2 = defaultSize;
160376
- }
160377
- } else {
160378
- for (let [
160379
- ind,
160380
- percent
160381
- ] of orderedPercentWidthMidpoints.entries()) {
160382
- if (widthSize <= percent) {
160383
- size2 = sizePossibilities[ind];
160384
- break;
160385
- }
160386
- }
160387
- if (!size2) {
160388
- size2 = defaultSize;
160389
- }
160390
- }
160391
- return {
160392
- setValue: { size: size2 }
160393
- };
160394
- } else {
160395
- return {
160396
- useEssentialOrDefaultValue: { size: true }
160397
- };
160398
- }
160399
- }
160400
- };
160401
- stateVariableDefinitions.width = {
160402
- description: "The width of the graph.",
160403
- public: true,
160404
- forRenderer: true,
160405
- shadowingInstructions: {
160406
- createComponentOfType: "componentSize"
160407
- },
160408
- returnDependencies: () => ({
160409
- size: {
160410
- dependencyType: "stateVariable",
160411
- variableName: "size"
160412
- }
160413
- }),
160414
- definition({ dependencyValues }) {
160415
- let width = {
160416
- isAbsolute: true,
160417
- size: widthsBySize[dependencyValues.size]
160418
- };
160419
- return {
160420
- setValue: { width }
160421
- };
160422
- }
160423
- };
161160
+ Object.assign(
161161
+ stateVariableDefinitions,
161162
+ returnSizeStateVariableDefinitions({ componentName: "graph" })
161163
+ );
160424
161164
  stateVariableDefinitions.aspectRatioFromAxisScales = {
160425
161165
  returnDependencies: () => ({
160426
161166
  aspectRatioAttr: {
@@ -217613,47 +218353,13 @@ class Image extends BlockComponent {
217613
218353
  Object.assign(stateVariableDefinitions, selectedStyleDefinition);
217614
218354
  let anchorDefinition = returnAnchorStateVariableDefinition();
217615
218355
  Object.assign(stateVariableDefinitions, anchorDefinition);
217616
- stateVariableDefinitions.shortDescription = {
217617
- description: "A short accessibility description of the image.",
217618
- forRenderer: true,
217619
- public: true,
217620
- shadowingInstructions: {
217621
- createComponentOfType: "text"
217622
- },
217623
- returnDependencies: () => ({
217624
- shortDescriptionChild: {
217625
- dependencyType: "child",
217626
- childGroups: ["shortDescriptions"],
217627
- variableNames: ["text"]
217628
- },
217629
- decorative: {
217630
- dependencyType: "stateVariable",
217631
- variableName: "decorative"
217632
- }
217633
- }),
217634
- definition({ dependencyValues }) {
217635
- let shortDescription = "";
217636
- const diagnostics2 = [];
217637
- if (dependencyValues.shortDescriptionChild.length > 0) {
217638
- const shortDescriptionChild = dependencyValues.shortDescriptionChild[dependencyValues.shortDescriptionChild.length - 1];
217639
- shortDescription = shortDescriptionChild.stateValues.text.trim();
217640
- }
217641
- if (shortDescription === "" && !dependencyValues.decorative) {
217642
- diagnostics2.push(
217643
- codedDiagnostic({
217644
- type: "accessibility",
217645
- level: 1,
217646
- code: "doenet-a0001",
217647
- args: { component: "image" }
217648
- })
217649
- );
217650
- }
217651
- return {
217652
- setValue: { shortDescription },
217653
- sendDiagnostics: diagnostics2
217654
- };
217655
- }
217656
- };
218356
+ Object.assign(
218357
+ stateVariableDefinitions,
218358
+ returnShortDescriptionStateVariableDefinition({
218359
+ componentType: "image",
218360
+ componentName: "image"
218361
+ })
218362
+ );
217657
218363
  stateVariableDefinitions.childIndicesToRender = {
217658
218364
  returnDependencies: () => ({
217659
218365
  allChildren: {
@@ -239916,6 +240622,7 @@ const componentTypeArray = [
239916
240622
  ...Object.values(MathListOperators),
239917
240623
  ...Object.values(ListIndexOperators),
239918
240624
  ...Object.values(CountOperators),
240625
+ BarChart,
239919
240626
  ...Object.values(FunctionOperators),
239920
240627
  ...Object.values(TextOperatorsOfMath),
239921
240628
  ...Object.values(Extrema$1),
@@ -242450,4 +243157,4 @@ export {
242450
243157
  getDefaultExportFromCjs$1 as g,
242451
243158
  updateSyntaxFromV06toV07 as u
242452
243159
  };
242453
- //# sourceMappingURL=index-D5mqYa1b.js.map
243160
+ //# sourceMappingURL=index-CDEHO53c.js.map