dynamic-mui 2.4.0 → 2.4.1

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 (104) hide show
  1. package/dist/{index-B7i3cvH0.mjs → AIForm-DtRl0WdY.mjs} +4186 -4359
  2. package/dist/AIForm-Dv8ahXyE.js +43 -0
  3. package/dist/accordion-BaiGxDcw.js +1 -0
  4. package/dist/{accordion-Bc3bEKtC.mjs → accordion-xg_TxxYS.mjs} +1 -1
  5. package/dist/{addressfield-bU-3Rnkq.mjs → addressfield-BvQEHdEk.mjs} +1 -1
  6. package/dist/addressfield-vVizrbZP.js +1 -0
  7. package/dist/ai/index.cjs +1 -0
  8. package/dist/ai/index.mjs +14 -0
  9. package/dist/{asyncautocomplete-BojHePYN.mjs → asyncautocomplete-AmSRs7PY.mjs} +19 -19
  10. package/dist/asyncautocomplete-Dtmxh4l1.js +1 -0
  11. package/dist/bar-BiIzbOC3.js +1 -0
  12. package/dist/{bar-DUZXtBln.mjs → bar-DNc7TMKj.mjs} +1 -1
  13. package/dist/{cascadeselect-CMqn7Tql.mjs → cascadeselect-BlznIKS6.mjs} +16 -16
  14. package/dist/cascadeselect-DqLtG-W9.js +1 -0
  15. package/dist/colorpicker-DpLvK1WR.js +1 -0
  16. package/dist/{colorpicker-CXWSUm_s.mjs → colorpicker-hP3b7teC.mjs} +2 -2
  17. package/dist/consentfield-B21l9tGo.js +1 -0
  18. package/dist/{consentfield-DxqzSUsQ.mjs → consentfield-CGT98YbR.mjs} +8 -8
  19. package/dist/{datatable-vq0d5mZg.mjs → datatable-B_6wXh2g.mjs} +1 -1
  20. package/dist/datatable-Bv0Q37Zy.js +1 -0
  21. package/dist/dynamic-mui.cjs +1 -1
  22. package/dist/dynamic-mui.d.ts +2 -0
  23. package/dist/dynamic-mui.mjs +207 -33
  24. package/dist/editabletable-D3c3DJxX.js +1 -0
  25. package/dist/{editabletable-C5eH6sPe.mjs → editabletable-YaFqdLvf.mjs} +13 -13
  26. package/dist/fileupload--KzSGb5a.js +1 -0
  27. package/dist/{fileupload-XnztToJ2.mjs → fileupload-ZBi72f1R.mjs} +11 -11
  28. package/dist/formrepeater-BhUEa4BI.js +1 -0
  29. package/dist/{formrepeater-CDhYRFqz.mjs → formrepeater-Cwgtvz1c.mjs} +8 -8
  30. package/dist/formwizard-BlozHDc_.js +1 -0
  31. package/dist/{formwizard-C2QaC746.mjs → formwizard-CYcgf5jL.mjs} +1 -1
  32. package/dist/geofield-BynrTSVm.js +1 -0
  33. package/dist/{geofield-_dw7uIT2.mjs → geofield-xqZy_DAY.mjs} +12 -12
  34. package/dist/{group-CZgTXmJP.mjs → group-DmLN-b09.mjs} +1 -1
  35. package/dist/group-Dtju1rHQ.js +1 -0
  36. package/dist/intlphone-BeHXAcFi.js +1 -0
  37. package/dist/{intlphone-357BAzba.mjs → intlphone-CXUQP9Gp.mjs} +5 -5
  38. package/dist/{keyvaluefield-BRX83BRS.mjs → keyvaluefield-BJoEbe4I.mjs} +13 -13
  39. package/dist/keyvaluefield-BZQDG0l5.js +1 -0
  40. package/dist/{line-JDUXJ2fy.mjs → line-B3CAbZOo.mjs} +1 -1
  41. package/dist/line-tIm99vYW.js +1 -0
  42. package/dist/{lineitemlist-D84p4ZC5.mjs → lineitemlist-CBSqoC9g.mjs} +7 -7
  43. package/dist/lineitemlist-RqStjYB-.js +1 -0
  44. package/dist/{list-B6gocnmr.mjs → list-C8QMpJOJ.mjs} +2 -2
  45. package/dist/list-D_cawpPI.js +1 -0
  46. package/dist/locationfield-BiLy-c09.js +1 -0
  47. package/dist/{locationfield-En3apdDQ.mjs → locationfield-KBbu-98L.mjs} +39 -39
  48. package/dist/{markdowneditor-B0CYYefE.mjs → markdowneditor-DFOgRmdL.mjs} +1 -1
  49. package/dist/markdowneditor-Dy7Q01FM.js +2 -0
  50. package/dist/{matrixfield-D9IJr1qQ.mjs → matrixfield-0lnuaEks.mjs} +7 -7
  51. package/dist/matrixfield-nWt6Cug5.js +1 -0
  52. package/dist/{multitextbox-CrHH_t_8.mjs → multitextbox-DmAWV163.mjs} +23 -23
  53. package/dist/multitextbox-oEgl2F8-.js +1 -0
  54. package/dist/{npsscale-BS-ooCks.mjs → npsscale-CdTEwERY.mjs} +12 -12
  55. package/dist/npsscale-DW4sxcLz.js +1 -0
  56. package/dist/{numberstepper-Dc7wEzfb.mjs → numberstepper-BwQ5coLc.mjs} +8 -8
  57. package/dist/numberstepper-cDosevJb.js +1 -0
  58. package/dist/{pie-BpGQ6Aor.mjs → pie-CBRckgd4.mjs} +1 -1
  59. package/dist/pie-gAfuDR1F.js +1 -0
  60. package/dist/richtexteditor-DI-h5Efn.js +1 -0
  61. package/dist/{richtexteditor-DHDVUoic.mjs → richtexteditor-xrbv8PXZ.mjs} +1 -1
  62. package/dist/{signature-Twiet_Pp.mjs → signature-CP_lA_Yh.mjs} +1 -1
  63. package/dist/{signature-CDaNiDTO.js → signature-FM6L60nk.js} +2 -2
  64. package/dist/{stepper-PK1xI0po.mjs → stepper-BprezTzX.mjs} +4 -4
  65. package/dist/stepper-CjGNFyBz.js +1 -0
  66. package/dist/{summaryfield-CDDYwbfV.mjs → summaryfield-5mJRwVZ4.mjs} +5 -5
  67. package/dist/summaryfield-C3xmqZQp.js +1 -0
  68. package/dist/tabs-B4P59kHX.js +1 -0
  69. package/dist/{tabs-BJ9HBvyr.mjs → tabs-By-Mm8vm.mjs} +1 -1
  70. package/dist/tagsinput-BwM3NYK_.js +1 -0
  71. package/dist/{tagsinput-B2W--DfP.mjs → tagsinput-Ce4EWy4i.mjs} +10 -10
  72. package/package.json +6 -1
  73. package/dist/accordion-CI-d8sBW.js +0 -1
  74. package/dist/addressfield-BVtAZyuA.js +0 -1
  75. package/dist/asyncautocomplete-CGUaYa8k.js +0 -1
  76. package/dist/bar-D-Mi7Kmk.js +0 -1
  77. package/dist/cascadeselect-Cu_sJIFt.js +0 -1
  78. package/dist/colorpicker-C6X7x0s_.js +0 -1
  79. package/dist/consentfield-BbwsP80E.js +0 -1
  80. package/dist/datatable-BThXDunv.js +0 -1
  81. package/dist/editabletable-Bv2TfEOc.js +0 -1
  82. package/dist/fileupload-CmWZnxyT.js +0 -1
  83. package/dist/formrepeater-COl6gNZi.js +0 -1
  84. package/dist/formwizard-hlQ_NCsd.js +0 -1
  85. package/dist/geofield-wtSTkcE0.js +0 -1
  86. package/dist/group-D95eDbtd.js +0 -1
  87. package/dist/index-DX3lZIKI.js +0 -43
  88. package/dist/intlphone-DR5-jK9f.js +0 -1
  89. package/dist/keyvaluefield-C89E1mqp.js +0 -1
  90. package/dist/line-B_-WceU1.js +0 -1
  91. package/dist/lineitemlist-VAV6uqyg.js +0 -1
  92. package/dist/list-DFdCIA2P.js +0 -1
  93. package/dist/locationfield-DSV_O6aK.js +0 -1
  94. package/dist/markdowneditor-LUCZHsC6.js +0 -2
  95. package/dist/matrixfield-BxngfAiS.js +0 -1
  96. package/dist/multitextbox-DETwPeJY.js +0 -1
  97. package/dist/npsscale-5fQ1nTCy.js +0 -1
  98. package/dist/numberstepper-FRaiyZz0.js +0 -1
  99. package/dist/pie-DvzqIIDM.js +0 -1
  100. package/dist/richtexteditor-B7iljrHN.js +0 -1
  101. package/dist/stepper-Cf2nMTEt.js +0 -1
  102. package/dist/summaryfield-XXHz95hU.js +0 -1
  103. package/dist/tabs-B3s52APG.js +0 -1
  104. package/dist/tagsinput-Dz7D54iz.js +0 -1
