@pie-element/venn-classification 0.1.1-next.16 → 0.1.1-next.18

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.
@@ -2646,51 +2646,72 @@ function ga(e = {}) {
2646
2646
  await a?.startup?.promise, typeof a?.typesetPromise == "function" && (await a.typesetPromise([n]), ta(n));
2647
2647
  };
2648
2648
  }
2649
- var _a = "@pie-lib/math-rendering", va = "@pie-lib/math-rendering@2", ya = null;
2650
- function ba() {
2649
+ var _a = "@pie-lib/math-rendering", va = "@pie-lib/math-rendering@2", ya = "pie-print", ba = 50, xa = 1e4, Sa = null;
2650
+ function Ca() {
2651
2651
  return !!window[va]?.opts?.useSingleDollar;
2652
2652
  }
2653
- function xa() {
2654
- return ya ||= ga({ useSingleDollar: ba() }), ya;
2653
+ function wa() {
2654
+ return Sa ||= ga({ useSingleDollar: Ca() }), Sa;
2655
2655
  }
2656
- function Sa() {
2656
+ function Ta() {
2657
2657
  if (typeof window > "u") return null;
2658
2658
  let e = window[_a];
2659
2659
  return typeof e?.renderMath == "function" ? e : null;
2660
2660
  }
2661
- function Ca() {
2662
- let e = Hi();
2663
- e && Vi("legacy-renderer-delegation", `window['${_a}'] renders this element's math with MathJax ${e}`);
2661
+ function Ea(e) {
2662
+ let t = e;
2663
+ for (; t;) {
2664
+ if (t instanceof Element && t.localName === ya) return t;
2665
+ t = t instanceof ShadowRoot ? t.host : t.parentNode;
2666
+ }
2667
+ return null;
2664
2668
  }
2665
- var wa = async (e) => {
2669
+ function Da() {
2670
+ let e = window.renderMath;
2671
+ return typeof e == "function" ? e : null;
2672
+ }
2673
+ async function Oa(e) {
2674
+ let t = Ea(e);
2675
+ if (!t) return null;
2676
+ let n = Da();
2677
+ if (n || t.mathRenderingModuleUrlImported !== !0) return n;
2678
+ let r = Date.now() + xa;
2679
+ for (; Date.now() < r;) {
2680
+ await new Promise((e) => setTimeout(e, ba));
2681
+ let e = Da();
2682
+ if (e) return e;
2683
+ }
2684
+ return null;
2685
+ }
2686
+ var ka = async (e) => {
2666
2687
  if (typeof window > "u") return;
2667
2688
  let t = typeof e == "string", n;
2668
2689
  t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
2669
- let r = Sa();
2670
- return r ? (Ca(), await r.renderMath?.(n)) : await xa()(n), t ? n.innerHTML : void 0;
2690
+ let r = Ta(), i = r || t ? null : await Oa(n);
2691
+ return r ? await r.renderMath?.(n) : i ? await i(n) : await wa()(n), t ? n.innerHTML : void 0;
2671
2692
  };
2672
2693
  //#endregion
2673
2694
  //#region src/delivery/tile-accessible-name.ts
2674
- function Ta(e) {
2695
+ function Aa(e) {
2675
2696
  return (e || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
2676
2697
  }
2677
- function Ea(e, n) {
2698
+ function ja(e, n) {
2678
2699
  let r = (e.imageAlt ?? "").trim();
2679
- return (e.imageUrl ?? "").trim() && r ? r : Ta(e.label ?? "") || t("tileFallbackName", n);
2700
+ return (e.imageUrl ?? "").trim() && r ? r : Aa(e.label ?? "") || t("tileFallbackName", n);
2680
2701
  }
2681
- function Da(e, n, r, i) {
2682
- let a = [Ea(e, i), n === null ? t("tileNotPlaced", i) : t("tileInRegion", i, { region: n })];
2702
+ function Ma(e, n, r, i) {
2703
+ let a = [ja(e, i), n === null ? t("tileNotPlaced", i) : t("tileInRegion", i, { region: n })];
2683
2704
  return r === "correct" && a.push(t("tileCorrect", i)), r === "incorrect" && a.push(t("tileIncorrect", i)), a.join(", ");
2684
2705
  }
2685
2706
  //#endregion
2686
2707
  //#region src/delivery/Tile.svelte
2687
- var Oa = /* @__PURE__ */ Y("<img alt=\"\" class=\"tile-img svelte-1hgaksk\" aria-hidden=\"true\" draggable=\"false\"/>"), ka = /* @__PURE__ */ Y("<span></span>"), Aa = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-correct svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"></path></svg></span>"), ja = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-incorrect svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"></path></svg></span>"), Ma = /* @__PURE__ */ Y("<button type=\"button\"><span><!> <!></span> <!></button>"), Na = {
2708
+ var Na = /* @__PURE__ */ Y("<img alt=\"\" class=\"tile-img svelte-1hgaksk\" aria-hidden=\"true\" draggable=\"false\"/>"), Pa = /* @__PURE__ */ Y("<span></span>"), Fa = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-correct svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"></path></svg></span>"), Ia = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-incorrect svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"></path></svg></span>"), La = /* @__PURE__ */ Y("<button type=\"button\"><span><!> <!></span> <!></button>"), Ra = {
2688
2709
  hash: "svelte-1hgaksk",
2689
2710
  code: ".venn-tile.svelte-1hgaksk {position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 14px;border:1.5px solid #334155;border-radius:10px;background:#ffffff;color:#0f172a;font-size:14px;font-weight:500;box-shadow:0 1px 2px rgba(15, 23, 42, 0.06);cursor:grab;touch-action:none;user-select:none;transition:box-shadow 120ms ease, transform 120ms ease, background 120ms ease;}.venn-tile.svelte-1hgaksk:focus-visible,\n .venn-tile.focused.svelte-1hgaksk {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.venn-tile.svelte-1hgaksk:hover:not(:disabled) {background:#f8fafc;}.venn-tile.held.svelte-1hgaksk {cursor:grabbing;box-shadow:0 6px 18px rgba(15, 23, 42, 0.18);transform:translateY(-1px);background:#eef2ff;}.venn-tile.invisible.svelte-1hgaksk {visibility:hidden;}.venn-tile.ghost.svelte-1hgaksk {pointer-events:none;cursor:grabbing;box-shadow:0 10px 24px rgba(15, 23, 42, 0.22);transform:rotate(-1.5deg);background:#ffffff;opacity:0.96;}.venn-tile.correct.svelte-1hgaksk {border-color:#0ea449;}.venn-tile.incorrect.svelte-1hgaksk {border-color:#bf0d00;}.venn-tile.svelte-1hgaksk:disabled {cursor:default;}.tile-body.svelte-1hgaksk {display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;pointer-events:none;max-width:220px;}.tile-body-image.svelte-1hgaksk {flex-direction:column;gap:4px;}.tile-img.svelte-1hgaksk {width:40px;height:40px;object-fit:contain;flex-shrink:0;}.tile-label.svelte-1hgaksk {pointer-events:none;text-align:center;line-height:1.25;word-break:break-word;}.tile-label-below.svelte-1hgaksk {font-size:12px;font-weight:600;}.venn-tile.fit.svelte-1hgaksk {box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;padding:6px 10px;}.fit.svelte-1hgaksk .tile-body:where(.svelte-1hgaksk) {max-width:100%;max-height:100%;overflow:hidden;}.fit.svelte-1hgaksk .tile-label:where(.svelte-1hgaksk) {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;}.fit.svelte-1hgaksk .tile-label-below:where(.svelte-1hgaksk) {-webkit-line-clamp:1;line-clamp:1;}.venn-badge.svelte-1hgaksk {position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#ffffff;}.venn-badge-correct.svelte-1hgaksk {background:#0ea449;}.venn-badge-incorrect.svelte-1hgaksk {background:#bf0d00;}\n @media (prefers-reduced-motion: reduce) {.venn-tile.svelte-1hgaksk {transition:none;}\n }"
2690
2711
  };
2691
- function Pa(e, t) {
2692
- Xe(t, !0), si(e, Na);
2693
- let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "name", 7), s = $(t, "language", 7), c = $(t, "correctness", 7, "neutral"), l = $(t, "held", 7, !1), u = $(t, "invisible", 7, !1), d = $(t, "ghost", 7, !1), f = $(t, "disabled", 7, !1), p = $(t, "focused", 7, !1), m = $(t, "fit", 7, !1), h = $(t, "onpointerdown", 7), g = $(t, "onkeydown", 7), _ = $(t, "onkeyup", 7), v = $(t, "onfocus", 7), y = $(t, "onclick", 7), b = /* @__PURE__ */ I(() => o() ?? Ea({
2712
+ function za(e, t) {
2713
+ Xe(t, !0), si(e, Ra);
2714
+ let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "name", 7), s = $(t, "language", 7), c = $(t, "correctness", 7, "neutral"), l = $(t, "held", 7, !1), u = $(t, "invisible", 7, !1), d = $(t, "ghost", 7, !1), f = $(t, "disabled", 7, !1), p = $(t, "focused", 7, !1), m = $(t, "fit", 7, !1), h = $(t, "onpointerdown", 7), g = $(t, "onkeydown", 7), _ = $(t, "onkeyup", 7), v = $(t, "onfocus", 7), y = $(t, "onclick", 7), b = /* @__PURE__ */ I(() => o() ?? ja({
2694
2715
  label: r(),
2695
2716
  imageUrl: i(),
2696
2717
  imageAlt: a()
@@ -2804,19 +2825,19 @@ function Pa(e, t) {
2804
2825
  set onclick(e) {
2805
2826
  y(e), R();
2806
2827
  }
2807
- }, C = Ma();
2828
+ }, C = La();
2808
2829
  let w;
2809
2830
  var te = H(C);
2810
2831
  let ne;
2811
2832
  var re = H(te), ie = (e) => {
2812
- var t = Oa();
2833
+ var t = Na();
2813
2834
  W(() => Q(t, "src", i())), X(e, t);
2814
2835
  };
2815
2836
  Z(re, (e) => {
2816
2837
  J(x) && e(ie);
2817
2838
  });
2818
2839
  var T = U(re, 2), E = (e) => {
2819
- var t = ka();
2840
+ var t = Pa();
2820
2841
  let n;
2821
2842
  oi(t, r, !0), N(t), W(() => n = pi(t, 1, "tile-label svelte-1hgaksk", null, n, { "tile-label-below": J(x) })), X(e, t);
2822
2843
  };
@@ -2824,9 +2845,9 @@ function Pa(e, t) {
2824
2845
  J(S) && e(E);
2825
2846
  }), N(te);
2826
2847
  var ae = U(te, 2), oe = (e) => {
2827
- X(e, Aa());
2848
+ X(e, Fa());
2828
2849
  }, se = (e) => {
2829
- X(e, ja());
2850
+ X(e, Ia());
2830
2851
  };
2831
2852
  return Z(ae, (e) => {
2832
2853
  c() === "correct" ? e(oe) : c() === "incorrect" && e(se, 1);
@@ -2857,7 +2878,7 @@ Sr([
2857
2878
  "keydown",
2858
2879
  "keyup",
2859
2880
  "click"
2860
- ]), Li(Pa, {
2881
+ ]), Li(za, {
2861
2882
  id: {},
2862
2883
  label: {},
2863
2884
  imageUrl: {},
@@ -2879,12 +2900,12 @@ Sr([
2879
2900
  }, [], [], { mode: "open" });
2880
2901
  //#endregion
2881
2902
  //#region src/delivery/Tray.svelte
2882
- var Fa = /* @__PURE__ */ Y("<div role=\"region\" data-region-key=\"tray\"><div class=\"tray-label svelte-1ogsh8s\"> </div> <div class=\"tray-items svelte-1ogsh8s\"><!></div></div>"), Ia = {
2903
+ var Ba = /* @__PURE__ */ Y("<div role=\"region\" data-region-key=\"tray\"><div class=\"tray-label svelte-1ogsh8s\"> </div> <div class=\"tray-items svelte-1ogsh8s\"><!></div></div>"), Va = {
2883
2904
  hash: "svelte-1ogsh8s",
2884
2905
  code: ".venn-tray.svelte-1ogsh8s {border:1.5px dashed #94a3b8;border-radius:12px;padding:14px 16px;background:#f8fafc;min-height:120px;transition:background 120ms ease, border-color 120ms ease;}.venn-tray.drop-target.svelte-1ogsh8s {background:#e0f2fe;border-color:#0ea5e9;}.venn-tray.focused.svelte-1ogsh8s {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.tray-label.svelte-1ogsh8s {font-size:12px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px;}.tray-items.svelte-1ogsh8s {display:flex;flex-wrap:wrap;gap:10px;}\n @media (prefers-reduced-motion: reduce) {.venn-tray.svelte-1ogsh8s {transition:none;}\n }"
2885
2906
  };
2886
- function La(e, t) {
2887
- Xe(t, !0), si(e, Ia);
2907
+ function Ha(e, t) {
2908
+ Xe(t, !0), si(e, Va);
2888
2909
  let n = $(t, "isDropTarget", 7, !1), r = $(t, "focused", 7, !1), i = $(t, "label", 7), a = $(t, "onpointerenter", 7), o = $(t, "onpointerleave", 7), s = $(t, "children", 7);
2889
2910
  var c = {
2890
2911
  get isDropTarget() {
@@ -2923,7 +2944,7 @@ function La(e, t) {
2923
2944
  set children(e) {
2924
2945
  s(e), R();
2925
2946
  }
2926
- }, l = Fa();
2947
+ }, l = Ba();
2927
2948
  let u;
2928
2949
  var d = H(l), f = ln(d, !0), p = U(d, 2), m = H(p), h = (e) => {
2929
2950
  var t = Mr();
@@ -2942,7 +2963,7 @@ function La(e, t) {
2942
2963
  o()?.apply(this, e);
2943
2964
  }), X(e, l), Ze(c);
2944
2965
  }
2945
- Li(La, {
2966
+ Li(Ha, {
2946
2967
  isDropTarget: {},
2947
2968
  focused: {},
2948
2969
  label: {},
@@ -2952,12 +2973,12 @@ Li(La, {
2952
2973
  }, [], [], { mode: "open" });
2953
2974
  //#endregion
2954
2975
  //#region src/delivery/TeacherInstructions.svelte
2955
- var Ra = /* @__PURE__ */ Y("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), za = {
2976
+ var Ua = /* @__PURE__ */ Y("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), Wa = {
2956
2977
  hash: "svelte-1jhejbv",
2957
2978
  code: ".teacher-instructions.svelte-1jhejbv {margin-bottom:1rem;}.teacher-instructions-toggle.svelte-1jhejbv {padding:0;border:0;border-bottom:1px dotted currentColor;background:transparent;font:inherit;color:var(--pie-primary, #3f51b5);cursor:pointer;}.teacher-instructions-toggle.svelte-1jhejbv:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.teacher-instructions-content.svelte-1jhejbv {padding-top:1rem;}"
2958
2979
  };
2959
- function Ba(e, t) {
2960
- Xe(t, !0), si(e, za);
2980
+ function Ga(e, t) {
2981
+ Xe(t, !0), si(e, Wa);
2961
2982
  let n = $(t, "html", 7), r = $(t, "language", 7), i = /* @__PURE__ */ z(!1), a = `venn-teacher-instructions-${Math.random().toString(36).slice(2, 10)}`;
2962
2983
  var o = {
2963
2984
  get html() {
@@ -2972,37 +2993,37 @@ function Ba(e, t) {
2972
2993
  set language(e) {
2973
2994
  r(e), R();
2974
2995
  }
2975
- }, c = Ra(), l = H(c), u = ln(l, !0), d = U(l, 2);
2996
+ }, c = Ua(), l = H(c), u = ln(l, !0), d = U(l, 2);
2976
2997
  return oi(d, n, !0), N(d), N(c), W((e) => {
2977
2998
  Q(l, "aria-expanded", J(i)), Q(l, "aria-controls", a), zr(u, e), Q(d, "id", a), Q(d, "hidden", !J(i));
2978
2999
  }, [() => s(J(i) ? "hideTeacherInstructions" : "showTeacherInstructions", r())]), xr("click", l, () => B(i, !J(i))), X(e, c), Ze(o);
2979
3000
  }
2980
- Sr(["click"]), Li(Ba, {
3001
+ Sr(["click"]), Li(Ga, {
2981
3002
  html: {},
2982
3003
  language: {}
2983
3004
  }, [], [], { mode: "open" });
2984
3005
  //#endregion
2985
3006
  //#region src/delivery/layout.ts
2986
- var Va = {
3007
+ var Ka = {
2987
3008
  w: 120,
2988
3009
  h: 52
2989
- }, Ha = {
3010
+ }, qa = {
2990
3011
  w: 120,
2991
3012
  h: 84
2992
- }, Ua = .6;
2993
- function Wa(e) {
3013
+ }, Ja = .6;
3014
+ function Ya(e) {
2994
3015
  return Math.min(1, 44 / Math.min(e.w, e.h));
2995
3016
  }
2996
- var Ga = {
3017
+ var Xa = {
2997
3018
  side: 24,
2998
3019
  top: 40,
2999
3020
  radius: 236,
3000
3021
  centerDistance: 200,
3001
3022
  outsideGap: 12,
3002
3023
  outsideStripHeight: 136
3003
- }, Ka = .05;
3004
- function qa(e = 1, t = 0) {
3005
- let n = Ga.side * e, r = Ga.radius * e, i = Ga.centerDistance * e, a = Ga.top * e + r, o = Ga.outsideGap * e, s = Math.max(Ga.outsideStripHeight * e, t);
3024
+ }, Za = .05;
3025
+ function Qa(e = 1, t = 0) {
3026
+ let n = Xa.side * e, r = Xa.radius * e, i = Xa.centerDistance * e, a = Xa.top * e + r, o = Xa.outsideGap * e, s = Math.max(Xa.outsideStripHeight * e, t);
3006
3027
  return {
3007
3028
  width: 2 * n + 2 * r + i,
3008
3029
  height: a + r + o + s,
@@ -3020,37 +3041,37 @@ function qa(e = 1, t = 0) {
3020
3041
  }]
3021
3042
  };
3022
3043
  }
3023
- function Ja() {
3024
- return qa();
3044
+ function $a() {
3045
+ return Qa();
3025
3046
  }
3026
- function Ya(e, t) {
3027
- return `min(100%, max(min(720px, ${Ua * 100 * e.width / e.height}vh), ${e.width * Wa(t)}px))`;
3047
+ function eo(e, t) {
3048
+ return `min(100%, max(min(720px, ${Ja * 100 * e.width / e.height}vh), ${e.width * Ya(t)}px))`;
3028
3049
  }
3029
- function Xa(e, t, n) {
3030
- return e > 0 ? Math.max(Wa(n), Math.min(1, e / t.width)) : 1;
3050
+ function to(e, t, n) {
3051
+ return e > 0 ? Math.max(Ya(n), Math.min(1, e / t.width)) : 1;
3031
3052
  }
3032
- function Za(e, t) {
3053
+ function no(e, t) {
3033
3054
  return Math.max(0, Math.floor((e + 8) / (t.w + 8) + 1e-9));
3034
3055
  }
3035
- function Qa(e, t) {
3056
+ function ro(e, t) {
3036
3057
  return t > e.r ? -1 : Math.sqrt(e.r * e.r - t * t);
3037
3058
  }
3038
- function $a(e, t, n) {
3039
- let r = Qa(e, Math.max(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3059
+ function io(e, t, n) {
3060
+ let r = ro(e, Math.max(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3040
3061
  return r < 0 ? null : [e.cx - r, e.cx + r];
3041
3062
  }
3042
- function eo(e, t, n) {
3043
- return Qa(e, t <= e.cy && e.cy <= n ? 0 : Math.min(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3063
+ function ao(e, t, n) {
3064
+ return ro(e, t <= e.cy && e.cy <= n ? 0 : Math.min(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3044
3065
  }
3045
- function to(e, t, n, r, i) {
3046
- let a = $a(t, r, i), o = $a(n, r, i), s, c;
3066
+ function oo(e, t, n, r, i) {
3067
+ let a = io(t, r, i), o = io(n, r, i), s, c;
3047
3068
  if (e === "0") {
3048
3069
  if (!a) return null;
3049
- let e = eo(n, r, i);
3070
+ let e = ao(n, r, i);
3050
3071
  [s, c] = [a[0], e < 0 ? a[1] : Math.min(a[1], n.cx - e)];
3051
3072
  } else if (e === "1") {
3052
3073
  if (!o) return null;
3053
- let e = eo(t, r, i);
3074
+ let e = ao(t, r, i);
3054
3075
  [s, c] = [e < 0 ? o[0] : Math.max(o[0], t.cx + e), o[1]];
3055
3076
  } else {
3056
3077
  if (!a || !o) return null;
@@ -3058,14 +3079,14 @@ function to(e, t, n, r, i) {
3058
3079
  }
3059
3080
  return c > s ? [s, c] : null;
3060
3081
  }
3061
- function no(e, t, n, r) {
3082
+ function so(e, t, n, r) {
3062
3083
  let i = r.h + 8, a = t.cy, o = Math.max(t.r, n.r);
3063
3084
  return [0, .5].map((s) => {
3064
3085
  let c = [], l = Math.ceil(o / i) + 1;
3065
3086
  for (let o = -l; o <= l; o++) {
3066
- let l = a + (o + s) * i, u = to(e, t, n, l - r.h / 2 - 6, l + r.h / 2 + 6);
3087
+ let l = a + (o + s) * i, u = oo(e, t, n, l - r.h / 2 - 6, l + r.h / 2 + 6);
3067
3088
  if (!u) continue;
3068
- let d = u[0] + 6, f = u[1] - 6, p = Za(f - d, r);
3089
+ let d = u[0] + 6, f = u[1] - 6, p = no(f - d, r);
3069
3090
  p > 0 && c.push({
3070
3091
  y: l,
3071
3092
  lo: d,
@@ -3076,11 +3097,11 @@ function no(e, t, n, r) {
3076
3097
  return c;
3077
3098
  });
3078
3099
  }
3079
- function ro(e) {
3100
+ function co(e) {
3080
3101
  return e.reduce((e, t) => e + t.n, 0);
3081
3102
  }
3082
- function io(e, t, n) {
3083
- let r = e.width - 6, i = Za(r - 6, n), a = n.h + 8, o = e.height - t, s = i * Math.max(0, Math.floor((o - 12 + 8) / a + 1e-9)), c = {
3103
+ function lo(e, t, n) {
3104
+ let r = e.width - 6, i = no(r - 6, n), a = n.h + 8, o = e.height - t, s = i * Math.max(0, Math.floor((o - 12 + 8) / a + 1e-9)), c = {
3084
3105
  x: e.width / 2,
3085
3106
  y: t + o / 2
3086
3107
  };
@@ -3089,7 +3110,7 @@ function io(e, t, n) {
3089
3110
  slots: (e) => {
3090
3111
  if (e <= 0) return [];
3091
3112
  let l = Math.min(e, s), u = i > 0 ? Math.ceil(l / i) : 0, d = t + (o - (u * a - 8)) / 2;
3092
- return lo(co(Array.from({ length: u }, (e, t) => ({
3113
+ return ho(mo(Array.from({ length: u }, (e, t) => ({
3093
3114
  y: d + n.h / 2 + t * a,
3094
3115
  lo: 6,
3095
3116
  hi: r,
@@ -3098,20 +3119,20 @@ function io(e, t, n) {
3098
3119
  }
3099
3120
  };
3100
3121
  }
3101
- function ao(e) {
3122
+ function uo(e) {
3102
3123
  return {
3103
3124
  x: e.x + e.w / 2,
3104
3125
  y: e.y + e.h / 2
3105
3126
  };
3106
3127
  }
3107
- function oo(e, t, n) {
3128
+ function fo(e, t, n) {
3108
3129
  let r = t * n.w + (t - 1) * 8, i = (e.lo + e.hi) / 2 - r / 2 + n.w / 2;
3109
3130
  return Array.from({ length: t }, (t, r) => ({
3110
3131
  x: i + r * (n.w + 8),
3111
3132
  y: e.y
3112
3133
  }));
3113
3134
  }
3114
- function so(e, t, n) {
3135
+ function po(e, t, n) {
3115
3136
  let r = [...e].sort((e, n) => Math.abs(e.y - t) - Math.abs(n.y - t) || e.y - n.y), i = [], a = 0;
3116
3137
  for (let e of r) {
3117
3138
  if (a >= n) break;
@@ -3119,39 +3140,39 @@ function so(e, t, n) {
3119
3140
  }
3120
3141
  return i.sort((e, t) => e.y - t.y);
3121
3142
  }
3122
- function co(e, t, n) {
3143
+ function mo(e, t, n) {
3123
3144
  let r = [], i = t;
3124
3145
  for (let t of e) {
3125
3146
  let e = Math.min(t.n, i);
3126
- r.push(...oo(t, e, n)), i -= e;
3147
+ r.push(...fo(t, e, n)), i -= e;
3127
3148
  }
3128
3149
  return r;
3129
3150
  }
3130
- function lo(e, t, n) {
3151
+ function ho(e, t, n) {
3131
3152
  let r = e[e.length - 1] ?? n;
3132
3153
  for (; e.length < t;) e.push({ ...r });
3133
3154
  return e;
3134
3155
  }
3135
- function uo(e, t, n, r) {
3136
- let i = Math.max(...e.map(ro));
3156
+ function go(e, t, n, r) {
3157
+ let i = Math.max(...e.map(co));
3137
3158
  return (a) => {
3138
3159
  if (a <= 0) return [];
3139
3160
  let o = Math.min(a, i), s = null, c = [Infinity, Infinity];
3140
3161
  for (let n of e) {
3141
- if (ro(n) < o) continue;
3142
- let e = so(n, t, o), r = Math.abs(e.reduce((e, t) => e + t.y, 0) / e.length - t), i = [e.length, r];
3162
+ if (co(n) < o) continue;
3163
+ let e = po(n, t, o), r = Math.abs(e.reduce((e, t) => e + t.y, 0) / e.length - t), i = [e.length, r];
3143
3164
  (i[0] < c[0] || i[0] === c[0] && i[1] < c[1] - 1e-9) && (s = e, c = i);
3144
3165
  }
3145
- return lo(s ? co(s, o, n) : [], a, r);
3166
+ return ho(s ? mo(s, o, n) : [], a, r);
3146
3167
  };
3147
3168
  }
3148
- function fo(e, t, n) {
3169
+ function _o(e, t, n) {
3149
3170
  let r = t.cy, i = 0, a = Math.min(t.r, n.r);
3150
3171
  for (let o = 0; o < 40; o++) {
3151
- let o = (i + a) / 2, s = to(e, t, n, r - o, r + o);
3172
+ let o = (i + a) / 2, s = oo(e, t, n, r - o, r + o);
3152
3173
  s && s[1] - s[0] >= 2 * o ? i = o : a = o;
3153
3174
  }
3154
- let o = to(e, t, n, r - i, r + i) ?? [0, 0];
3175
+ let o = oo(e, t, n, r - i, r + i) ?? [0, 0];
3155
3176
  return {
3156
3177
  x: o[0] + 1,
3157
3178
  y: r - i + 1,
@@ -3159,26 +3180,26 @@ function fo(e, t, n) {
3159
3180
  h: 2 * i - 2
3160
3181
  };
3161
3182
  }
3162
- function po(e, t, n) {
3183
+ function vo(e, t, n) {
3163
3184
  let [r, i] = t.circles;
3164
- return Math.max(...no(e, r, i, n).map(ro));
3185
+ return Math.max(...so(e, r, i, n).map(co));
3165
3186
  }
3166
- var mo = [
3187
+ var yo = [
3167
3188
  "0",
3168
3189
  "0,1",
3169
3190
  "1"
3170
3191
  ];
3171
- function ho(e, t = Va) {
3172
- let n = qa();
3192
+ function bo(e, t = Ka) {
3193
+ let n = Qa();
3173
3194
  for (let r = 1;; r++) {
3174
3195
  let i = n;
3175
- if (mo.every((n) => po(n, i, t) >= (e[n] ?? 0))) break;
3176
- n = qa(1 + r * Ka);
3196
+ if (yo.every((n) => vo(n, i, t) >= (e[n] ?? 0))) break;
3197
+ n = Qa(1 + r * Za);
3177
3198
  }
3178
- let r = e[""] ?? 0, i = Za(n.width - 12, t), a = Math.ceil(r / i) * (t.h + 8) - 8 + 12;
3179
- return a > n.outsideStripHeight ? qa(n.scale, a) : n;
3199
+ let r = e[""] ?? 0, i = no(n.width - 12, t), a = Math.ceil(r / i) * (t.h + 8) - 8 + 12;
3200
+ return a > n.outsideStripHeight ? Qa(n.scale, a) : n;
3180
3201
  }
3181
- function go(e, t = Ja(), n = Va) {
3202
+ function xo(e, t = $a(), n = Ka) {
3182
3203
  if (e.circles?.length !== 2) throw Error(`buildLayout2Set requires exactly 2 circles (got ${e.circles?.length ?? 0})`);
3183
3204
  let [a, s] = t.circles, c = i(2), l = Math.max(a.cy + a.r, s.cy + s.r), u = Math.min(t.height - t.outsideStripHeight, l + t.outsideGap), d = (e, t, n) => (r, i) => {
3184
3205
  let a = r - e, o = i - t;
@@ -3194,11 +3215,11 @@ function go(e, t = Ja(), n = Va) {
3194
3215
  y: u,
3195
3216
  w: t.width,
3196
3217
  h: t.height - u
3197
- }, {capacity: g, slots: _} = io(t, u, n);
3218
+ }, {capacity: g, slots: _} = lo(t, u, n);
3198
3219
  else if (c === "0" || c === "1" || c === "0,1") {
3199
- d = c === "0" ? (e, t) => f(e, t) && !p(e, t) : c === "1" ? (e, t) => p(e, t) && !f(e, t) : (e, t) => f(e, t) && p(e, t), h = fo(c, a, s);
3200
- let e = no(c, a, s, n);
3201
- g = Math.max(...e.map(ro)), _ = uo(e, a.cy, n, ao(h));
3220
+ d = c === "0" ? (e, t) => f(e, t) && !p(e, t) : c === "1" ? (e, t) => p(e, t) && !f(e, t) : (e, t) => f(e, t) && p(e, t), h = _o(c, a, s);
3221
+ let e = so(c, a, s, n);
3222
+ g = Math.max(...e.map(co)), _ = go(e, a.cy, n, uo(h));
3202
3223
  } else d = () => !1, h = {
3203
3224
  x: 0,
3204
3225
  y: 0,
@@ -3220,7 +3241,7 @@ function go(e, t = Ja(), n = Va) {
3220
3241
  outsideStripTop: u
3221
3242
  };
3222
3243
  }
3223
- function _o(e, t, n) {
3244
+ function So(e, t, n) {
3224
3245
  for (let r of [
3225
3246
  "0,1",
3226
3247
  "0",
@@ -3234,7 +3255,7 @@ function _o(e, t, n) {
3234
3255
  }
3235
3256
  //#endregion
3236
3257
  //#region src/delivery/dnd.ts
3237
- function vo({ model: t, session: r, tileId: i, placement: o }) {
3258
+ function Co({ model: t, session: r, tileId: i, placement: o }) {
3238
3259
  let s = a(r, t), c = {
3239
3260
  ...s,
3240
3261
  placements: {
@@ -3244,19 +3265,19 @@ function vo({ model: t, session: r, tileId: i, placement: o }) {
3244
3265
  };
3245
3266
  return c.completed = n(t, c), c;
3246
3267
  }
3247
- function yo(t, n) {
3268
+ function wo(t, n) {
3248
3269
  let r = t?.placements?.[n];
3249
3270
  return Array.isArray(r) ? e(r) : null;
3250
3271
  }
3251
- function bo(e, t, n) {
3252
- let r = yo(e, t);
3272
+ function To(e, t, n) {
3273
+ let r = wo(e, t);
3253
3274
  return r === null || n === null ? r === n : c(r, n);
3254
3275
  }
3255
- function xo(e, t) {
3276
+ function Eo(e, t) {
3256
3277
  let n = t?.placements ?? {};
3257
3278
  return (e.tiles || []).filter((e) => n[e.id] == null);
3258
3279
  }
3259
- function So(t, n) {
3280
+ function Do(t, n) {
3260
3281
  let r = n?.placements ?? {}, i = {};
3261
3282
  for (let n of t.tiles || []) {
3262
3283
  let t = r[n.id];
@@ -3268,12 +3289,12 @@ function So(t, n) {
3268
3289
  }
3269
3290
  //#endregion
3270
3291
  //#region src/delivery/VennClassification.svelte
3271
- var Co = /* @__PURE__ */ Y("<div class=\"venn-prompt svelte-gkcqor\"></div>"), wo = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-283 359 34 35\" aria-hidden=\"true\"><circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"#bce2ff\"></circle><path d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\" fill=\"#bce2ff\"></path><polygon points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\" fill=\"#1a9cff\"></polygon></svg>"), To = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-129.5 127 34 35\" aria-hidden=\"true\"><path style=\"fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;\" d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"></path><path style=\"fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;\" d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"></path><circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\"></circle><path d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\" fill=\"#bce2ff\"></path><polygon points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\" fill=\"#1a9cff\"></polygon></svg>"), Eo = /* @__PURE__ */ Y("<button type=\"button\" class=\"toggle-correct svelte-gkcqor\"><!> <span class=\"toggle-label svelte-gkcqor\"> </span></button>"), Do = /* @__PURE__ */ Y("<div class=\"venn-error svelte-gkcqor\" role=\"alert\"> </div>"), Oo = /* @__PURE__ */ jr("<circle fill=\"rgba(14, 165, 233, 0.12)\"></circle>"), ko = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\"></rect>"), Ao = /* @__PURE__ */ jr("<circle></circle>"), jo = /* @__PURE__ */ jr("<circle fill=\"none\" stroke=\"#1e293b\"></circle>"), Mo = /* @__PURE__ */ jr("<text font-weight=\"600\" fill=\"#0f172a\"> </text>"), No = /* @__PURE__ */ Y("<div class=\"region-aria svelte-gkcqor\" role=\"region\"></div>"), Po = /* @__PURE__ */ Y("<div class=\"tile-wrapper svelte-gkcqor\"><!></div>"), Fo = /* @__PURE__ */ Y("<div class=\"venn-diagram svelte-gkcqor\"><svg preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" class=\"svelte-gkcqor\"><defs><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><clipPath clipPathUnits=\"userSpaceOnUse\"><circle></circle></clipPath><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"white\"></rect><circle fill=\"black\"></circle><circle fill=\"black\"></circle></mask></defs><rect fill=\"#ffffff\" stroke=\"#cbd5e1\"></rect><!><!><!><!><!><!><!><line stroke=\"#cbd5e1\"></line></svg> <div class=\"region-labels svelte-gkcqor\" aria-hidden=\"false\"></div> <div class=\"placed-tiles svelte-gkcqor\"></div></div> <!>", 1), Io = /* @__PURE__ */ Y("<div class=\"drag-ghost svelte-gkcqor\"><!></div>"), Lo = /* @__PURE__ */ Y("<div class=\"venn-root svelte-gkcqor\"><!> <!> <!> <!> <!> <div class=\"sr-only svelte-gkcqor\" aria-live=\"polite\" aria-atomic=\"true\"></div></div>"), Ro = {
3292
+ var Oo = /* @__PURE__ */ Y("<div class=\"venn-prompt svelte-gkcqor\"></div>"), ko = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-283 359 34 35\" aria-hidden=\"true\"><circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"#bce2ff\"></circle><path d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\" fill=\"#bce2ff\"></path><polygon points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\" fill=\"#1a9cff\"></polygon></svg>"), Ao = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-129.5 127 34 35\" aria-hidden=\"true\"><path style=\"fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;\" d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"></path><path style=\"fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;\" d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"></path><circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\"></circle><path d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\" fill=\"#bce2ff\"></path><polygon points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\" fill=\"#1a9cff\"></polygon></svg>"), jo = /* @__PURE__ */ Y("<button type=\"button\" class=\"toggle-correct svelte-gkcqor\"><!> <span class=\"toggle-label svelte-gkcqor\"> </span></button>"), Mo = /* @__PURE__ */ Y("<div class=\"venn-error svelte-gkcqor\" role=\"alert\"> </div>"), No = /* @__PURE__ */ jr("<circle fill=\"rgba(14, 165, 233, 0.12)\"></circle>"), Po = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\"></rect>"), Fo = /* @__PURE__ */ jr("<circle></circle>"), Io = /* @__PURE__ */ jr("<circle fill=\"none\" stroke=\"#1e293b\"></circle>"), Lo = /* @__PURE__ */ jr("<text font-weight=\"600\" fill=\"#0f172a\"> </text>"), Ro = /* @__PURE__ */ Y("<div class=\"region-aria svelte-gkcqor\" role=\"region\"></div>"), zo = /* @__PURE__ */ Y("<div class=\"tile-wrapper svelte-gkcqor\"><!></div>"), Bo = /* @__PURE__ */ Y("<div class=\"venn-diagram svelte-gkcqor\"><svg preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" class=\"svelte-gkcqor\"><defs><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><clipPath clipPathUnits=\"userSpaceOnUse\"><circle></circle></clipPath><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"white\"></rect><circle fill=\"black\"></circle><circle fill=\"black\"></circle></mask></defs><rect fill=\"#ffffff\" stroke=\"#cbd5e1\"></rect><!><!><!><!><!><!><!><line stroke=\"#cbd5e1\"></line></svg> <div class=\"region-labels svelte-gkcqor\" aria-hidden=\"false\"></div> <div class=\"placed-tiles svelte-gkcqor\"></div></div> <!>", 1), Vo = /* @__PURE__ */ Y("<div class=\"drag-ghost svelte-gkcqor\"><!></div>"), Ho = /* @__PURE__ */ Y("<div class=\"venn-root svelte-gkcqor\"><!> <!> <!> <!> <!> <div class=\"sr-only svelte-gkcqor\" aria-live=\"polite\" aria-atomic=\"true\"></div></div>"), Uo = {
3272
3293
  hash: "svelte-gkcqor",
3273
3294
  code: ".venn-root.svelte-gkcqor {display:flex;flex-direction:column;gap:16px;padding:16px;color:#0f172a;font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;--vc-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.venn-prompt.svelte-gkcqor {font-size:16px;line-height:1.5;}.venn-prompt.svelte-gkcqor p {margin:0 0 8px 0;}.toggle-correct.svelte-gkcqor {align-self:center;display:inline-flex;align-items:center;gap:8px;margin:0 0 4px 0;padding:0;background:transparent;border:0;color:inherit;font:inherit;font-size:14px;cursor:pointer;user-select:none;}.toggle-correct.svelte-gkcqor:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;border-radius:2px;}.toggle-icon.svelte-gkcqor {width:25px;height:25px;flex-shrink:0;}.toggle-label.svelte-gkcqor {line-height:1.2;}.toggle-correct.svelte-gkcqor:hover .toggle-label:where(.svelte-gkcqor),\n .toggle-correct.svelte-gkcqor:focus-visible .toggle-label:where(.svelte-gkcqor) {text-decoration:underline;}.venn-diagram.svelte-gkcqor {\n /*\n * Width and aspect ratio come from the geometry, inline. The width cap\n * keeps the diagram from dominating wide layouts, and the viewport-height\n * share keeps the prompt, toggle and tray in view in short windows, down\n * to the width that keeps tiles at 44 px (`diagramCssWidth`).\n */position:relative;margin:0 auto;}.venn-diagram.svelte-gkcqor svg:where(.svelte-gkcqor) {width:100%;height:100%;display:block;}.placed-tiles.svelte-gkcqor,\n .region-labels.svelte-gkcqor {position:absolute;inset:0;pointer-events:none;}.tile-wrapper.svelte-gkcqor {position:absolute;display:flex;pointer-events:auto;}.region-aria.svelte-gkcqor {position:absolute;width:1px;height:1px;transform:translate(-50%, -50%);opacity:0;pointer-events:none;}.venn-error.svelte-gkcqor {padding:12px 16px;border:1.5px solid #bf0d00;border-radius:8px;background:#fef2f2;color:#7f1d1d;font-size:14px;}\n /* Tailwind's `sr-only`, scoped: PIE players ship no Tailwind. */.sr-only.svelte-gkcqor {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.drag-ghost.svelte-gkcqor {position:fixed;top:0;left:0;transform:translate(-50%, -50%);pointer-events:none;z-index:1000;}"
3274
3295
  };
3275
- function zo(e, n) {
3276
- Xe(n, !0), si(e, Ro);
3296
+ function Wo(e, n) {
3297
+ Xe(n, !0), si(e, Uo);
3277
3298
  let r = [{ label: "Set A" }, { label: "Set B" }], i = `venn-${Math.random().toString(36).slice(2, 10)}`, a = `${i}-mask-left-only`, c = `${i}-mask-right-only`, l = `${i}-mask-outside`, u = `${i}-clip-left`, d = null, f = /* @__PURE__ */ z(null), p = null, m = /* @__PURE__ */ z(!1), h = /* @__PURE__ */ z(null), g = /* @__PURE__ */ z(null), _ = /* @__PURE__ */ z(null), v = /* @__PURE__ */ z(null), y = /* @__PURE__ */ z(0), b = null, x = null, S = /* @__PURE__ */ I(() => n?.model?.circles ?? r), ee = /* @__PURE__ */ I(() => J(S).length === 2), C = /* @__PURE__ */ I(() => n?.model?.language), w = /* @__PURE__ */ I(() => ({
3278
3299
  circles: J(S),
3279
3300
  tiles: n?.model?.tiles ?? [],
@@ -3281,7 +3302,7 @@ function zo(e, n) {
3281
3302
  language: J(C),
3282
3303
  scoringPolicy: "partialPerTile",
3283
3304
  promptEnabled: !0
3284
- })), te = /* @__PURE__ */ I(() => n?.model?.env?.mode === "evaluate"), ne = /* @__PURE__ */ I(() => n?.model?.disabled === !0), re = /* @__PURE__ */ I(() => n?.model?.prompt ?? null), T = /* @__PURE__ */ I(() => de(n?.session, n?.model, J(m))), E = /* @__PURE__ */ I(() => ({ placements: J(T) })), ae = /* @__PURE__ */ I(() => So(J(w), J(E))), oe = /* @__PURE__ */ I(() => xo(J(w), J(E))), se = /* @__PURE__ */ I(() => (J(w).tiles ?? []).some((e) => (e.imageUrl ?? "").trim()) ? Ha : Va), D = /* @__PURE__ */ I(() => ho(Object.fromEntries(Object.entries(J(ae)).map(([e, t]) => [e, t.length])), J(se))), ce = /* @__PURE__ */ I(() => J(ee) ? go(J(w), J(D), J(se)) : null), le = /* @__PURE__ */ I(() => Xa(J(y), J(D), J(se))), O = /* @__PURE__ */ I(() => [
3305
+ })), te = /* @__PURE__ */ I(() => n?.model?.env?.mode === "evaluate"), ne = /* @__PURE__ */ I(() => n?.model?.disabled === !0), re = /* @__PURE__ */ I(() => n?.model?.prompt ?? null), T = /* @__PURE__ */ I(() => de(n?.session, n?.model, J(m))), E = /* @__PURE__ */ I(() => ({ placements: J(T) })), ae = /* @__PURE__ */ I(() => Do(J(w), J(E))), oe = /* @__PURE__ */ I(() => Eo(J(w), J(E))), se = /* @__PURE__ */ I(() => (J(w).tiles ?? []).some((e) => (e.imageUrl ?? "").trim()) ? qa : Ka), D = /* @__PURE__ */ I(() => bo(Object.fromEntries(Object.entries(J(ae)).map(([e, t]) => [e, t.length])), J(se))), ce = /* @__PURE__ */ I(() => J(ee) ? xo(J(w), J(D), J(se)) : null), le = /* @__PURE__ */ I(() => to(J(y), J(D), J(se))), O = /* @__PURE__ */ I(() => [
3285
3306
  "0",
3286
3307
  "0,1",
3287
3308
  "1",
@@ -3325,7 +3346,7 @@ function zo(e, n) {
3325
3346
  };
3326
3347
  }
3327
3348
  function me(e, t) {
3328
- let r = vo({
3349
+ let r = Co({
3329
3350
  model: J(w),
3330
3351
  session: n?.session,
3331
3352
  tileId: e,
@@ -3349,8 +3370,8 @@ function zo(e, n) {
3349
3370
  b?.(), J(h) !== null && ve();
3350
3371
  }
3351
3372
  function be(e, r) {
3352
- let i = Ea(e, J(C)), a = r === "tray" ? null : r === null ? void 0 : ge(r)?.region;
3353
- if (a === void 0 || bo(n?.session, e.id, a)) {
3373
+ let i = ja(e, J(C)), a = r === "tray" ? null : r === null ? void 0 : ge(r)?.region;
3374
+ if (a === void 0 || To(n?.session, e.id, a)) {
3354
3375
  k(t("cancelled", J(C)));
3355
3376
  return;
3356
3377
  }
@@ -3364,7 +3385,7 @@ function zo(e, n) {
3364
3385
  n.preventDefault(), b?.(), n.currentTarget.setPointerCapture?.(n.pointerId), B(h, e.id, !0), B(_, null), B(v, {
3365
3386
  x: n.clientX,
3366
3387
  y: n.clientY
3367
- }, !0), B(g, Se(n.clientX, n.clientY), !0), k(t("pickedUp", J(C), { name: Ea(e, J(C)) }));
3388
+ }, !0), B(g, Se(n.clientX, n.clientY), !0), k(t("pickedUp", J(C), { name: ja(e, J(C)) }));
3368
3389
  let r = (e) => {
3369
3390
  B(v, {
3370
3391
  x: e.clientX,
@@ -3385,7 +3406,7 @@ function zo(e, n) {
3385
3406
  if (Ce(e, t)) return "tray";
3386
3407
  let n = pe(e, t);
3387
3408
  if (!n || !J(ce)) return null;
3388
- let r = _o(J(ce), n.x, n.y);
3409
+ let r = So(J(ce), n.x, n.y);
3389
3410
  return r ? r.key : null;
3390
3411
  }
3391
3412
  function Ce(e, t) {
@@ -3407,9 +3428,9 @@ function zo(e, n) {
3407
3428
  let t = J(_);
3408
3429
  ve(), be(e, t), we(e.id);
3409
3430
  } else {
3410
- let n = yo(J(E), e.id), r = n === null ? J(O)[0] ?? null : o(n);
3431
+ let n = wo(J(E), e.id), r = n === null ? J(O)[0] ?? null : o(n);
3411
3432
  B(h, e.id, !0), B(_, r, !0), k(t("pickedUpWithKeyboard", J(C), {
3412
- name: Ea(e, J(C)),
3433
+ name: ja(e, J(C)),
3413
3434
  target: _e(r ?? "")
3414
3435
  }));
3415
3436
  }
@@ -3461,7 +3482,7 @@ function zo(e, n) {
3461
3482
  if (!d) return;
3462
3483
  let e = (e) => console.warn("venn-classification: MathJax render failed", e);
3463
3484
  try {
3464
- Promise.resolve(wa(d)).catch(e);
3485
+ Promise.resolve(ka(d)).catch(e);
3465
3486
  } catch (t) {
3466
3487
  e(t);
3467
3488
  }
@@ -3472,8 +3493,8 @@ function zo(e, n) {
3472
3493
  J(T), J(w).tiles?.length, fr().then(M);
3473
3494
  });
3474
3495
  let ke = /* @__PURE__ */ I(() => J(te) ? Object.values(n?.model?.correctness ?? {}).filter((e) => e === "incorrect" || e === "unanswered").length : 0), Ae = /* @__PURE__ */ I(() => J(h) === null ? J(g) ?? null : J(g) ?? J(_) ?? null), je = /* @__PURE__ */ I(() => J(Ae) === "0"), Me = /* @__PURE__ */ I(() => J(Ae) === "1"), Ne = /* @__PURE__ */ I(() => J(Ae) === "0,1"), Pe = /* @__PURE__ */ I(() => J(Ae) === ""), Fe = "rgba(37, 99, 235, 0.18)", Ie = /* @__PURE__ */ I(() => J(h) !== null && J(v) !== null ? he(J(h)) : null);
3475
- var Le = Lo(), Re = H(Le), ze = (e) => {
3476
- Ba(e, {
3496
+ var Le = Ho(), Re = H(Le), ze = (e) => {
3497
+ Ga(e, {
3477
3498
  get html() {
3478
3499
  return n.model.teacherInstructions;
3479
3500
  },
@@ -3486,17 +3507,17 @@ function zo(e, n) {
3486
3507
  n?.model?.teacherInstructions && e(ze);
3487
3508
  });
3488
3509
  var Be = U(Re, 2), Ve = (e) => {
3489
- var t = Co();
3510
+ var t = Oo();
3490
3511
  oi(t, () => J(re), !0), N(t), X(e, t);
3491
3512
  };
3492
3513
  Z(Be, (e) => {
3493
3514
  J(re) && e(Ve);
3494
3515
  });
3495
3516
  var He = U(Be, 2), Ue = (e) => {
3496
- var t = Eo(), n = H(t), r = (e) => {
3497
- X(e, wo());
3517
+ var t = jo(), n = H(t), r = (e) => {
3518
+ X(e, ko());
3498
3519
  }, i = (e) => {
3499
- X(e, To());
3520
+ X(e, Ao());
3500
3521
  };
3501
3522
  Z(n, (e) => {
3502
3523
  J(m) ? e(r) : e(i, -1);
@@ -3510,13 +3531,13 @@ function zo(e, n) {
3510
3531
  J(te) && J(ke) > 0 && e(Ue);
3511
3532
  });
3512
3533
  var We = U(He, 2), Ge = (e) => {
3513
- var n = Do(), r = ln(n, !0);
3534
+ var n = Mo(), r = ln(n, !0);
3514
3535
  W((e) => zr(r, e), [() => t("unsupportedCircles", J(C), {
3515
3536
  count: J(S).length,
3516
3537
  supported: 2
3517
3538
  })]), X(e, n);
3518
3539
  }, Ke = (e) => {
3519
- var n = Fo(), r = cn(n);
3540
+ var n = Bo(), r = cn(n);
3520
3541
  let i;
3521
3542
  var o = H(r), s = H(o), d = H(s), p = H(d), m = U(p), b = U(m);
3522
3543
  N(d);
@@ -3526,13 +3547,13 @@ function zo(e, n) {
3526
3547
  N(E), N(s);
3527
3548
  var k = U(s), pe = U(k);
3528
3549
  ei(pe, 17, () => J(D).circles, Xr, (e, t) => {
3529
- var n = Oo();
3550
+ var n = No();
3530
3551
  W(() => {
3531
3552
  Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r);
3532
3553
  }), X(e, n);
3533
3554
  });
3534
3555
  var me = U(pe), he = (e) => {
3535
- var t = ko();
3556
+ var t = Po();
3536
3557
  Q(t, "fill", Fe), W(() => {
3537
3558
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${a})`);
3538
3559
  }), X(e, t);
@@ -3541,7 +3562,7 @@ function zo(e, n) {
3541
3562
  J(je) && e(he);
3542
3563
  });
3543
3564
  var ge = U(me), _e = (e) => {
3544
- var t = ko();
3565
+ var t = Po();
3545
3566
  Q(t, "fill", Fe), W(() => {
3546
3567
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${c})`);
3547
3568
  }), X(e, t);
@@ -3550,7 +3571,7 @@ function zo(e, n) {
3550
3571
  J(Me) && e(_e);
3551
3572
  });
3552
3573
  var ve = U(ge), ye = (e) => {
3553
- var t = Ao();
3574
+ var t = Fo();
3554
3575
  Q(t, "fill", Fe), W(() => {
3555
3576
  Q(t, "cx", J(D).circles[1].cx), Q(t, "cy", J(D).circles[1].cy), Q(t, "r", J(D).circles[1].r), Q(t, "clip-path", `url(#${u})`);
3556
3577
  }), X(e, t);
@@ -3559,7 +3580,7 @@ function zo(e, n) {
3559
3580
  J(Ne) && e(ye);
3560
3581
  });
3561
3582
  var be = U(ve), Se = (e) => {
3562
- var t = ko();
3583
+ var t = Po();
3563
3584
  Q(t, "fill", Fe), W(() => {
3564
3585
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${l})`);
3565
3586
  }), X(e, t);
@@ -3569,14 +3590,14 @@ function zo(e, n) {
3569
3590
  });
3570
3591
  var Ce = U(be);
3571
3592
  ei(Ce, 17, () => J(D).circles, Xr, (e, t) => {
3572
- var n = jo();
3593
+ var n = Io();
3573
3594
  W(() => {
3574
3595
  Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r), Q(n, "stroke-width", 2 * J(D).scale);
3575
3596
  }), X(e, n);
3576
3597
  });
3577
3598
  var we = U(Ce);
3578
3599
  ei(we, 17, () => J(D).circles, Xr, (e, t, n) => {
3579
- var r = Mo();
3600
+ var r = Lo();
3580
3601
  Q(r, "text-anchor", n === 0 ? "start" : "end");
3581
3602
  var i = ln(r, !0);
3582
3603
  W((e, t) => {
@@ -3588,7 +3609,7 @@ function zo(e, n) {
3588
3609
  var Oe = U(o, 2);
3589
3610
  ei(Oe, 21, () => J(ce).regions, Xr, (e, t) => {
3590
3611
  let n = /* @__PURE__ */ I(() => fe(J(t).hitRect.x + J(t).hitRect.w / 2, J(t).hitRect.y + J(t).hitRect.h / 2));
3591
- var r = No();
3612
+ var r = Ro();
3592
3613
  W(() => {
3593
3614
  Q(r, "aria-label", J(t).label), Q(r, "data-region-key", J(t).key), hi(r, `left: ${J(n).left ?? ""}%; top: ${J(n).top ?? ""}%;`);
3594
3615
  }), X(e, r);
@@ -3602,10 +3623,10 @@ function zo(e, n) {
3602
3623
  var n = Mr();
3603
3624
  ei(cn(n), 19, i, (e) => e.id, (e, n, r) => {
3604
3625
  let i = /* @__PURE__ */ I(() => fe(J(t)[J(r)].x, J(t)[J(r)].y));
3605
- var o = Po(), s = H(o);
3626
+ var o = zo(), s = H(o);
3606
3627
  {
3607
- let e = /* @__PURE__ */ I(() => Da(J(n), J(a).label, j(J(n).id), J(C))), t = /* @__PURE__ */ I(() => j(J(n).id) ?? "neutral"), r = /* @__PURE__ */ I(() => J(h) === J(n).id), i = /* @__PURE__ */ I(() => J(h) === J(n).id && J(v) !== null);
3608
- Pa(s, {
3628
+ let e = /* @__PURE__ */ I(() => Ma(J(n), J(a).label, j(J(n).id), J(C))), t = /* @__PURE__ */ I(() => j(J(n).id) ?? "neutral"), r = /* @__PURE__ */ I(() => J(h) === J(n).id), i = /* @__PURE__ */ I(() => J(h) === J(n).id && J(v) !== null);
3629
+ za(s, {
3609
3630
  fit: !0,
3610
3631
  get id() {
3611
3632
  return J(n).id;
@@ -3650,7 +3671,7 @@ function zo(e, n) {
3650
3671
  var ke = U(r, 2);
3651
3672
  {
3652
3673
  let e = /* @__PURE__ */ I(() => J(g) === "tray" || J(h) !== null && J(_) === "tray"), n = /* @__PURE__ */ I(() => t("tray", J(C)));
3653
- La(ke, {
3674
+ Ha(ke, {
3654
3675
  get isDropTarget() {
3655
3676
  return J(e);
3656
3677
  },
@@ -3661,8 +3682,8 @@ function zo(e, n) {
3661
3682
  var n = Mr();
3662
3683
  ei(cn(n), 17, () => J(oe), (e) => e.id, (e, t) => {
3663
3684
  {
3664
- let n = /* @__PURE__ */ I(() => Da(J(t), null, j(J(t).id), J(C))), r = /* @__PURE__ */ I(() => j(J(t).id) ?? "neutral"), i = /* @__PURE__ */ I(() => J(h) === J(t).id), a = /* @__PURE__ */ I(() => J(h) === J(t).id && J(v) !== null);
3665
- Pa(e, {
3685
+ let n = /* @__PURE__ */ I(() => Ma(J(t), null, j(J(t).id), J(C))), r = /* @__PURE__ */ I(() => j(J(t).id) ?? "neutral"), i = /* @__PURE__ */ I(() => J(h) === J(t).id), a = /* @__PURE__ */ I(() => J(h) === J(t).id && J(v) !== null);
3686
+ za(e, {
3666
3687
  get id() {
3667
3688
  return J(t).id;
3668
3689
  },
@@ -3706,14 +3727,14 @@ function zo(e, n) {
3706
3727
  width: e,
3707
3728
  "aspect-ratio": `${J(D).width ?? ""} / ${J(D).height ?? ""}`
3708
3729
  }), Q(o, "viewBox", `0 0 ${J(D).width ?? ""} ${J(D).height ?? ""}`), Q(d, "id", a), Q(d, "width", J(D).width), Q(d, "height", J(D).height), Q(p, "width", J(D).width), Q(p, "height", J(D).height), Q(m, "cx", J(D).circles[0].cx), Q(m, "cy", J(D).circles[0].cy), Q(m, "r", J(D).circles[0].r), Q(b, "cx", J(D).circles[1].cx), Q(b, "cy", J(D).circles[1].cy), Q(b, "r", J(D).circles[1].r), Q(x, "id", c), Q(x, "width", J(D).width), Q(x, "height", J(D).height), Q(S, "width", J(D).width), Q(S, "height", J(D).height), Q(ee, "cx", J(D).circles[1].cx), Q(ee, "cy", J(D).circles[1].cy), Q(ee, "r", J(D).circles[1].r), Q(te, "cx", J(D).circles[0].cx), Q(te, "cy", J(D).circles[0].cy), Q(te, "r", J(D).circles[0].r), Q(re, "id", u), Q(T, "cx", J(D).circles[0].cx), Q(T, "cy", J(D).circles[0].cy), Q(T, "r", J(D).circles[0].r), Q(E, "id", l), Q(E, "width", J(D).width), Q(E, "height", J(D).height), Q(O, "width", J(D).width), Q(O, "height", J(D).height), Q(ue, "cx", J(D).circles[0].cx), Q(ue, "cy", J(D).circles[0].cy), Q(ue, "r", J(D).circles[0].r), Q(de, "cx", J(D).circles[1].cx), Q(de, "cy", J(D).circles[1].cy), Q(de, "r", J(D).circles[1].r), Q(k, "x", J(D).scale), Q(k, "y", J(D).scale), Q(k, "width", J(D).width - 2 * J(D).scale), Q(k, "height", J(D).height - 2 * J(D).scale), Q(k, "stroke-width", 1.5 * J(D).scale), Q(k, "rx", 12 * J(D).scale), Q(Te, "x1", 16 * J(D).scale), Q(Te, "x2", J(D).width - 16 * J(D).scale), Q(Te, "y1", J(ce).outsideStripTop), Q(Te, "y2", J(ce).outsideStripTop), Q(Te, "stroke-width", J(D).scale), Q(Te, "stroke-dasharray", `${4 * J(D).scale} ${6 * J(D).scale}`);
3709
- }, [() => Ya(J(D), J(se))]), Di(r, "clientWidth", (e) => B(y, e)), X(e, n);
3730
+ }, [() => eo(J(D), J(se))]), Di(r, "clientWidth", (e) => B(y, e)), X(e, n);
3710
3731
  };
3711
3732
  Z(We, (e) => {
3712
3733
  J(ce) ? e(Ke, -1) : e(Ge);
3713
3734
  });
3714
3735
  var qe = U(We, 2), Je = (e) => {
3715
- var t = Io();
3716
- Pa(H(t), {
3736
+ var t = Vo();
3737
+ za(H(t), {
3717
3738
  get id() {
3718
3739
  return J(Ie).id;
3719
3740
  },
@@ -3737,12 +3758,12 @@ function zo(e, n) {
3737
3758
  J(Ie) && J(v) && e(Je);
3738
3759
  }), ki(U(qe, 2), (e) => p = e, () => p), N(Le), ki(Le, (e) => d = e, () => d), xr("focusout", Le, Oe), X(e, Le), Ze();
3739
3760
  }
3740
- Sr(["focusout", "click"]), Li(zo, {
3761
+ Sr(["focusout", "click"]), Li(Wo, {
3741
3762
  model: { type: "Object" },
3742
3763
  session: { type: "Object" },
3743
3764
  onSessionChange: {}
3744
3765
  }, [], []);
3745
3766
  //#endregion
3746
- export { H as A, Xe as B, Mr as C, J as D, xr as E, B as F, N as H, z as I, R as L, ln as M, U as N, W as O, $t as P, I as R, X as S, Sr as T, ie as U, Ae as V, Z as _, ki as a, qr as b, Q as c, hi as d, pi as f, Xr as g, ei as h, $ as i, cn as j, xn as k, Si as l, oi as m, Ta as n, Di as o, si as p, Li as r, bi as s, zo as t, xi as u, Yr as v, Y as w, zr as x, Jr as y, Ze as z };
3767
+ export { H as A, Xe as B, Mr as C, J as D, xr as E, B as F, N as H, z as I, R as L, ln as M, U as N, W as O, $t as P, I as R, X as S, Sr as T, ie as U, Ae as V, Z as _, ki as a, qr as b, Q as c, hi as d, pi as f, Xr as g, ei as h, $ as i, cn as j, xn as k, Si as l, oi as m, Aa as n, Di as o, si as p, Li as r, bi as s, Wo as t, xi as u, Yr as v, Y as w, zr as x, Jr as y, Ze as z };
3747
3768
 
3748
- //# sourceMappingURL=VennClassification-BPq_DgNM.js.map
3769
+ //# sourceMappingURL=VennClassification-F4mRKoc5.js.map