@pie-element/hotspot 11.2.0-next.19 → 11.2.0-next.21

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.
@@ -17,7 +17,7 @@
17
17
  }
18
18
  })([["cb0f0518b022d739", (url) => "@font-face{font-family:Symbola;src:local(Symbola Regular),local(Symbola),url(\"" + url(() => new URL("../assets/Symbola-4c507403.woff2", import.meta.url)) + "\")format(\"woff2\")}.mq-editable-field{display:inline-block}.mq-editable-field .mq-cursor{z-index:1;border-left:1px solid #000;margin-left:-1px;padding:0;display:inline-block;position:relative}.mq-editable-field .mq-cursor.mq-blink{visibility:hidden}.mq-editable-field,.mq-math-mode .mq-editable-field{border:1px solid gray}.mq-editable-field.mq-focused,.mq-math-mode .mq-editable-field.mq-focused{border-color:#709ac0;border-radius:1px;box-shadow:0 0 1px 2px #8bd,inset 0 0 2px #6ae}.mq-math-mode .mq-editable-field{margin:1px}.mq-editable-field .mq-latex-command-input{color:inherit;border:1px solid gray;margin-left:2px;margin-right:1px;padding-right:1px;font-family:Courier New,monospace}.mq-editable-field .mq-latex-command-input.mq-empty{background:0 0}.mq-editable-field .mq-latex-command-input.mq-hasCursor{border-color:activeborder}.mq-editable-field.mq-empty:after,.mq-editable-field.mq-text-mode:after,.mq-math-mode .mq-empty:after,.mq-editable-field .mq-cursor:only-child:after,.mq-editable-field .mq-textarea+.mq-cursor:last-child:after{visibility:hidden;content:\"c\"}.mq-editable-field .mq-text-mode .mq-cursor:only-child:after{content:\"\"}.mq-editable-field.mq-text-mode{overflow:auto hidden}.mq-root-block,.mq-math-mode .mq-root-block{box-sizing:border-box;white-space:nowrap;vertical-align:middle;width:100%;padding:2px;display:inline-block;overflow:hidden}.mq-math-mode{font-variant:normal;font-size:115%;font-style:normal;font-weight:400;line-height:1;display:inline-block}.mq-math-mode .mq-non-leaf,.mq-math-mode .mq-scaled{display:inline-block}.mq-math-mode var,.mq-math-mode .mq-text-mode,.mq-math-mode .mq-nonSymbola{font-family:Times New Roman,Symbola,serif;line-height:.9}.mq-math-mode *{font-size:inherit;line-height:inherit;-webkit-user-select:none;user-select:none;box-sizing:border-box;border-color:#000;margin:0;padding:0}.mq-math-mode .mq-empty,.mq-math-mode.mq-empty{background:0 0}.mq-math-mode .mq-text-mode{white-space:pre;display:inline-block}.mq-math-mode .mq-text-mode.mq-hasCursor{min-width:1ex;margin:0 -.1em;padding:0 .1em;box-shadow:inset 0 .1em .2em #a9a9a9}.mq-math-mode .mq-font{font:1em Times New Roman,Symbola,serif}.mq-math-mode .mq-font *{font-family:inherit;font-style:inherit}.mq-math-mode b,.mq-math-mode b.mq-font{font-weight:bolder}.mq-math-mode var,.mq-math-mode i,.mq-math-mode i.mq-font{font-style:italic}.mq-math-mode var.mq-f{margin-left:.1em;margin-right:.2em}.mq-math-mode .mq-roman var.mq-f{margin:0}.mq-math-mode big{font-size:200%}.mq-math-mode .mq-int>big{vertical-align:-.16em;display:inline-block;transform:scaleX(.7)}.mq-math-mode .mq-int>.mq-supsub{vertical-align:-1.1em;padding-right:.2em;font-size:80%}.mq-math-mode .mq-int>.mq-supsub>.mq-sup>.mq-sup-inner{vertical-align:1.3em}.mq-math-mode .mq-int>.mq-supsub>.mq-sub{margin-left:-.35em}.mq-math-mode .mq-roman{font-style:normal}.mq-math-mode .mq-sans-serif{font-family:sans-serif,Symbola,serif}.mq-math-mode .mq-monospace{font-family:monospace,Symbola,serif}.mq-math-mode .mq-overleftrightarrow{margin-top:.35em;position:relative}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner{text-align:center;border-top:.14em solid #4d4d4d;min-width:1em;margin:0 .1em;padding-top:.35em;display:inline-block;position:relative}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-overleftrightarrow-inner-right{text-align:right;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;right:-.4em}.mq-math-mode .mq-overleftrightarrow .mq-overleftrightarrow-inner .mq-overleftrightarrow-inner-left{text-align:left;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;left:-.4em}.mq-math-mode .mq-overline .mq-overline-inner{text-align:center;border-top:.14em solid #4d4d4d;margin-left:.1em;padding-top:.2em;padding-right:.1em;display:inline-block}.mq-math-mode .mq-overline .mq-overline-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overline .mq-overline-inner .mq-overline-inner-right,.mq-math-mode .mq-overline .mq-overline-inner .mq-overline-inner-left{display:none}.mq-math-mode .mq-longdiv{padding-top:.2em}.mq-math-mode .mq-longdiv .mq-longdiv-curve-border{border-top-right-radius:100em;border-bottom-right-radius:100em;width:2px;max-width:2px;margin-right:-.12em;padding-top:.2em;font-size:1.4em;display:inline}.mq-math-mode .mq-longdiv .mq-longdiv-inner{text-align:center;border-top:1px solid gray;border-radius:0 0 0 10px;min-width:1em;margin-left:-.2em;margin-right:.15em;padding-top:.19em;padding-left:.44em;font-size:1em;display:inline}.mq-math-mode .mq-longdiv .mq-longdiv-inner .mq-empty{min-width:1.5em;display:inline-block}.mq-math-mode .mq-underline{border-bottom:1px solid #000;margin-bottom:1px}.mq-math-mode .mq-underline.mq-empty{min-width:1em}.mq-math-mode .mq-overarc{-moz-border-radius-topright:50% .3em;-moz-border-radius-topleft:50% .3em;border-top:1px solid #000;border-top-left-radius:50% .3em;border-top-right-radius:50% .3em;margin-top:1px;padding-top:.15em}.mq-math-mode .mq-overarrow{margin-top:.35em;position:relative}.mq-math-mode .mq-overarrow .mq-overarrow-inner{text-align:center;border-top:.14em solid #4d4d4d;min-width:1em;margin:0 .1em;padding-top:.35em;display:inline-block;position:relative}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty{min-width:1em;margin-top:.1em;display:inline-block}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-overarrow-inner-right{text-align:right;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:block;position:absolute;top:-.562em;right:-.4em}.mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-overarrow-inner-left{text-align:left;font-family:LearnosityIconsRegular;font-size:.75em;line-height:1em;display:none;position:absolute;top:-.562em;left:-.4em}.mq-math-mode .mq-overarrow.mq-arrow-left .mq-overarrow-inner .mq-overarrow-inner-right{display:none}.mq-math-mode .mq-overarrow.mq-arrow-left .mq-overarrow-inner .mq-overarrow-inner-left{display:block}.mq-math-mode .mq-overarrow.mq-arrow-both{vertical-align:text-bottom}.mq-math-mode .mq-overarrow.mq-arrow-both.mq-empty{min-height:1.23em}.mq-math-mode .mq-overarrow.mq-arrow-both.mq-empty:after{top:-.34em}.mq-math-mode .mq-overarrow.mq-arrow-both:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-math-mode .mq-overarrow.mq-arrow-both:after{content:\"➤\";visibility:visible;text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-2.3em}.mq-math-mode .mq-xarrow{text-align:center;vertical-align:.9em;padding:0 .2em;font-size:70%;position:relative}.mq-math-mode .mq-xarrow .mq-xarrow-over{border-bottom:1px solid #000;padding:.1em .1em .2em;display:block;position:relative}.mq-math-mode .mq-xarrow .mq-xarrow-under{float:left;margin-bottom:.2em;padding:0 .1em .2em;position:relative;top:.2em}.mq-math-mode .mq-xarrow .mq-xarrow-over:before{content:\"➤\";height:1em;font-size:.6em;display:block;position:absolute;bottom:-.62em;right:-.3em}.mq-math-mode .mq-xarrow.mq-arrow-left .mq-xarrow-over:before{filter:FlipH;-ms-filter:\"FlipH\";left:-.3em;right:auto;transform:scaleX(-1)}.mq-math-mode .mq-binary-operator{padding:0 .2em;display:inline-block}.mq-math-mode .mq-supsub{text-align:left;vertical-align:-.5em;font-size:90%}.mq-math-mode .mq-supsub.mq-sup-only{vertical-align:.5em}.mq-math-mode .mq-supsub.mq-sup-only .mq-sup{vertical-align:text-bottom;display:inline-block}.mq-math-mode .mq-supsub .mq-sup{display:block}.mq-math-mode .mq-supsub .mq-sub{float:left;display:block}.mq-math-mode .mq-supsub .mq-binary-operator{padding:0 .1em}.mq-math-mode .mq-supsub .mq-fraction{font-size:70%}.mq-math-mode sup.mq-nthroot{vertical-align:.8em;min-width:.5em;margin-left:.2em;margin-right:-.6em;font-size:80%}.mq-math-mode .mq-paren{vertical-align:top;transform-origin:50% .06em;padding:0 .1em}.mq-math-mode .mq-paren.mq-ghost{color:silver}.mq-math-mode .mq-paren+span{margin-top:.1em;margin-bottom:.1em}.mq-math-mode .mq-array{vertical-align:middle;text-align:center}.mq-math-mode .mq-array>span{display:block}.mq-math-mode .mq-operator-name{font-family:Symbola,Times New Roman,serif;font-style:normal;line-height:.9}.mq-math-mode var.mq-operator-name.mq-first{padding-left:.2em}.mq-math-mode var.mq-operator-name.mq-last,.mq-math-mode .mq-supsub.mq-after-operator-name{padding-right:.2em}.mq-math-mode .mq-fraction{text-align:center;vertical-align:-.4em;padding:0 .2em;font-size:90%}.mq-math-mode .mq-fraction,.mq-math-mode .mq-large-operator{display:-moz-groupbox}.mq-math-mode x:-moz-any-link{display:-moz-groupbox}.mq-math-mode .mq-fraction,.mq-math-mode .mq-large-operator,.mq-math-mode x:default{display:inline-block}.mq-math-mode x:-moz-any-link{display:inline-block}.mq-math-mode .mq-underset.mq-tilde-vector .mq-under{line-height:.6em}.mq-math-mode .mq-numerator,.mq-math-mode .mq-denominator,.mq-math-mode .mq-dot-recurring,.mq-math-mode .mq-over,.mq-math-mode .mq-under{display:block}.mq-math-mode .mq-numerator,.mq-math-mode .mq-over{margin-bottom:.2em;padding:0 .1em}.mq-math-mode .mq-denominator{float:right;border-top:1px solid;width:100%;padding:.3em .1em .1em}.mq-math-mode .mq-dot-recurring{text-align:center;height:.6em}.mq-math-mode .mq-overunder{text-align:center;position:relative;top:.01em}.mq-math-mode .mq-overunder .mq-font{font-family:inherit}.mq-math-mode .mq-overunder.mq-underset{vertical-align:text-top}.mq-math-mode .mq-overunder.mq-underset .mq-under,.mq-math-mode .mq-overunder.mq-overset .mq-over{font-size:.7em;display:block}.mq-math-mode .mq-sqrt-prefix{vertical-align:top;transform-origin:top;padding-top:0;position:relative;top:.1em}.mq-math-mode .mq-sqrt-stem{border-top:1px solid;margin-top:1px;margin-right:.1em;padding-top:1px;padding-left:.15em;padding-right:.2em}.mq-math-mode .mq-diacritic-above{text-align:center;line-height:.4em;display:block}.mq-math-mode .mq-diacritic-stem{text-align:center;display:block}.mq-math-mode .mq-hat-prefix{text-align:center;margin-bottom:-.7em;line-height:.95em;display:block;transform:scaleX(1.5)}.mq-math-mode .mq-hat-stem{display:block}.mq-math-mode .mq-large-operator{vertical-align:-.2em;text-align:center;vertical-align:middle;padding:.2em}.mq-math-mode .mq-large-operator .mq-from,.mq-math-mode .mq-large-operator big,.mq-math-mode .mq-large-operator .mq-to{display:block}.mq-math-mode .mq-large-operator .mq-from,.mq-math-mode .mq-large-operator .mq-to{font-size:80%}.mq-math-mode .mq-large-operator .mq-from{float:right;width:100%}.mq-math-mode .mq-lim{text-align:center}.mq-math-mode .mq-lim span{display:block}.mq-math-mode .mq-lim .mq-approaches{float:right;width:100%;font-size:80%}.mq-math-mode .mq-lim .mq-approaches span>span{display:inline}.mq-math-mode .mq-matrix{vertical-align:middle;margin-left:.1em;margin-right:.1em}.mq-math-mode .mq-matrix table{border-spacing:3px;border-collapse:separate;border-bottom:none;width:auto}.mq-math-mode .mq-matrix table.mq-rows-1{vertical-align:middle;margin-bottom:1px}.mq-math-mode .mq-matrix td{vertical-align:baseline;border:1px dotted #fff;width:auto;padding:.1em .3em}.mq-math-mode .mq-matrix td.mq-empty{border:1px dotted #000}.mq-math-mode .mq-abs{border-left:1px solid #000;border-right:1px solid #000;margin-left:.1em;margin-right:.1em;padding-left:.2em;padding-right:.2em}.mq-math-mode .mq-lrnplaceholder{margin-left:.05em;margin-right:.05em}.mq-math-mode .mq-parallelogram{margin-top:-.5em;line-height:1em;position:relative;overflow:hidden}.mq-math-mode .mq-parallelogram .mq-parallelogram-inner{font-size:2em;position:relative;top:.23em}.mq-math-mode,.mq-math-mode .mq-editable-field{cursor:text;font-family:Symbola,Times New Roman,serif}.mq-math-mode .mq-longdiv .mq-longdiv-curve-border,.mq-math-mode .mq-editable-field .mq-longdiv .mq-longdiv-curve-border{font-size:1.33em}.mq-overarrow{text-align:center;border-top:1px solid #000;min-width:.5em;margin-top:1px;padding-top:.2em}.mq-overarrow:before{content:\"➤\";text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-.34em}.mq-overarrow.mq-arrow-left:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-overarrow.mq-arrow-both{vertical-align:text-bottom}.mq-overarrow.mq-arrow-both.mq-empty{min-height:1.23em}.mq-overarrow.mq-arrow-both.mq-empty:after{top:-.34em}.mq-overarrow.mq-arrow-both:before{filter:FlipH;-ms-filter:\"FlipH\";transform:scaleX(-1)}.mq-overarrow.mq-arrow-both:after{content:\"➤\";visibility:visible;text-align:right;font-size:.5em;line-height:0;display:block;position:relative;top:-2.3em}.mq-math-mode .mq-selection,.mq-editable-field .mq-selection,.mq-math-mode .mq-selection .mq-non-leaf,.mq-editable-field .mq-selection .mq-non-leaf,.mq-math-mode .mq-selection .mq-scaled,.mq-editable-field .mq-selection .mq-scaled{color:highlighttext;border-color:highlighttext;background:highlight!important}.mq-math-mode .mq-selection .mq-matrixed,.mq-editable-field .mq-selection .mq-matrixed{background:#39f!important}.mq-math-mode .mq-selection .mq-matrixed-container,.mq-editable-field .mq-selection .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"#3399FF\")!important}.mq-math-mode .mq-selection.mq-blur,.mq-editable-field .mq-selection.mq-blur,.mq-math-mode .mq-selection.mq-blur .mq-non-leaf,.mq-editable-field .mq-selection.mq-blur .mq-non-leaf,.mq-math-mode .mq-selection.mq-blur .mq-scaled,.mq-editable-field .mq-selection.mq-blur .mq-scaled,.mq-math-mode .mq-selection.mq-blur .mq-matrixed,.mq-editable-field .mq-selection.mq-blur .mq-matrixed{color:#000;border-color:#000;background:#d4d4d4!important}.mq-math-mode .mq-selection.mq-blur .mq-matrixed-container,.mq-editable-field .mq-selection.mq-blur .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"#D4D4D4\")!important}.mq-editable-field .mq-textarea,.mq-math-mode .mq-textarea{-webkit-user-select:text;user-select:text;position:relative}.mq-editable-field .mq-textarea>textarea,.mq-math-mode .mq-textarea>textarea{opacity:0;overflow:hidden}.mq-editable-field .mq-textarea *,.mq-math-mode .mq-textarea *,.mq-editable-field .mq-selectable,.mq-math-mode .mq-selectable{-webkit-user-select:text;user-select:text;clip:rect(1em 1em 1em 1em);resize:none;box-sizing:content-box;width:1px;height:1px;position:absolute;transform:scale(0)}.mq-math-mode .mq-matrixed{background:#fff;display:inline-block}.mq-math-mode .mq-matrixed-container{filter:progid:DXImageTransform.Microsoft.Chroma(color=\"white\");margin-top:-.1em}.mq-math-mode .mq-matrix table{border-spacing:2px}button .mq-math-mode .mq-matrix table.mq-rows-2 td,button .mq-math-mode .mq-matrix table.mq-rows-3 td{width:.9em;font-size:.3em}button .mq-math-mode .mq-matrix table.mq-rows-2{margin-bottom:-2px}button .mq-math-mode .mq-matrix table.mq-rows-1{margin-bottom:3px}button .mq-math-mode .mq-matrix table.mq-rows-1 td{width:1.1em;margin-bottom:3px;font-size:.6em}button .mq-math-mode .mq-matrix .matrix-edit-content-row{text-align:center;vertical-align:middle;display:inline-block}button .mq-math-mode .mq-matrix .matrix-edit-content-row p{font-size:.7em}button .mq-math-mode .mq-matrix .matrix-edit-content-col{text-align:center;vertical-align:middle;display:inline-block}button .mq-math-mode .mq-matrix .matrix-edit-content-col p{padding:0 .15em;font-size:.7em}button .mq-math-mode .mq-matrix .mq-paren{padding:0;display:inline-block;transform:scale(1.13,1.77)}button .matrix-edit .mq-empty{width:.8em;margin:.1em;padding:.1em;font-size:.4em}\n"]]);
19
19
  import { a as e, n as t, o as n, s as r, t as i } from "../browser-D4gLESxz.js";
20
- import { $ as a, A as o, At as s, B as c, Bt as l, C as u, Ct as d, Dt as f, Et as p, F as m, Ft as h, G as g, Gt as _, H as v, Ht as y, I as b, It as x, J as S, Jt as C, K as ee, Kt as w, Lt as T, M as E, Mt as D, N as O, Nt as te, Ot as ne, P as re, Pt as ie, Q as k, Qt as ae, R as oe, Rt as A, S as se, St as j, Tt as ce, U as le, Ut as ue, V as de, Vt as fe, Wt as pe, X as me, Xt as he, Y as ge, Yt as M, Z as _e, Zt as ve, _ as ye, _t as be, a as xe, at as N, b as Se, bt as Ce, c as we, ct as Te, d as Ee, dt as De, et as Oe, f as ke, ft as Ae, g as je, gt as Me, h as Ne, ht as Pe, it as Fe, j as Ie, jt as Le, kt as Re, lt as ze, m as Be, mt as Ve, n as He, nt as Ue, o as We, ot as Ge, p as Ke, pt as qe, q as Je, qt as Ye, r as Xe, rt as Ze, s as Qe, st as $e, t as et, tt, u as nt, ut as rt, v as it, vt as at, w as ot, x as st, xt as ct, y as lt, yt as ut, z as dt, zt as ft } from "../ReactKonva-e9jPRlPL.js";
20
+ import { $ as a, A as o, At as s, B as c, Bt as l, C as u, Ct as d, Dt as f, Et as p, F as m, Ft as h, G as g, Gt as _, H as v, Ht as y, I as b, It as x, J as S, Jt as C, K as ee, Kt as w, Lt as T, M as E, Mt as D, N as O, Nt as te, Ot as ne, P as re, Pt as ie, Q as k, Qt as ae, R as oe, Rt as A, S as se, St as j, Tt as ce, U as le, Ut as ue, V as de, Vt as fe, Wt as pe, X as me, Xt as he, Y as ge, Yt as M, Z as _e, Zt as ve, _ as ye, _t as be, a as xe, at as N, b as Se, bt as Ce, c as we, ct as Te, d as Ee, dt as De, et as Oe, f as ke, ft as Ae, g as je, gt as Me, h as Ne, ht as Pe, it as Fe, j as Ie, jt as Le, kt as Re, lt as ze, m as Be, mt as Ve, n as He, nt as Ue, o as We, ot as Ge, p as Ke, pt as qe, q as Je, qt as Ye, r as Xe, rt as Ze, s as Qe, st as $e, t as et, tt, u as nt, ut as rt, v as it, vt as at, w as ot, x as st, xt as ct, y as lt, yt as ut, z as dt, zt as ft } from "../ReactKonva-Dk12iw29.js";
21
21
  import { a as pt, c as mt, d as ht, f as gt, i as _t, l as vt, n as yt, o as bt, r as xt, s as St, t as Ct, u as wt } from "../dist-CJeYAWp3.js";
22
22
  import * as P from "react";
23
23
  import F, { Component as Tt, createContext as Et, createElement as Dt, createRef as Ot, forwardRef as kt, memo as At, useCallback as jt, useContext as Mt, useDebugValue as Nt, useEffect as Pt, useLayoutEffect as Ft, useMemo as It, useRef as Lt, useState as Rt, version as zt } from "react";
@@ -21255,7 +21255,7 @@ function ID({ n: e, children: t, isDragging: n, isOver: r, dragItem: i, value: a
21255
21255
  Pt(() => (document.addEventListener("click", u), () => {
21256
21256
  document.removeEventListener("click", u);
21257
21257
  }), []), Pt(() => {
21258
- l.current && typeof ve == "function" && ve(l.current);
21258
+ l.current && typeof ae == "function" && ae(l.current);
21259
21259
  }, [
21260
21260
  a?.value,
21261
21261
  r,
@@ -21469,7 +21469,7 @@ var VD = (e) => {
21469
21469
  ]);
21470
21470
  let ee = (e) => e.clientX > document.documentElement.clientWidth || e.clientY > document.documentElement.clientHeight || e.target === document.documentElement;
21471
21471
  return Pt(() => {
21472
- m.current && typeof ve == "function" && ve(m.current);
21472
+ m.current && typeof ae == "function" && ae(m.current);
21473
21473
  }, [s]), Pt(() => {
21474
21474
  let e = document.body.getBoundingClientRect(), { from: n } = t.state.selection, r = t.view.coordsAtPos(n);
21475
21475
  y({
@@ -26704,7 +26704,7 @@ var _N = gN, { commonMqFontStyles: vN, longdivStyles: yN, supsubStyles: bN } = C
26704
26704
  "data-latex": "",
26705
26705
  "data-raw": e.latex
26706
26706
  },
26707
- ae(e.latex, e.wrapper)
26707
+ ve(e.latex, e.wrapper)
26708
26708
  ];
26709
26709
  },
26710
26710
  addNodeView() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/controller-utils/dist/index.js","../../../src/controller/utils.ts","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { isEmpty, isEqual } from '@pie-element/shared-lodash';\n\nexport const getCorrectResponse = (choices) =>\n choices\n .filter((c) => c.correct)\n .map((c) => c.id)\n .sort();\n\nexport const isResponseCorrect = (question, session) => {\n const {\n shapes: { rectangles = [], polygons = [], circles = [] },\n } = question;\n const choices = [...rectangles, ...polygons, ...circles];\n let correctResponseIds = getCorrectResponse(choices);\n\n if (!session || isEmpty(session)) {\n return false;\n }\n\n if (session.answers && session.answers.length) {\n let answerIds = (session.answers || []).map((a) => a.id);\n\n return isEqual(answerIds.sort(), correctResponseIds);\n } else if (!(correctResponseIds && correctResponseIds.length)) {\n return true;\n }\n\n return false;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n dimensions: { height: 0, width: 0 },\n hotspotColor: 'rgba(137, 183, 244, 0.25)',\n hotspotList: ['rgba(137, 183, 244, 0.25)'],\n imageUrl: '',\n multipleCorrect: true,\n outlineColor: 'blue',\n outlineList: ['blue'],\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationaleEnabled: true,\n shapes: { rectangles: [], polygons: [], circles: [] },\n strokeWidth: 5,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport debug from 'debug';\nimport { isEmpty } from '@pie-element/shared-lodash';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\n\nimport { isResponseCorrect } from './utils.js';\n\nimport defaults from './defaults.js';\n\nconst log = debug('pie-elements:hotspot:controller');\n\nconst checkNullish = (value) => value !== null && value !== undefined;\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const {\n imageUrl,\n dimensions,\n hotspotColor,\n hoverOutlineColor,\n selectedHotspotColor,\n multipleCorrect,\n outlineColor,\n partialScoring,\n prompt,\n shapes,\n language,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n } = normalizedQuestion;\n const { rectangles, polygons, circles } = shapes || {};\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate' || (env.role === 'instructor' && env.mode === 'view');\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n dimensions,\n imageUrl,\n outlineColor,\n hotspotColor,\n hoverOutlineColor: checkNullish(hoverOutlineColor) ? hoverOutlineColor : 'black',\n selectedHotspotColor,\n multipleCorrect,\n partialScoring,\n language,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n shapes: {\n ...shapes,\n // eslint-disable-next-line no-unused-vars\n rectangles: (rectangles || []).map(({ index, correct, ...rectProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...rectProps } : { ...rectProps },\n ),\n // eslint-disable-next-line no-unused-vars\n polygons: (polygons || []).map(({ index, correct, ...polyProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...polyProps } : { ...polyProps },\n ),\n // eslint-disable-next-line no-unused-vars\n circles: (circles || []).map(({ index, correct, ...circleProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...circleProps } : { ...circleProps },\n ),\n },\n responseCorrect: env.mode === 'evaluate' ? isResponseCorrect(normalizedQuestion, session) : undefined,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n out.prompt = normalizedQuestion.promptEnabled ? prompt : null;\n out.strokeWidth = normalizedQuestion.strokeWidth;\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nconst getScore = (config, session, env = {}) => {\n const { answers } = session || {};\n\n if (!config.shapes || (!config.shapes.rectangles && !config.shapes.polygons && !config.shapes.circles)) {\n return 0;\n }\n\n const { shapes: { rectangles = [], polygons = [], circles = [] } = {} } = config;\n const partialScoringEnabled = partialScoring.enabled(config, env);\n\n if (!partialScoringEnabled) {\n return isResponseCorrect(config, session) ? 1 : 0;\n }\n\n let correctAnswers = 0;\n let selectedChoices = 0;\n\n const choices = [...rectangles, ...polygons, ...circles];\n\n const correctChoices = choices.filter((choice) => choice.correct);\n\n choices.forEach((shape) => {\n const selected = answers && answers.filter((answer) => answer.id === shape.id)[0];\n const correctlySelected = shape.correct && selected;\n\n if (selected) {\n selectedChoices += 1;\n }\n\n if (correctlySelected) {\n correctAnswers += 1;\n }\n });\n\n const extraAnswers = selectedChoices > correctChoices.length ? selectedChoices - correctChoices.length : 0;\n\n const total = correctChoices.length === 0 ? 1 : correctChoices.length;\n const str = ((correctAnswers - extraAnswers) / total).toFixed(2);\n\n return str < 0 ? 0 : parseFloat(str);\n};\n\n /**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { answers } = session || {};\n const { shapes } = model || {};\n\n const allShapes = [];\n if (shapes) {\n if (shapes.rectangles) allShapes.push(...shapes.rectangles);\n if (shapes.polygons) allShapes.push(...shapes.polygons);\n if (shapes.circles) allShapes.push(...shapes.circles);\n }\n\n const correctShapes = allShapes.filter(shape => shape.correct);\n const totalShapes = allShapes.length;\n\n traceLog.push(`Total of ${totalShapes} hotspot(s) defined, ${correctShapes.length} correct.`);\n\n if (answers && answers.length > 0) {\n traceLog.push(`Student selected ${answers.length} hotspot(s).`);\n\n let correctSelections = 0;\n let incorrectSelections = 0;\n\n answers.forEach(answer => {\n const shape = allShapes.find(s => s.id === answer.id);\n if (shape && shape.correct) {\n correctSelections++;\n } else {\n incorrectSelections++;\n }\n });\n\n const missedCorrect = correctShapes.filter(correctShape =>\n !answers.some(answer => answer.id === correctShape.id)\n ).length;\n\n if (correctSelections > 0) {\n traceLog.push(`${correctSelections} correct hotspot(s) selected.`);\n }\n if (incorrectSelections > 0) {\n traceLog.push(`${incorrectSelections} incorrect hotspot(s) selected.`);\n }\n if (missedCorrect > 0) {\n traceLog.push(`${missedCorrect} correct hotspot(s) missed.`);\n }\n } else {\n traceLog.push('No hotspots selected.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n if (partialScoringEnabled) {\n traceLog.push(`Score calculated using partial scoring.`);\n\n if (answers && answers.length > 0) {\n let correctSelections = 0;\n let incorrectSelections = 0;\n\n answers.forEach(answer => {\n const shape = allShapes.find(s => s.id === answer.id);\n if (shape && shape.correct) {\n correctSelections++;\n } else {\n incorrectSelections++;\n }\n });\n\n const totalCorrectAvailable = correctShapes.length;\n traceLog.push(`Partial scoring calculation: ${correctSelections} correct selections out of ${totalCorrectAvailable} available.`);\n\n if (incorrectSelections > totalCorrectAvailable) {\n const extraSelections = incorrectSelections - (totalCorrectAvailable - correctSelections);\n traceLog.push(`${extraSelections} extra incorrect selection(s) beyond required amount are deducted from score.`);\n }\n }\n } else {\n traceLog.push(`Score calculated using all-or-nothing scoring.`);\n }\n\n const score = getScore(model, session, env);\n traceLog.push(`Score: ${score}.`);\n\n return traceLog;\n}\n\nexport function outcome(config, session, env = {}) {\n return new Promise((resolve) => {\n log('outcome...');\n\n if (!session || isEmpty(session)) {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['No hotspots selected. Score: 0.']\n });\n }\n\n if (session.answers) {\n const traceLog = getLogTrace(config, session, env);\n const score = getScore(config, session, env);\n\n resolve({ score, empty: false, traceLog });\n } else {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['No hotspots selected. Score: 0.']\n });\n }\n });\n}\n\nconst returnShapesCorrect = (shapes) => {\n let answers = [];\n\n shapes.forEach((i) => {\n const { correct, id } = i;\n if (correct) {\n answers.push({ id });\n }\n });\n return answers;\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { shapes: { rectangles = [], circles = [], polygons = {} } = {} } = question;\n\n const rectangleCorrect = returnShapesCorrect(rectangles);\n const polygonsCorrect = returnShapesCorrect(polygons);\n const circlesCorrect = returnShapesCorrect(circles);\n\n resolve({\n answers: [...rectangleCorrect, ...polygonsCorrect, ...circlesCorrect],\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { shapes } = model;\n const { minShapes = 2, maxShapes, maxSelections } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const allShapes = Object.values(shapes || {}).reduce((acc, shape) => [...acc, ...shape], []);\n\n const nbOfSelections = (allShapes || []).reduce((acc, shape) => (shape.correct ? acc + 1 : acc), 0);\n\n const nbOfShapes = (allShapes || []).length;\n\n if (nbOfShapes < minShapes) {\n errors.shapes = `There should be at least ${minShapes} shapes defined.`;\n } else if (nbOfShapes > maxShapes) {\n errors.shapes = `No more than ${maxShapes} shapes should be defined.`;\n }\n\n if (nbOfSelections < 1) {\n errors.selections = 'There should be at least 1 shape selected.';\n } else if (nbOfSelections > maxSelections) {\n errors.selections = `No more than ${maxSelections} shapes should be selected.`;\n }\n\n return errors;\n};\n"],"mappings":";;;mCACI,IAAI,OAAO,gBA8CX,IAAoB,kBA9CY,GAAG,MAAM;CAC5C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,GAAG;EACxB,KAAK,EAAE;EACP,YAAY,CAAC;CACd,CAAC;CACD,OAAO,KAAK,EAAE,GAAG,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GAAG;AAC5D,EAuCwB,CAAE,EAAE,eAAe,EAAE,CAAC;AAC9C,SAAS,EAAE,GAAG,GAAG,GAAG;CACnB,OAAO,GAAG,mBAAmB,CAAC,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,aAAa;AAC7F;;;ACtCA,IAAa,KAAsB,MACjC,EACG,QAAQ,MAAM,EAAE,OAAO,CAAC,CACxB,KAAK,MAAM,EAAE,EAAE,CAAC,CAChB,KAAK,GAEG,KAAqB,GAAU,MAAY;CACtD,IAAM,EACJ,QAAQ,EAAE,gBAAa,CAAC,GAAG,cAAW,CAAC,GAAG,aAAU,CAAC,QACnD,GAEA,IAAqB,EAAmB;EAD3B,GAAG;EAAY,GAAG;EAAU,GAAG;CACJ,CAAO;CAcnD,OAZI,CAAC,KAAW,EAAQ,CAAO,IACtB,KAGL,EAAQ,WAAW,EAAQ,QAAQ,SAG9B,GAFU,EAAQ,WA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AAS,gBAAgB,EAAU,8BAGxC,IAAiB,IACnB,EAAO,aAAa,+CACX,IAAiB,MAC1B,EAAO,aAAa,gBAAgB,EAAc,+BAG7C;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/controller-utils/dist/index.js","../../../src/controller/utils.ts","../../../src/controller/defaults.ts","../../../src/controller/index.ts"],"sourcesContent":["//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" && Object.keys(e).length === 0;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n?.[\"@pie-element\"]?.lockChoiceOrder);\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n != \"boolean\" || n;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { isEmpty, isEqual } from '@pie-element/shared-lodash';\n\nexport const getCorrectResponse = (choices) =>\n choices\n .filter((c) => c.correct)\n .map((c) => c.id)\n .sort();\n\nexport const isResponseCorrect = (question, session) => {\n const {\n shapes: { rectangles = [], polygons = [], circles = [] },\n } = question;\n const choices = [...rectangles, ...polygons, ...circles];\n let correctResponseIds = getCorrectResponse(choices);\n\n if (!session || isEmpty(session)) {\n return false;\n }\n\n if (session.answers && session.answers.length) {\n let answerIds = (session.answers || []).map((a) => a.id);\n\n return isEqual(answerIds.sort(), correctResponseIds);\n } else if (!(correctResponseIds && correctResponseIds.length)) {\n return true;\n }\n\n return false;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n dimensions: { height: 0, width: 0 },\n hotspotColor: 'rgba(137, 183, 244, 0.25)',\n hotspotList: ['rgba(137, 183, 244, 0.25)'],\n imageUrl: '',\n multipleCorrect: true,\n outlineColor: 'blue',\n outlineList: ['blue'],\n partialScoring: false,\n prompt: '',\n promptEnabled: true,\n rationaleEnabled: true,\n shapes: { rectangles: [], polygons: [], circles: [] },\n strokeWidth: 5,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/hotspot/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport debug from 'debug';\nimport { isEmpty } from '@pie-element/shared-lodash';\nimport { partialScoring } from '@pie-element/shared-controller-utils';\n\nimport { isResponseCorrect } from './utils.js';\n\nimport defaults from './defaults.js';\n\nconst log = debug('pie-elements:hotspot:controller');\n\nconst checkNullish = (value) => value !== null && value !== undefined;\n\nexport const normalize = (question) => ({\n ...defaults,\n ...question,\n});\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const {\n imageUrl,\n dimensions,\n hotspotColor,\n hoverOutlineColor,\n selectedHotspotColor,\n multipleCorrect,\n outlineColor,\n partialScoring,\n prompt,\n shapes,\n language,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n } = normalizedQuestion;\n const { rectangles, polygons, circles } = shapes || {};\n\n const shouldIncludeCorrectResponse = env.mode === 'evaluate' || (env.role === 'instructor' && env.mode === 'view');\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n dimensions,\n imageUrl,\n outlineColor,\n hotspotColor,\n hoverOutlineColor: checkNullish(hoverOutlineColor) ? hoverOutlineColor : 'black',\n selectedHotspotColor,\n multipleCorrect,\n partialScoring,\n language,\n fontSizeFactor,\n autoplayAudioEnabled,\n completeAudioEnabled,\n customAudioButton,\n shapes: {\n ...shapes,\n // eslint-disable-next-line no-unused-vars\n rectangles: (rectangles || []).map(({ index, correct, ...rectProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...rectProps } : { ...rectProps },\n ),\n // eslint-disable-next-line no-unused-vars\n polygons: (polygons || []).map(({ index, correct, ...polyProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...polyProps } : { ...polyProps },\n ),\n // eslint-disable-next-line no-unused-vars\n circles: (circles || []).map(({ index, correct, ...circleProps }) =>\n shouldIncludeCorrectResponse ? { correct, ...circleProps } : { ...circleProps },\n ),\n },\n responseCorrect: env.mode === 'evaluate' ? isResponseCorrect(normalizedQuestion, session) : undefined,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = normalizedQuestion.rationaleEnabled ? normalizedQuestion.rationale : null;\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.rationale = null;\n out.teacherInstructions = null;\n }\n\n out.prompt = normalizedQuestion.promptEnabled ? prompt : null;\n out.strokeWidth = normalizedQuestion.strokeWidth;\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nconst getScore = (config, session, env = {}) => {\n const { answers } = session || {};\n\n if (!config.shapes || (!config.shapes.rectangles && !config.shapes.polygons && !config.shapes.circles)) {\n return 0;\n }\n\n const { shapes: { rectangles = [], polygons = [], circles = [] } = {} } = config;\n const partialScoringEnabled = partialScoring.enabled(config, env);\n\n if (!partialScoringEnabled) {\n return isResponseCorrect(config, session) ? 1 : 0;\n }\n\n let correctAnswers = 0;\n let selectedChoices = 0;\n\n const choices = [...rectangles, ...polygons, ...circles];\n\n const correctChoices = choices.filter((choice) => choice.correct);\n\n choices.forEach((shape) => {\n const selected = answers && answers.filter((answer) => answer.id === shape.id)[0];\n const correctlySelected = shape.correct && selected;\n\n if (selected) {\n selectedChoices += 1;\n }\n\n if (correctlySelected) {\n correctAnswers += 1;\n }\n });\n\n const extraAnswers = selectedChoices > correctChoices.length ? selectedChoices - correctChoices.length : 0;\n\n const total = correctChoices.length === 0 ? 1 : correctChoices.length;\n const str = ((correctAnswers - extraAnswers) / total).toFixed(2);\n\n return str < 0 ? 0 : parseFloat(str);\n};\n\n /**\n * Generates detailed trace log for scoring evaluation\n * @param {Object} model - the question model\n * @param {Object} session - the student session\n * @param {Object} env - the environment\n * @returns {Array} traceLog - array of trace messages\n */\nexport const getLogTrace = (model, session, env) => {\n const traceLog = [];\n const { answers } = session || {};\n const { shapes } = model || {};\n\n const allShapes = [];\n if (shapes) {\n if (shapes.rectangles) allShapes.push(...shapes.rectangles);\n if (shapes.polygons) allShapes.push(...shapes.polygons);\n if (shapes.circles) allShapes.push(...shapes.circles);\n }\n\n const correctShapes = allShapes.filter(shape => shape.correct);\n const totalShapes = allShapes.length;\n\n traceLog.push(`Total of ${totalShapes} hotspot(s) defined, ${correctShapes.length} correct.`);\n\n if (answers && answers.length > 0) {\n traceLog.push(`Student selected ${answers.length} hotspot(s).`);\n\n let correctSelections = 0;\n let incorrectSelections = 0;\n\n answers.forEach(answer => {\n const shape = allShapes.find(s => s.id === answer.id);\n if (shape && shape.correct) {\n correctSelections++;\n } else {\n incorrectSelections++;\n }\n });\n\n const missedCorrect = correctShapes.filter(correctShape =>\n !answers.some(answer => answer.id === correctShape.id)\n ).length;\n\n if (correctSelections > 0) {\n traceLog.push(`${correctSelections} correct hotspot(s) selected.`);\n }\n if (incorrectSelections > 0) {\n traceLog.push(`${incorrectSelections} incorrect hotspot(s) selected.`);\n }\n if (missedCorrect > 0) {\n traceLog.push(`${missedCorrect} correct hotspot(s) missed.`);\n }\n } else {\n traceLog.push('No hotspots selected.');\n }\n\n const partialScoringEnabled = partialScoring.enabled(model, env);\n\n if (partialScoringEnabled) {\n traceLog.push(`Score calculated using partial scoring.`);\n\n if (answers && answers.length > 0) {\n let correctSelections = 0;\n let incorrectSelections = 0;\n\n answers.forEach(answer => {\n const shape = allShapes.find(s => s.id === answer.id);\n if (shape && shape.correct) {\n correctSelections++;\n } else {\n incorrectSelections++;\n }\n });\n\n const totalCorrectAvailable = correctShapes.length;\n traceLog.push(`Partial scoring calculation: ${correctSelections} correct selections out of ${totalCorrectAvailable} available.`);\n\n if (incorrectSelections > totalCorrectAvailable) {\n const extraSelections = incorrectSelections - (totalCorrectAvailable - correctSelections);\n traceLog.push(`${extraSelections} extra incorrect selection(s) beyond required amount are deducted from score.`);\n }\n }\n } else {\n traceLog.push(`Score calculated using all-or-nothing scoring.`);\n }\n\n const score = getScore(model, session, env);\n traceLog.push(`Score: ${score}.`);\n\n return traceLog;\n}\n\nexport function outcome(config, session, env = {}) {\n return new Promise((resolve) => {\n log('outcome...');\n\n if (!session || isEmpty(session)) {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['No hotspots selected. Score: 0.']\n });\n }\n\n if (session.answers) {\n const traceLog = getLogTrace(config, session, env);\n const score = getScore(config, session, env);\n\n resolve({ score, empty: false, traceLog });\n } else {\n resolve({\n score: 0,\n empty: true,\n traceLog: ['No hotspots selected. Score: 0.']\n });\n }\n });\n}\n\nconst returnShapesCorrect = (shapes) => {\n let answers = [];\n\n shapes.forEach((i) => {\n const { correct, id } = i;\n if (correct) {\n answers.push({ id });\n }\n });\n return answers;\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { shapes: { rectangles = [], circles = [], polygons = {} } = {} } = question;\n\n const rectangleCorrect = returnShapesCorrect(rectangles);\n const polygonsCorrect = returnShapesCorrect(polygons);\n const circlesCorrect = returnShapesCorrect(circles);\n\n resolve({\n answers: [...rectangleCorrect, ...polygonsCorrect, ...circlesCorrect],\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const { shapes } = model;\n const { minShapes = 2, maxShapes, maxSelections } = config;\n const errors = {};\n\n ['teacherInstructions', 'prompt', 'rationale'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n const allShapes = Object.values(shapes || {}).reduce((acc, shape) => [...acc, ...shape], []);\n\n const nbOfSelections = (allShapes || []).reduce((acc, shape) => (shape.correct ? acc + 1 : acc), 0);\n\n const nbOfShapes = (allShapes || []).length;\n\n if (nbOfShapes < minShapes) {\n errors.shapes = `There should be at least ${minShapes} shapes defined.`;\n } else if (nbOfShapes > maxShapes) {\n errors.shapes = `No more than ${maxShapes} shapes should be defined.`;\n }\n\n if (nbOfSelections < 1) {\n errors.selections = 'There should be at least 1 shape selected.';\n } else if (nbOfSelections > maxSelections) {\n errors.selections = `No more than ${maxSelections} shapes should be selected.`;\n }\n\n return errors;\n};\n"],"mappings":";;;mCACI,IAAI,OAAO,gBA8CX,IAAoB,kBA9CY,GAAG,MAAM;CAC5C,IAAI,IAAI,CAAC;CACT,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,GAAG;EACxB,KAAK,EAAE;EACP,YAAY,CAAC;CACd,CAAC;CACD,OAAO,KAAK,EAAE,GAAG,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC,GAAG;AAC5D,EAuCwB,CAAE,EAAE,eAAe,EAAE,CAAC;AAC9C,SAAS,EAAE,GAAG,GAAG,GAAG;CACnB,OAAO,GAAG,mBAAmB,CAAC,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,aAAa;AAC7F;;;ACtCA,IAAa,KAAsB,MACjC,EACG,QAAQ,MAAM,EAAE,OAAO,CAAC,CACxB,KAAK,MAAM,EAAE,EAAE,CAAC,CAChB,KAAK,GAEG,KAAqB,GAAU,MAAY;CACtD,IAAM,EACJ,QAAQ,EAAE,gBAAa,CAAC,GAAG,cAAW,CAAC,GAAG,aAAU,CAAC,QACnD,GAEA,IAAqB,EAAmB;EAD3B,GAAG;EAAY,GAAG;EAAU,GAAG;CACJ,CAAO;CAcnD,OAZI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AAA,CAAG;CAcrC,OAZI,IAAa,IACf,EAAO,SAAS,4BAA4B,EAAU,oBAC7C,IAAa,MACtB,EAAO,SAAS,gBAAgB,EAAU,8BAGxC,IAAiB,IACnB,EAAO,aAAa,+CACX,IAAiB,MAC1B,EAAO,aAAa,gBAAgB,EAAc,+BAG7C;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "../browser-D4gLESxz.js";
2
- import { D as t, E as n, Et as r, Jt as i, L as a, O as o, W as s, Yt as c, Zt as l, a as u, b as d, c as f, i as p, k as m, l as h, n as g, o as _, r as v, s as y, t as b, wt as x } from "../ReactKonva-e9jPRlPL.js";
2
+ import { D as t, E as n, Et as r, Jt as i, L as a, O as o, Qt as s, W as c, Yt as l, a as u, b as d, c as f, i as p, k as m, l as h, n as g, o as _, r as v, s as y, t as b, wt as x } from "../ReactKonva-Dk12iw29.js";
3
3
  import S, { useRef as C } from "react";
4
4
  import { createRoot as w } from "react-dom/client";
5
5
  import { jsx as T, jsxs as E } from "react/jsx-runtime";
@@ -1737,7 +1737,7 @@ var et = $e(o, "Readable") || $e(rt.Readable, "Readable"), tt = d, nt = tt.defau
1737
1737
  minWidth: "140px",
1738
1738
  alignSelf: "center",
1739
1739
  verticalAlign: "middle",
1740
- color: `var(--correct-answer-toggle-label-color, ${c.text()})`,
1740
+ color: `var(--correct-answer-toggle-label-color, ${l.text()})`,
1741
1741
  fontWeight: "normal",
1742
1742
  ...it
1743
1743
  })), ct = r("div")(() => ({
@@ -2454,9 +2454,9 @@ function Bt(e) {
2454
2454
  function $(e, t) {
2455
2455
  return !e || Bt(e) ? e : Bt(e.default) ? e.default : t && Bt(e[t]) ? e[t] : t && Bt(e[t]?.default) ? e[t].default : e;
2456
2456
  }
2457
- var Vt = $(a, "UiLayout") || $(Kt.UiLayout, "UiLayout"), Ht = $(m, "PreviewPrompt") || $(Kt.PreviewPrompt, "PreviewPrompt"), Ut = $(s, "Collapsible") || $(Kt.Collapsible, "Collapsible"), Wt = d, Gt = Wt.default, Kt = Gt && typeof Gt == "object" ? Gt : Wt, qt = r(Vt)({
2458
- color: c.text(),
2459
- backgroundColor: c.background(),
2457
+ var Vt = $(a, "UiLayout") || $(Kt.UiLayout, "UiLayout"), Ht = $(m, "PreviewPrompt") || $(Kt.PreviewPrompt, "PreviewPrompt"), Ut = $(c, "Collapsible") || $(Kt.Collapsible, "Collapsible"), Wt = d, Gt = Wt.default, Kt = Gt && typeof Gt == "object" ? Gt : Wt, qt = r(Vt)({
2458
+ color: l.text(),
2459
+ backgroundColor: l.background(),
2460
2460
  position: "relative"
2461
2461
  }), Jt = r(Ut)(({ theme: e }) => ({ marginBottom: e.spacing(2) })), Yt = class extends S.Component {
2462
2462
  constructor(e) {
@@ -2477,10 +2477,10 @@ var Vt = $(a, "UiLayout") || $(Kt.UiLayout, "UiLayout"), Ht = $(m, "PreviewPromp
2477
2477
  e && this.observer.observe(e, {
2478
2478
  attributes: !0,
2479
2479
  attributeFilter: ["style"]
2480
- }), l(D.findDOMNode(this));
2480
+ }), s(D.findDOMNode(this));
2481
2481
  }
2482
2482
  componentDidUpdate() {
2483
- l(D.findDOMNode(this));
2483
+ s(D.findDOMNode(this));
2484
2484
  }
2485
2485
  componentWillUnmount() {
2486
2486
  this.observer?.disconnect();
@@ -2659,7 +2659,7 @@ var en = $t("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMC
2659
2659
  onSelectChoice: this.onSelectChoice.bind(this)
2660
2660
  });
2661
2661
  this._root ||= w(this), this._root.render(e), queueMicrotask(() => {
2662
- l(this);
2662
+ s(this);
2663
2663
  });
2664
2664
  }
2665
2665
  }