@@ -1,37 +1,37 @@
1
- import { jsxs as S, jsx as i, Fragment as k } from "react/jsx-runtime";
2
- import q from "react";
3
- import { u as O, k as U, V as H, n as R } from "./index-B7i3cvH0.mjs";
1
+ import { jsxs as S, jsx as i, Fragment as q } from "react/jsx-runtime";
2
+ import w from "react";
3
+ import { j as O, t as U, V as H, v as R } from "./AIForm-DtRl0WdY.mjs";
4
4
  import G from "@mui/material/TextField";
5
5
  import J from "@mui/material/Button";
6
6
  import m from "@mui/material/Box";
7
7
  import { Icon as K } from "@mui/material";
8
- function oe({ attributes: s = {}, rules: v = {}, onChange: r, submitTick: h, messages: w }) {
8
+ function oe({ attributes: l = {}, rules: v = {}, onChange: r, submitTick: h, messages: F }) {
9
9
  const {
10
10
  id: d = "",
11
- MuiAttributes: n = {},
12
- InputProps: F = {},
11
+ MuiAttributes: s = {},
12
+ InputProps: b = {},
13
13
  format: x = "",
14
14
  buttonText: g = "Update Location",
15
- buttonIcon: b = "location_on",
16
- buttonDisplay: z = "both",
15
+ buttonIcon: j = "location_on",
16
+ buttonDisplay: k = "both",
17
17
  MuiButtonAttributes: P = {},
18
18
  disabled: V = !1
19
- } = s, [a, u] = q.useState({
20
- value: s.value !== void 0 ? s.value : "",
21
- helperText: n.helperText || "",
19
+ } = l, [a, u] = w.useState({
20
+ value: l.value !== void 0 ? l.value : "",
21
+ helperText: s.helperText || "",
22
22
  error: !1
23
23
  });
24
- q.useEffect(() => {
25
- s.value !== void 0 && s.value !== a.value && u((e) => ({ ...e, value: s.value }));
26
- }, [s.value]);
27
- const A = (e) => x ? R(e).format(x) : e, c = (e) => {
24
+ w.useEffect(() => {
25
+ l.value !== void 0 && l.value !== a.value && u((e) => ({ ...e, value: l.value }));
26
+ }, [l.value]);
27
+ const z = (e) => x ? R(e).format(x) : e, c = (e) => {
28
28
  const { validation: t } = v;
29
29
  if (t)
30
30
  for (let o = 0; o < t.length; o += 1) {
31
- const l = t[o], B = H[l.rule];
32
- if (!(typeof B == "function" ? B(e, l.value) : !0)) {
33
- const L = l.rule === "mandatory" ? w?.required || "This field is required" : "";
34
- return { isValid: !1, message: l.message || L };
31
+ const n = t[o], B = H[n.rule];
32
+ if (!(typeof B == "function" ? B(e, n.value) : !0)) {
33
+ const L = n.rule === "mandatory" ? F?.required || "This field is required" : "";
34
+ return { isValid: !1, message: n.message || L };
35
35
  }
36
36
  }
37
37
  return { isValid: !0, message: "" };
@@ -42,38 +42,38 @@ function oe({ attributes: s = {}, rules: v = {}, onChange: r, submitTick: h, mes
42
42
  u((t) => ({ ...t, helperText: e.message, error: !e.isValid }));
43
43
  }
44
44
  }, [h]);
45
- const D = (e) => {
45
+ const A = (e) => {
46
46
  const { value: t } = e.target, o = c(t);
47
47
  u({ value: t, helperText: o.message, error: !o.isValid });
48
- }, E = (e) => {
49
- const { value: t } = e.target, o = A(t), l = c(o);
50
- u({ value: o, helperText: l.message, error: !l.isValid }), typeof r == "function" && r({ id: d, value: o });
51
- }, M = () => {
48
+ }, D = (e) => {
49
+ const { value: t } = e.target, o = z(t), n = c(o);
50
+ u({ value: o, helperText: n.message, error: !n.isValid }), typeof r == "function" && r({ id: d, value: o });
51
+ }, E = () => {
52
52
  r && r({ id: d, value: a.value, option: "location_update_request" });
53
- }, W = () => {
54
- const e = z, t = /* @__PURE__ */ i(K, { children: b });
53
+ }, M = () => {
54
+ const e = k, t = /* @__PURE__ */ i(K, { children: j });
55
55
  switch (e) {
56
56
  case "icon":
57
57
  return t;
58
58
  case "text":
59
- return /* @__PURE__ */ i(k, { children: g });
59
+ return /* @__PURE__ */ i(q, { children: g });
60
60
  default:
61
- return /* @__PURE__ */ S(k, { children: [
61
+ return /* @__PURE__ */ S(q, { children: [
62
62
  t,
63
63
  /* @__PURE__ */ i(m, { component: "span", sx: { ml: 0.5 }, children: g })
64
64
  ] });
65
65
  }
66
- }, _ = v?.validation?.some((e) => e.rule === "mandatory") || !1, p = !!n?.slotProps, f = { ...n };
66
+ }, W = v?.validation?.some((e) => e.rule === "mandatory") || !1, p = !!s?.slotProps, f = { ...s };
67
67
  let I, T;
68
68
  if (p) {
69
- const e = n.slotProps && n.slotProps.input || {};
69
+ const e = s.slotProps && s.slotProps.input || {};
70
70
  T = {
71
- ...n.slotProps || {},
71
+ ...s.slotProps || {},
72
72
  input: { ...e }
73
73
  }, delete f.slotProps;
74
74
  } else
75
- I = { ...n.inputProps || {} }, delete f.inputProps;
76
- const j = n.variant || "outlined", y = n.size || "medium", C = y === "small" ? j === "outlined" ? 40 : 48 : 56;
75
+ I = { ...s.inputProps || {} }, delete f.inputProps;
76
+ const _ = s.variant || "outlined", y = s.size || "medium", C = y === "small" ? _ === "outlined" ? 40 : 48 : 56;
77
77
  return /* @__PURE__ */ S(m, { sx: { display: "flex", gap: 1, alignItems: "flex-start", width: "100%" }, children: [
78
78
  /* @__PURE__ */ i(m, { sx: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ i(
79
79
  G,
@@ -81,12 +81,12 @@ function oe({ attributes: s = {}, rules: v = {}, onChange: r, submitTick: h, mes
81
81
  fullWidth: !0,
82
82
  ...f,
83
83
  id: d,
84
- required: _,
84
+ required: W,
85
85
  inputProps: p ? void 0 : I,
86
86
  slotProps: p ? T : void 0,
87
- InputProps: U(F),
88
- onChange: D,
89
- onBlur: E,
87
+ InputProps: U(b),
88
+ onChange: A,
89
+ onBlur: D,
90
90
  value: a.value,
91
91
  error: a.error,
92
92
  helperText: a.helperText,
@@ -99,7 +99,7 @@ function oe({ attributes: s = {}, rules: v = {}, onChange: r, submitTick: h, mes
99
99
  variant: "outlined",
100
100
  color: "primary",
101
101
  size: y === "small" ? "small" : "medium",
102
- onClick: M,
102
+ onClick: E,
103
103
  disabled: V,
104
104
  ...P,
105
105
  sx: {
@@ -109,7 +109,7 @@ function oe({ attributes: s = {}, rules: v = {}, onChange: r, submitTick: h, mes
109
109
  flexShrink: 0,
110
110
  ...P?.sx
111
111
  },
112
- children: W()
112
+ children: M()
113
113
  }
114
114
  )
115
115
  ] });
@@ -7,7 +7,7 @@ import k from "@mui/material/TextField";
7
7
  import y from "@mui/material/FormControl";
8
8
  import C from "@mui/material/FormLabel";
9
9
  import { alpha as S } from "@mui/material/styles";
10
- import { u as j, m as M, a as H } from "./index-B7i3cvH0.mjs";
10
+ import { j, m as M, k as H } from "./AIForm-DtRl0WdY.mjs";
11
11
  function R(t) {
12
12
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
13
13
  }
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),p=require("react"),v=require("@mui/material/Box"),w=require("@mui/material/Stack"),j=require("@mui/material/Button"),q=require("@mui/material/TextField"),y=require("@mui/material/FormControl"),k=require("@mui/material/FormLabel"),S=require("@mui/material/styles"),l=require("./AIForm-Dv8ahXyE.js");function C(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function M(t){let e=C(t||"");return e=e.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),e=e.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),e=e.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),e=e.replace(/(?:^-\s+.*(?:\n|$))+/gm,s=>`<ul>${s.trimEnd().split(`
2
+ `).map(i=>i.replace(/^-\s+(.*)$/,"<li>$1</li>")).join("")}</ul>`),e=e.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,'<a href="$2">$1</a>'),e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*([^*]+)\*/g,"<em>$1</em>"),e=e.split(/\n{2,}/).map(s=>{const n=s.trim();return n?/^<(h1|h2|h3|ul|pre)/.test(n)?n:`<p>${n.replace(/\n/g,"<br />")}</p>`:""}).join(""),e}function R({attributes:t={},rules:e={},onChange:s}){const{id:n="",label:i,rows:a=6,MuiAttributes:g={}}=t,{sx:h,...x}=g,[u,c]=p.useState(t.value||""),[d,f]=p.useState(!1);l.useUpdateEffect(()=>{c(t.value||"")},[t.value]);const $=e?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,b=r=>{const m=r.target.value;c(m),s?.({id:n,value:m})};return o.jsxs(y,{required:$,component:"fieldset",fullWidth:!0,children:[o.jsxs(w,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:1},children:[i?o.jsx(k,{component:"legend",children:i}):o.jsx("span",{}),o.jsx(j,{size:"small",variant:"outlined",onClick:()=>f(r=>!r),sx:{borderRadius:"10px",textTransform:"none"},children:d?"Write":"Preview"})]}),d?o.jsx(v,{"data-testid":"markdown-preview",dangerouslySetInnerHTML:{__html:M(u)},sx:{minHeight:r=>r.spacing(a*3),p:2,borderRadius:"10px",border:r=>`1px solid ${S.alpha(r.palette.text.primary,.12)}`,backgroundColor:r=>r.palette.background.paper,"& :first-of-type":{mt:0},"& :last-child":{mb:0}}}):o.jsx(q,{id:n||void 0,value:u,onChange:b,multiline:!0,minRows:a,fullWidth:!0,placeholder:"Write markdown…",inputProps:{"aria-label":i||"markdown editor"},...x,sx:l.mergeSx(l.premiumInputSx,h)})]})}exports.default=R;
@@ -12,7 +12,7 @@ import J from "@mui/material/FormControl";
12
12
  import K from "@mui/material/FormLabel";
13
13
  import N from "@mui/material/FormHelperText";
14
14
  import { alpha as R } from "@mui/material/styles";
15
- import { u as O, m as Q, b as V } from "./index-B7i3cvH0.mjs";
15
+ import { j as O, m as Q, l as V } from "./AIForm-DtRl0WdY.mjs";
16
16
  const X = (n) => (n || []).map(
17
17
  (a) => typeof a == "string" ? { id: a, label: a } : { id: String(a.id), label: a.label ?? String(a.id) }
18
18
  ), Y = (n) => (n || []).map(
@@ -30,7 +30,7 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
30
30
  O(() => {
31
31
  S(n.value || {});
32
32
  }, [n.value]);
33
- const p = a?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, q = (e) => {
33
+ const p = a?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, j = (e) => {
34
34
  let r = !0, l = "";
35
35
  return p && (x.every((m) => {
36
36
  const i = e[m.id];
@@ -40,11 +40,11 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
40
40
  )?.message || "Required")), { isValid: r, message: l };
41
41
  }, k = (e) => {
42
42
  S(e);
43
- const r = q(e);
43
+ const r = j(e);
44
44
  W(!r.isValid), z(r.message), $?.({ id: h, value: e, option: e });
45
- }, H = (e, r) => {
45
+ }, q = (e, r) => {
46
46
  k({ ...o, [e]: r });
47
- }, j = (e, r, l) => {
47
+ }, H = (e, r, l) => {
48
48
  const f = Array.isArray(o[e]) ? o[e] : [], m = l ? [...f, r] : f.filter((i) => i !== r);
49
49
  k({ ...o, [e]: m });
50
50
  }, A = (e, r) => {
@@ -86,7 +86,7 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
86
86
  G,
87
87
  {
88
88
  checked: A(e.id, r.value),
89
- onChange: (l) => j(e.id, r.value, l.target.checked),
89
+ onChange: (l) => H(e.id, r.value, l.target.checked),
90
90
  inputProps: {
91
91
  "aria-label": `${e.label} ${r.label}`
92
92
  }
@@ -96,7 +96,7 @@ function ce({ attributes: n = {}, rules: a = {}, onChange: $ }) {
96
96
  {
97
97
  name: `matrix-${h}-${e.id}`,
98
98
  checked: A(e.id, r.value),
99
- onChange: () => H(e.id, r.value),
99
+ onChange: () => q(e.id, r.value),
100
100
  inputProps: {
101
101
  "aria-label": `${e.label} ${r.label}`
102
102
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react"),w=require("@mui/material/Table"),B=require("@mui/material/TableBody"),c=require("@mui/material/TableCell"),L=require("@mui/material/TableContainer"),O=require("@mui/material/TableHead"),A=require("@mui/material/TableRow"),U=require("@mui/material/Radio"),D=require("@mui/material/Checkbox"),G=require("@mui/material/FormControl"),J=require("@mui/material/FormLabel"),K=require("@mui/material/FormHelperText"),M=require("@mui/material/styles"),x=require("./AIForm-Dv8ahXyE.js"),N=l=>(l||[]).map(s=>typeof s=="string"?{id:s,label:s}:{id:String(s.id),label:s.label??String(s.id)}),Q=l=>(l||[]).map(s=>typeof s=="string"?{value:s,label:s}:{value:String(s.value),label:s.label??String(s.value)});function V({attributes:l={},rules:s={},onChange:k}){const{MuiAttributes:R={},id:b="",rows:p=[],columns:g=[],multiple:d=!1,label:v=""}=l,f=o.useMemo(()=>N(p),[p]),y=o.useMemo(()=>Q(g),[g]),[i,q]=o.useState(l.value||{}),[j,F]=o.useState(!1),[S,$]=o.useState("");x.useUpdateEffect(()=>{q(l.value||{})},[l.value]);const m=s?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,W=e=>{let r=!0,n="";return m&&(f.every(u=>{const a=e[u.id];return d?Array.isArray(a)&&a.length>0:a!=null&&a!==""})||(r=!1,n=s?.validation?.find(a=>a.rule==="mandatory"||a.rule==="mandatoryselect")?.message||"Required")),{isValid:r,message:n}},C=e=>{q(e);const r=W(e);F(!r.isValid),$(r.message),k?.({id:b,value:e,option:e})},z=(e,r)=>{C({...i,[e]:r})},H=(e,r,n)=>{const h=Array.isArray(i[e])?i[e]:[],u=n?[...h,r]:h.filter(a=>a!==r);C({...i,[e]:u})},T=(e,r)=>{const n=i[e];return d?Array.isArray(n)&&n.includes(r):n===r},{sx:P,...E}=R;return t.jsxs(G,{required:m,error:j,component:"fieldset",fullWidth:!0,children:[v&&t.jsx(J,{required:m,error:j,sx:{mb:1,fontWeight:600},children:v}),t.jsx(L,{sx:x.mergeSx(x.premiumSurfaceSx,{width:"100%"}),children:t.jsxs(w,{size:"small",...E,sx:P,children:[t.jsx(O,{children:t.jsxs(A,{sx:e=>({backgroundColor:M.alpha(e.palette.primary.main,.06)}),children:[t.jsx(c,{sx:{fontWeight:700}}),y.map(e=>t.jsx(c,{align:"center",sx:{fontWeight:700},children:e.label},e.value))]})}),t.jsx(B,{children:f.map(e=>t.jsxs(A,{hover:!0,sx:r=>({transition:"background-color .18s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{backgroundColor:M.alpha(r.palette.primary.main,.04)}}),children:[t.jsx(c,{component:"th",scope:"row",sx:{fontWeight:500},children:e.label}),y.map(r=>t.jsx(c,{align:"center",padding:"checkbox",children:d?t.jsx(D,{checked:T(e.id,r.value),onChange:n=>H(e.id,r.value,n.target.checked),inputProps:{"aria-label":`${e.label} ${r.label}`}}):t.jsx(U,{name:`matrix-${b}-${e.id}`,checked:T(e.id,r.value),onChange:()=>z(e.id,r.value),inputProps:{"aria-label":`${e.label} ${r.label}`}})},r.value))]},e.id))})]})}),S&&t.jsx(K,{children:S})]})}exports.default=V;
@@ -1,9 +1,9 @@
1
- import { jsx as a, jsxs as k } from "react/jsx-runtime";
2
- import { useRef as S, useState as j, useEffect as R } from "react";
1
+ import { jsx as o, jsxs as k } from "react/jsx-runtime";
2
+ import { useRef as j, useState as S, useEffect as R } from "react";
3
3
  import { Stack as q, Box as w, TextField as O, Button as $, Icon as d, IconButton as B } from "@mui/material";
