@pie-element/graphing-solution-set 6.4.0-beta.7 → 7.0.0-next.20261002100925

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.
Files changed (100) hide show
  1. package/author.js +2 -0
  2. package/configure.js +2 -0
  3. package/controller.js +1 -0
  4. package/dist/author/configure.d.ts +26 -0
  5. package/dist/author/configure.js +190 -0
  6. package/dist/author/correct-response.d.ts +33 -0
  7. package/dist/author/correct-response.js +206 -0
  8. package/dist/author/defaults.d.ts +238 -0
  9. package/dist/author/defaults.js +339 -0
  10. package/dist/author/graphing-config.d.ts +33 -0
  11. package/dist/author/graphing-config.js +237 -0
  12. package/dist/author/index.d.ts +63 -0
  13. package/dist/author/index.js +95 -0
  14. package/dist/author/utils.d.ts +46 -0
  15. package/dist/author/utils.js +474 -0
  16. package/dist/browser/alert-dialog-mARgEnYR.js +50672 -0
  17. package/dist/browser/alert-dialog-mARgEnYR.js.map +1 -0
  18. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  19. package/dist/browser/author/index.js +3833 -0
  20. package/dist/browser/author/index.js.map +1 -0
  21. package/dist/browser/browser-bbrzkX59.js +352 -0
  22. package/dist/browser/browser-bbrzkX59.js.map +1 -0
  23. package/dist/browser/controller/index.js +193 -0
  24. package/dist/browser/controller/index.js.map +1 -0
  25. package/dist/browser/delivery/index.js +781 -0
  26. package/dist/browser/delivery/index.js.map +1 -0
  27. package/dist/browser/editor-runtime/alert-dialog-1f82g6Ih.js +34263 -0
  28. package/dist/browser/editor-runtime/alert-dialog-1f82g6Ih.js.map +1 -0
  29. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  30. package/dist/browser/editor-runtime/author/index.js +3833 -0
  31. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  32. package/dist/browser/editor-runtime/browser-d5JHIrvC.js +352 -0
  33. package/dist/browser/editor-runtime/browser-d5JHIrvC.js.map +1 -0
  34. package/dist/browser/editor-runtime/controller/index.js +193 -0
  35. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  36. package/dist/browser/editor-runtime/delivery/index.js +781 -0
  37. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  38. package/dist/controller/defaults.d.ts +64 -0
  39. package/dist/controller/defaults.js +54 -0
  40. package/dist/controller/index.d.ts +24 -0
  41. package/dist/controller/index.js +110 -0
  42. package/dist/controller/utils.d.ts +20 -0
  43. package/dist/controller/utils.js +39 -0
  44. package/dist/delivery/index.d.ts +22 -0
  45. package/dist/delivery/index.js +62 -0
  46. package/dist/delivery/main.d.ts +31 -0
  47. package/dist/delivery/main.js +198 -0
  48. package/dist/delivery/utils.d.ts +12 -0
  49. package/dist/delivery/utils.js +220 -0
  50. package/dist/graphing-solution-set.css +2 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.iife.d.ts +8 -0
  53. package/dist/index.iife.js +369 -0
  54. package/dist/index.js +2 -0
  55. package/dist/runtime-support.d.ts +12 -0
  56. package/dist/runtime-support.js +12 -0
  57. package/package.json +94 -23
  58. package/CHANGELOG.json +0 -1
  59. package/CHANGELOG.md +0 -899
  60. package/LICENSE.md +0 -5
  61. package/README.md +0 -20
  62. package/configure/CHANGELOG.json +0 -1
  63. package/configure/CHANGELOG.md +0 -859
  64. package/configure/lib/configure.js +0 -312
  65. package/configure/lib/configure.js.map +0 -1
  66. package/configure/lib/correct-response.js +0 -435
  67. package/configure/lib/correct-response.js.map +0 -1
  68. package/configure/lib/defaults.js +0 -357
  69. package/configure/lib/defaults.js.map +0 -1
  70. package/configure/lib/graphing-config.js +0 -408
  71. package/configure/lib/graphing-config.js.map +0 -1
  72. package/configure/lib/index.js +0 -167
  73. package/configure/lib/index.js.map +0 -1
  74. package/configure/lib/utils.js +0 -630
  75. package/configure/lib/utils.js.map +0 -1
  76. package/configure/package.json +0 -29
  77. package/controller/CHANGELOG.json +0 -1
  78. package/controller/CHANGELOG.md +0 -715
  79. package/controller/lib/defaults.js +0 -69
  80. package/controller/lib/defaults.js.map +0 -1
  81. package/controller/lib/index.js +0 -351
  82. package/controller/lib/index.js.map +0 -1
  83. package/controller/lib/utils.js +0 -212
  84. package/controller/lib/utils.js.map +0 -1
  85. package/controller/package.json +0 -22
  86. package/demo-gss.gif +0 -0
  87. package/docs/config-schema.json +0 -1560
  88. package/docs/config-schema.json.md +0 -1114
  89. package/docs/demo/config.js +0 -8
  90. package/docs/demo/generate.js +0 -54
  91. package/docs/demo/index.html +0 -1
  92. package/docs/demo/session.js +0 -6
  93. package/docs/pie-schema.json +0 -1800
  94. package/docs/pie-schema.json.md +0 -952
  95. package/lib/index.js +0 -165
  96. package/lib/index.js.map +0 -1
  97. package/lib/main.js +0 -355
  98. package/lib/main.js.map +0 -1
  99. package/lib/utils.js +0 -515
  100. package/lib/utils.js.map +0 -1