4
- import { u as v, a as C } from "./index-B7i3cvH0.mjs";
4
+ import { j as v, k as C } from "./AIForm-DtRl0WdY.mjs";
5
5
  function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, messages: m }) {
6
- const { id: u = "" } = r, h = m?.required || "Required", f = S(null), [t, o] = j(() => {
6
+ const { id: s = "" } = r, h = m?.required || "Required", f = j(null), [t, a] = S(() => {
7
7
  if (r.value && typeof r.value == "object") {
8
8
  const e = Object.entries(r.value).map(([l, n]) => ({
9
9
  key: l,
@@ -12,41 +12,41 @@ function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, mess
12
12
  if (e.length > 0) return e;
13
13
  }
14
14
  return [{ key: "t1", value: "" }];
15
- }), s = p?.validation?.some((e) => e.rule === "mandatory") || !1;
15
+ }), u = p?.validation?.some((e) => e.rule === "mandatory") || !1;
16
16
  v(() => {
17
- c && s && !t[0]?.value && f.current?.focus();
17
+ c && u && !t[0]?.value && f.current?.focus();
18
18
  }, [c]), v(() => {
19
19
  if (r.value && typeof r.value == "object") {
20
20
  const e = Object.entries(r.value).map(([l, n]) => ({
21
21
  key: l,
22
22
  value: String(n)
23
23
  }));
24
- JSON.stringify(e) !== JSON.stringify(t) && o(e.length > 0 ? e : [{ key: "t1", value: "" }]);
25
- } else r.value || o([{ key: "t1", value: "" }]);
24
+ JSON.stringify(e) !== JSON.stringify(t) && a(e.length > 0 ? e : [{ key: "t1", value: "" }]);
25
+ } else r.value || a([{ key: "t1", value: "" }]);
26
26
  }, [r.value]), R(() => {
27
27
  const e = t.reduce((l, n) => (l[n.key] = n.value, l), {});
28
- i && i({ id: u, value: e });
29
- }, [t, u]);
28
+ i && i({ id: s, value: e });
29
+ }, [t, s]);
30
30
  const y = () => {
31
31
  const e = t.length + 1;
32
- o([...t, { key: `t${e}`, value: "" }]);
32
+ a([...t, { key: `t${e}`, value: "" }]);
33
33
  }, g = (e) => {
34
34
  const l = t.filter((n, I) => I !== e);
35
- o(l);
35
+ a(l);
36
36
  }, x = (e, l) => {
37
37
  const n = [...t];
38
- n[e].value = l, o(n);
38
+ n[e].value = l, a(n);
39
39
  };
40
- return /* @__PURE__ */ a(q, { spacing: 2, sx: { width: "100%" }, children: t.map((e, l) => /* @__PURE__ */ k(w, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
41
- /* @__PURE__ */ a(
40
+ return /* @__PURE__ */ o(q, { spacing: 2, sx: { width: "100%" }, children: t.map((e, l) => /* @__PURE__ */ k(w, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
41
+ /* @__PURE__ */ o(
42
42
  O,
43
43
  {
44
44
  fullWidth: !0,
45
- id: l === 0 ? u : `${u}_${e.key}`,
45
+ id: l === 0 ? s : `${s}_${e.key}`,
46
46
  inputRef: l === 0 ? f : void 0,
47
- required: s,
48
- error: s && !e.value,
49
- helperText: s && !e.value ? h : "",
47
+ required: u,
48
+ error: u && !e.value,
49
+ helperText: u && !e.value ? h : "",
50
50
  label: `Value ${e.key}`,
51
51
  value: e.value,
52
52
  onChange: (n) => x(l, n.target.value),
@@ -54,21 +54,21 @@ function T({ attributes: r = {}, rules: p = {}, onChange: i, submitTick: c, mess
54
54
  sx: C
55
55
  }
56
56
  ),
57
- l === t.length - 1 ? /* @__PURE__ */ a(
57
+ l === t.length - 1 ? /* @__PURE__ */ o(
58
58
  $,
59
59
  {
60
60
  variant: "contained",
61
61
  color: "primary",
62
62
  onClick: y,
63
63
  sx: { minWidth: "40px", p: 1 },
64
- children: /* @__PURE__ */ a(d, { children: "add" })
64
+ children: /* @__PURE__ */ o(d, { children: "add" })
65
65
  }
66
- ) : /* @__PURE__ */ a(
66
+ ) : /* @__PURE__ */ o(
67
67
  B,
68
68
  {
69
69
  color: "error",
70
70
  onClick: () => g(l),
71
- children: /* @__PURE__ */ a(d, { children: "remove" })
71
+ children: /* @__PURE__ */ o(d, { children: "remove" })
72
72
  }
73
73
  )
74
74
  ] }, l)) });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),a=require("@mui/material"),d=require("./AIForm-Dv8ahXyE.js");function k({attributes:r={},rules:h={},onChange:f,submitTick:v,messages:m}){const{id:o=""}=r,x=m?.required||"Required",p=i.useRef(null),[l,u]=i.useState(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));if(e.length>0)return e}return[{key:"t1",value:""}]}),c=h?.validation?.some(e=>e.rule==="mandatory")||!1;d.useUpdateEffect(()=>{v&&c&&!l[0]?.value&&p.current?.focus()},[v]),d.useUpdateEffect(()=>{if(r.value&&typeof r.value=="object"){const e=Object.entries(r.value).map(([n,t])=>({key:n,value:String(t)}));JSON.stringify(e)!==JSON.stringify(l)&&u(e.length>0?e:[{key:"t1",value:""}])}else r.value||u([{key:"t1",value:""}])},[r.value]),i.useEffect(()=>{const e=l.reduce((n,t)=>(n[t.key]=t.value,n),{});f&&f({id:o,value:e})},[l,o]);const y=()=>{const e=l.length+1;u([...l,{key:`t${e}`,value:""}])},g=e=>{const n=l.filter((t,I)=>I!==e);u(n)},j=(e,n)=>{const t=[...l];t[e].value=n,u(t)};return s.jsx(a.Stack,{spacing:2,sx:{width:"100%"},children:l.map((e,n)=>s.jsxs(a.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[s.jsx(a.TextField,{fullWidth:!0,id:n===0?o:`${o}_${e.key}`,inputRef:n===0?p:void 0,required:c,error:c&&!e.value,helperText:c&&!e.value?x:"",label:`Value ${e.key}`,value:e.value,onChange:t=>j(n,t.target.value),size:"small",sx:d.premiumInputSx}),n===l.length-1?s.jsx(a.Button,{variant:"contained",color:"primary",onClick:y,sx:{minWidth:"40px",p:1},children:s.jsx(a.Icon,{children:"add"})}):s.jsx(a.IconButton,{color:"error",onClick:()=>g(n),children:s.jsx(a.Icon,{children:"remove"})})]},n))})}exports.default=k;
@@ -7,34 +7,34 @@ import A from "@mui/material/FormControl";
7
7
  import F from "@mui/material/FormLabel";
8
8
  import L from "@mui/material/FormHelperText";
9
9
  import { alpha as l } from "@mui/material/styles";
10
- import { u as V, P as s, d as N } from "./index-B7i3cvH0.mjs";
11
- function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, messages: M }) {
10
+ import { j as V, P as s, o as N } from "./AIForm-DtRl0WdY.mjs";
11
+ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: m, messages: M }) {
12
12
  const {
13
- id: m = "",
13
+ id: d = "",
14
14
  label: i,
15
15
  min: R = 0,
16
16
  max: $ = 10,
17
17
  lowLabel: E = "Not likely",
18
- highLabel: I = "Very likely",
18
+ highLabel: j = "Very likely",
19
19
  MuiAttributes: c = {}
20
- } = a, U = typeof a.value == "number" ? a.value : "", [u, f] = n.useState(U), [W, x] = n.useState(!1), [y, h] = n.useState("");
20
+ } = a, I = typeof a.value == "number" ? a.value : "", [u, f] = n.useState(I), [U, x] = n.useState(!1), [y, h] = n.useState("");
21
21
  V(() => {
22
22
  f(typeof a.value == "number" ? a.value : "");
23
23
  }, [a.value]);
24
24
  const g = p?.validation?.some((e) => e.rule === "mandatory" || e.rule === "mandatoryselect") || !1, b = (e) => g ? typeof e != "number" ? { isValid: !1, message: p?.validation?.find((r) => r.rule === "mandatory" || r.rule === "mandatoryselect")?.message || M?.required || "Required" } : { isValid: !0, message: "" } : { isValid: !0, message: "" };
25
25
  V(() => {
26
- if (d) {
26
+ if (m) {
27
27
  const e = b(u);
28
28
  x(!e.isValid), h(e.message);
29
29
  }
30
- }, [d]);
31
- const j = (e) => {
30
+ }, [m]);
31
+ const W = (e) => {
32
32
  f(e);
33
33
  const o = b(e);
34
- x(!o.isValid), h(o.message), k?.({ id: m, value: e });
34
+ x(!o.isValid), h(o.message), k?.({ id: d, value: e });
35
35
  }, v = [];
36
36
  for (let e = R; e <= $; e += 1) v.push(e);
37
- return /* @__PURE__ */ S(A, { id: m, required: g, error: W, component: "fieldset", sx: { width: "100%" }, children: [
37
+ return /* @__PURE__ */ S(A, { id: d, required: g, error: U, component: "fieldset", sx: { width: "100%" }, children: [
38
38
  i && /* @__PURE__ */ t(F, { sx: { mb: 1, fontWeight: 500 }, component: "legend", children: i }),
39
39
  /* @__PURE__ */ t(C, { role: "radiogroup", "aria-label": i || "nps scale", sx: { display: "flex", flexWrap: "wrap", gap: 0.75 }, children: v.map((e) => {
40
40
  const o = u === e;
@@ -45,7 +45,7 @@ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, mess
45
45
  "aria-checked": o,
46
46
  variant: o ? "contained" : "outlined",
47
47
  color: "primary",
48
- onClick: () => j(e),
48
+ onClick: () => W(e),
49
49
  ...c,
50
50
  sx: (r) => ({
51
51
  minWidth: 44,
@@ -77,7 +77,7 @@ function K({ attributes: a = {}, rules: p = {}, onChange: k, submitTick: d, mess
77
77
  }) }),
78
78
  /* @__PURE__ */ S(C, { sx: { display: "flex", justifyContent: "space-between", mt: 0.75 }, children: [
79
79
  /* @__PURE__ */ t(w, { variant: "caption", color: "text.secondary", children: E }),
80
- /* @__PURE__ */ t(w, { variant: "caption", color: "text.secondary", children: I })
80
+ /* @__PURE__ */ t(w, { variant: "caption", color: "text.secondary", children: j })
81
81
  ] }),
82
82
  y && /* @__PURE__ */ t(L, { children: y })
83
83
  ] });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react"),q=require("@mui/material/Box"),k=require("@mui/material/Button"),S=require("@mui/material/Typography"),A=require("@mui/material/FormControl"),$=require("@mui/material/FormLabel"),N=require("@mui/material/FormHelperText"),s=require("@mui/material/styles"),l=require("./AIForm-Dv8ahXyE.js");function P({attributes:t={},rules:c={},onChange:j,submitTick:d,messages:M}){const{id:p="",label:n,min:E=0,max:I=10,lowLabel:R="Not likely",highLabel:C="Very likely",MuiAttributes:u={}}=t,w=typeof t.value=="number"?t.value:"",[m,x]=i.useState(w),[U,y]=i.useState(!1),[f,h]=i.useState("");l.useUpdateEffect(()=>{x(typeof t.value=="number"?t.value:"")},[t.value]);const g=c?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1,b=e=>g?typeof e!="number"?{isValid:!1,message:c?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||M?.required||"Required"}:{isValid:!0,message:""}:{isValid:!0,message:""};l.useUpdateEffect(()=>{if(d){const e=b(m);y(!e.isValid),h(e.message)}},[d]);const V=e=>{x(e);const a=b(e);y(!a.isValid),h(a.message),j?.({id:p,value:e})},v=[];for(let e=E;e<=I;e+=1)v.push(e);return o.jsxs(A,{id:p,required:g,error:U,component:"fieldset",sx:{width:"100%"},children:[n&&o.jsx($,{sx:{mb:1,fontWeight:500},component:"legend",children:n}),o.jsx(q,{role:"radiogroup","aria-label":n||"nps scale",sx:{display:"flex",flexWrap:"wrap",gap:.75},children:v.map(e=>{const a=m===e;return o.jsx(k,{role:"radio","aria-checked":a,variant:a?"contained":"outlined",color:"primary",onClick:()=>V(e),...u,sx:r=>({minWidth:44,height:44,px:0,fontWeight:600,borderRadius:`${l.PREMIUM_RADIUS}px`,transition:`transform .18s ${l.PREMIUM_EASING}, box-shadow .18s ${l.PREMIUM_EASING}, background-color .18s ${l.PREMIUM_EASING}`,...a?{boxShadow:`0 4px 12px ${s.alpha(r.palette.primary.main,.35)}`}:{borderColor:s.alpha(r.palette.text.primary,.2),"&:hover":{borderColor:r.palette.primary.main,backgroundColor:s.alpha(r.palette.primary.main,.06)}},"&:hover":{transform:"translateY(-1px)",...a?{boxShadow:`0 6px 16px ${s.alpha(r.palette.primary.main,.4)}`}:{borderColor:r.palette.primary.main,backgroundColor:s.alpha(r.palette.primary.main,.06)}},...u.sx||{}}),children:e},e)})}),o.jsxs(q,{sx:{display:"flex",justifyContent:"space-between",mt:.75},children:[o.jsx(S,{variant:"caption",color:"text.secondary",children:R}),o.jsx(S,{variant:"caption",color:"text.secondary",children:C})]}),f&&o.jsx(N,{children:f})]})}exports.default=P;
@@ -9,7 +9,7 @@ import E from "@mui/material/FormHelperText";
9
9
  import H from "@mui/icons-material/Remove";
10
10
  import L from "@mui/icons-material/Add";
11
11
  import { alpha as m } from "@mui/material/styles";
12
- import { u as P, m as U } from "./index-B7i3cvH0.mjs";
12
+ import { j as P, m as U } from "./AIForm-DtRl0WdY.mjs";
13
13
  const t = (n, c = 0) => {
14
14
  const i = Number(n);
15
15
  return Number.isFinite(i) ? i : c;
@@ -22,19 +22,19 @@ function re({ attributes: n = {}, rules: c = {}, onChange: i }) {
22
22
  max: s,
23
23
  step: b = 1,
24
24
  label: d
25
- } = n, { sx: B, ...F } = A, h = l != null, v = s != null, u = (e) => {
25
+ } = n, { sx: B, ...F } = A, h = l != null, v = s != null, p = (e) => {
26
26
  let r = e;
27
27
  return h && (r = Math.max(r, t(l))), v && (r = Math.min(r, t(s))), r;
28
- }, [a, g] = I.useState(() => u(t(n.value, 0))), [S, p] = I.useState(String(a)), y = c?.validation?.some(
28
+ }, [a, g] = I.useState(() => p(t(n.value, 0))), [S, u] = I.useState(String(a)), y = c?.validation?.some(
29
29
  (e) => e.rule === "mandatory" || e.rule === "mandatoryselect"
30
30
  ) || !1;
31
31
  P(() => {
32
- const e = u(t(n.value, 0));
33
- g(e), p(String(e));
32
+ const e = p(t(n.value, 0));
33
+ g(e), u(String(e));
34
34
  }, [n.value]);
35
35
  const x = (e) => {
36
- const r = u(e);
37
- g(r), p(String(r)), i?.({ id: f, value: r });
36
+ const r = p(e);
37
+ g(r), u(String(r)), i?.({ id: f, value: r });
38
38
  }, M = h && a <= t(l), C = v && a >= t(s), N = () => {
39
39
  M || x(a - t(b, 1));
40
40
  }, R = () => {
@@ -99,7 +99,7 @@ function re({ attributes: n = {}, rules: c = {}, onChange: i }) {
99
99
  inputMode: "numeric",
100
100
  style: { textAlign: "center", width: 56 }
101
101
  },
102
- onChange: (e) => p(e.target.value),
102
+ onChange: (e) => u(e.target.value),
103
103
  onBlur: j,
104
104
  sx: {
105
105
  "& input": { py: 0.75 }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),C=require("react"),N=require("@mui/material/Stack"),T=require("@mui/material/InputBase"),k=require("@mui/material/IconButton"),P=require("@mui/material/FormControl"),$=require("@mui/material/FormLabel"),D=require("@mui/material/FormHelperText"),E=require("@mui/icons-material/Remove"),H=require("@mui/icons-material/Add"),c=require("@mui/material/styles"),w=require("./AIForm-Dv8ahXyE.js"),n=(o,u=0)=>{const i=Number(o);return Number.isFinite(i)?i:u};function L({attributes:o={},rules:u={},onChange:i}){const{MuiAttributes:I={},id:b="",min:s,max:l,step:h=1,label:d}=o,{sx:A,...F}=I,f=s!=null,g=l!=null,m=e=>{let t=e;return f&&(t=Math.max(t,n(s))),g&&(t=Math.min(t,n(l))),t},[a,v]=C.useState(()=>m(n(o.value,0))),[y,x]=C.useState(String(a)),S=u?.validation?.some(e=>e.rule==="mandatory"||e.rule==="mandatoryselect")||!1;w.useUpdateEffect(()=>{const e=m(n(o.value,0));v(e),x(String(e))},[o.value]);const p=e=>{const t=m(e);v(t),x(String(t)),i?.({id:b,value:t})},q=f&&a<=n(s),M=g&&a>=n(l),R=()=>{q||p(a-n(h,1))},z=()=>{M||p(a+n(h,1))},B=()=>{p(n(y,a))},j={borderRadius:0,px:1.25,color:"text.primary",transition:"background-color .18s","&:hover":e=>({backgroundColor:c.alpha(e.palette.primary.main,.08)}),"&.Mui-disabled":{color:"text.disabled"}};return r.jsxs(P,{component:"fieldset",error:!1,children:[d&&r.jsx($,{component:"legend",required:S,sx:{mb:1},children:d}),r.jsxs(N,{direction:"row",alignItems:"center",sx:w.mergeSx(e=>({display:"inline-flex",width:"fit-content",borderRadius:"10px",overflow:"hidden",border:`1px solid ${c.alpha(e.palette.text.primary,.16)}`,backgroundColor:e.palette.background.paper,transition:"box-shadow .2s, border-color .2s","&:hover":{borderColor:c.alpha(e.palette.primary.main,.5)},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${c.alpha(e.palette.primary.main,.16)}`}}),A),children:[r.jsx(k,{"aria-label":"decrement",onClick:R,disabled:q,size:"small",sx:j,children:r.jsx(E,{fontSize:"small"})}),r.jsx(T,{...F,value:y,inputProps:{"aria-label":d||b||"value",inputMode:"numeric",style:{textAlign:"center",width:56}},onChange:e=>x(e.target.value),onBlur:B,sx:{"& input":{py:.75}}}),r.jsx(k,{"aria-label":"increment",onClick:z,disabled:M,size:"small",sx:j,children:r.jsx(H,{fontSize:"small"})})]}),S&&r.jsx(D,{sx:{mx:0},children:""})]})}exports.default=L;
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import a, { Suspense as s } from "react";
3
3
  import n from "@mui/material/Box";
4
4
  import f from "@mui/material/CircularProgress";
5
- import { g as m } from "./index-B7i3cvH0.mjs";
5
+ import { i as m } from "./AIForm-DtRl0WdY.mjs";
6
6
  const c = a.lazy(
7
7
  () => import("@mui/x-charts/PieChart").then((r) => ({ default: r.PieChart }))
8
8
  );
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.create;var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var x=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of l(t))!d.call(e,i)&&i!==r&&u(e,i,{get:()=>t[i],enumerable:!(s=a(t,i))||s.enumerable});return e};var f=(e,t,r)=>(r=e!=null?c(h(e)):{},x(t||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),j=require("@mui/material/Box"),C=require("@mui/material/CircularProgress"),y=require("./AIForm-Dv8ahXyE.js"),P=o.lazy(()=>import("@mui/x-charts/PieChart").then(e=>({default:e.PieChart})));function g({attributes:e={}}){const{MuiChartAttributes:t={},id:r=""}=e,s=y.getMuiX("PieChart")||P;return n.jsx(o.Suspense,{fallback:n.jsx(j,{sx:{display:"flex",justifyContent:"center",p:2},children:n.jsx(C,{})}),children:n.jsx(s,{height:300,...t},r)})}exports.default=g;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),p=require("@mui/material/Box"),h=require("@mui/material/Paper"),x=require("@mui/material/Divider"),g=require("@mui/material/IconButton"),j=require("@mui/material/Tooltip"),M=require("@mui/material/FormLabel"),q=require("@mui/material/FormControl"),S=require("@mui/icons-material/FormatBold"),R=require("@mui/icons-material/FormatItalic"),y=require("@mui/icons-material/FormatUnderlined"),E=require("@mui/icons-material/FormatListBulleted"),C=require("@mui/icons-material/FormatListNumbered"),L=require("@mui/icons-material/Link"),v=require("@mui/icons-material/FormatClear"),n=require("@mui/material/styles"),o=require("./AIForm-Dv8ahXyE.js"),U=[{command:"bold",label:"Bold",icon:r.jsx(S,{fontSize:"small"})},{command:"italic",label:"Italic",icon:r.jsx(R,{fontSize:"small"})},{command:"underline",label:"Underline",icon:r.jsx(y,{fontSize:"small"})},{command:"insertUnorderedList",label:"Bulleted list",icon:r.jsx(E,{fontSize:"small"})},{command:"insertOrderedList",label:"Numbered list",icon:r.jsx(C,{fontSize:"small"})},{command:"createLink",label:"Insert link",icon:r.jsx(L,{fontSize:"small"}),prompt:!0},{command:"removeFormat",label:"Clear formatting",icon:r.jsx(v,{fontSize:"small"})}];function F({attributes:a={},onChange:u}){const{id:i="",label:s,minHeight:b=160,MuiAttributes:d={}}=a,l=m.useRef(null);m.useEffect(()=>{const e=l.current;if(!e)return;const t=a.value??"";e.innerHTML!==t&&(e.innerHTML=t)},[a.value]);const f=e=>{l.current?.focus();try{if(e.prompt){const t=window.prompt("Enter a URL");t&&document.execCommand(e.command,!1,t)}else document.execCommand(e.command)}catch{}l.current&&u?.({id:i,value:l.current.innerHTML})},I=e=>{u?.({id:i,value:e.currentTarget.innerHTML})};return r.jsxs(q,{fullWidth:!0,children:[s&&r.jsx(M,{sx:{mb:.75,fontWeight:500},component:"legend",children:s}),r.jsxs(h,{variant:"outlined",sx:e=>({borderRadius:`${o.PREMIUM_RADIUS+2}px`,borderColor:n.alpha(e.palette.text.primary,.12),overflow:"hidden",transition:`box-shadow .2s ${o.PREMIUM_EASING}, border-color .2s ${o.PREMIUM_EASING}`,"&:hover":{borderColor:n.alpha(e.palette.primary.main,.5),boxShadow:`0 2px 10px ${n.alpha(e.palette.common.black,.06)}`},"&:focus-within":{borderColor:e.palette.primary.main,boxShadow:`0 0 0 3px ${n.alpha(e.palette.primary.main,.16)}`}}),children:[r.jsx(p,{sx:e=>({display:"flex",flexWrap:"wrap",alignItems:"center",gap:.25,px:.75,py:.5,backgroundColor:n.alpha(e.palette.text.primary,.03)}),children:U.map((e,t)=>r.jsxs(m.Fragment,{children:[(t===3||t===5)&&r.jsx(x,{orientation:"vertical",flexItem:!0,sx:{mx:.25,my:.5}}),r.jsx(j,{title:e.label,children:r.jsx(g,{size:"small","aria-label":e.label,onMouseDown:c=>c.preventDefault(),onClick:()=>f(e),sx:c=>({borderRadius:`${o.PREMIUM_RADIUS-2}px`,transition:`background-color .18s ${o.PREMIUM_EASING}, transform .18s ${o.PREMIUM_EASING}`,"&:hover":{backgroundColor:n.alpha(c.palette.primary.main,.1),transform:"translateY(-1px)"}}),children:e.icon})})]},e.command))}),r.jsx(x,{}),r.jsx(p,{id:i,ref:l,role:"textbox","aria-multiline":"true","aria-label":s||"rich text",contentEditable:!0,suppressContentEditableWarning:!0,onInput:I,...d,sx:e=>({minHeight:b,px:1.75,py:1.25,outline:"none",lineHeight:1.6,color:e.palette.text.primary,backgroundColor:e.palette.background.paper,"& p":{margin:"0 0 0.5em"},"& ul, & ol":{paddingLeft:"1.5em",margin:"0 0 0.5em"},"& a":{color:e.palette.primary.main},...d.sx||{}})})]})]})}exports.default=F;
@@ -15,7 +15,7 @@ import w from "@mui/icons-material/FormatListNumbered";
15
15
  import T from "@mui/icons-material/Link";
16
16
  import z from "@mui/icons-material/FormatClear";
17
17
  import { alpha as t } from "@mui/material/styles";
18
- import { P as l, d as b } from "./index-B7i3cvH0.mjs";
18
+ import { P as l, o as b } from "./AIForm-DtRl0WdY.mjs";
19
19
  const E = [
20
20
  { command: "bold", label: "Bold", icon: /* @__PURE__ */ o(R, { fontSize: "small" }) },
21
21
  { command: "italic", label: "Italic", icon: /* @__PURE__ */ o(k, { fontSize: "small" }) },
@@ -1,6 +1,6 @@
1
1
  import { jsxs as rt, jsx as X } from "react/jsx-runtime";
2
2
  import Ft, { Component as Yt, useRef as wt, useState as nt, useEffect as Pt } from "react";
3
- import { h as Lt } from "./index-B7i3cvH0.mjs";
3
+ import { R as Lt } from "./AIForm-DtRl0WdY.mjs";
4
4
  import { Box as Q, Typography as Tt, Button as St, CircularProgress as Bt } from "@mui/material";
5
5
  import { u as Nt } from "./s3Upload-dpioZ2c8.mjs";
6
6
  function mt() {