@@ -0,0 +1,3833 @@
1
+ import { E as e, g as t, o as n, r, s as i, t as a, x as o } from "../browser-bbrzkX59.js";
2
+ import { $ as s, A as c, B as l, D as u, E as d, F as f, G as p, H as m, I as h, J as g, K as _, L as v, M as y, O as b, P as x, Q as S, R as C, V as w, W as T, X as E, Y as D, Z as O, _ as k, a as A, b as ee, c as j, d as M, et as te, f as ne, g as N, h as re, k as ie, l as P, m as F, n as ae, nt as oe, o as se, p as ce, q as le, r as ue, s as de, t as fe, tt as pe, u as me, v as he, x as ge, y as I, z as L } from "../alert-dialog-mARgEnYR.js";
3
+ import * as R from "react";
4
+ import z, { Component as _e, createElement as ve } from "react";
5
+ import { createRoot as ye } from "react-dom/client";
6
+ import { Fragment as be, jsx as B, jsxs as V } from "react/jsx-runtime";
7
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/internal/svg-icons/CheckBoxOutlineBlank.js
8
+ var xe = v(/*#__PURE__*/ B("path", { d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" }), "CheckBoxOutlineBlank"), Se = v(/*#__PURE__*/ B("path", { d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }), "CheckBox"), Ce = v(/*#__PURE__*/ B("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z" }), "IndeterminateCheckBox");
9
+ //#endregion
10
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Checkbox/checkboxClasses.js
11
+ function we(e) {
12
+ return S("MuiCheckbox", e);
13
+ }
14
+ var Te = O("MuiCheckbox", [
15
+ "root",
16
+ "checked",
17
+ "disabled",
18
+ "indeterminate",
19
+ "colorPrimary",
20
+ "colorSecondary",
21
+ "sizeSmall",
22
+ "sizeMedium"
23
+ ]), Ee = (e) => {
24
+ let { classes: t, indeterminate: n, color: r, size: i } = e, a = E({ root: [
25
+ "root",
26
+ n && "indeterminate",
27
+ `color${C(r)}`,
28
+ `size${C(i)}`
29
+ ] }, we, t);
30
+ return {
31
+ ...t,
32
+ ...a
33
+ };
34
+ }, De = _(de, {
35
+ shouldForwardProp: (e) => le(e) || e === "classes",
36
+ name: "MuiCheckbox",
37
+ slot: "Root",
38
+ overridesResolver: (e, t) => {
39
+ let { ownerState: n } = e;
40
+ return [
41
+ t.root,
42
+ n.indeterminate && t.indeterminate,
43
+ t[`size${C(n.size)}`],
44
+ n.color !== "default" && t[`color${C(n.color)}`]
45
+ ];
46
+ }
47
+ })(l(({ theme: e }) => ({
48
+ color: (e.vars || e).palette.text.secondary,
49
+ variants: [
50
+ {
51
+ props: {
52
+ color: "default",
53
+ disableRipple: !1
54
+ },
55
+ style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity) } }
56
+ },
57
+ ...Object.entries(e.palette).filter(y()).map(([t]) => ({
58
+ props: {
59
+ color: t,
60
+ disableRipple: !1
61
+ },
62
+ style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity) } }
63
+ })),
64
+ ...Object.entries(e.palette).filter(y()).map(([t]) => ({
65
+ props: { color: t },
66
+ style: {
67
+ [`&.${Te.checked}, &.${Te.indeterminate}`]: { color: (e.vars || e).palette[t].main },
68
+ [`&.${Te.disabled}`]: { color: (e.vars || e).palette.action.disabled }
69
+ }
70
+ })),
71
+ {
72
+ props: { disableRipple: !1 },
73
+ style: { "&:hover": { "@media (hover: none)": { backgroundColor: "transparent" } } }
74
+ }
75
+ ]
76
+ }))), Oe = /*#__PURE__*/ B(Se, {}), ke = /*#__PURE__*/ B(xe, {}), Ae = /*#__PURE__*/ B(Ce, {}), je = /*#__PURE__*/ R.forwardRef(function(e, t) {
77
+ let n = m({
78
+ props: e,
79
+ name: "MuiCheckbox"
80
+ }), { checkedIcon: r = Oe, color: i = "primary", icon: a = ke, indeterminate: o = !1, indeterminateIcon: c = Ae, inputProps: l, size: u = "medium", disableRipple: d = !1, className: f, slots: p = {}, slotProps: h = {}, ...g } = n, _ = o ? c : a, v = o ? c : r, y = {
81
+ ...n,
82
+ disableRipple: d,
83
+ color: i,
84
+ indeterminate: o,
85
+ size: u
86
+ }, b = Ee(y), S = h.input ?? l, [C, w] = L("root", {
87
+ ref: t,
88
+ elementType: De,
89
+ className: s(b.root, f),
90
+ shouldForwardComponentProp: !0,
91
+ externalForwardedProps: {
92
+ slots: p,
93
+ slotProps: h,
94
+ ...g
95
+ },
96
+ ownerState: y,
97
+ additionalProps: {
98
+ type: "checkbox",
99
+ icon: /*#__PURE__*/ R.cloneElement(_, { fontSize: _.props.fontSize ?? u }),
100
+ checkedIcon: /*#__PURE__*/ R.cloneElement(v, { fontSize: v.props.fontSize ?? u }),
101
+ disableRipple: d,
102
+ slots: p,
103
+ slotProps: { input: x(typeof S == "function" ? S(y) : S, {
104
+ "data-indeterminate": o,
105
+ "aria-checked": o ? "mixed" : void 0
106
+ }) }
107
+ }
108
+ });
109
+ return /*#__PURE__*/ B(C, {
110
+ ...w,
111
+ classes: b
112
+ });
113
+ });
114
+ //#endregion
115
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/FormControlLabel/formControlLabelClasses.js
116
+ function Me(e) {
117
+ return S("MuiFormControlLabel", e);
118
+ }
119
+ var H = O("MuiFormControlLabel", [
120
+ "root",
121
+ "labelPlacementStart",
122
+ "labelPlacementTop",
123
+ "labelPlacementBottom",
124
+ "disabled",
125
+ "label",
126
+ "error",
127
+ "required",
128
+ "asterisk"
129
+ ]), Ne = (e) => {
130
+ let { classes: t, disabled: n, labelPlacement: r, error: i, required: a } = e;
131
+ return E({
132
+ root: [
133
+ "root",
134
+ n && "disabled",
135
+ `labelPlacement${C(r)}`,
136
+ i && "error",
137
+ a && "required"
138
+ ],
139
+ label: ["label", n && "disabled"],
140
+ asterisk: ["asterisk", i && "error"]
141
+ }, Me, t);
142
+ }, Pe = _("label", {
143
+ name: "MuiFormControlLabel",
144
+ slot: "Root",
145
+ overridesResolver: (e, t) => {
146
+ let { ownerState: n } = e;
147
+ return [
148
+ { [`& .${H.label}`]: t.label },
149
+ t.root,
150
+ t[`labelPlacement${C(n.labelPlacement)}`]
151
+ ];
152
+ }
153
+ })(l(({ theme: e }) => ({
154
+ display: "inline-flex",
155
+ alignItems: "center",
156
+ cursor: "pointer",
157
+ verticalAlign: "middle",
158
+ WebkitTapHighlightColor: "transparent",
159
+ marginLeft: -11,
160
+ marginRight: 16,
161
+ [`&.${H.disabled}`]: { cursor: "default" },
162
+ [`& .${H.label}`]: { [`&.${H.disabled}`]: { color: (e.vars || e).palette.text.disabled } },
163
+ variants: [
164
+ {
165
+ props: { labelPlacement: "start" },
166
+ style: {
167
+ flexDirection: "row-reverse",
168
+ marginRight: -11
169
+ }
170
+ },
171
+ {
172
+ props: { labelPlacement: "top" },
173
+ style: { flexDirection: "column-reverse" }
174
+ },
175
+ {
176
+ props: { labelPlacement: "bottom" },
177
+ style: { flexDirection: "column" }
178
+ },
179
+ {
180
+ props: ({ labelPlacement: e }) => e === "start" || e === "top" || e === "bottom",
181
+ style: { marginLeft: 16 }
182
+ }
183
+ ]
184
+ }))), Fe = _("span", {
185
+ name: "MuiFormControlLabel",
186
+ slot: "Asterisk"
187
+ })(l(({ theme: e }) => ({ [`&.${H.error}`]: { color: (e.vars || e).palette.error.main } }))), Ie = /*#__PURE__*/ R.forwardRef(function(e, t) {
188
+ let n = m({
189
+ props: e,
190
+ name: "MuiFormControlLabel"
191
+ }), { checked: r, className: i, componentsProps: a = {}, control: o, disabled: l, disableTypography: u, inputRef: d, label: f, labelPlacement: p = "end", name: h, onChange: g, required: _, slots: v = {}, slotProps: y = {}, value: x, ...S } = n, C = b(), w = l ?? o.props.disabled ?? C?.disabled, T = _ ?? o.props.required, E = {
192
+ disabled: w,
193
+ required: T
194
+ };
195
+ [
196
+ "checked",
197
+ "name",
198
+ "onChange",
199
+ "value",
200
+ "inputRef"
201
+ ].forEach((e) => {
202
+ o.props[e] === void 0 && n[e] !== void 0 && (E[e] = n[e]);
203
+ });
204
+ let D = c({
205
+ props: n,
206
+ muiFormControl: C,
207
+ states: ["error"]
208
+ }), O = {
209
+ ...n,
210
+ disabled: w,
211
+ labelPlacement: p,
212
+ required: T,
213
+ error: D.error
214
+ }, k = Ne(O), [A, ee] = L("typography", {
215
+ elementType: I,
216
+ externalForwardedProps: {
217
+ slots: v,
218
+ slotProps: {
219
+ ...a,
220
+ ...y
221
+ }
222
+ },
223
+ ownerState: O
224
+ }), j = f;
225
+ return j != null && j.type !== I && !u && (j = /*#__PURE__*/ B(A, {
226
+ component: "span",
227
+ ...ee,
228
+ className: s(k.label, ee?.className),
229
+ children: j
230
+ })), /*#__PURE__*/ V(Pe, {
231
+ className: s(k.root, i),
232
+ ownerState: O,
233
+ ref: t,
234
+ ...S,
235
+ children: [/*#__PURE__*/ R.cloneElement(o, E), T ? /*#__PURE__*/ V("div", { children: [j, /*#__PURE__*/ V(Fe, {
236
+ ownerState: O,
237
+ "aria-hidden": !0,
238
+ className: k.asterisk,
239
+ children: [" ", "*"]
240
+ })] }) : j]
241
+ });
242
+ });
243
+ //#endregion
244
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/FormGroup/formGroupClasses.js
245
+ function Le(e) {
246
+ return S("MuiFormGroup", e);
247
+ }
248
+ O("MuiFormGroup", [
249
+ "root",
250
+ "row",
251
+ "error"
252
+ ]);
253
+ //#endregion
254
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/FormGroup/FormGroup.js
255
+ var Re = (e) => {
256
+ let { classes: t, row: n, error: r } = e;
257
+ return E({ root: [
258
+ "root",
259
+ n && "row",
260
+ r && "error"
261
+ ] }, Le, t);
262
+ }, ze = _("div", {
263
+ name: "MuiFormGroup",
264
+ slot: "Root",
265
+ overridesResolver: (e, t) => {
266
+ let { ownerState: n } = e;
267
+ return [t.root, n.row && t.row];
268
+ }
269
+ })({
270
+ display: "flex",
271
+ flexDirection: "column",
272
+ flexWrap: "wrap",
273
+ variants: [{
274
+ props: { row: !0 },
275
+ style: { flexDirection: "row" }
276
+ }]
277
+ }), Be = /*#__PURE__*/ R.forwardRef(function(e, t) {
278
+ let n = m({
279
+ props: e,
280
+ name: "MuiFormGroup"
281
+ }), { className: r, row: i = !1, ...a } = n, o = c({
282
+ props: n,
283
+ muiFormControl: b(),
284
+ states: ["error"]
285
+ }), l = {
286
+ ...n,
287
+ row: i,
288
+ error: o.error
289
+ };
290
+ return /*#__PURE__*/ B(ze, {
291
+ className: s(Re(l).root, r),
292
+ ownerState: l,
293
+ ref: t,
294
+ ...a
295
+ });
296
+ });
297
+ //#endregion
298
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/InputAdornment/inputAdornmentClasses.js
299
+ function Ve(e) {
300
+ return S("MuiInputAdornment", e);
301
+ }
302
+ var He = O("MuiInputAdornment", [
303
+ "root",
304
+ "filled",
305
+ "standard",
306
+ "outlined",
307
+ "positionStart",
308
+ "positionEnd",
309
+ "disablePointerEvents",
310
+ "hiddenLabel",
311
+ "sizeSmall"
312
+ ]), Ue, We = (e, t) => {
313
+ let { ownerState: n } = e;
314
+ return [
315
+ t.root,
316
+ t[`position${C(n.position)}`],
317
+ n.disablePointerEvents === !0 && t.disablePointerEvents,
318
+ t[n.variant]
319
+ ];
320
+ }, Ge = (e) => {
321
+ let { classes: t, disablePointerEvents: n, hiddenLabel: r, position: i, size: a, variant: o } = e;
322
+ return E({ root: [
323
+ "root",
324
+ n && "disablePointerEvents",
325
+ i && `position${C(i)}`,
326
+ o,
327
+ r && "hiddenLabel",
328
+ a && `size${C(a)}`
329
+ ] }, Ve, t);
330
+ }, Ke = _("div", {
331
+ name: "MuiInputAdornment",
332
+ slot: "Root",
333
+ overridesResolver: We
334
+ })(l(({ theme: e }) => ({
335
+ display: "flex",
336
+ maxHeight: "2em",
337
+ alignItems: "center",
338
+ whiteSpace: "nowrap",
339
+ color: (e.vars || e).palette.action.active,
340
+ variants: [
341
+ {
342
+ props: { variant: "filled" },
343
+ style: { [`&.${He.positionStart}&:not(.${He.hiddenLabel})`]: { marginTop: 16 } }
344
+ },
345
+ {
346
+ props: { position: "start" },
347
+ style: { marginRight: 8 }
348
+ },
349
+ {
350
+ props: { position: "end" },
351
+ style: { marginLeft: 8 }
352
+ },
353
+ {
354
+ props: { disablePointerEvents: !0 },
355
+ style: { pointerEvents: "none" }
356
+ }
357
+ ]
358
+ }))), qe = /*#__PURE__*/ R.forwardRef(function(e, t) {
359
+ let n = m({
360
+ props: e,
361
+ name: "MuiInputAdornment"
362
+ }), { children: r, className: i, component: a = "div", disablePointerEvents: o = !1, disableTypography: c = !1, position: l, variant: u, ...d } = n, f = b() || {}, p = u;
363
+ u && f.variant, f && !p && (p = f.variant);
364
+ let h = {
365
+ ...n,
366
+ hiddenLabel: f.hiddenLabel,
367
+ size: f.size,
368
+ disablePointerEvents: o,
369
+ position: l,
370
+ variant: p
371
+ }, g = Ge(h);
372
+ return /*#__PURE__*/ B(ie.Provider, {
373
+ value: null,
374
+ children: /*#__PURE__*/ B(Ke, {
375
+ as: a,
376
+ ownerState: h,
377
+ className: s(g.root, i),
378
+ ref: t,
379
+ ...d,
380
+ children: typeof r == "string" && !c ? /*#__PURE__*/ B(I, {
381
+ color: "textSecondary",
382
+ children: r
383
+ }) : /*#__PURE__*/ V(R.Fragment, { children: [l === "start" ? Ue ||= /*#__PURE__*/ B("span", {
384
+ className: "notranslate",
385
+ "aria-hidden": !0,
386
+ children: "​"
387
+ }) : null, r] })
388
+ })
389
+ });
390
+ });
391
+ //#endregion
392
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/RadioGroup/radioGroupClasses.js
393
+ function Je(e) {
394
+ return S("MuiRadioGroup", e);
395
+ }
396
+ O("MuiRadioGroup", [
397
+ "root",
398
+ "row",
399
+ "error"
400
+ ]);
401
+ //#endregion
402
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/RadioGroup/RadioGroup.js
403
+ var Ye = (e) => {
404
+ let { classes: t, row: n, error: r } = e;
405
+ return E({ root: [
406
+ "root",
407
+ n && "row",
408
+ r && "error"
409
+ ] }, Je, t);
410
+ }, Xe = /*#__PURE__*/ R.forwardRef(function(e, t) {
411
+ let { actions: n, children: r, className: i, defaultValue: a, name: o, onChange: c, value: l, ...u } = e, d = R.useRef(null), p = Ye(e), [m, g] = f({
412
+ controlled: l,
413
+ default: a,
414
+ name: "RadioGroup"
415
+ });
416
+ R.useImperativeHandle(n, () => ({ focus: () => {
417
+ let e = d.current.querySelector("input:not(:disabled):checked");
418
+ e ||= d.current.querySelector("input:not(:disabled)"), e && e.focus();
419
+ } }), []);
420
+ let _ = w(t, d), v = h(o), y = R.useMemo(() => ({
421
+ name: v,
422
+ onChange(e) {
423
+ g(e.target.value), c && c(e, e.target.value);
424
+ },
425
+ value: m
426
+ }), [
427
+ v,
428
+ c,
429
+ g,
430
+ m
431
+ ]);
432
+ return /*#__PURE__*/ B(se.Provider, {
433
+ value: y,
434
+ children: /*#__PURE__*/ B(Be, {
435
+ role: "radiogroup",
436
+ ref: _,
437
+ className: s(p.root, i),
438
+ ...u,
439
+ children: r
440
+ })
441
+ });
442
+ });
443
+ //#endregion
444
+ //#region ../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Switch/switchClasses.js
445
+ function Ze(e) {
446
+ return S("MuiSwitch", e);
447
+ }
448
+ var U = O("MuiSwitch", [
449
+ "root",
450
+ "edgeStart",
451
+ "edgeEnd",
452
+ "switchBase",
453
+ "colorPrimary",
454
+ "colorSecondary",
455
+ "sizeSmall",
456
+ "sizeMedium",
457
+ "checked",
458
+ "disabled",
459
+ "input",
460
+ "thumb",
461
+ "track"
462
+ ]), Qe = (e) => {
463
+ let { classes: t, edge: n, size: r, color: i, checked: a, disabled: o } = e, s = E({
464
+ root: [
465
+ "root",
466
+ n && `edge${C(n)}`,
467
+ `size${C(r)}`
468
+ ],
469
+ switchBase: [
470
+ "switchBase",
471
+ `color${C(i)}`,
472
+ a && "checked",
473
+ o && "disabled"
474
+ ],
475
+ thumb: ["thumb"],
476
+ track: ["track"],
477
+ input: ["input"]
478
+ }, Ze, t);
479
+ return {
480
+ ...t,
481
+ ...s
482
+ };
483
+ }, $e = _("span", {
484
+ name: "MuiSwitch",
485
+ slot: "Root",
486
+ overridesResolver: (e, t) => {
487
+ let { ownerState: n } = e;
488
+ return [
489
+ t.root,
490
+ n.edge && t[`edge${C(n.edge)}`],
491
+ t[`size${C(n.size)}`]
492
+ ];
493
+ }
494
+ })({
495
+ display: "inline-flex",
496
+ width: 58,
497
+ height: 38,
498
+ overflow: "hidden",
499
+ padding: 12,
500
+ boxSizing: "border-box",
501
+ position: "relative",
502
+ flexShrink: 0,
503
+ zIndex: 0,
504
+ verticalAlign: "middle",
505
+ "@media print": { colorAdjust: "exact" },
506
+ variants: [
507
+ {
508
+ props: { edge: "start" },
509
+ style: { marginLeft: -8 }
510
+ },
511
+ {
512
+ props: { edge: "end" },
513
+ style: { marginRight: -8 }
514
+ },
515
+ {
516
+ props: { size: "small" },
517
+ style: {
518
+ width: 40,
519
+ height: 24,
520
+ padding: 7,
521
+ [`& .${U.thumb}`]: {
522
+ width: 16,
523
+ height: 16
524
+ },
525
+ [`& .${U.switchBase}`]: {
526
+ padding: 4,
527
+ [`&.${U.checked}`]: { transform: "translateX(16px)" }
528
+ }
529
+ }
530
+ }
531
+ ]
532
+ }), et = _(de, {
533
+ name: "MuiSwitch",
534
+ slot: "SwitchBase",
535
+ overridesResolver: (e, t) => {
536
+ let { ownerState: n } = e;
537
+ return [
538
+ t.switchBase,
539
+ { [`& .${U.input}`]: t.input },
540
+ n.color !== "default" && t[`color${C(n.color)}`]
541
+ ];
542
+ }
543
+ })(l(({ theme: e }) => ({
544
+ position: "absolute",
545
+ top: 0,
546
+ left: 0,
547
+ zIndex: 1,
548
+ color: e.vars ? e.vars.palette.Switch.defaultColor : `${e.palette.mode === "light" ? e.palette.common.white : e.palette.grey[300]}`,
549
+ transition: e.transitions.create(["left", "transform"], { duration: e.transitions.duration.shortest }),
550
+ [`&.${U.checked}`]: { transform: "translateX(20px)" },
551
+ [`&.${U.disabled}`]: { color: e.vars ? e.vars.palette.Switch.defaultDisabledColor : `${e.palette.mode === "light" ? e.palette.grey[100] : e.palette.grey[600]}` },
552
+ [`&.${U.checked} + .${U.track}`]: { opacity: .5 },
553
+ [`&.${U.disabled} + .${U.track}`]: { opacity: e.vars ? e.vars.opacity.switchTrackDisabled : `${e.palette.mode === "light" ? .12 : .2}` },
554
+ [`& .${U.input}`]: {
555
+ left: "-100%",
556
+ width: "300%"
557
+ }
558
+ })), l(({ theme: e }) => ({
559
+ "&:hover": {
560
+ backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity),
561
+ "@media (hover: none)": { backgroundColor: "transparent" }
562
+ },
563
+ variants: [...Object.entries(e.palette).filter(y(["light"])).map(([t]) => ({
564
+ props: { color: t },
565
+ style: {
566
+ [`&.${U.checked}`]: {
567
+ color: (e.vars || e).palette[t].main,
568
+ "&:hover": {
569
+ backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity),
570
+ "@media (hover: none)": { backgroundColor: "transparent" }
571
+ },
572
+ [`&.${U.disabled}`]: { color: e.vars ? e.vars.palette.Switch[`${t}DisabledColor`] : `${e.palette.mode === "light" ? e.lighten(e.palette[t].main, .62) : e.darken(e.palette[t].main, .55)}` }
573
+ },
574
+ [`&.${U.checked} + .${U.track}`]: { backgroundColor: (e.vars || e).palette[t].main }
575
+ }
576
+ }))]
577
+ }))), tt = _("span", {
578
+ name: "MuiSwitch",
579
+ slot: "Track"
580
+ })(l(({ theme: e }) => ({
581
+ height: "100%",
582
+ width: "100%",
583
+ borderRadius: 14 / 2,
584
+ boxSizing: "border-box",
585
+ border: "1px solid transparent",
586
+ zIndex: -1,
587
+ transition: e.transitions.create(["opacity", "background-color"], { duration: e.transitions.duration.shortest }),
588
+ backgroundColor: e.vars ? e.vars.palette.common.onBackground : `${e.palette.mode === "light" ? e.palette.common.black : e.palette.common.white}`,
589
+ opacity: e.vars ? e.vars.opacity.switchTrack : `${e.palette.mode === "light" ? .38 : .3}`
590
+ }))), nt = _("span", {
591
+ name: "MuiSwitch",
592
+ slot: "Thumb"
593
+ })(l(({ theme: e }) => ({
594
+ boxShadow: (e.vars || e).shadows[1],
595
+ backgroundColor: "currentColor",
596
+ boxSizing: "border-box",
597
+ border: "1px solid transparent",
598
+ width: 20,
599
+ height: 20,
600
+ borderRadius: "50%"
601
+ }))), rt = /*#__PURE__*/ R.forwardRef(function(e, t) {
602
+ let n = m({
603
+ props: e,
604
+ name: "MuiSwitch"
605
+ }), { className: r, color: i = "primary", edge: a = !1, size: o = "medium", sx: c, slots: l = {}, slotProps: u = {}, ...d } = n, f = {
606
+ ...n,
607
+ color: i,
608
+ edge: a,
609
+ size: o
610
+ }, p = Qe(f), h = u.input, g = {
611
+ slots: l,
612
+ slotProps: u
613
+ }, [_, v] = L("root", {
614
+ className: s(p.root, r),
615
+ elementType: $e,
616
+ externalForwardedProps: g,
617
+ ownerState: f,
618
+ additionalProps: { sx: c }
619
+ }), [y, b] = L("thumb", {
620
+ className: p.thumb,
621
+ elementType: nt,
622
+ externalForwardedProps: g,
623
+ ownerState: f
624
+ }), S = /*#__PURE__*/ B(y, { ...b }), [C, w] = L("track", {
625
+ className: p.track,
626
+ elementType: tt,
627
+ externalForwardedProps: g,
628
+ ownerState: f
629
+ });
630
+ return /*#__PURE__*/ V(_, {
631
+ ...v,
632
+ children: [/*#__PURE__*/ B(et, {
633
+ type: "checkbox",
634
+ icon: S,
635
+ checkedIcon: S,
636
+ ref: t,
637
+ ownerState: f,
638
+ ...d,
639
+ classes: {
640
+ ...p,
641
+ root: p.switchBase
642
+ },
643
+ slots: {
644
+ ...l.switchBase && { root: l.switchBase },
645
+ ...l.input && { input: l.input }
646
+ },
647
+ slotProps: {
648
+ ...u.switchBase && { root: typeof u.switchBase == "function" ? u.switchBase(f) : u.switchBase },
649
+ input: x(typeof h == "function" ? h(f) : h, { role: "switch" })
650
+ }
651
+ }), /*#__PURE__*/ B(C, { ...w })]
652
+ });
653
+ }), W = /* @__PURE__ */ e(a(), 1), G = /* @__PURE__ */ e(pe(), 1), it = _(Ie)(() => ({ "& .MuiFormControlLabel-label": {
654
+ left: "-5px",
655
+ position: "relative"
656
+ } })), at = _(A)(() => ({ color: `${T.tertiary()} !important` })), ot = ({ label: e, value: t, checked: n, onChange: r }) => /* @__PURE__ */ B(it, {
657
+ value: t,
658
+ control: /* @__PURE__ */ B(at, {
659
+ checked: n,
660
+ onChange: r
661
+ }),
662
+ label: e
663
+ });
664
+ ot.propTypes = {
665
+ label: G.default.string,
666
+ value: G.default.string,
667
+ checked: G.default.bool,
668
+ onChange: G.default.func
669
+ };
670
+ //#endregion
671
+ //#region ../../lib-react/config-ui/dist/tabs/index.js
672
+ var st = _(ne)(() => ({})), ct = class extends z.Component {
673
+ static propTypes = {
674
+ className: G.default.string,
675
+ contentClassName: G.default.string,
676
+ contentStyle: G.default.object,
677
+ children: G.default.oneOfType([G.default.arrayOf(G.default.node), G.default.node]).isRequired
678
+ };
679
+ constructor(e) {
680
+ super(e), this.state = { value: 0 };
681
+ }
682
+ handleChange = (e, t) => {
683
+ this.setState({ value: t });
684
+ };
685
+ render() {
686
+ let { value: e } = this.state, { children: t, className: n, contentClassName: r, contentStyle: i = {} } = this.props;
687
+ return /* @__PURE__ */ V("div", {
688
+ className: n,
689
+ children: [/* @__PURE__ */ B(ce, {
690
+ indicatorColor: "primary",
691
+ value: e,
692
+ onChange: this.handleChange,
693
+ children: z.Children.map(t, (e, t) => e && e.props.title ? /* @__PURE__ */ B(st, { label: e.props.title }, t) : null)
694
+ }), /* @__PURE__ */ B("div", {
695
+ className: r,
696
+ style: i,
697
+ children: t[e]
698
+ })]
699
+ });
700
+ }
701
+ }, lt = _(Ie)(({ theme: e, mini: t }) => ({
702
+ margin: 0,
703
+ marginLeft: 0,
704
+ padding: 0,
705
+ "& .MuiFormControlLabel-label": {
706
+ fontSize: e.typography.fontSize - 1,
707
+ transform: "translate(-4%, 2%)",
708
+ color: "rgba(0,0,0,1.0)",
709
+ ...t && {
710
+ marginLeft: e.spacing(1),
711
+ color: D[700],
712
+ fontSize: e.typography.fontSize - 3
713
+ }
714
+ }
715
+ })), ut = _(je)(({ theme: e, mini: t, error: n }) => ({
716
+ color: `${T.tertiary()} !important`,
717
+ ...t && {
718
+ margin: 0,
719
+ padding: 0,
720
+ width: e.spacing(3),
721
+ height: e.spacing(3)
722
+ },
723
+ ...n && { color: `${e.palette.error.main} !important` }
724
+ })), dt = ({ mini: e, checked: t, onChange: n, value: r, label: i, error: a }) => /* @__PURE__ */ B(lt, {
725
+ mini: e,
726
+ control: /* @__PURE__ */ B(ut, {
727
+ checked: t,
728
+ onChange: n,
729
+ value: r,
730
+ mini: e,
731
+ error: a
732
+ }),
733
+ label: i
734
+ });
735
+ dt.propTypes = {
736
+ mini: G.default.bool,
737
+ checked: G.default.bool.isRequired,
738
+ onChange: G.default.func.isRequired,
739
+ value: G.default.string,
740
+ label: G.default.string.isRequired,
741
+ error: G.default.bool
742
+ }, dt.defaultProps = {
743
+ value: "",
744
+ mini: !1,
745
+ error: !1
746
+ };
747
+ //#endregion
748
+ //#region ../../lib-react/config-ui/dist/number-text-field.js
749
+ var ft = (0, W.default)("@pie-lib:config-ui:number-text-field"), pt = _(F)(({ theme: e }) => ({
750
+ marginRight: e.spacing(1),
751
+ "& .MuiInputLabel-root": {
752
+ width: "auto",
753
+ minWidth: "max-content",
754
+ maxWidth: "none",
755
+ whiteSpace: "nowrap",
756
+ overflow: "visible",
757
+ transform: "translate(0, 8px) scale(0.75)",
758
+ transformOrigin: "top left",
759
+ position: "relative"
760
+ },
761
+ "& .MuiInputBase-root, & .MuiInput-root, & .MuiFilledInput-root, & .MuiOutlinedInput-root": {
762
+ height: "auto",
763
+ minHeight: "auto",
764
+ marginTop: 0
765
+ },
766
+ "& .MuiInputBase-input": {
767
+ height: "auto",
768
+ minHeight: "auto",
769
+ padding: "6px 0 7px"
770
+ }
771
+ })), mt = (e, t) => {
772
+ if (!i(e) && !i(t)) return 0;
773
+ if (!i(e) && i(t)) return t;
774
+ if (i(e)) return e;
775
+ }, ht = class extends z.Component {
776
+ static propTypes = {
777
+ disabled: G.default.bool,
778
+ className: G.default.string,
779
+ inputClassName: G.default.string,
780
+ onChange: G.default.func.isRequired,
781
+ value: G.default.number,
782
+ min: G.default.number,
783
+ max: G.default.number,
784
+ label: G.default.string,
785
+ suffix: G.default.string,
786
+ showErrorWhenOutsideRange: G.default.bool,
787
+ disableUnderline: G.default.bool,
788
+ variant: G.default.string
789
+ };
790
+ static defaultProps = { showErrorWhenOutsideRange: !1 };
791
+ constructor(e) {
792
+ super(e);
793
+ let t = this.clamp(e.value);
794
+ this.state = { value: t }, t !== e.value && this.props.onChange({}, t), this.onChange = this.onChange.bind(this);
795
+ }
796
+ UNSAFE_componentWillReceiveProps(e) {
797
+ let t = this.clamp(e.value, e.min, e.max);
798
+ this.setState({ value: t });
799
+ }
800
+ clamp(e, t = this.props.min, n = this.props.max) {
801
+ return i(e) ? (i(n) && (e = Math.min(e, n)), i(t) && (e = Math.max(e, t)), e) : mt(t, n);
802
+ }
803
+ onBlur = (e) => {
804
+ let t = e.target.value, n = parseFloat(t);
805
+ ft("rawNumber: ", n);
806
+ let r = this.clamp(n);
807
+ ft("number: ", r), r !== this.state.value && (ft("trigger update..."), this.setState({ value: r.toString() }, () => {
808
+ this.props.onChange(e, r);
809
+ }));
810
+ };
811
+ onChange(e) {
812
+ let t = e.target.value;
813
+ this.setState({ value: t });
814
+ }
815
+ errorMessage = () => {
816
+ let { min: e, max: t } = this.props;
817
+ if (e && t) return `The value must be between ${e} and ${t}`;
818
+ if (e) return `The value must be greater than ${e}`;
819
+ if (t) return `The value must be less than ${t}`;
820
+ };
821
+ getError = () => {
822
+ let { value: e } = this.state, t = parseFloat(e);
823
+ if (this.clamp(t) !== t) return this.errorMessage();
824
+ };
825
+ render() {
826
+ let { className: e, label: t, disabled: n, suffix: r, min: i, max: a, inputClassName: o, disableUnderline: s, showErrorWhenOutsideRange: c, variant: l } = this.props, u = c && this.getError();
827
+ return /* @__PURE__ */ B(pt, {
828
+ variant: s ? "filled" : l || "standard",
829
+ inputRef: (e) => {
830
+ this.inputRef = e;
831
+ },
832
+ disabled: n,
833
+ label: t,
834
+ InputLabelProps: { shrink: !0 },
835
+ value: this.state.value,
836
+ error: !!u,
837
+ helperText: u,
838
+ onChange: this.onChange,
839
+ onBlur: this.onBlur,
840
+ onKeyDown: (e) => {
841
+ e.key === "Enter" && this.inputRef && this.inputRef.blur();
842
+ },
843
+ type: "number",
844
+ className: e,
845
+ slotProps: { input: {
846
+ endAdornment: r && /* @__PURE__ */ B(qe, {
847
+ position: "end",
848
+ children: r
849
+ }),
850
+ className: o,
851
+ inputProps: {
852
+ min: i,
853
+ max: a
854
+ }
855
+ } },
856
+ margin: "normal"
857
+ });
858
+ }
859
+ }, gt = (e) => typeof e == "object" && !!e && typeof e.n == "number" && typeof e.d == "number", K = (e) => {
860
+ if (typeof e == "number") return e;
861
+ if (gt(e)) return (e.s ?? 1) * e.n / e.d;
862
+ let t = String(e).trim(), n = t.match(/^([+-]?\d+)\s*\/\s*([+-]?\d+)$/);
863
+ return n ? Number.parseInt(n[1] ?? "0", 10) / Number.parseInt(n[2] ?? "1", 10) : Number(t);
864
+ }, _t = v(/*#__PURE__*/ B("path", { d: "M19 13H5v-2h14z" }), "Remove"), vt = v(/*#__PURE__*/ B("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z" }), "Add"), yt = _(F)(() => ({
865
+ "& input[type=number]": { MozAppearance: "textfield" },
866
+ "& input[type=number]::-webkit-outer-spin-button": {
867
+ WebkitAppearance: "none",
868
+ margin: 0
869
+ },
870
+ "& input[type=number]::-webkit-inner-spin-button": {
871
+ WebkitAppearance: "none",
872
+ margin: 0
873
+ }
874
+ })), bt = _(ee)(() => ({ padding: "2px" })), xt = (e, t) => {
875
+ if (!i(e) && !i(t)) return 0;
876
+ if (!i(e) && i(t)) return t;
877
+ if (i(e)) return e;
878
+ }, q = class extends z.Component {
879
+ static propTypes = {
880
+ className: G.default.string,
881
+ customValues: G.default.array,
882
+ disabled: G.default.bool,
883
+ error: G.default.bool,
884
+ inputClassName: G.default.string,
885
+ helperText: G.default.string,
886
+ onChange: G.default.func.isRequired,
887
+ onlyIntegersAllowed: G.default.bool,
888
+ value: G.default.any,
889
+ min: G.default.number,
890
+ max: G.default.number,
891
+ step: G.default.number,
892
+ label: G.default.string,
893
+ disableUnderline: G.default.bool,
894
+ textAlign: G.default.string,
895
+ variant: G.default.string,
896
+ type: G.default.string
897
+ };
898
+ static defaultProps = {
899
+ step: 1,
900
+ customValues: [],
901
+ textAlign: "center",
902
+ variant: "standard",
903
+ onlyIntegersAllowed: !1
904
+ };
905
+ constructor(e) {
906
+ super(e);
907
+ let { value: t, currentIndex: n } = this.normalizeValueAndIndex(e.customValues, e.value);
908
+ this.state = {
909
+ value: t,
910
+ currentIndex: n
911
+ }, t !== e.value && this.props.onChange({}, t), this.onChange = this.onChange.bind(this);
912
+ }
913
+ UNSAFE_componentWillReceiveProps(e) {
914
+ let { value: t, currentIndex: n } = this.normalizeValueAndIndex(e.customValues, e.value, e.min, e.max);
915
+ this.setState({
916
+ value: t,
917
+ currentIndex: n
918
+ });
919
+ }
920
+ clamp(e, t = this.props.min, n = this.props.max) {
921
+ let { customValues: r } = this.props;
922
+ return (r || []).length > 0 ? e : i(e) ? (i(n) && (e = Math.min(e, n)), i(t) && (e = Math.max(e, t)), e) : xt(t, n);
923
+ }
924
+ normalizeValueAndIndex = (e, t, n, r) => {
925
+ let { type: i } = this.props, a = this.clamp(t, n, r), o = (e || []).findIndex((e) => e === a);
926
+ if ((e || []).length > 0 && o === -1) {
927
+ let t = i === "text" ? this.getClosestFractionValue(e, a) : this.getClosestValue(e, a);
928
+ return {
929
+ value: t.value,
930
+ currentIndex: t.index
931
+ };
932
+ }
933
+ return {
934
+ value: a,
935
+ currentIndex: o
936
+ };
937
+ };
938
+ getClosestValue = (e, t) => e.reduce((e, n, r) => Math.abs(n - t) < Math.abs(e.value - t) ? {
939
+ value: n,
940
+ index: r
941
+ } : e, {
942
+ value: e[0],
943
+ index: 0
944
+ });
945
+ getClosestFractionValue = (e, t) => e.reduce((e, n, r) => Math.abs(K(n) - K(t)) < Math.abs(K(e.value) - K(t)) ? {
946
+ value: n,
947
+ index: r
948
+ } : e, {
949
+ value: e[0],
950
+ index: 0
951
+ });
952
+ getValidFraction = (e) => {
953
+ if (this.isPositiveInteger(e.trim())) return e.trim();
954
+ if (e.trim() === "" || e.trim().split("/").length !== 2) return !1;
955
+ let [t, n] = e.trim().split("/");
956
+ return isNaN(t) || isNaN(n) || (t = parseFloat(t), n = parseFloat(n), !Number.isInteger(t) || !Number.isInteger(n)) || t < 0 || n < 1 ? !1 : t + "/" + n;
957
+ };
958
+ isPositiveInteger = (e) => e >>> 0 === parseFloat(e);
959
+ onBlur = (e) => {
960
+ let { customValues: t, onlyIntegersAllowed: n, type: r } = this.props, { value: i } = e.target;
961
+ r === "text" && (i = this.getValidFraction(i) || this.props.value);
962
+ let a = n ? Math.round(parseFloat(i)) : parseFloat(i);
963
+ r === "text" && (a = i.trim());
964
+ let { value: o, currentIndex: s } = this.normalizeValueAndIndex(t, a);
965
+ this.setState({
966
+ value: o.toString(),
967
+ currentIndex: s
968
+ }, () => this.props.onChange(e, o));
969
+ };
970
+ onChange(e) {
971
+ let { type: t } = this.props, { value: n } = e.target;
972
+ t !== "text" && typeof n == "string" && n.trim() === "" || this.setState({ value: n });
973
+ }
974
+ changeValue(e, t = 1, n = !1) {
975
+ e.preventDefault();
976
+ let { customValues: r, step: i, onlyIntegersAllowed: a, onChange: o } = this.props, { currentIndex: s, value: c } = this.state, l = s + t * 1, u;
977
+ if (r.length > 0) {
978
+ if (l < 0 || l >= r.length) return;
979
+ u = r[l];
980
+ } else {
981
+ let e = ((a ? parseInt(c) : parseFloat(c)) * 1e4 + i * t * 1e4) / 1e4;
982
+ u = this.clamp(e);
983
+ }
984
+ this.setState({
985
+ value: u.toString(),
986
+ currentIndex: l
987
+ }, () => {
988
+ n && o(e, u);
989
+ });
990
+ }
991
+ render() {
992
+ let { className: e, label: t, disabled: n, error: r, min: a, max: o, customValues: s, inputClassName: c, disableUnderline: l, helperText: u, variant: d, textAlign: f, type: p = "number" } = this.props, { value: m } = this.state, h = e, g = !1, _ = !1;
993
+ return s.length > 0 ? (g = m === s[0], _ = m === s[s.length - 1]) : i(a) && i(o) && (g = m === a, _ = m === o), /* @__PURE__ */ B(yt, {
994
+ variant: d,
995
+ inputRef: (e) => this.inputRef = e,
996
+ disabled: n,
997
+ label: t,
998
+ value: m,
999
+ error: r,
1000
+ helperText: u,
1001
+ onChange: this.onChange,
1002
+ onBlur: this.onBlur,
1003
+ onKeyPress: (e) => {
1004
+ e.key === "Enter" && this.inputRef && this.inputRef.blur();
1005
+ },
1006
+ onKeyDown: (e) => {
1007
+ e.key === "ArrowUp" && this.changeValue(e), e.key === "ArrowDown" && this.changeValue(e, -1);
1008
+ },
1009
+ title: "",
1010
+ type: p,
1011
+ className: h,
1012
+ InputProps: {
1013
+ className: c,
1014
+ disableUnderline: l,
1015
+ startAdornment: /* @__PURE__ */ B(qe, {
1016
+ position: "start",
1017
+ children: /* @__PURE__ */ B(bt, {
1018
+ disabled: n || g,
1019
+ onClick: (e) => this.changeValue(e, -1, !0),
1020
+ size: "large",
1021
+ children: /* @__PURE__ */ B(_t, { fontSize: "small" })
1022
+ })
1023
+ }),
1024
+ endAdornment: /* @__PURE__ */ B(qe, {
1025
+ position: "end",
1026
+ children: /* @__PURE__ */ B(bt, {
1027
+ disabled: n || _,
1028
+ onClick: (e) => this.changeValue(e, 1, !0),
1029
+ size: "large",
1030
+ children: /* @__PURE__ */ B(vt, { fontSize: "small" })
1031
+ })
1032
+ })
1033
+ },
1034
+ inputProps: {
1035
+ style: { textAlign: f },
1036
+ min: a,
1037
+ max: o
1038
+ }
1039
+ });
1040
+ }
1041
+ };
1042
+ //#endregion
1043
+ //#region ../../lib-react/config-ui/dist/two-choice.js
1044
+ function J(e) {
1045
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1046
+ }
1047
+ function St(e, t) {
1048
+ return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
1049
+ }
1050
+ var Ct = St(d, "InputContainer") || St(Et.InputContainer, "InputContainer"), wt = ge, Tt = wt.default, Et = Tt && typeof Tt == "object" ? Tt : wt, Dt = _("div")(({ theme: e, direction: t }) => ({
1051
+ display: "flex",
1052
+ flexWrap: "wrap",
1053
+ paddingLeft: 0,
1054
+ marginTop: e.spacing(1),
1055
+ ...t === "vertical" && { flexDirection: "column" }
1056
+ })), Ot = class extends z.Component {
1057
+ static propTypes = {
1058
+ header: G.default.string.isRequired,
1059
+ className: G.default.string,
1060
+ customLabel: G.default.func,
1061
+ opts: G.default.array.isRequired,
1062
+ value: G.default.string,
1063
+ onChange: G.default.func.isRequired,
1064
+ direction: G.default.oneOf(["horizontal", "vertical"])
1065
+ };
1066
+ handleChange = (e) => {
1067
+ this.props.onChange(e.currentTarget.value);
1068
+ };
1069
+ render() {
1070
+ let { header: e, className: t, customLabel: n, opts: r, value: i, direction: a } = this.props, o = r.map((e) => typeof e == "string" ? {
1071
+ label: e,
1072
+ value: e
1073
+ } : e), s = n || ot;
1074
+ return /* @__PURE__ */ B(Ct, {
1075
+ label: e,
1076
+ className: t,
1077
+ children: /* @__PURE__ */ B(Dt, {
1078
+ direction: a,
1079
+ children: o.map((e, t) => /* @__PURE__ */ B(s, {
1080
+ value: e.value,
1081
+ checked: e.value === i,
1082
+ onChange: this.handleChange,
1083
+ label: e.label
1084
+ }, t))
1085
+ })
1086
+ });
1087
+ }
1088
+ }, kt = G.default.shape({
1089
+ label: G.default.string,
1090
+ value: G.default.string
1091
+ });
1092
+ (class extends z.Component {
1093
+ static propTypes = {
1094
+ header: G.default.string.isRequired,
1095
+ value: G.default.string.isRequired,
1096
+ onChange: G.default.func.isRequired,
1097
+ one: G.default.oneOfType([kt, G.default.string]),
1098
+ two: G.default.oneOfType([kt, G.default.string]),
1099
+ className: G.default.string,
1100
+ customLabel: G.default.func
1101
+ };
1102
+ render() {
1103
+ let { one: e, two: t, header: n, className: r, customLabel: i, value: a, onChange: o } = this.props;
1104
+ return /* @__PURE__ */ B(Ot, {
1105
+ customLabel: i,
1106
+ header: n,
1107
+ className: r,
1108
+ opts: [e, t],
1109
+ value: a,
1110
+ onChange: o
1111
+ });
1112
+ }
1113
+ });
1114
+ //#endregion
1115
+ //#region ../../lib-react/config-ui/dist/_virtual/_rolldown/runtime.js
1116
+ var At = Object.defineProperty, jt = (e, t) => {
1117
+ let n = {};
1118
+ for (var r in e) At(n, r, {
1119
+ get: e[r],
1120
+ enumerable: !0
1121
+ });
1122
+ return t || At(n, Symbol.toStringTag, { value: "Module" }), n;
1123
+ }, Mt = _("div")(() => ({
1124
+ display: "flex",
1125
+ flexDirection: "column",
1126
+ position: "relative"
1127
+ })), Nt = _("div")(() => ({
1128
+ display: "flex",
1129
+ justifyContent: "space-between"
1130
+ })), Pt = _("div")(({ theme: e }) => ({ padding: `${e.spacing(2)} 0` })), Ft = _("div")(() => ({ flex: "1" })), It = _("div")(({ theme: e }) => ({ marginLeft: e.spacing(2) })), Lt = class extends z.Component {
1131
+ static propTypes = {
1132
+ mode: G.default.oneOf(["tabbed", "inline"]),
1133
+ secondary: G.default.oneOfType([G.default.arrayOf(G.default.node), G.default.node]),
1134
+ children: G.default.oneOfType([G.default.arrayOf(G.default.node), G.default.node]),
1135
+ dimensions: G.default.object
1136
+ };
1137
+ getConfiguration = () => {
1138
+ let { secondary: e } = this.props;
1139
+ return e?.props?.configuration || e?.props?.children?.props?.configuration || void 0;
1140
+ };
1141
+ render() {
1142
+ let { mode: e, secondary: t, children: n, dimensions: r } = this.props, { minHeight: i, minWidth: a, maxHeight: o, maxWidth: s } = r || {}, c = this.getConfiguration(), l = Object.entries(c || {}).some(([, e]) => !!e?.settings);
1143
+ if (!l) try {
1144
+ l = JSON.stringify(c)?.match(/settings":true/)?.length;
1145
+ } catch (e) {
1146
+ console.log(e.toString());
1147
+ }
1148
+ return /* @__PURE__ */ V(Mt, {
1149
+ style: {
1150
+ minHeight: i,
1151
+ minWidth: a,
1152
+ maxHeight: o,
1153
+ maxWidth: s
1154
+ },
1155
+ children: [
1156
+ e === "inline" && /* @__PURE__ */ V(Nt, { children: [/* @__PURE__ */ B(Ft, {
1157
+ className: "design-container",
1158
+ children: n
1159
+ }), l && /* @__PURE__ */ B(It, {
1160
+ className: "settings-container",
1161
+ children: t
1162
+ })] }),
1163
+ e === "tabbed" && l && /* @__PURE__ */ V(ct, {
1164
+ onChange: this.onTabsChange,
1165
+ contentClassName: "content-container",
1166
+ indicatorColor: "primary",
1167
+ children: [/* @__PURE__ */ B(Pt, {
1168
+ title: "Design",
1169
+ className: "design-container",
1170
+ children: n
1171
+ }), /* @__PURE__ */ B(Pt, {
1172
+ title: "Settings",
1173
+ className: "settings-container",
1174
+ children: t
1175
+ })]
1176
+ }),
1177
+ e === "tabbed" && !l && /* @__PURE__ */ B(Pt, {
1178
+ className: "design-container",
1179
+ children: n
1180
+ })
1181
+ ]
1182
+ });
1183
+ }
1184
+ };
1185
+ //#endregion
1186
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
1187
+ function Rt() {
1188
+ return Rt = Object.assign ? Object.assign.bind() : function(e) {
1189
+ for (var t = 1; t < arguments.length; t++) {
1190
+ var n = arguments[t];
1191
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
1192
+ }
1193
+ return e;
1194
+ }, Rt.apply(null, arguments);
1195
+ }
1196
+ //#endregion
1197
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
1198
+ function zt(e, t) {
1199
+ if (e == null) return {};
1200
+ var n = {};
1201
+ for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
1202
+ if (t.indexOf(r) !== -1) continue;
1203
+ n[r] = e[r];
1204
+ }
1205
+ return n;
1206
+ }
1207
+ //#endregion
1208
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
1209
+ function Bt(e, t) {
1210
+ return Bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
1211
+ return e.__proto__ = t, e;
1212
+ }, Bt(e, t);
1213
+ }
1214
+ //#endregion
1215
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
1216
+ function Vt(e, t) {
1217
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Bt(e, t);
1218
+ }
1219
+ //#endregion
1220
+ //#region ../../lib-react/config-ui/dist/node_modules/.bun/resize-observer-polyfill@1.5.1/node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
1221
+ var Ht = (function() {
1222
+ if (typeof Map < "u") return Map;
1223
+ function e(e, t) {
1224
+ var n = -1;
1225
+ return e.some(function(e, r) {
1226
+ return e[0] === t ? (n = r, !0) : !1;
1227
+ }), n;
1228
+ }
1229
+ return function() {
1230
+ function t() {
1231
+ this.__entries__ = [];
1232
+ }
1233
+ return Object.defineProperty(t.prototype, "size", {
1234
+ get: function() {
1235
+ return this.__entries__.length;
1236
+ },
1237
+ enumerable: !0,
1238
+ configurable: !0
1239
+ }), t.prototype.get = function(t) {
1240
+ var n = e(this.__entries__, t), r = this.__entries__[n];
1241
+ return r && r[1];
1242
+ }, t.prototype.set = function(t, n) {
1243
+ var r = e(this.__entries__, t);
1244
+ ~r ? this.__entries__[r][1] = n : this.__entries__.push([t, n]);
1245
+ }, t.prototype.delete = function(t) {
1246
+ var n = this.__entries__, r = e(n, t);
1247
+ ~r && n.splice(r, 1);
1248
+ }, t.prototype.has = function(t) {
1249
+ return !!~e(this.__entries__, t);
1250
+ }, t.prototype.clear = function() {
1251
+ this.__entries__.splice(0);
1252
+ }, t.prototype.forEach = function(e, t) {
1253
+ t === void 0 && (t = null);
1254
+ for (var n = 0, r = this.__entries__; n < r.length; n++) {
1255
+ var i = r[n];
1256
+ e.call(t, i[1], i[0]);
1257
+ }
1258
+ }, t;
1259
+ }();
1260
+ })(), Ut = typeof window < "u" && typeof document < "u" && window.document === document, Y = (function() {
1261
+ return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
1262
+ })(), Wt = (function() {
1263
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(Y) : function(e) {
1264
+ return setTimeout(function() {
1265
+ return e(Date.now());
1266
+ }, 1e3 / 60);
1267
+ };
1268
+ })(), Gt = 2;
1269
+ function Kt(e, t) {
1270
+ var n = !1, r = !1, i = 0;
1271
+ function a() {
1272
+ n && (n = !1, e()), r && s();
1273
+ }
1274
+ function o() {
1275
+ Wt(a);
1276
+ }
1277
+ function s() {
1278
+ var e = Date.now();
1279
+ if (n) {
1280
+ if (e - i < Gt) return;
1281
+ r = !0;
1282
+ } else n = !0, r = !1, setTimeout(o, t);
1283
+ i = e;
1284
+ }
1285
+ return s;
1286
+ }
1287
+ var qt = 20, Jt = [
1288
+ "top",
1289
+ "right",
1290
+ "bottom",
1291
+ "left",
1292
+ "width",
1293
+ "height",
1294
+ "size",
1295
+ "weight"
1296
+ ], Yt = typeof MutationObserver < "u", Xt = function() {
1297
+ function e() {
1298
+ this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = Kt(this.refresh.bind(this), qt);
1299
+ }
1300
+ return e.prototype.addObserver = function(e) {
1301
+ ~this.observers_.indexOf(e) || this.observers_.push(e), this.connected_ || this.connect_();
1302
+ }, e.prototype.removeObserver = function(e) {
1303
+ var t = this.observers_, n = t.indexOf(e);
1304
+ ~n && t.splice(n, 1), !t.length && this.connected_ && this.disconnect_();
1305
+ }, e.prototype.refresh = function() {
1306
+ this.updateObservers_() && this.refresh();
1307
+ }, e.prototype.updateObservers_ = function() {
1308
+ var e = this.observers_.filter(function(e) {
1309
+ return e.gatherActive(), e.hasActive();
1310
+ });
1311
+ return e.forEach(function(e) {
1312
+ return e.broadcastActive();
1313
+ }), e.length > 0;
1314
+ }, e.prototype.connect_ = function() {
1315
+ !Ut || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), Yt ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
1316
+ attributes: !0,
1317
+ childList: !0,
1318
+ characterData: !0,
1319
+ subtree: !0
1320
+ })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
1321
+ }, e.prototype.disconnect_ = function() {
1322
+ !Ut || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
1323
+ }, e.prototype.onTransitionEnd_ = function(e) {
1324
+ var t = e.propertyName, n = t === void 0 ? "" : t;
1325
+ Jt.some(function(e) {
1326
+ return !!~n.indexOf(e);
1327
+ }) && this.refresh();
1328
+ }, e.getInstance = function() {
1329
+ return this.instance_ ||= new e(), this.instance_;
1330
+ }, e.instance_ = null, e;
1331
+ }(), Zt = (function(e, t) {
1332
+ for (var n = 0, r = Object.keys(t); n < r.length; n++) {
1333
+ var i = r[n];
1334
+ Object.defineProperty(e, i, {
1335
+ value: t[i],
1336
+ enumerable: !1,
1337
+ writable: !1,
1338
+ configurable: !0
1339
+ });
1340
+ }
1341
+ return e;
1342
+ }), X = (function(e) {
1343
+ return e && e.ownerDocument && e.ownerDocument.defaultView || Y;
1344
+ }), Qt = ln(0, 0, 0, 0);
1345
+ function $t(e) {
1346
+ return parseFloat(e) || 0;
1347
+ }
1348
+ function en(e) {
1349
+ return [...arguments].slice(1).reduce(function(t, n) {
1350
+ var r = e["border-" + n + "-width"];
1351
+ return t + $t(r);
1352
+ }, 0);
1353
+ }
1354
+ function tn(e) {
1355
+ for (var t = [
1356
+ "top",
1357
+ "right",
1358
+ "bottom",
1359
+ "left"
1360
+ ], n = {}, r = 0, i = t; r < i.length; r++) {
1361
+ var a = i[r], o = e["padding-" + a];
1362
+ n[a] = $t(o);
1363
+ }
1364
+ return n;
1365
+ }
1366
+ function nn(e) {
1367
+ var t = e.getBBox();
1368
+ return ln(0, 0, t.width, t.height);
1369
+ }
1370
+ function rn(e) {
1371
+ var t = e.clientWidth, n = e.clientHeight;
1372
+ if (!t && !n) return Qt;
1373
+ var r = X(e).getComputedStyle(e), i = tn(r), a = i.left + i.right, o = i.top + i.bottom, s = $t(r.width), c = $t(r.height);
1374
+ if (r.boxSizing === "border-box" && (Math.round(s + a) !== t && (s -= en(r, "left", "right") + a), Math.round(c + o) !== n && (c -= en(r, "top", "bottom") + o)), !on(e)) {
1375
+ var l = Math.round(s + a) - t, u = Math.round(c + o) - n;
1376
+ Math.abs(l) !== 1 && (s -= l), Math.abs(u) !== 1 && (c -= u);
1377
+ }
1378
+ return ln(i.left, i.top, s, c);
1379
+ }
1380
+ var an = (function() {
1381
+ return typeof SVGGraphicsElement < "u" ? function(e) {
1382
+ return e instanceof X(e).SVGGraphicsElement;
1383
+ } : function(e) {
1384
+ return e instanceof X(e).SVGElement && typeof e.getBBox == "function";
1385
+ };
1386
+ })();
1387
+ function on(e) {
1388
+ return e === X(e).document.documentElement;
1389
+ }
1390
+ function sn(e) {
1391
+ return Ut ? an(e) ? nn(e) : rn(e) : Qt;
1392
+ }
1393
+ function cn(e) {
1394
+ var t = e.x, n = e.y, r = e.width, i = e.height, a = Object.create((typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object).prototype);
1395
+ return Zt(a, {
1396
+ x: t,
1397
+ y: n,
1398
+ width: r,
1399
+ height: i,
1400
+ top: n,
1401
+ right: t + r,
1402
+ bottom: i + n,
1403
+ left: t
1404
+ }), a;
1405
+ }
1406
+ function ln(e, t, n, r) {
1407
+ return {
1408
+ x: e,
1409
+ y: t,
1410
+ width: n,
1411
+ height: r
1412
+ };
1413
+ }
1414
+ var un = function() {
1415
+ function e(e) {
1416
+ this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = ln(0, 0, 0, 0), this.target = e;
1417
+ }
1418
+ return e.prototype.isActive = function() {
1419
+ var e = sn(this.target);
1420
+ return this.contentRect_ = e, e.width !== this.broadcastWidth || e.height !== this.broadcastHeight;
1421
+ }, e.prototype.broadcastRect = function() {
1422
+ var e = this.contentRect_;
1423
+ return this.broadcastWidth = e.width, this.broadcastHeight = e.height, e;
1424
+ }, e;
1425
+ }(), dn = function() {
1426
+ function e(e, t) {
1427
+ var n = cn(t);
1428
+ Zt(this, {
1429
+ target: e,
1430
+ contentRect: n
1431
+ });
1432
+ }
1433
+ return e;
1434
+ }(), fn = function() {
1435
+ function e(e, t, n) {
1436
+ if (this.activeObservations_ = [], this.observations_ = new Ht(), typeof e != "function") throw TypeError("The callback provided as parameter 1 is not a function.");
1437
+ this.callback_ = e, this.controller_ = t, this.callbackCtx_ = n;
1438
+ }
1439
+ return e.prototype.observe = function(e) {
1440
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1441
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1442
+ if (!(e instanceof X(e).Element)) throw TypeError("parameter 1 is not of type \"Element\".");
1443
+ var t = this.observations_;
1444
+ t.has(e) || (t.set(e, new un(e)), this.controller_.addObserver(this), this.controller_.refresh());
1445
+ }
1446
+ }, e.prototype.unobserve = function(e) {
1447
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1448
+ if (!(typeof Element > "u" || !(Element instanceof Object))) {
1449
+ if (!(e instanceof X(e).Element)) throw TypeError("parameter 1 is not of type \"Element\".");
1450
+ var t = this.observations_;
1451
+ t.has(e) && (t.delete(e), t.size || this.controller_.removeObserver(this));
1452
+ }
1453
+ }, e.prototype.disconnect = function() {
1454
+ this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
1455
+ }, e.prototype.gatherActive = function() {
1456
+ var e = this;
1457
+ this.clearActive(), this.observations_.forEach(function(t) {
1458
+ t.isActive() && e.activeObservations_.push(t);
1459
+ });
1460
+ }, e.prototype.broadcastActive = function() {
1461
+ if (this.hasActive()) {
1462
+ var e = this.callbackCtx_, t = this.activeObservations_.map(function(e) {
1463
+ return new dn(e.target, e.broadcastRect());
1464
+ });
1465
+ this.callback_.call(e, t, e), this.clearActive();
1466
+ }
1467
+ }, e.prototype.clearActive = function() {
1468
+ this.activeObservations_.splice(0);
1469
+ }, e.prototype.hasActive = function() {
1470
+ return this.activeObservations_.length > 0;
1471
+ }, e;
1472
+ }(), pn = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new Ht(), mn = function() {
1473
+ function e(t) {
1474
+ if (!(this instanceof e)) throw TypeError("Cannot call a class as a function.");
1475
+ if (!arguments.length) throw TypeError("1 argument required, but only 0 present.");
1476
+ var n = new fn(t, Xt.getInstance(), this);
1477
+ pn.set(this, n);
1478
+ }
1479
+ return e;
1480
+ }();
1481
+ [
1482
+ "observe",
1483
+ "unobserve",
1484
+ "disconnect"
1485
+ ].forEach(function(e) {
1486
+ mn.prototype[e] = function() {
1487
+ var t;
1488
+ return (t = pn.get(this))[e].apply(t, arguments);
1489
+ };
1490
+ });
1491
+ var hn = (function() {
1492
+ return Y.ResizeObserver === void 0 ? mn : Y.ResizeObserver;
1493
+ })(), gn = [
1494
+ "client",
1495
+ "offset",
1496
+ "scroll",
1497
+ "bounds",
1498
+ "margin"
1499
+ ];
1500
+ function _n(e) {
1501
+ var t = [];
1502
+ return gn.forEach(function(n) {
1503
+ e[n] && t.push(n);
1504
+ }), t;
1505
+ }
1506
+ function vn(e, t) {
1507
+ var n = {};
1508
+ if (t.indexOf("client") > -1 && (n.client = {
1509
+ top: e.clientTop,
1510
+ left: e.clientLeft,
1511
+ width: e.clientWidth,
1512
+ height: e.clientHeight
1513
+ }), t.indexOf("offset") > -1 && (n.offset = {
1514
+ top: e.offsetTop,
1515
+ left: e.offsetLeft,
1516
+ width: e.offsetWidth,
1517
+ height: e.offsetHeight
1518
+ }), t.indexOf("scroll") > -1 && (n.scroll = {
1519
+ top: e.scrollTop,
1520
+ left: e.scrollLeft,
1521
+ width: e.scrollWidth,
1522
+ height: e.scrollHeight
1523
+ }), t.indexOf("bounds") > -1) {
1524
+ var r = e.getBoundingClientRect();
1525
+ n.bounds = {
1526
+ top: r.top,
1527
+ right: r.right,
1528
+ bottom: r.bottom,
1529
+ left: r.left,
1530
+ width: r.width,
1531
+ height: r.height
1532
+ };
1533
+ }
1534
+ if (t.indexOf("margin") > -1) {
1535
+ var i = getComputedStyle(e);
1536
+ n.margin = {
1537
+ top: i ? parseInt(i.marginTop) : 0,
1538
+ right: i ? parseInt(i.marginRight) : 0,
1539
+ bottom: i ? parseInt(i.marginBottom) : 0,
1540
+ left: i ? parseInt(i.marginLeft) : 0
1541
+ };
1542
+ }
1543
+ return n;
1544
+ }
1545
+ function yn(e) {
1546
+ return e && e.ownerDocument && e.ownerDocument.defaultView || window;
1547
+ }
1548
+ function bn(e) {
1549
+ return function(t) {
1550
+ var n, r;
1551
+ return r = n = /*#__PURE__*/ function(n) {
1552
+ Vt(r, n);
1553
+ function r() {
1554
+ var t, r = [...arguments];
1555
+ return t = n.call.apply(n, [this].concat(r)) || this, t.state = { contentRect: {
1556
+ entry: {},
1557
+ client: {},
1558
+ offset: {},
1559
+ scroll: {},
1560
+ bounds: {},
1561
+ margin: {}
1562
+ } }, t._animationFrameID = null, t._resizeObserver = null, t._node = null, t._window = null, t.measure = function(n) {
1563
+ var r = vn(t._node, e || _n(t.props));
1564
+ n && (r.entry = n[0].contentRect), t._animationFrameID = t._window.requestAnimationFrame(function() {
1565
+ t._resizeObserver !== null && (t.setState({ contentRect: r }), typeof t.props.onResize == "function" && t.props.onResize(r));
1566
+ });
1567
+ }, t._handleRef = function(e) {
1568
+ t._resizeObserver !== null && t._node !== null && t._resizeObserver.unobserve(t._node), t._node = e, t._window = yn(t._node);
1569
+ var n = t.props.innerRef;
1570
+ n && (typeof n == "function" ? n(t._node) : n.current = t._node), t._resizeObserver !== null && t._node !== null && t._resizeObserver.observe(t._node);
1571
+ }, t;
1572
+ }
1573
+ var i = r.prototype;
1574
+ return i.componentDidMount = function() {
1575
+ this._resizeObserver = this._window !== null && this._window.ResizeObserver ? new this._window.ResizeObserver(this.measure) : new hn(this.measure), this._node !== null && (this._resizeObserver.observe(this._node), typeof this.props.onResize == "function" && this.props.onResize(vn(this._node, e || _n(this.props))));
1576
+ }, i.componentWillUnmount = function() {
1577
+ this._window !== null && this._window.cancelAnimationFrame(this._animationFrameID), this._resizeObserver !== null && (this._resizeObserver.disconnect(), this._resizeObserver = null);
1578
+ }, i.render = function() {
1579
+ var e = this.props;
1580
+ return e.innerRef, e.onResize, ve(t, Rt({}, zt(e, ["innerRef", "onResize"]), {
1581
+ measureRef: this._handleRef,
1582
+ measure: this.measure,
1583
+ contentRect: this.state.contentRect
1584
+ }));
1585
+ }, r;
1586
+ }(_e), n.propTypes = {
1587
+ client: G.default.bool,
1588
+ offset: G.default.bool,
1589
+ scroll: G.default.bool,
1590
+ bounds: G.default.bool,
1591
+ margin: G.default.bool,
1592
+ innerRef: G.default.oneOfType([G.default.object, G.default.func]),
1593
+ onResize: G.default.func
1594
+ }, r;
1595
+ };
1596
+ }
1597
+ var xn = bn()(function(e) {
1598
+ var t = e.measure, n = e.measureRef, r = e.contentRect, i = e.children;
1599
+ return i({
1600
+ measure: t,
1601
+ measureRef: n,
1602
+ contentRect: r
1603
+ });
1604
+ });
1605
+ xn.displayName = "Measure", xn.propTypes.children = G.default.func;
1606
+ //#endregion
1607
+ //#region ../../lib-react/config-ui/dist/layout/settings-box.js
1608
+ var Sn = _("div")(() => ({
1609
+ backgroundColor: T.white(),
1610
+ border: `2px solid ${T.border()}`,
1611
+ display: "flex",
1612
+ flexDirection: "column",
1613
+ justifyContent: "flex-start",
1614
+ minWidth: "275px",
1615
+ maxWidth: "300px",
1616
+ padding: "20px 4px 4px 20px",
1617
+ zIndex: 99
1618
+ })), Cn = class extends z.Component {
1619
+ static propTypes = {
1620
+ className: G.default.string,
1621
+ children: G.default.oneOfType([G.default.arrayOf(G.default.node), G.default.node]).isRequired
1622
+ };
1623
+ static defaultProps = {};
1624
+ render() {
1625
+ let { className: e, children: t } = this.props;
1626
+ return /* @__PURE__ */ B(Sn, {
1627
+ className: e,
1628
+ children: t
1629
+ });
1630
+ }
1631
+ }, wn = g({
1632
+ typography: { fontFamily: "inherit" },
1633
+ components: { MuiButton: { styleOverrides: { contained: {
1634
+ backgroundColor: "#e0e0e0",
1635
+ color: "#000000",
1636
+ "&:hover": { backgroundColor: "#bdbdbd" }
1637
+ } } } }
1638
+ }), Tn = class extends z.Component {
1639
+ static propTypes = {
1640
+ children: G.default.oneOfType([
1641
+ G.default.string,
1642
+ G.default.arrayOf(G.default.element),
1643
+ G.default.element
1644
+ ]),
1645
+ className: G.default.string,
1646
+ dimensions: G.default.object,
1647
+ settings: G.default.element,
1648
+ sidePanelMinWidth: G.default.number,
1649
+ hideSettings: G.default.bool,
1650
+ extraCSSRules: G.default.shape({
1651
+ names: G.default.arrayOf(G.default.string),
1652
+ rules: G.default.string
1653
+ })
1654
+ };
1655
+ static defaultProps = {
1656
+ sidePanelMinWidth: 1135,
1657
+ hideSettings: !1,
1658
+ dimensions: {}
1659
+ };
1660
+ constructor(...e) {
1661
+ super(...e), this.state = { layoutMode: void 0 };
1662
+ }
1663
+ onResize = (e) => {
1664
+ let { bounds: t } = e, { sidePanelMinWidth: n, dimensions: r } = this.props, { maxWidth: i } = r || {}, a = t.width > n && (!i || i > n) ? "inline" : "tabbed";
1665
+ a !== this.state.layoutMode && this.setState({ layoutMode: a });
1666
+ };
1667
+ render() {
1668
+ return /* @__PURE__ */ B(te, {
1669
+ injectFirst: !0,
1670
+ children: /* @__PURE__ */ B(p, {
1671
+ theme: wn,
1672
+ children: /* @__PURE__ */ B(xn, {
1673
+ bounds: !0,
1674
+ onResize: this.onResize,
1675
+ children: ({ measureRef: e }) => {
1676
+ let { children: t, settings: n, hideSettings: r, dimensions: i, extraCSSRules: a } = this.props, { layoutMode: o } = this.state, s = r ? null : o === "inline" ? /* @__PURE__ */ B(Cn, {
1677
+ className: "settings-box",
1678
+ children: n
1679
+ }) : n;
1680
+ return /* @__PURE__ */ V("div", {
1681
+ ref: e,
1682
+ className: "main-container extraCSSRules",
1683
+ children: [a?.rules ? /* @__PURE__ */ B("style", { dangerouslySetInnerHTML: { __html: `.extraCSSRules { ${a.rules} }` } }) : null, /* @__PURE__ */ B(Lt, {
1684
+ mode: o,
1685
+ secondary: s,
1686
+ dimensions: i,
1687
+ children: t
1688
+ })]
1689
+ });
1690
+ }
1691
+ })
1692
+ })
1693
+ });
1694
+ }
1695
+ }, En = bn("bounds")(Tn), Dn = /* @__PURE__ */ jt({
1696
+ ConfigLayout: () => En,
1697
+ LayoutContents: () => Lt
1698
+ }), On = _("div")(() => ({
1699
+ display: "flex",
1700
+ width: "100%",
1701
+ justifyContent: "space-between"
1702
+ })), kn = _(u)(({ theme: e }) => ({
1703
+ color: "rgba(0, 0, 0, 0.89)",
1704
+ fontSize: e.typography.fontSize,
1705
+ paddingTop: e.spacing(2)
1706
+ })), An = _(rt)(({ checked: e }) => ({
1707
+ "&.Mui-checked .MuiSwitch-thumb": { color: `${T.tertiary()} !important` },
1708
+ "&.Mui-checked .MuiSwitch-track": { backgroundColor: `${T.tertiaryLight()} !important` },
1709
+ "& .MuiSwitch-track": { backgroundColor: e ? `${T.tertiaryLight()} !important` : void 0 }
1710
+ })), jn = ({ checked: e, disabled: t, label: n, toggle: r }) => /* @__PURE__ */ V(On, { children: [/* @__PURE__ */ B(kn, { children: n }), /* @__PURE__ */ B(An, {
1711
+ checked: e,
1712
+ disabled: t,
1713
+ onChange: (e) => r(e.target.checked)
1714
+ })] });
1715
+ jn.propTypes = {
1716
+ checked: G.default.bool,
1717
+ disabled: G.default.bool,
1718
+ label: G.default.string.isRequired,
1719
+ toggle: G.default.func.isRequired
1720
+ };
1721
+ //#endregion
1722
+ //#region ../../lib-react/config-ui/dist/settings/settings-radio-label.js
1723
+ var Mn = _(Ie)(({ theme: e }) => ({ "& .MuiFormControlLabel-label": {
1724
+ color: "rgba(0, 0, 0, 0.89)",
1725
+ fontSize: e.typography.fontSize - 2,
1726
+ left: "-5px",
1727
+ position: "relative"
1728
+ } })), Nn = _(A)(() => ({ color: `${T.tertiary()} !important` })), Pn = ({ label: e, value: t, checked: n, onChange: r }) => /* @__PURE__ */ B(Mn, {
1729
+ value: t,
1730
+ control: /* @__PURE__ */ B(Nn, {
1731
+ checked: n,
1732
+ onChange: r
1733
+ }),
1734
+ label: e
1735
+ });
1736
+ Pn.propTypes = {
1737
+ label: G.default.string,
1738
+ value: G.default.string,
1739
+ checked: G.default.bool,
1740
+ onChange: G.default.func
1741
+ };
1742
+ //#endregion
1743
+ //#region ../../lib-react/config-ui/dist/settings/panel.js
1744
+ var Fn = (0, W.default)("pie-lib:config-ui:settings:panel"), In = {
1745
+ label: G.default.string,
1746
+ value: G.default.string
1747
+ }, Z = {
1748
+ label: G.default.string,
1749
+ value: G.default.string,
1750
+ onChange: G.default.func
1751
+ }, Ln = ({ label: e, value: t, onChange: n }) => /* @__PURE__ */ B(dt, {
1752
+ checked: t,
1753
+ label: e,
1754
+ onChange: (e) => {
1755
+ n(e.target.checked);
1756
+ }
1757
+ });
1758
+ Ln.propTypes = {
1759
+ label: G.default.string,
1760
+ value: G.default.bool,
1761
+ onChange: G.default.func
1762
+ };
1763
+ var Rn = _(Ot)(({ theme: e }) => ({
1764
+ marginTop: e.spacing(.5),
1765
+ paddingBottom: e.spacing(.5),
1766
+ width: "100%",
1767
+ "& > label": {
1768
+ color: "rgba(0, 0, 0, 0.89)",
1769
+ transform: "translate(0, 10px) scale(1)",
1770
+ fontSize: "18px",
1771
+ marginTop: e.spacing(2.5)
1772
+ },
1773
+ "& > div": { marginTop: e.spacing(2.5) }
1774
+ })), zn = ({ label: e, value: t, onChange: n, choices: r }) => /* @__PURE__ */ B(Rn, {
1775
+ direction: "horizontal",
1776
+ customLabel: Pn,
1777
+ value: t,
1778
+ header: e,
1779
+ opts: r,
1780
+ onChange: n
1781
+ });
1782
+ zn.propTypes = {
1783
+ ...Z,
1784
+ choices: G.default.arrayOf(G.default.shape(In))
1785
+ };
1786
+ var Bn = zn, Vn = _("p")(({ theme: e }) => ({
1787
+ margin: 0,
1788
+ fontSize: e.typography.fontSize
1789
+ })), Hn = _(N)(({ theme: e }) => ({
1790
+ marginTop: e.spacing(.5),
1791
+ border: "2px solid lightgrey",
1792
+ padding: `0 ${e.spacing(1)}`,
1793
+ borderRadius: "4px"
1794
+ })), Un = ({ label: e, value: t, onChange: n, choices: r = [] }) => {
1795
+ let i = (e) => typeof e == "string" ? e : e.label, a = (e) => typeof e == "string" ? e : e.value;
1796
+ return /* @__PURE__ */ V("div", { children: [e && /* @__PURE__ */ B(Vn, { children: e }), /* @__PURE__ */ B(Hn, {
1797
+ value: t || r && r[0],
1798
+ onChange: ({ target: e }) => n(e.value),
1799
+ input: /* @__PURE__ */ B(he, { id: `dropdown-${e}` }),
1800
+ disableUnderline: !0,
1801
+ MenuProps: { transitionDuration: {
1802
+ enter: 225,
1803
+ exit: 195
1804
+ } },
1805
+ children: r.map((e, t) => /* @__PURE__ */ B(re, {
1806
+ value: a(e),
1807
+ children: i(e)
1808
+ }, t))
1809
+ })] });
1810
+ };
1811
+ Un.propTypes = {
1812
+ ...Z,
1813
+ choices: G.default.arrayOf(G.default.string)
1814
+ };
1815
+ var Wn = _(I)(({ theme: e }) => ({
1816
+ marginRight: e.spacing(3),
1817
+ marginTop: e.spacing(1)
1818
+ })), Gn = ({ label: e }) => /* @__PURE__ */ B(Wn, { children: e }), Kn = _(ht)(({ theme: e }) => ({
1819
+ width: "35%",
1820
+ marginRight: e.spacing(3),
1821
+ marginTop: e.spacing(1),
1822
+ "& .MuiInputBase-root": {
1823
+ marginTop: e.spacing(.5),
1824
+ border: "2px solid lightgrey",
1825
+ borderRadius: "4px",
1826
+ padding: `0 ${e.spacing(1)}`,
1827
+ backgroundColor: "transparent"
1828
+ }
1829
+ })), qn = ({ label: e, value: t, onChange: n = () => {}, suffix: r, min: i, max: a }) => /* @__PURE__ */ B(Kn, {
1830
+ variant: "standard",
1831
+ label: e || "Label",
1832
+ value: t,
1833
+ max: a,
1834
+ min: i,
1835
+ onChange: (e, t) => n(t),
1836
+ suffix: r,
1837
+ showErrorWhenOutsideRange: !0,
1838
+ disableUnderline: !0
1839
+ });
1840
+ qn.propTypes = {
1841
+ ...Z,
1842
+ suffix: G.default.string,
1843
+ min: G.default.number,
1844
+ max: G.default.number,
1845
+ value: G.default.number
1846
+ }, Gn.propTypes = { ...Z };
1847
+ var Jn = ({ disabled: e, label: t, value: n, onChange: r }) => /* @__PURE__ */ B(jn, {
1848
+ label: t,
1849
+ checked: !!n,
1850
+ disabled: !!e,
1851
+ toggle: r
1852
+ });
1853
+ Jn.propTypes = {
1854
+ ...Z,
1855
+ value: G.default.bool
1856
+ };
1857
+ var Yn = {
1858
+ toggle: Jn,
1859
+ radio: Bn,
1860
+ dropdown: Un,
1861
+ numberField: qn,
1862
+ checkbox: Ln,
1863
+ textField: Gn
1864
+ }, Xn = _("div")(({ theme: e }) => ({ margin: `0 0 ${e.spacing(2)} 0` })), Zn = _("div")(({ theme: e }) => ({
1865
+ color: "#495B8F",
1866
+ fontSize: e.typography.fontSize + 2,
1867
+ fontWeight: 600,
1868
+ marginBottom: e.spacing(1)
1869
+ })), Qn = _("p")(({ theme: e }) => ({
1870
+ fontSize: e.typography.fontSize,
1871
+ marginBottom: 0
1872
+ })), $n = (e) => {
1873
+ let { model: t, label: n, group: r, configuration: i, onChange: a } = e, s = (e, n, r) => {
1874
+ let { isConfigProperty: s, ...c } = o(e, r || n), l = o(s ? i : t, n), u = {
1875
+ ...c,
1876
+ key: n,
1877
+ value: l
1878
+ }, d = Yn[u.type];
1879
+ return /* @__PURE__ */ B(d, {
1880
+ ...u,
1881
+ onChange: (e) => a(n, e, s)
1882
+ }, n);
1883
+ }, c = (e, t) => {
1884
+ let n = e[t];
1885
+ if (!n) return null;
1886
+ let { type: r, label: i, fields: a, choices: o } = n;
1887
+ return r === "numberFields" ? /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B(Qn, { children: i }), Object.keys(a).map((n) => s(e, `${t}.${n}`, `${t}.fields.${n}`))] }, `numberField-${i}`) : r === "checkboxes" ? /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B("p", { children: i }), Object.keys(o).map((n) => s(e, `${t}.${n}`, `${t}.choices.${n}`))] }, `checkbox-${i}`) : s(e, t);
1888
+ };
1889
+ return /* @__PURE__ */ V(Xn, { children: [/* @__PURE__ */ B(Zn, { children: n }), Object.keys(r).map((e) => c(r, e))] });
1890
+ };
1891
+ $n.propTypes = {
1892
+ model: G.default.object,
1893
+ label: G.default.string,
1894
+ group: G.default.object,
1895
+ configuration: G.default.object,
1896
+ onChange: G.default.func
1897
+ };
1898
+ var er = class extends z.Component {
1899
+ static propTypes = {
1900
+ model: G.default.object,
1901
+ configuration: G.default.object,
1902
+ groups: G.default.object,
1903
+ onChangeModel: G.default.func,
1904
+ onChangeConfiguration: G.default.func,
1905
+ modal: G.default.object
1906
+ };
1907
+ static defaultProps = {
1908
+ onChangeModel: () => {},
1909
+ onChangeConfiguration: () => {}
1910
+ };
1911
+ change = (e, t, r = !1) => {
1912
+ Fn("[changeModel]", e, t);
1913
+ let { onChangeModel: i, onChangeConfiguration: a } = this.props, o = { ...this.props.model }, s = { ...this.props.configuration };
1914
+ r ? (n(s, e, t), a(s, e)) : (n(o, e, t), i(o, e));
1915
+ };
1916
+ render() {
1917
+ let { groups: e, model: t, configuration: n, modal: r } = this.props;
1918
+ return Fn("render:", t), /* @__PURE__ */ V("div", { children: [Object.keys(e || {}).map((r) => Object.entries(e[r]).some(([, e]) => !!e) ? /* @__PURE__ */ B($n, {
1919
+ label: r,
1920
+ model: t,
1921
+ configuration: n,
1922
+ group: e[r],
1923
+ onChange: this.change
1924
+ }, r) : null), r] });
1925
+ }
1926
+ }, tr = /* @__PURE__ */ jt({
1927
+ Panel: () => er,
1928
+ checkbox: () => lr,
1929
+ checkboxes: () => ur,
1930
+ dropdown: () => or,
1931
+ numberField: () => sr,
1932
+ numberFields: () => cr,
1933
+ radio: () => ar,
1934
+ textField: () => nr,
1935
+ toggle: () => rr
1936
+ }), nr = (e, t = !0) => ({
1937
+ label: e,
1938
+ type: "textField",
1939
+ isConfigProperty: t
1940
+ }), rr = (e, t = !1, n = !1) => ({
1941
+ type: "toggle",
1942
+ label: e,
1943
+ isConfigProperty: t,
1944
+ disabled: n
1945
+ }), ir = (e) => typeof e == "string" ? {
1946
+ label: e,
1947
+ value: e
1948
+ } : e, ar = function() {
1949
+ let [e, t, n = !1] = Array.prototype.slice.call(arguments);
1950
+ return {
1951
+ type: "radio",
1952
+ label: e,
1953
+ choices: t && t.map((e) => ir(e)),
1954
+ isConfigProperty: n
1955
+ };
1956
+ }, or = (e, t, n = !1) => ({
1957
+ type: "dropdown",
1958
+ label: e,
1959
+ choices: t,
1960
+ isConfigProperty: n
1961
+ }), sr = (e, t, n = !1) => ({
1962
+ ...t,
1963
+ label: e,
1964
+ type: "numberField",
1965
+ isConfigProperty: n
1966
+ }), cr = (e, t, n = !1) => (Object.keys(t).map((e) => {
1967
+ t[e] = sr(t[e].label, t[e], n);
1968
+ }), {
1969
+ type: "numberFields",
1970
+ label: e,
1971
+ fields: t
1972
+ }), lr = (e, t, n = !1) => ({
1973
+ ...t,
1974
+ label: e,
1975
+ type: "checkbox",
1976
+ isConfigProperty: n
1977
+ }), ur = (e, t, n = !1) => (Object.keys(t).map((e) => {
1978
+ t[e] = lr(t[e].label, t[e], n);
1979
+ }), {
1980
+ type: "checkboxes",
1981
+ label: e,
1982
+ choices: t
1983
+ });
1984
+ //#endregion
1985
+ //#region ../../lib-react/config-ui/dist/index.js
1986
+ function dr(e) {
1987
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1988
+ }
1989
+ function fr(e, t) {
1990
+ return !e || dr(e) ? e : dr(e.default) ? e.default : t && dr(e[t]) ? e[t] : t && dr(e[t]?.default) ? e[t].default : e;
1991
+ }
1992
+ var pr = fr(d, "InputContainer") || fr(gr.InputContainer, "InputContainer"), mr = ge, hr = mr.default, gr = hr && typeof hr == "object" ? hr : mr;
1993
+ //#endregion
1994
+ //#region ../../lib-react/graphing-solution-set/dist/grid-setup.js
1995
+ function _r(e) {
1996
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
1997
+ }
1998
+ function vr(e, t) {
1999
+ return !e || _r(e) ? e : _r(e.default) ? e.default : t && _r(e[t]) ? e[t] : t && _r(e[t]?.default) ? e[t].default : e;
2000
+ }
2001
+ var yr = vr(d, "InputContainer") || vr(Sr.InputContainer, "InputContainer"), br = ge, xr = br.default, Sr = xr && typeof xr == "object" ? xr : br, Cr = _("div")(() => ({ width: "450px" })), wr = _("div")(() => ({
2002
+ display: "flex",
2003
+ flexDirection: "column",
2004
+ width: "100%"
2005
+ })), Tr = _("div")(() => ({
2006
+ display: "flex",
2007
+ flexDirection: "column",
2008
+ alignItems: "center"
2009
+ })), Er = _("div")(() => ({
2010
+ display: "flex",
2011
+ justifyContent: "space-around",
2012
+ alignItems: "center"
2013
+ })), Dr = _("div")(({ theme: e }) => ({
2014
+ width: "130px",
2015
+ margin: `${e.spacing(1)} ${e.spacing(.5)}`
2016
+ })), Q = _("div")(({ theme: e }) => ({
2017
+ width: "160px",
2018
+ margin: `${e.spacing(1)} ${e.spacing(.5)}`,
2019
+ "& .MuiFormControl-root": { width: "100%" }
2020
+ })), Or = _("div")(({ theme: e }) => ({
2021
+ width: "230px",
2022
+ margin: `${e.spacing(1)} ${e.spacing(.5)}`,
2023
+ "& .MuiFormControl-root": { width: "100%" }
2024
+ })), kr = _(I)(({ theme: e }) => ({
2025
+ fontStyle: "italic",
2026
+ margin: `${e.spacing(1)} 0`
2027
+ })), Ar = _("div")(() => ({
2028
+ display: "flex",
2029
+ justifyContent: "space-between",
2030
+ alignItems: "center"
2031
+ })), jr = _(I)(() => ({ color: T.disabled() })), Mr = _("div")(({ theme: e }) => ({ paddingTop: e.spacing(2) })), Nr = (e) => {
2032
+ let { disabled: t, displayedFields: n, labelValue: r, labelValues: i, gridValue: a, gridValues: o, onChange: s } = e, { labelStep: c = {}, step: l = {} } = n;
2033
+ return /* @__PURE__ */ V(Tr, { children: [l && l.enabled && /* @__PURE__ */ B(Q, { children: /* @__PURE__ */ B(q, {
2034
+ label: l.label || "",
2035
+ value: a,
2036
+ customValues: o,
2037
+ variant: "outlined",
2038
+ disabled: t,
2039
+ onChange: (e, t) => s("step", t)
2040
+ }) }), c && c.enabled && /* @__PURE__ */ B(Q, { children: /* @__PURE__ */ B(q, {
2041
+ label: c.label || "",
2042
+ value: r,
2043
+ customValues: i,
2044
+ variant: "outlined",
2045
+ disabled: t,
2046
+ onChange: (e, t) => s("labelStep", t)
2047
+ }) })] });
2048
+ };
2049
+ Nr.propTypes = {
2050
+ disabled: G.default.bool,
2051
+ displayedFields: G.default.object,
2052
+ labelValue: G.default.number,
2053
+ labelValues: G.default.array,
2054
+ gridValue: G.default.number,
2055
+ gridValues: G.default.array,
2056
+ onChange: G.default.func
2057
+ };
2058
+ var Pr = (e) => {
2059
+ let { disabled: t, displayedFields: n, displayHeader: r, label: i, maxValue: a, minValue: o, onChange: s, type: c } = e, { axisLabel: l = {}, min: u = {}, max: d = {} } = n;
2060
+ return /* @__PURE__ */ V(Tr, { children: [
2061
+ r && /* @__PURE__ */ V(I, {
2062
+ variant: "subtitle2",
2063
+ children: [/* @__PURE__ */ B("i", { children: c === "domain" ? "x" : "y" }), "-axis"]
2064
+ }),
2065
+ u && u.enabled && /* @__PURE__ */ B(Q, { children: /* @__PURE__ */ B(q, {
2066
+ label: u.label || "",
2067
+ value: o,
2068
+ min: -1e4,
2069
+ max: a - .05,
2070
+ variant: "outlined",
2071
+ disabled: t,
2072
+ onChange: (e, t) => s("min", t)
2073
+ }) }),
2074
+ d && d.enabled && /* @__PURE__ */ B(Q, { children: /* @__PURE__ */ B(q, {
2075
+ label: d.label || "",
2076
+ value: a,
2077
+ min: o + .05,
2078
+ max: 1e4,
2079
+ variant: "outlined",
2080
+ disabled: t,
2081
+ onChange: (e, t) => s("max", t)
2082
+ }) }),
2083
+ l && l.enabled && /* @__PURE__ */ B(Q, { children: /* @__PURE__ */ B(yr, {
2084
+ label: l.label || "",
2085
+ children: /* @__PURE__ */ B(Mr, { children: /* @__PURE__ */ B(M, {
2086
+ onChange: (e) => s("axisLabel", e),
2087
+ markup: i || "",
2088
+ charactersLimit: 5,
2089
+ onKeyDown: (e) => e.key === "Enter",
2090
+ activePlugins: [
2091
+ "bold",
2092
+ "italic",
2093
+ "underline",
2094
+ "strikethrough"
2095
+ ]
2096
+ }) })
2097
+ }) })
2098
+ ] });
2099
+ };
2100
+ Pr.propTypes = {
2101
+ disabled: G.default.bool,
2102
+ displayedFields: G.default.object,
2103
+ displayHeader: G.default.bool,
2104
+ label: G.default.string,
2105
+ maxValue: G.default.number,
2106
+ minValue: G.default.number,
2107
+ type: G.default.string,
2108
+ onChange: G.default.func
2109
+ };
2110
+ var Fr = (e) => {
2111
+ let { domain: t, displayedFields: n = {}, gridValues: r = {}, includeAxes: i, labelValues: a = {}, onChange: o, onChangeView: s, range: c, size: l, sizeConstraints: u, standardGrid: d } = e, f = {
2112
+ min: 2,
2113
+ max: 41
2114
+ }, { axisLabel: p = {}, dimensionsEnabled: m, includeAxesEnabled: h, labelStep: g = {}, min: _ = {}, max: v = {}, standardGridEnabled: y, step: b = {} } = n || {}, x = _.enabled || v.enabled || p.enabled || b.enabled || g.enabled, S = {
2115
+ step: b,
2116
+ labelStep: g
2117
+ }, C = {
2118
+ min: _,
2119
+ max: v,
2120
+ axisLabel: p
2121
+ }, w = (e) => {
2122
+ let n = (e) => {
2123
+ let n = e === "domain" ? t : c;
2124
+ return {
2125
+ min: 1,
2126
+ max: n.max < f.min || n.max > f.max ? 16 : n.max,
2127
+ step: 1,
2128
+ labelStep: 0
2129
+ };
2130
+ }, r = {
2131
+ ...c,
2132
+ ...e ? { labelStep: 1 } : n("range")
2133
+ }, i = {
2134
+ ...t,
2135
+ ...e ? { labelStep: 1 } : n("domain")
2136
+ };
2137
+ o({
2138
+ includeAxes: e,
2139
+ range: r,
2140
+ domain: i
2141
+ });
2142
+ }, T = (e) => {
2143
+ o({
2144
+ standardGrid: e,
2145
+ range: {
2146
+ ...t,
2147
+ axisLabel: c.axisLabel
2148
+ },
2149
+ graph: {
2150
+ ...l,
2151
+ height: l.width
2152
+ }
2153
+ });
2154
+ }, E = (e, t) => {
2155
+ let n = {
2156
+ ...l,
2157
+ [e]: t
2158
+ };
2159
+ d && (n.height = t), o({ graph: n });
2160
+ }, D = (e, n) => {
2161
+ t[e] = n, d && e !== "axisLabel" && (c[e] = n), o({
2162
+ domain: t,
2163
+ range: c
2164
+ });
2165
+ }, O = (e, t) => {
2166
+ c[e] = t, o({ range: c });
2167
+ }, k = /* @__PURE__ */ V(be, { children: [
2168
+ /* @__PURE__ */ V(Er, { children: [/* @__PURE__ */ B(Pr, {
2169
+ displayedFields: C,
2170
+ displayHeader: x,
2171
+ type: "domain",
2172
+ minValue: t.min,
2173
+ maxValue: t.max,
2174
+ label: t.axisLabel,
2175
+ includeAxes: i,
2176
+ onChange: D
2177
+ }), /* @__PURE__ */ B(Pr, {
2178
+ displayedFields: C,
2179
+ displayHeader: x,
2180
+ type: "range",
2181
+ minValue: c.min,
2182
+ maxValue: c.max,
2183
+ label: c.axisLabel,
2184
+ disabled: d,
2185
+ includeAxes: i,
2186
+ onChange: O
2187
+ })] }),
2188
+ (_.enabled || v.enabled) && /* @__PURE__ */ B(kr, { children: "If you want the axis to be visible, use a zero or negative Min Value, and a positive Max Value" }),
2189
+ (b.enabled || g.enabled) && /* @__PURE__ */ V(Er, { children: [/* @__PURE__ */ B(Nr, {
2190
+ displayedFields: S,
2191
+ gridValue: t.step,
2192
+ labelValue: t.labelStep,
2193
+ gridValues: r.domain || [],
2194
+ labelValues: a.domain || [],
2195
+ onChange: D
2196
+ }), /* @__PURE__ */ B(Nr, {
2197
+ disabled: d,
2198
+ displayedFields: S,
2199
+ gridValue: c.step,
2200
+ labelValue: c.labelStep,
2201
+ gridValues: r.range || [],
2202
+ labelValues: a.range || [],
2203
+ onChange: O
2204
+ })] }),
2205
+ g.enabled && /* @__PURE__ */ B(kr, { children: "For unnumbered gridlines, enter a label interval of 0" })
2206
+ ] }), A = v.enabled ? /* @__PURE__ */ V(Tr, { children: [/* @__PURE__ */ B(Or, { children: /* @__PURE__ */ B(q, {
2207
+ label: "Number of Vertical Gridlines",
2208
+ value: t.max,
2209
+ min: !i && f.min,
2210
+ max: !i && f.max,
2211
+ variant: "outlined",
2212
+ onChange: (e, t) => D("max", t)
2213
+ }) }), /* @__PURE__ */ B(Or, { children: /* @__PURE__ */ B(q, {
2214
+ label: "Number of Horizontal Gridlines",
2215
+ value: c.max,
2216
+ min: !i && f.min,
2217
+ max: !i && f.max,
2218
+ variant: "outlined",
2219
+ disabled: d,
2220
+ onChange: (e, t) => O("max", t)
2221
+ }) })] }) : null;
2222
+ return /* @__PURE__ */ B(Cr, { children: /* @__PURE__ */ V(me, {
2223
+ onChange: s,
2224
+ TransitionProps: { timeout: {
2225
+ enter: 225,
2226
+ exit: 195
2227
+ } },
2228
+ children: [/* @__PURE__ */ B(j, {
2229
+ expandIcon: /* @__PURE__ */ B(ue, {}),
2230
+ children: /* @__PURE__ */ B(I, {
2231
+ variant: "subtitle1",
2232
+ children: "Customize Grid Setup"
2233
+ })
2234
+ }), /* @__PURE__ */ B(P, { children: /* @__PURE__ */ V(wr, { children: [
2235
+ h && /* @__PURE__ */ B(jn, {
2236
+ label: "Include axes and labels?",
2237
+ toggle: w,
2238
+ checked: i
2239
+ }),
2240
+ y && /* @__PURE__ */ B(jn, {
2241
+ label: "Constrain to standard coordinate grid?",
2242
+ toggle: T,
2243
+ checked: d
2244
+ }),
2245
+ i ? k : A,
2246
+ m && /* @__PURE__ */ V(Ar, { children: [
2247
+ /* @__PURE__ */ V("div", { children: [/* @__PURE__ */ B(I, { children: "Dimensions(px)" }), /* @__PURE__ */ V(jr, { children: [
2248
+ "Min ",
2249
+ u.min,
2250
+ ", Max ",
2251
+ u.max
2252
+ ] })] }),
2253
+ /* @__PURE__ */ B(Dr, { children: /* @__PURE__ */ B(q, {
2254
+ label: "Width",
2255
+ value: l.width,
2256
+ min: u.min,
2257
+ max: u.max,
2258
+ step: u.step,
2259
+ variant: "outlined",
2260
+ onChange: (e, t) => E("width", t)
2261
+ }) }),
2262
+ /* @__PURE__ */ B(Dr, { children: /* @__PURE__ */ B(q, {
2263
+ label: "Height",
2264
+ value: l.height,
2265
+ min: u.min,
2266
+ max: u.max,
2267
+ step: u.step,
2268
+ variant: "outlined",
2269
+ disabled: d,
2270
+ onChange: (e, t) => E("height", t)
2271
+ }) })
2272
+ ] })
2273
+ ] }) })]
2274
+ }) });
2275
+ };
2276
+ Fr.propTypes = {
2277
+ domain: G.default.object,
2278
+ displayedFields: G.default.object,
2279
+ gridValues: G.default.object,
2280
+ includeAxes: G.default.bool,
2281
+ labelValues: G.default.object,
2282
+ onChange: G.default.func,
2283
+ onChangeView: G.default.func,
2284
+ range: G.default.object,
2285
+ size: G.default.object,
2286
+ sizeConstraints: G.default.object,
2287
+ standardGrid: G.default.bool
2288
+ };
2289
+ //#endregion
2290
+ //#region src/author/utils.ts
2291
+ var Ir = [
2292
+ .01,
2293
+ .02,
2294
+ .04,
2295
+ .05,
2296
+ .0625,
2297
+ .1,
2298
+ .125,
2299
+ .2,
2300
+ .25,
2301
+ .5,
2302
+ 1,
2303
+ 2,
2304
+ 3,
2305
+ 4,
2306
+ 5,
2307
+ 8,
2308
+ 10,
2309
+ 12,
2310
+ 15,
2311
+ 20,
2312
+ 40,
2313
+ 50,
2314
+ 64,
2315
+ 100,
2316
+ 500,
2317
+ 1e3
2318
+ ], Lr = [
2319
+ .01,
2320
+ .02,
2321
+ .05,
2322
+ .1,
2323
+ .2,
2324
+ .25,
2325
+ .5,
2326
+ 1,
2327
+ 2,
2328
+ 5,
2329
+ 10,
2330
+ 20,
2331
+ 50,
2332
+ 100,
2333
+ 500,
2334
+ 1e3
2335
+ ], Rr = {
2336
+ .01: [
2337
+ 0,
2338
+ .01,
2339
+ .02,
2340
+ .04,
2341
+ .05,
2342
+ .1
2343
+ ],
2344
+ .02: [
2345
+ 0,
2346
+ .02,
2347
+ .04,
2348
+ .1
2349
+ ],
2350
+ .04: [
2351
+ 0,
2352
+ .04,
2353
+ .08,
2354
+ .16,
2355
+ .2
2356
+ ],
2357
+ .05: [
2358
+ 0,
2359
+ .05,
2360
+ .1,
2361
+ .2,
2362
+ .25
2363
+ ],
2364
+ .0625: [
2365
+ 0,
2366
+ .0625,
2367
+ .125,
2368
+ .25,
2369
+ .5
2370
+ ],
2371
+ .1: [
2372
+ 0,
2373
+ .1,
2374
+ .2,
2375
+ .4,
2376
+ .5,
2377
+ 1
2378
+ ],
2379
+ .125: [
2380
+ 0,
2381
+ .125,
2382
+ .25,
2383
+ .5,
2384
+ 1
2385
+ ],
2386
+ .2: [
2387
+ 0,
2388
+ .2,
2389
+ .5,
2390
+ .1
2391
+ ],
2392
+ .25: [
2393
+ 0,
2394
+ .25,
2395
+ .5,
2396
+ 1,
2397
+ 2
2398
+ ],
2399
+ .5: [
2400
+ 0,
2401
+ .5,
2402
+ 1,
2403
+ 2
2404
+ ],
2405
+ 1: [
2406
+ 0,
2407
+ 1,
2408
+ 2,
2409
+ 4,
2410
+ 5,
2411
+ 10
2412
+ ],
2413
+ 2: [
2414
+ 0,
2415
+ 2,
2416
+ 4,
2417
+ 8,
2418
+ 10
2419
+ ],
2420
+ 3: [
2421
+ 0,
2422
+ 3,
2423
+ 6,
2424
+ 12,
2425
+ 15
2426
+ ],
2427
+ 4: [
2428
+ 0,
2429
+ 4,
2430
+ 8,
2431
+ 16,
2432
+ 20
2433
+ ],
2434
+ 5: [
2435
+ 0,
2436
+ 5,
2437
+ 10,
2438
+ 20,
2439
+ 25
2440
+ ],
2441
+ 8: [
2442
+ 0,
2443
+ 8,
2444
+ 16,
2445
+ 32,
2446
+ 40,
2447
+ 64
2448
+ ],
2449
+ 10: [
2450
+ 0,
2451
+ 10,
2452
+ 20,
2453
+ 40,
2454
+ 50,
2455
+ 100
2456
+ ],
2457
+ 12: [
2458
+ 0,
2459
+ 12,
2460
+ 24
2461
+ ],
2462
+ 15: [
2463
+ 0,
2464
+ 15,
2465
+ 30,
2466
+ 60
2467
+ ],
2468
+ 20: [
2469
+ 0,
2470
+ 20,
2471
+ 40,
2472
+ 80,
2473
+ 100
2474
+ ],
2475
+ 40: [
2476
+ 0,
2477
+ 40,
2478
+ 80,
2479
+ 160,
2480
+ 200
2481
+ ],
2482
+ 50: [
2483
+ 0,
2484
+ 50,
2485
+ 100,
2486
+ 200,
2487
+ 250
2488
+ ],
2489
+ 64: [
2490
+ 0,
2491
+ 64,
2492
+ 128
2493
+ ],
2494
+ 100: [
2495
+ 0,
2496
+ 100,
2497
+ 200,
2498
+ 400,
2499
+ 500
2500
+ ],
2501
+ 500: [
2502
+ 0,
2503
+ 500,
2504
+ 1e3,
2505
+ 2500
2506
+ ],
2507
+ 1e3: [
2508
+ 0,
2509
+ 1e3,
2510
+ 2e3,
2511
+ 4e3,
2512
+ 5e3
2513
+ ]
2514
+ }, zr = (e, t, n = !1) => {
2515
+ let r = 10 * (e.max - e.min) / t, i = r * 10;
2516
+ return (n ? Lr : Ir).filter((e) => e >= r && e <= i);
2517
+ }, Br = (e) => Rr[e] || [], Vr = (e, t, n, i) => {
2518
+ let a = zr(e, t), o = Br(e.step);
2519
+ if (!r(n, a) && !a.includes(e.step)) {
2520
+ let n = zr(e, t, !0)[0] || 1;
2521
+ return e.step = n, o = Br(n), o.includes(e.labelStep) || (e.labelStep = n), {
2522
+ gridValues: a,
2523
+ labelValues: o
2524
+ };
2525
+ }
2526
+ return !r(i, o) && !o.includes(e.labelStep) && (e.labelStep = e.step), {
2527
+ gridValues: a,
2528
+ labelValues: o
2529
+ };
2530
+ }, Hr = (e) => {
2531
+ let t = [], n = 0;
2532
+ for (; n >= e.min && t.indexOf(n) < 0;) t.push(n), n = Math.round((n - e.step) * 1e4) / 1e4;
2533
+ for (n = Math.round(e.step * 1e4) / 1e4; n <= e.max && t.indexOf(n) < 0;) t.push(n), n = Math.round((n + e.step) * 1e4) / 1e4;
2534
+ return t ? t.filter((t) => t >= e.min && t <= e.max) : [];
2535
+ }, Ur = (e, t, n) => {
2536
+ let r = Hr(e), i = Hr(t), a = (e, t) => r.includes(e) && i.includes(t);
2537
+ return Object.entries(n || {}).reduce((e, [t, n]) => (e[t] = {
2538
+ ...n,
2539
+ marks: (n.marks || []).filter((e) => {
2540
+ if (e.type === "point") return a(e.x, e.y);
2541
+ if (e.type === "polygon") return !e.points.find((e) => !a(e.x, e.y));
2542
+ let t = e.from || e.root, n = e.to || e.edge;
2543
+ return e.building ? a(t.x, t.y) : a(t.x, t.y) && a(n.x, n.y);
2544
+ })
2545
+ }, e), {});
2546
+ }, Wr = (e, t) => Number(Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2).toFixed(3)), Gr = (e, t) => {
2547
+ let n = e, r = !1, i = [...t];
2548
+ i.push(t[0]);
2549
+ for (let e = 0; e < i.length - 1; e++) {
2550
+ let t = i[e], a = i[e + 1];
2551
+ if (Wr(t, n) + Wr(n, a) === Wr(t, a)) {
2552
+ r = !0;
2553
+ break;
2554
+ }
2555
+ }
2556
+ return r;
2557
+ }, Kr = (e, t, n, r, i, a, o, s) => {
2558
+ let c, l = (s - a) * (n - e) - (o - i) * (r - t);
2559
+ return l === 0 ? null : (c = ((o - i) * (t - a) - (s - a) * (e - i)) / l, {
2560
+ x: Number((e + c * (n - e)).toFixed(3)),
2561
+ y: Number((t + c * (r - t)).toFixed(3))
2562
+ });
2563
+ }, qr = (e, t, n) => e.x > t.min && e.x < t.max && e.y > n.min && e.y < n.max, Jr = (e, t, n) => e.x >= t.min && e.x <= t.max && e.y >= n.min && e.y <= n.max, Yr = (e, t, n) => {
2564
+ let r = [], i = [
2565
+ [
2566
+ t.max,
2567
+ n.max,
2568
+ t.max,
2569
+ n.min
2570
+ ],
2571
+ [
2572
+ t.min,
2573
+ n.max,
2574
+ t.min,
2575
+ n.min
2576
+ ],
2577
+ [
2578
+ t.min,
2579
+ n.max,
2580
+ t.max,
2581
+ n.max
2582
+ ],
2583
+ [
2584
+ t.min,
2585
+ n.min,
2586
+ t.max,
2587
+ n.min
2588
+ ]
2589
+ ];
2590
+ for (let a = 0; a < i.length; a++) {
2591
+ let o = Kr(e.from.x, e.from.y, e.to.x, e.to.y, i[a][0], i[a][1], i[a][2], i[a][3]);
2592
+ o && Jr(o, t, n) && r.push(o);
2593
+ }
2594
+ return r;
2595
+ }, Xr = (e) => {
2596
+ e.sort((e, t) => e.y - t.y);
2597
+ let t = (e[0].y + e[e.length - 1].y) / 2;
2598
+ e.sort((e, t) => t.x - e.x);
2599
+ let n = {
2600
+ x: (e[0].x + e[e.length - 1].x) / 2,
2601
+ y: t
2602
+ }, r;
2603
+ e.forEach((e) => {
2604
+ let t = Math.atan2(e.y - n.y, e.x - n.x);
2605
+ r ? t < r && (t += Math.PI * 2) : r = t, e.angle = t;
2606
+ }), e.sort((e, t) => e.angle - t.angle);
2607
+ let i = e.reverse();
2608
+ return i.unshift(i.pop()), i.map(({ angle: e, ...t }) => t);
2609
+ }, Zr = (e, t) => e.x * t.x + e.y * t.y, Qr = (e) => Math.sqrt(e.x * e.x + e.y * e.y), $r = (e, t) => {
2610
+ let n = Zr(e, t), r = Qr(e), i = Qr(t);
2611
+ return Math.acos(n / (r * i));
2612
+ }, ei = (e, t, n, r) => {
2613
+ let i = {
2614
+ x: t.x - e.x,
2615
+ y: t.y - e.y
2616
+ }, a = {
2617
+ x: n.x - e.x,
2618
+ y: n.y - e.y
2619
+ }, o = {
2620
+ x: r.x - e.x,
2621
+ y: r.y - e.y
2622
+ }, s = $r(i, o) + $r(a, o);
2623
+ return Math.abs(s - $r(i, a)) < 1e-4;
2624
+ }, ti = (e) => e.filter((t, n) => n === e.findIndex((e) => t.x === e.x && t.y === e.y)), ni = (e) => {
2625
+ for (let t = 0; t < e.length; t++) e[t] = e[t].filter((n, r) => r === e[t].findIndex((e) => n.x === e.x && n.y === e.y));
2626
+ e = e.filter((e) => e.length > 2);
2627
+ for (let t = 0; t < e.length; t++) e[t] = Xr(e[t]);
2628
+ return e;
2629
+ }, ri = (e, t, n) => {
2630
+ let r = [];
2631
+ return r.push([].concat(e)), r.push([].concat(e)), e[0].x === t.max && e[1].y === n.max || e[1].x === t.max && e[0].y === n.max ? (r[0].push({
2632
+ x: t.max,
2633
+ y: n.max
2634
+ }), r[1].push({
2635
+ x: t.min,
2636
+ y: n.max
2637
+ }, {
2638
+ x: t.min,
2639
+ y: n.min
2640
+ }, {
2641
+ x: t.max,
2642
+ y: n.min
2643
+ })) : e[0].x === t.min && e[1].y === n.max || e[1].x === t.min && e[0].y === n.max ? (r[0].push({
2644
+ x: t.min,
2645
+ y: n.max
2646
+ }), r[1].push({
2647
+ x: t.max,
2648
+ y: n.max
2649
+ }, {
2650
+ x: t.max,
2651
+ y: n.min
2652
+ }, {
2653
+ x: t.min,
2654
+ y: n.min
2655
+ })) : e[0].x === t.min && e[1].y === n.min || e[1].x === t.min && e[0].y === n.min ? (r[0].push({
2656
+ x: t.min,
2657
+ y: n.min
2658
+ }), r[1].push({
2659
+ x: t.max,
2660
+ y: n.min
2661
+ }, {
2662
+ x: t.max,
2663
+ y: n.max
2664
+ }, {
2665
+ x: t.min,
2666
+ y: n.max
2667
+ })) : e[0].x === t.max && e[1].y === n.min || e[1].x === t.max && e[0].y === n.min ? (r[0].push({
2668
+ x: t.max,
2669
+ y: n.min
2670
+ }), r[1].push({
2671
+ x: t.min,
2672
+ y: n.min
2673
+ }, {
2674
+ x: t.min,
2675
+ y: n.max
2676
+ }, {
2677
+ x: t.max,
2678
+ y: n.max
2679
+ })) : e[0].x === t.min && e[1].x === t.max || e[0].x === t.max && e[1].x === t.min ? (r[0].push({
2680
+ x: t.min,
2681
+ y: n.max
2682
+ }, {
2683
+ x: t.max,
2684
+ y: n.max
2685
+ }), r[1].push({
2686
+ x: t.min,
2687
+ y: n.min
2688
+ }, {
2689
+ x: t.max,
2690
+ y: n.min
2691
+ })) : (e[0].y === n.min && e[1].y === n.max || e[0].y === n.max && e[1].y === n.min) && (r[0].push({
2692
+ x: t.min,
2693
+ y: n.min
2694
+ }, {
2695
+ x: t.min,
2696
+ y: n.max
2697
+ }), r[1].push({
2698
+ x: t.max,
2699
+ y: n.min
2700
+ }, {
2701
+ x: t.max,
2702
+ y: n.max
2703
+ })), ni(r);
2704
+ }, ii = (e, t, n, r) => {
2705
+ let i = t[0], a = t[1], o = [
2706
+ {
2707
+ x: n.min,
2708
+ y: r.min
2709
+ },
2710
+ {
2711
+ x: n.min,
2712
+ y: r.max
2713
+ },
2714
+ {
2715
+ x: n.max,
2716
+ y: r.min
2717
+ },
2718
+ {
2719
+ x: n.max,
2720
+ y: r.max
2721
+ }
2722
+ ], s = Kr(i.from.x, i.from.y, i.to.x, i.to.y, a.from.x, a.from.y, a.to.x, a.to.y), c = [], l = Yr(i, n, r);
2723
+ l = ti(l);
2724
+ let u = Yr(a, n, r);
2725
+ if (u = ti(u), s && qr(s, n, r)) for (let e = 0; e < l.length; e++) for (let t = 0; t < u.length; t++) {
2726
+ let n = [], r = [];
2727
+ n.push(s), n.push(l[e]), n.push(u[t]);
2728
+ for (let i = 0; i < o.length; i++) ei(s, l[e], u[t], o[i]) ? n.push(o[i]) : r.push(o[i]);
2729
+ o = r, c.push(n);
2730
+ }
2731
+ else {
2732
+ let e = ri(l, n, r), t = ri(u, n, r);
2733
+ for (let t = 0; t < e.length; t++) Gr(u[0], e[t]) && Gr(u[1], e[t]) || c.push(e[t]);
2734
+ for (let e = 0; e < t.length; e++) Gr(l[0], t[e]) && Gr(l[1], t[e]) || c.push(t[e]);
2735
+ for (let e = 0; e < c.length; e++) o = o.filter(function(t) {
2736
+ return !c[e].some(function(e) {
2737
+ return t.x === e.x && t.y === e.y;
2738
+ });
2739
+ });
2740
+ let i = o.concat(l, u);
2741
+ c.push(i);
2742
+ }
2743
+ return ni(c);
2744
+ }, ai = (e, t, n, r) => (e.numberOfLines === 1 ? e.sections = ri(Yr(t[0], n, r), n, r) : e.sections = ii(e, t, n, r), e), oi = (e, t) => {
2745
+ let n = t.length, r = e.x, i = e.y, a = !1, o = t[0], s;
2746
+ for (let e = 1; e <= n; e++) {
2747
+ if (s = t[e % n], i > Math.min(o.y, s.y) && i <= Math.max(o.y, s.y) && r <= Math.max(o.x, s.x)) {
2748
+ let e = (i - o.y) * (s.x - o.x) / (s.y - o.y) + o.x;
2749
+ (o.x === s.x || r <= e) && (a = !a);
2750
+ }
2751
+ o = s;
2752
+ }
2753
+ return a;
2754
+ }, si = (e, t) => {
2755
+ if (t.length === 0) return !1;
2756
+ if (e.numberOfLines === 1) {
2757
+ if (t.length === 1) return !t[0].building;
2758
+ } else if (t.length !== 2) return !1;
2759
+ else return !t[1].building;
2760
+ }, ci = _("div")(({ theme: e }) => ({
2761
+ display: "flex",
2762
+ flexWrap: "wrap",
2763
+ marginBottom: e.spacing(2.5)
2764
+ })), li = _("div")(({ theme: e }) => ({
2765
+ display: "flex",
2766
+ flexDirection: "column",
2767
+ marginRight: e.spacing(3),
2768
+ marginBottom: e.spacing(2.5)
2769
+ })), ui = _("div")({
2770
+ display: "flex",
2771
+ flexDirection: "column"
2772
+ }), di = _(I)(({ theme: e }) => ({
2773
+ marginTop: e.spacing(1.5),
2774
+ marginBottom: e.spacing(1)
2775
+ })), fi = _("div")(({ theme: e }) => ({
2776
+ display: "flex",
2777
+ flexWrap: "wrap",
2778
+ alignItems: "center",
2779
+ width: "100%",
2780
+ marginBottom: e.spacing(2.5)
2781
+ })), pi = _(I)(({ theme: e }) => ({ padding: `0 ${e.spacing(1)}` })), mi = _(N)({ flex: "1" }), hi = class extends R.Component {
2782
+ static propTypes = {
2783
+ availableTools: G.default.array,
2784
+ authoring: G.default.object,
2785
+ dimensionsEnabled: G.default.bool,
2786
+ graphDimensions: G.default.object,
2787
+ gridConfigurations: G.default.array,
2788
+ labelsPlaceholders: G.default.object,
2789
+ model: G.default.object.isRequired,
2790
+ onChange: G.default.func.isRequired,
2791
+ showLabels: G.default.bool,
2792
+ showTitle: G.default.bool,
2793
+ titlePlaceholder: G.default.string
2794
+ };
2795
+ constructor(e) {
2796
+ super(e);
2797
+ let { domain: t, range: n, graph: r } = e.model || {}, i = {
2798
+ domain: zr(t, r.width, !0),
2799
+ range: zr(n, r.height, !0)
2800
+ }, a = {
2801
+ domain: Br(t.step),
2802
+ range: Br(n.step)
2803
+ };
2804
+ this.state = {
2805
+ gridValues: i,
2806
+ labelValues: a,
2807
+ showPixelGuides: !1,
2808
+ dialog: { isOpened: !1 },
2809
+ domain: { ...t },
2810
+ range: { ...n }
2811
+ };
2812
+ }
2813
+ changeLabels = (e) => {
2814
+ let { model: t, onChange: n } = this.props;
2815
+ n({
2816
+ ...t,
2817
+ labels: e
2818
+ });
2819
+ };
2820
+ changeTitle = (e) => {
2821
+ let { model: t, onChange: n } = this.props;
2822
+ n({
2823
+ ...t,
2824
+ title: e
2825
+ });
2826
+ };
2827
+ onConfigChange = (e, n) => {
2828
+ let { model: i, onChange: a } = this.props, { defaultGridConfiguration: o = 0 } = i, { gridValues: s, labelValues: c, domain: l, range: u } = this.state, d = {
2829
+ ...i,
2830
+ ...e
2831
+ }, { answers: f, domain: p, includeAxes: m = !0, graph: h, range: g, standardGrid: _ } = d, v = {
2832
+ domain: [],
2833
+ range: []
2834
+ }, y = {
2835
+ domain: [],
2836
+ range: []
2837
+ }, b = n >= 0 ? n : o;
2838
+ if (m) {
2839
+ let e = Vr(p, h.width, s.domain, c.domain);
2840
+ v.domain = e.gridValues || [], y.domain = e.labelValues || [];
2841
+ }
2842
+ if (_) v.range = v.domain, y.range = y.domain, g.step = p.step, g.labelStep = p.labelStep;
2843
+ else if (m) {
2844
+ let e = Vr(g, h.height, s.range, c.range);
2845
+ v.range = e.gridValues || [], y.range = e.labelValues || [];
2846
+ }
2847
+ let x = t(f);
2848
+ x.correctAnswer.marks = f.correctAnswer.marks.filter((e) => e.type !== "polygon");
2849
+ let S = Ur(p, g, x);
2850
+ if (!r(x, S)) {
2851
+ this.setState({ dialog: {
2852
+ isOpened: !0,
2853
+ onClose: () => this.setState({ dialog: { isOpened: !1 } }, a({
2854
+ ...i,
2855
+ domain: l,
2856
+ range: u
2857
+ })),
2858
+ onConfirm: () => {
2859
+ d.gssLineData.sections = [], d.gssLineData.selectedTool = "lineA", this.setState({
2860
+ gridValues: v,
2861
+ labelValues: y,
2862
+ dialog: { isOpened: !1 },
2863
+ domain: { ...p },
2864
+ range: { ...g }
2865
+ }, a({
2866
+ ...d,
2867
+ answers: S,
2868
+ defaultGridConfiguration: b
2869
+ }));
2870
+ }
2871
+ } });
2872
+ return;
2873
+ }
2874
+ this.setState({
2875
+ gridValues: v,
2876
+ labelValues: y,
2877
+ domain: { ...p },
2878
+ range: { ...g }
2879
+ }), a({
2880
+ ...d,
2881
+ defaultGridConfiguration: b
2882
+ });
2883
+ };
2884
+ onChangeView = (e, t) => {
2885
+ let { graphDimensions: { enabled: n } = {} } = this.props;
2886
+ n && this.setState({ showPixelGuides: t });
2887
+ };
2888
+ changeGridConfiguration = (e) => {
2889
+ let { gridConfigurations: t } = this.props, { value: n } = e.target;
2890
+ this.onConfigChange(t?.[n] || {}, n);
2891
+ };
2892
+ render() {
2893
+ let { authoring: e = {}, gridConfigurations: t = [], graphDimensions: n = {}, labelsPlaceholders: r, model: i, showLabels: a, dimensionsEnabled: o, showTitle: s, titlePlaceholder: c, mathMlOptions: l = {} } = this.props, { arrows: u, coordinatesOnHover: d, defaultGridConfiguration: f, domain: p, labels: m, range: h, standardGrid: g, title: _ } = i || {}, v = (i || {}).graph || {}, { min: y, max: b, step: x } = n || {}, { dialog: S = {}, gridValues: C, labelValues: w, showPixelGuides: T } = this.state, E = {
2894
+ min: Math.max(150, y),
2895
+ max: Math.min(800, b),
2896
+ step: x >= 1 ? Math.min(200, x) : 20
2897
+ }, D = {
2898
+ axisLabel: e.axisLabel,
2899
+ dimensionsEnabled: o,
2900
+ includeAxesEnabled: !1,
2901
+ labelStep: e.labelStep,
2902
+ min: e.min,
2903
+ max: e.max,
2904
+ standardGridEnabled: e.standardGridEnabled,
2905
+ step: e.step
2906
+ }, O = e.enabled && Object.values(D).some((e) => typeof e == "object" ? e.enabled : e);
2907
+ return /* @__PURE__ */ V(ci, { children: [
2908
+ /* @__PURE__ */ V(li, { children: [t && t.length ? /* @__PURE__ */ V(fi, { children: [/* @__PURE__ */ B(pi, {
2909
+ component: "div",
2910
+ variant: "h6",
2911
+ children: "Grid Configuration"
2912
+ }), /* @__PURE__ */ B(mi, {
2913
+ input: /* @__PURE__ */ B(k, { labelWidth: 10 }),
2914
+ displayEmpty: !0,
2915
+ onChange: this.changeGridConfiguration,
2916
+ value: f,
2917
+ MenuProps: { transitionDuration: {
2918
+ enter: 225,
2919
+ exit: 195
2920
+ } },
2921
+ children: (t || []).map((e, t) => /* @__PURE__ */ B(re, {
2922
+ value: t,
2923
+ children: e.label
2924
+ }, t))
2925
+ })] }) : null, O && /* @__PURE__ */ B(Fr, {
2926
+ displayedFields: D,
2927
+ domain: p,
2928
+ gridValues: C,
2929
+ includeAxes: !0,
2930
+ labelValues: w,
2931
+ range: h,
2932
+ size: v,
2933
+ sizeConstraints: E,
2934
+ standardGrid: g,
2935
+ onChange: this.onConfigChange,
2936
+ onChangeView: this.onChangeView
2937
+ })] }),
2938
+ /* @__PURE__ */ V(ui, { children: [
2939
+ /* @__PURE__ */ B(I, {
2940
+ component: "div",
2941
+ variant: "h6",
2942
+ children: "Define Graph Attributes"
2943
+ }),
2944
+ /* @__PURE__ */ B(di, {
2945
+ component: "div",
2946
+ variant: "body1",
2947
+ children: "Use this interface to add/edit a title and/or labels"
2948
+ }),
2949
+ /* @__PURE__ */ B(ae, {
2950
+ axesSettings: { includeArrows: u },
2951
+ backgroundMarks: [],
2952
+ coordinatesOnHover: d,
2953
+ collapsibleToolbar: !0,
2954
+ collapsibleToolbarTitle: "Add Background Shapes to Graph",
2955
+ domain: p,
2956
+ labels: m,
2957
+ labelsPlaceholders: r,
2958
+ marks: [],
2959
+ onChangeLabels: this.changeLabels,
2960
+ onChangeTitle: this.changeTitle,
2961
+ range: h,
2962
+ showLabels: a,
2963
+ showPixelGuides: T,
2964
+ showTitle: s,
2965
+ size: {
2966
+ width: v.width,
2967
+ height: v.height
2968
+ },
2969
+ title: _,
2970
+ titlePlaceholder: c,
2971
+ disableToolbar: !0,
2972
+ mathMlOptions: l
2973
+ }, "graphing-config")
2974
+ ] }, "graph"),
2975
+ /* @__PURE__ */ B(fe, {
2976
+ open: S.isOpened,
2977
+ title: "Warning",
2978
+ text: "This change would make it impossible for students to plot one or more graph objects in the current correct answers. If you proceed, all such graph objects will be removed from the correct answers.",
2979
+ onClose: S.onClose,
2980
+ onConfirm: S.onConfirm
2981
+ })
2982
+ ] });
2983
+ }
2984
+ }, gi = _(I)(({ theme: e }) => ({
2985
+ marginTop: e.spacing(1.5),
2986
+ marginBottom: e.spacing(1)
2987
+ })), _i = _(Ie)({
2988
+ height: "20px",
2989
+ width: "fit-content",
2990
+ padding: ".5rem 0"
2991
+ }), vi = _(A)({ color: "#000000 !important" }), yi = _("div")(({ theme: e }) => ({
2992
+ fontSize: e.typography.fontSize - 2,
2993
+ color: e.palette.error.main,
2994
+ paddingTop: e.spacing(1)
2995
+ })), bi = class extends R.Component {
2996
+ static propTypes = {
2997
+ errors: G.default.object,
2998
+ model: G.default.object.isRequired,
2999
+ onChange: G.default.func.isRequired
3000
+ };
3001
+ state = { dialog: { open: !1 } };
3002
+ handleAlertDialog = (e, t) => this.setState({ dialog: { open: e } }, t);
3003
+ changeMarks = (e) => {
3004
+ let { model: t, onChange: r } = this.props, { gssLineData: i } = t;
3005
+ i.selectedTool === "lineA" && e.length > 0 && (e[0].fill = i.lineA.lineType), i.selectedTool === "lineB" && e.length > 1 && (e[1].fill = i.lineB.lineType), e.length === 0 && (i.selectedTool = "lineA", n(t, "gssLineData", i)), n(t, "answers.correctAnswer.marks", e), r(t);
3006
+ };
3007
+ onResetClick = () => {
3008
+ let { model: e, onChange: t } = this.props, { gssLineData: r, answers: i } = e;
3009
+ this.setState({ dialog: {
3010
+ open: !0,
3011
+ title: "Warning",
3012
+ text: "This will remove all the elements added on the graph and reset graph to original state. Are you sure you want to continue?",
3013
+ onConfirm: () => {
3014
+ i.correctAnswer.marks = [], r.selectedTool = "lineA", r.lineA.lineType = "Solid", r.lineB && (r.lineB.lineType = "Solid"), n(e, "answers", i), n(e, "gssLineData", r), t(e), this.handleAlertDialog(!1);
3015
+ },
3016
+ onClose: () => this.handleAlertDialog(!1)
3017
+ } });
3018
+ };
3019
+ changeNumberOfLines = (e, t) => {
3020
+ let { model: n } = this.props;
3021
+ n.gssLineData.selectedTool === "solutionSet" ? this.setState({ dialog: {
3022
+ open: !0,
3023
+ title: "Warning",
3024
+ text: "Changing number of lines after adding solution set will remove added solution set. Are you sure you want to continue?",
3025
+ onConfirm: () => {
3026
+ this.changeLine(e, t), this.handleAlertDialog(!1);
3027
+ },
3028
+ onClose: () => this.handleAlertDialog(!1)
3029
+ } }) : this.changeLine(e, t);
3030
+ };
3031
+ changeLine = (e, t) => {
3032
+ let { model: r, onChange: i } = this.props, { answers: a } = r, o = r.gssLineData;
3033
+ a.correctAnswer.marks = a.correctAnswer.marks.filter((e) => e.type !== "polygon"), Number.parseInt(t) === 1 ? (delete o.lineB, a.correctAnswer.marks.length > 1 && a.correctAnswer.marks.pop(), o.numberOfLines = 1, o.selectedTool = "lineA") : (o.numberOfLines = 2, a.correctAnswer.marks.length > 0 && (o.selectedTool = "lineB"), o.lineB = { lineType: "Solid" }), n(r, "answers", a), n(r, "gssLineData", o), i(r);
3034
+ };
3035
+ onSolutionSetSelected = (e) => {
3036
+ let { model: t, onChange: r } = this.props, { answers: i, gssLineData: a } = t;
3037
+ for (let t of a.sections) if (oi(e, t)) {
3038
+ let e = {
3039
+ points: t,
3040
+ building: !1,
3041
+ type: "polygon",
3042
+ closed: !0,
3043
+ isSolution: !0
3044
+ };
3045
+ i.correctAnswer.marks = i.correctAnswer.marks.filter((e) => e.type !== "polygon"), i.correctAnswer.marks.push(e);
3046
+ break;
3047
+ }
3048
+ n(t, "answers", i), r(t);
3049
+ };
3050
+ onChangeGssLineData = (e, t) => {
3051
+ let { model: n } = this.props, { answers: r, domain: i, range: a } = n;
3052
+ if (e.selectedTool === "solutionSet") {
3053
+ let n = r.correctAnswer.marks.filter((e) => e.type !== "polygon");
3054
+ if (!si(e, n)) e.selectedTool = t, this.setState({ dialog: {
3055
+ open: !0,
3056
+ title: "Warning",
3057
+ text: "Please define the line(s) and then select a solution set for the item.",
3058
+ onConfirm: () => this.handleAlertDialog(!1)
3059
+ } });
3060
+ else {
3061
+ let t = r.correctAnswer.marks.filter((e) => e.type !== "polygon");
3062
+ e = ai(e, t, i, a);
3063
+ }
3064
+ this.handleGssLineDataChange(e, r);
3065
+ } else {
3066
+ let n = r.correctAnswer.marks.filter((e) => e.type === "polygon");
3067
+ t === "solutionSet" && n.length > 0 ? this.setState({ dialog: {
3068
+ open: !0,
3069
+ title: "Warning",
3070
+ text: "Changing a line after adding a solution set will clear your selected solution set. Click 'Clear Solution Set' to change the line. Otherwise, click 'Cancel'.",
3071
+ onConfirm: () => {
3072
+ r.correctAnswer.marks = r.correctAnswer.marks.filter((e) => e.type !== "polygon"), this.handleGssLineDataChange(e, r), this.handleAlertDialog(!1);
3073
+ },
3074
+ onConfirmText: "CLEAR SOLUTION SET",
3075
+ onClose: () => {
3076
+ e.selectedTool = t, this.handleGssLineDataChange(e, r), this.handleAlertDialog(!1);
3077
+ }
3078
+ } }) : this.handleGssLineDataChange(e, r);
3079
+ }
3080
+ };
3081
+ handleGssLineDataChange = (e, t) => {
3082
+ let { model: r, onChange: i } = this.props;
3083
+ t.correctAnswer.marks.length > 0 && t.correctAnswer.marks[0] && e.lineA && (t.correctAnswer.marks[0].fill = e.lineA.lineType), t.correctAnswer.marks.length > 1 && t.correctAnswer.marks[1] && e.lineB && (t.correctAnswer.marks[1].fill = e.lineB.lineType), (e.selectedTool === "lineB" && t.correctAnswer.marks.length === 0 || e.selectedTool === "lineB" && t.correctAnswer.marks[0].building) && (this.setState({ dialog: {
3084
+ open: !0,
3085
+ title: "Warning",
3086
+ text: "Please add Line A to the graph before adding Line B",
3087
+ onConfirm: () => this.handleAlertDialog(!1)
3088
+ } }), e.selectedTool = "lineA"), e.selectedTool === "lineA" && t.correctAnswer.marks.length > 1 && t.correctAnswer.marks[1].building && (this.setState({ dialog: {
3089
+ open: !0,
3090
+ title: "Warning",
3091
+ text: "Please add Line B to the graph before switching to Line A",
3092
+ onConfirm: () => this.handleAlertDialog(!1)
3093
+ } }), e.selectedTool = "lineB"), n(r, "gssLineData", e), n(r, "answers", t), i(r);
3094
+ };
3095
+ updateModel = (e) => {
3096
+ let { model: t, onChange: n } = this.props;
3097
+ n({
3098
+ ...t,
3099
+ ...e
3100
+ });
3101
+ };
3102
+ render() {
3103
+ let { errors: e, model: t, mathMlOptions: n = {} } = this.props, { dialog: r } = this.state, { gssLineData: i = {
3104
+ numberOfLines: 1,
3105
+ selectedTool: "lineA",
3106
+ lineA: { lineType: "Solid" }
3107
+ }, arrows: a, coordinatesOnHover: o, domain: s, graph: c = {}, labels: l, labelsEnabled: u, range: d, title: f, titleEnabled: p, answers: m } = t || {}, { correctAnswerErrors: h = "" } = e || {};
3108
+ return /* @__PURE__ */ V("div", { children: [
3109
+ /* @__PURE__ */ B(I, {
3110
+ component: "div",
3111
+ variant: "h6",
3112
+ children: "Define Line Type(s) and Correct Response"
3113
+ }),
3114
+ /* @__PURE__ */ B(gi, {
3115
+ component: "div",
3116
+ variant: "body1",
3117
+ children: "Use this interface to choose how many lines students will be able to draw, and to define the correct answer."
3118
+ }),
3119
+ /* @__PURE__ */ B(gi, {
3120
+ component: "div",
3121
+ variant: "body1",
3122
+ children: "Choose Number of Lines"
3123
+ }),
3124
+ /* @__PURE__ */ V(Xe, {
3125
+ name: "numberOfLines",
3126
+ value: i.numberOfLines,
3127
+ onChange: this.changeNumberOfLines,
3128
+ children: [/* @__PURE__ */ B(_i, {
3129
+ value: "1",
3130
+ control: /* @__PURE__ */ B(vi, { checked: i.numberOfLines === 1 }),
3131
+ label: "One"
3132
+ }), /* @__PURE__ */ B(_i, {
3133
+ value: "2",
3134
+ control: /* @__PURE__ */ B(vi, { checked: i.numberOfLines === 2 }),
3135
+ label: "Two"
3136
+ })]
3137
+ }),
3138
+ /* @__PURE__ */ V(R.Fragment, { children: [/* @__PURE__ */ B(ae, {
3139
+ style: h.correctAnswer && { border: "2px solid red" },
3140
+ axesSettings: { includeArrows: a },
3141
+ backgroundMarks: [],
3142
+ coordinatesOnHover: o,
3143
+ disabledLabels: !0,
3144
+ disabledTitle: !0,
3145
+ domain: s,
3146
+ draggableTools: !0,
3147
+ labels: l,
3148
+ marks: m && m.correctAnswer && m.correctAnswer.marks ? m.correctAnswer.marks : [],
3149
+ onChangeMarks: (e) => this.changeMarks(e),
3150
+ onCustomReset: this.onResetClick,
3151
+ range: d,
3152
+ showLabels: u,
3153
+ showTitle: p,
3154
+ size: {
3155
+ width: c.width,
3156
+ height: c.height
3157
+ },
3158
+ title: f,
3159
+ gssLineData: i,
3160
+ onChangeGssLineData: this.onChangeGssLineData,
3161
+ onSolutionSetSelected: this.onSolutionSetSelected,
3162
+ toolbarTools: ["line", "polygon"],
3163
+ mathMlOptions: n
3164
+ }), h.correctAnswer && /* @__PURE__ */ B(yi, { children: h.correctAnswer })] }),
3165
+ /* @__PURE__ */ B(fe, {
3166
+ open: r.open,
3167
+ title: r.title,
3168
+ text: r.text,
3169
+ onClose: r.onClose,
3170
+ onConfirm: r.onConfirm,
3171
+ onConfirmText: r.onConfirmText ? r.onConfirmText : "OK"
3172
+ })
3173
+ ] });
3174
+ }
3175
+ }, { Panel: xi, toggle: $, radio: Si, checkboxes: Ci, textField: wi, dropdown: Ti } = tr;
3176
+ (0, W.default)("@pie-element:graphing-solution-set:configure");
3177
+ var Ei = _(pr)(({ theme: e }) => ({
3178
+ width: "100%",
3179
+ paddingTop: e.spacing(2),
3180
+ marginBottom: e.spacing(2),
3181
+ marginTop: e.spacing(2)
3182
+ })), Di = _(I)(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), Oi = class extends z.Component {
3183
+ static propTypes = {
3184
+ onModelChanged: G.default.func,
3185
+ onConfigurationChanged: G.default.func,
3186
+ imageSupport: G.default.object,
3187
+ uploadSoundSupport: G.default.object,
3188
+ model: G.default.object.isRequired,
3189
+ configuration: G.default.object.isRequired
3190
+ };
3191
+ componentDidMount() {
3192
+ let { configuration: e, onModelChanged: t, model: n } = this.props, { title: r, graphDimensions: i } = e || {}, { arrows: a, titleEnabled: o, dimensionsEnabled: s } = n || {};
3193
+ typeof a == "boolean" && (a = a ? {
3194
+ left: !0,
3195
+ right: !0,
3196
+ up: !0,
3197
+ down: !0
3198
+ } : {
3199
+ left: !1,
3200
+ right: !1,
3201
+ up: !1,
3202
+ down: !1
3203
+ });
3204
+ let c = o ?? r.enabled, l = s ?? i.enabled;
3205
+ t && t({
3206
+ ...n,
3207
+ arrows: a,
3208
+ titleEnabled: c,
3209
+ dimensionsEnabled: l
3210
+ });
3211
+ }
3212
+ onRationaleChange = (e) => {
3213
+ let { onModelChanged: t, model: n } = this.props;
3214
+ t({
3215
+ ...n,
3216
+ rationale: e
3217
+ });
3218
+ };
3219
+ onPromptChange = (e) => {
3220
+ let { onModelChanged: t, model: n } = this.props;
3221
+ t({
3222
+ ...n,
3223
+ prompt: e
3224
+ });
3225
+ };
3226
+ onTeacherInstructionsChange = (e) => {
3227
+ let { onModelChanged: t, model: n } = this.props;
3228
+ t({
3229
+ ...n,
3230
+ teacherInstructions: e
3231
+ });
3232
+ };
3233
+ render() {
3234
+ let { model: e, configuration: t, onConfigurationChanged: n, onModelChanged: r, imageSupport: i, uploadSoundSupport: a } = this.props, { arrows: o = {}, authoring: s = {}, coordinatesOnHover: c = {}, contentDimensions: l = {}, gridConfigurations: u = [], graphDimensions: d = {}, instruction: f = {}, labels: p = {}, padding: m = {}, prompt: h = {}, rationale: g = {}, scoringType: _ = {}, settingsPanelDisabled: v, spellCheck: y = {}, studentInstructions: b = {}, teacherInstructions: x = {}, title: S = {}, maxImageWidth: C = {}, maxImageHeight: w = {}, withRubric: T = {}, language: E = {}, languageChoices: D = {}, mathMlOptions: O = {} } = t || {}, { errors: k = {}, extraCSSRules: A, labelsEnabled: ee, dimensionsEnabled: j, promptEnabled: te, rationaleEnabled: ne, spellCheckEnabled: N, teacherInstructionsEnabled: re, titleEnabled: ie } = e || {}, P = C && C.prompt, F = w && w.prompt, ae = {
3235
+ top: p.top,
3236
+ right: p.right,
3237
+ bottom: p.bottom,
3238
+ left: p.left
3239
+ }, oe = {
3240
+ arrows: o.settings && Ci(o.label, {
3241
+ left: o.left,
3242
+ right: o.right,
3243
+ up: o.up,
3244
+ down: o.down
3245
+ }),
3246
+ titleEnabled: S.settings && $(S.label),
3247
+ padding: m.settings && $(m.label),
3248
+ labelsEnabled: p.settings && $(p.label),
3249
+ "language.enabled": E.settings && $(E.label, !0),
3250
+ language: E.settings && E.enabled && Ti(D.label, D.options),
3251
+ dimensionsEnabled: d.settings && $(d.label),
3252
+ coordinatesOnHover: c.settings && $(c.label)
3253
+ }, se = {
3254
+ "authoring.enabled": s.settings && $(s.label, !0),
3255
+ teacherInstructionsEnabled: x.settings && $(x.label),
3256
+ studentInstructionsEnabled: b.settings && $(b.label),
3257
+ promptEnabled: h.settings && $(h.label),
3258
+ rationaleEnabled: g.settings && $(g.label),
3259
+ spellCheckEnabled: y.settings && $(y.label),
3260
+ scoringType: _.settings && Si(_.label, ["dichotomous", "partial scoring"]),
3261
+ rubricEnabled: T?.settings && $(T?.label),
3262
+ instruction: f.settings && wi(f.label)
3263
+ };
3264
+ return /* @__PURE__ */ V(Dn.ConfigLayout, {
3265
+ extraCSSRules: A,
3266
+ dimensions: l,
3267
+ hideSettings: v,
3268
+ settings: /* @__PURE__ */ B(xi, {
3269
+ model: e,
3270
+ configuration: t,
3271
+ onChangeModel: r,
3272
+ onChangeConfiguration: n,
3273
+ groups: {
3274
+ Settings: oe,
3275
+ Properties: se
3276
+ }
3277
+ }),
3278
+ children: [
3279
+ /* @__PURE__ */ B(Di, {
3280
+ component: "div",
3281
+ variant: "body1",
3282
+ children: f?.label || ""
3283
+ }),
3284
+ re && /* @__PURE__ */ B(Ei, {
3285
+ label: x.label,
3286
+ children: /* @__PURE__ */ B(M, {
3287
+ markup: e.teacherInstructions || "",
3288
+ onChange: this.onTeacherInstructionsChange,
3289
+ imageSupport: i,
3290
+ nonEmpty: !1,
3291
+ spellCheck: N,
3292
+ maxImageWidth: C && C.teacherInstructions || P,
3293
+ maxImageHeight: w && w.teacherInstructions || F,
3294
+ uploadSoundSupport: a,
3295
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
3296
+ mathMlOptions: O
3297
+ })
3298
+ }),
3299
+ te && /* @__PURE__ */ B(Ei, {
3300
+ label: h.label,
3301
+ children: /* @__PURE__ */ B(M, {
3302
+ markup: e.prompt,
3303
+ onChange: this.onPromptChange,
3304
+ imageSupport: i,
3305
+ nonEmpty: !1,
3306
+ spellCheck: N,
3307
+ disableUnderline: !0,
3308
+ maxImageWidth: P,
3309
+ maxImageHeight: F,
3310
+ uploadSoundSupport: a,
3311
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
3312
+ mathMlOptions: O
3313
+ })
3314
+ }),
3315
+ /* @__PURE__ */ B(hi, {
3316
+ authoring: s,
3317
+ gridConfigurations: u,
3318
+ graphDimensions: d,
3319
+ labelsPlaceholders: ae,
3320
+ model: e,
3321
+ showLabels: ee,
3322
+ dimensionsEnabled: j,
3323
+ showTitle: ie,
3324
+ titlePlaceholder: S.placeholder,
3325
+ onChange: this.props.onModelChanged,
3326
+ mathMlOptions: O
3327
+ }),
3328
+ /* @__PURE__ */ B(bi, {
3329
+ errors: k,
3330
+ model: e,
3331
+ onChange: this.props.onModelChanged,
3332
+ mathMlOptions: O
3333
+ }),
3334
+ ne && /* @__PURE__ */ B(Ei, {
3335
+ label: g.label || "Rationale",
3336
+ children: /* @__PURE__ */ B(M, {
3337
+ markup: e.rationale || "",
3338
+ onChange: this.onRationaleChange,
3339
+ imageSupport: i,
3340
+ spellCheck: N,
3341
+ maxImageWidth: C && C.rationale || P,
3342
+ maxImageHeight: w && w.rationale || F,
3343
+ uploadSoundSupport: a,
3344
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
3345
+ mathMlOptions: O
3346
+ })
3347
+ })
3348
+ ]
3349
+ });
3350
+ }
3351
+ }, ki = class e extends CustomEvent {
3352
+ static {
3353
+ this.TYPE = "model.updated";
3354
+ }
3355
+ constructor(t, n = !1) {
3356
+ super(e.TYPE, {
3357
+ bubbles: !0,
3358
+ detail: {
3359
+ update: t,
3360
+ reset: n
3361
+ }
3362
+ }), this.update = t, this.reset = n;
3363
+ }
3364
+ }, Ai = class e extends CustomEvent {
3365
+ static {
3366
+ this.TYPE = "delete.image";
3367
+ }
3368
+ constructor(t, n) {
3369
+ super(e.TYPE, {
3370
+ bubbles: !0,
3371
+ detail: {
3372
+ src: t,
3373
+ done: n
3374
+ }
3375
+ }), this.src = t, this.done = n;
3376
+ }
3377
+ }, ji = class e extends CustomEvent {
3378
+ static {
3379
+ this.TYPE = "insert.image";
3380
+ }
3381
+ constructor(t) {
3382
+ super(e.TYPE, {
3383
+ bubbles: !0,
3384
+ detail: t
3385
+ }), this.handler = t;
3386
+ }
3387
+ }, Mi = class e extends CustomEvent {
3388
+ static {
3389
+ this.TYPE = "delete.sound";
3390
+ }
3391
+ constructor(t, n) {
3392
+ super(e.TYPE, {
3393
+ bubbles: !0,
3394
+ detail: {
3395
+ src: t,
3396
+ done: n
3397
+ }
3398
+ }), this.src = t, this.done = n;
3399
+ }
3400
+ }, Ni = class e extends CustomEvent {
3401
+ static {
3402
+ this.TYPE = "insert.sound";
3403
+ }
3404
+ constructor(t) {
3405
+ super(e.TYPE, {
3406
+ bubbles: !0,
3407
+ detail: t
3408
+ }), this.handler = t;
3409
+ }
3410
+ }, Pi = {
3411
+ model: {
3412
+ answers: { correctAnswer: {
3413
+ name: "Correct Answer",
3414
+ marks: []
3415
+ } },
3416
+ arrows: {
3417
+ left: !0,
3418
+ right: !0,
3419
+ up: !0,
3420
+ down: !0
3421
+ },
3422
+ marks: [],
3423
+ defaultGridConfiguration: 0,
3424
+ domain: {
3425
+ min: -5,
3426
+ max: 5,
3427
+ step: 1,
3428
+ labelStep: 1,
3429
+ axisLabel: "x"
3430
+ },
3431
+ graph: {
3432
+ width: 500,
3433
+ height: 500
3434
+ },
3435
+ gssLineData: {
3436
+ numberOfLines: 1,
3437
+ selectedTool: "lineA",
3438
+ sections: [],
3439
+ lineA: { lineType: "Solid" }
3440
+ },
3441
+ includeAxes: !0,
3442
+ labels: {},
3443
+ labelsEnabled: !0,
3444
+ padding: !0,
3445
+ prompt: "",
3446
+ range: {
3447
+ min: -5,
3448
+ max: 5,
3449
+ step: 1,
3450
+ labelStep: 1,
3451
+ axisLabel: "y"
3452
+ },
3453
+ rationale: "",
3454
+ standardGrid: !1,
3455
+ title: "",
3456
+ coordinatesOnHover: !1,
3457
+ promptEnabled: !0,
3458
+ rationaleEnabled: !0,
3459
+ teacherInstructionsEnabled: !0,
3460
+ studentInstructionsEnabled: !0
3461
+ },
3462
+ configuration: {
3463
+ authoring: {
3464
+ settings: !1,
3465
+ label: "Customize Grid Setup",
3466
+ enabled: !0,
3467
+ includeAxesEnabled: !1,
3468
+ standardGridEnabled: !0,
3469
+ min: {
3470
+ label: "Min Value",
3471
+ enabled: !0
3472
+ },
3473
+ max: {
3474
+ label: "Max Value",
3475
+ enabled: !0
3476
+ },
3477
+ axisLabel: {
3478
+ label: "Label",
3479
+ enabled: !0
3480
+ },
3481
+ step: {
3482
+ label: "Grid Interval",
3483
+ enabled: !0
3484
+ },
3485
+ labelStep: {
3486
+ label: "Label Interval",
3487
+ enabled: !0
3488
+ }
3489
+ },
3490
+ arrows: {
3491
+ settings: !0,
3492
+ label: "Include Arrows",
3493
+ left: { label: "left" },
3494
+ right: { label: "right" },
3495
+ up: { label: "up" },
3496
+ down: { label: "down" }
3497
+ },
3498
+ gridConfigurations: [
3499
+ {
3500
+ label: "4-quadrant coordinate grid, -10 to 10",
3501
+ arrows: {
3502
+ left: !0,
3503
+ right: !0,
3504
+ up: !0,
3505
+ down: !0
3506
+ },
3507
+ domain: {
3508
+ min: -10,
3509
+ max: 10,
3510
+ step: 1,
3511
+ padding: 0,
3512
+ labelStep: 1,
3513
+ axisLabel: "<i>x</i>"
3514
+ },
3515
+ graph: {
3516
+ width: 480,
3517
+ height: 480
3518
+ },
3519
+ includeAxes: !0,
3520
+ labels: {
3521
+ top: "",
3522
+ right: "",
3523
+ bottom: "",
3524
+ left: ""
3525
+ },
3526
+ padding: !0,
3527
+ range: {
3528
+ min: -10,
3529
+ max: 10,
3530
+ step: 1,
3531
+ padding: 0,
3532
+ labelStep: 1,
3533
+ axisLabel: "<i>y</i>"
3534
+ },
3535
+ standardGrid: !0,
3536
+ title: ""
3537
+ },
3538
+ {
3539
+ label: "0 to 10 on both axes",
3540
+ arrows: {
3541
+ left: !1,
3542
+ right: !0,
3543
+ up: !0,
3544
+ down: !1
3545
+ },
3546
+ domain: {
3547
+ min: 0,
3548
+ max: 10,
3549
+ step: 1,
3550
+ padding: 0,
3551
+ labelStep: 1,
3552
+ axisLabel: "<i>x</i>"
3553
+ },
3554
+ graph: {
3555
+ width: 480,
3556
+ height: 480
3557
+ },
3558
+ includeAxes: !0,
3559
+ labels: {
3560
+ top: "",
3561
+ right: "",
3562
+ bottom: "",
3563
+ left: ""
3564
+ },
3565
+ padding: !0,
3566
+ range: {
3567
+ min: 0,
3568
+ max: 10,
3569
+ step: 1,
3570
+ padding: 0,
3571
+ labelStep: 1,
3572
+ axisLabel: "<i>y</i>"
3573
+ },
3574
+ standardGrid: !0,
3575
+ title: ""
3576
+ },
3577
+ {
3578
+ label: "0 to 20 on both axes",
3579
+ arrows: {
3580
+ left: !1,
3581
+ right: !0,
3582
+ up: !0,
3583
+ down: !1
3584
+ },
3585
+ domain: {
3586
+ min: 0,
3587
+ max: 20,
3588
+ step: 1,
3589
+ padding: 0,
3590
+ labelStep: 1,
3591
+ axisLabel: "<i>x</i>"
3592
+ },
3593
+ graph: {
3594
+ width: 480,
3595
+ height: 480
3596
+ },
3597
+ includeAxes: !0,
3598
+ labels: {
3599
+ top: "",
3600
+ right: "",
3601
+ bottom: "",
3602
+ left: ""
3603
+ },
3604
+ padding: !0,
3605
+ range: {
3606
+ min: 0,
3607
+ max: 20,
3608
+ step: 1,
3609
+ padding: 0,
3610
+ labelStep: 1,
3611
+ axisLabel: "<i>y</i>"
3612
+ },
3613
+ standardGrid: !0,
3614
+ title: ""
3615
+ },
3616
+ {
3617
+ label: "Sample Data Graph",
3618
+ arrows: {
3619
+ left: !1,
3620
+ right: !0,
3621
+ up: !0,
3622
+ down: !1
3623
+ },
3624
+ domain: {
3625
+ min: 0,
3626
+ max: 30,
3627
+ step: 1,
3628
+ padding: 0,
3629
+ labelStep: 2,
3630
+ axisLabel: "<i>t</i>"
3631
+ },
3632
+ graph: {
3633
+ width: 480,
3634
+ height: 480
3635
+ },
3636
+ includeAxes: !0,
3637
+ labels: {
3638
+ top: "",
3639
+ right: "",
3640
+ bottom: "Time (seconds)",
3641
+ left: "Distance (meters)"
3642
+ },
3643
+ padding: !0,
3644
+ range: {
3645
+ min: 0,
3646
+ max: 80,
3647
+ step: 5,
3648
+ padding: 0,
3649
+ labelStep: 10,
3650
+ axisLabel: "<i>d</i>"
3651
+ },
3652
+ standardGrid: !1,
3653
+ title: "Distance as a function of time"
3654
+ }
3655
+ ],
3656
+ graphDimensions: {
3657
+ settings: !1,
3658
+ label: "Graph Dimensions",
3659
+ enabled: !0,
3660
+ min: 150,
3661
+ max: 800,
3662
+ step: 20
3663
+ },
3664
+ padding: {
3665
+ settings: !1,
3666
+ label: "Padding"
3667
+ },
3668
+ labels: {
3669
+ settings: !0,
3670
+ label: "Graph Labels",
3671
+ enabled: !0,
3672
+ top: "Click here to add a top label",
3673
+ right: "Click here to add a right label",
3674
+ bottom: "Click here to add a bottom label",
3675
+ left: "Click here to add a left label"
3676
+ },
3677
+ prompt: {
3678
+ settings: !0,
3679
+ label: "Item Stem"
3680
+ },
3681
+ rationale: {
3682
+ settings: !0,
3683
+ label: "Rationale"
3684
+ },
3685
+ scoringType: {
3686
+ settings: !1,
3687
+ label: "Scoring Type"
3688
+ },
3689
+ studentInstructions: {
3690
+ settings: !1,
3691
+ label: "Student Instructions"
3692
+ },
3693
+ teacherInstructions: {
3694
+ settings: !0,
3695
+ label: "Teacher Instructions"
3696
+ },
3697
+ title: {
3698
+ settings: !0,
3699
+ label: "Graph Title",
3700
+ enabled: !0,
3701
+ placeholder: "Click here to add a title for this graph"
3702
+ },
3703
+ instruction: {
3704
+ settings: !1,
3705
+ label: "Graphing Solution Set items involve plotting one or two lines on a graph and then selecting the correct area that represents the solution set. To create one, first configure the grid, then select if one or two lines will be offered and if the lines should be solid or dashed. After defining the line(s), define the correct answer by clicking the area that represents the solution set."
3706
+ },
3707
+ settingsPanelDisabled: !1,
3708
+ spellCheck: {
3709
+ label: "Spellcheck",
3710
+ settings: !1,
3711
+ enabled: !0
3712
+ },
3713
+ coordinatesOnHover: {
3714
+ settings: !0,
3715
+ label: "Coordinates on Hover"
3716
+ },
3717
+ maxImageWidth: {
3718
+ teacherInstructions: 300,
3719
+ prompt: 300,
3720
+ rationale: 300
3721
+ },
3722
+ maxImageHeight: {
3723
+ teacherInstructions: 300,
3724
+ prompt: 300,
3725
+ rationale: 300
3726
+ },
3727
+ withRubric: {
3728
+ settings: !1,
3729
+ label: "Add Rubric"
3730
+ },
3731
+ language: {
3732
+ settings: !1,
3733
+ label: "Specify Language",
3734
+ enabled: !1
3735
+ },
3736
+ languageChoices: {
3737
+ label: "Language Choices",
3738
+ options: []
3739
+ },
3740
+ mathMlOptions: {
3741
+ mmlOutput: !1,
3742
+ mmlEditing: !1
3743
+ }
3744
+ }
3745
+ }, Fi = (0, W.default)("pie-elements:graphing-solution-set:configure"), Ii = (e) => Object.keys(e || {}).sort().reduce((t, n) => (n !== "correctAnswer" && (t[n] = e[n]), t), {}), Li = class e extends HTMLElement {
3746
+ static createDefaultModel = (e = {}) => {
3747
+ let t = {
3748
+ ...Pi.model,
3749
+ ...e
3750
+ }, { answers: n = {}, domain: r = {}, graph: i = {}, range: a = {}, standardGrid: o } = t;
3751
+ return {
3752
+ ...t,
3753
+ answers: n && n.correctAnswer && {
3754
+ correctAnswer: n.correctAnswer,
3755
+ ...Ii(n)
3756
+ } || n,
3757
+ range: o && {
3758
+ ...a,
3759
+ min: r.min,
3760
+ max: r.max,
3761
+ step: r.step,
3762
+ labelStep: r.labelStep
3763
+ } || a,
3764
+ graph: o && {
3765
+ ...i,
3766
+ height: i.width
3767
+ } || i
3768
+ };
3769
+ };
3770
+ constructor() {
3771
+ super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = Pi.configuration;
3772
+ }
3773
+ set model(t) {
3774
+ this._model = e.createDefaultModel(t), this._render();
3775
+ }
3776
+ set configuration(e) {
3777
+ this._configuration = {
3778
+ ...Pi.configuration,
3779
+ ...e
3780
+ };
3781
+ let { language: t, languageChoices: n } = this._configuration;
3782
+ t?.enabled ? n?.options?.length && (this._model.language = n.options[0].value) : t?.settings ? this._model.language && (this._configuration.language.enabled = !0) : delete this._model.language, this._render();
3783
+ }
3784
+ onModelChanged = (e) => {
3785
+ this._model = e, this._render(), Fi("[onModelChanged]: ", this._model), this.dispatchEvent(new ki(this._model));
3786
+ };
3787
+ onConfigurationChanged = (e) => {
3788
+ this._configuration = e, this._render();
3789
+ };
3790
+ insertImage = (e) => {
3791
+ this.dispatchEvent(new ji(e));
3792
+ };
3793
+ onDeleteImage = (e, t) => {
3794
+ this.dispatchEvent(new Ai(e, t));
3795
+ };
3796
+ insertSound(e) {
3797
+ this.dispatchEvent(new Ni(e));
3798
+ }
3799
+ onDeleteSound(e, t) {
3800
+ this.dispatchEvent(new Mi(e, t));
3801
+ }
3802
+ _render() {
3803
+ if (this._model) {
3804
+ let e = z.createElement(Oi, {
3805
+ onModelChanged: this.onModelChanged,
3806
+ onConfigurationChanged: this.onConfigurationChanged,
3807
+ model: this._model,
3808
+ configuration: this._configuration,
3809
+ imageSupport: {
3810
+ add: this.insertImage,
3811
+ delete: this.onDeleteImage
3812
+ },
3813
+ uploadSoundSupport: {
3814
+ add: this.insertSound.bind(this),
3815
+ delete: this.onDeleteSound.bind(this)
3816
+ }
3817
+ });
3818
+ this._root ||= ye(this), this._root.render(e), queueMicrotask(() => {
3819
+ oe(this);
3820
+ });
3821
+ }
3822
+ }
3823
+ connectedCallback() {
3824
+ this._render();
3825
+ }
3826
+ disconnectedCallback() {
3827
+ this._root &&= (this._root.unmount(), null);
3828
+ }
3829
+ };
3830
+ //#endregion
3831
+ export { Li as default };
3832
+
3833
+ //# sourceMappingURL=index.js.map