dynamic-mui 2.5.1 → 2.5.2

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 (75) hide show
  1. package/dist/{AIForm-D8_6RVmA.js → AIForm-CAlzDffx.js} +2 -2
  2. package/dist/{AIForm-BVJ7qhP5.mjs → AIForm-DhR29Z6d.mjs} +2 -2
  3. package/dist/{accordion-B3fSXKqC.js → accordion-B1Laqpu6.js} +1 -1
  4. package/dist/{accordion-BxTjyh5y.mjs → accordion-DRo0ZP5u.mjs} +1 -1
  5. package/dist/{addressfield-C9VaV9xw.mjs → addressfield-1Ht4A4u9.mjs} +1 -1
  6. package/dist/{addressfield-Cv8zK_sb.js → addressfield-DEu_5gQv.js} +1 -1
  7. package/dist/ai/index.cjs +1 -1
  8. package/dist/ai/index.mjs +1 -1
  9. package/dist/{asyncautocomplete-BveFRqpV.mjs → asyncautocomplete-BPTtLquY.mjs} +1 -1
  10. package/dist/{asyncautocomplete-CoOb7mtv.js → asyncautocomplete-DPn-jVl4.js} +1 -1
  11. package/dist/{bar-CE_D8esp.js → bar-CEFjy1KY.js} +1 -1
  12. package/dist/{bar-BfMaIpfo.mjs → bar-CkCZunh6.mjs} +1 -1
  13. package/dist/{cascadeselect-C53hT-C-.mjs → cascadeselect-BKqX6e3j.mjs} +1 -1
  14. package/dist/{cascadeselect-CWECmehh.js → cascadeselect-DCMmaKxY.js} +1 -1
  15. package/dist/collection-B6mXg1EE.js +1 -0
  16. package/dist/{collection-HUYkt74J.mjs → collection-D6iGJnXe.mjs} +317 -300
  17. package/dist/{colorpicker-BRQPl_IL.mjs → colorpicker-DRC4NHgd.mjs} +1 -1
  18. package/dist/{colorpicker-zE3r16Gc.js → colorpicker-VOk6ZC89.js} +1 -1
  19. package/dist/{consentfield-CEddOmCa.js → consentfield-Bogbxanw.js} +1 -1
  20. package/dist/{consentfield-Cylid9il.mjs → consentfield-DHIVXzhj.mjs} +1 -1
  21. package/dist/{datatable-BWimO7zD.mjs → datatable-DU0W9LHs.mjs} +1 -1
  22. package/dist/{datatable-3MUZQhnx.js → datatable-DUdM8xtY.js} +1 -1
  23. package/dist/dynamic-mui.cjs +1 -1
  24. package/dist/dynamic-mui.mjs +2 -2
  25. package/dist/{editabletable-CVJ14zrm.mjs → editabletable-D801lgHY.mjs} +1 -1
  26. package/dist/{editabletable--ow4E3bB.js → editabletable-De_BiNVx.js} +1 -1
  27. package/dist/{fileupload-DHiYLdJ5.mjs → fileupload-CozsBlXX.mjs} +1 -1
  28. package/dist/{fileupload-B7f6VOb0.js → fileupload-YGYUpPXo.js} +1 -1
  29. package/dist/{formrepeater-BGZGTcVb.mjs → formrepeater-LXzfFY3V.mjs} +1 -1
  30. package/dist/{formrepeater-CvWeLug8.js → formrepeater-iD9e1ow4.js} +1 -1
  31. package/dist/{formwizard-BeJK5mqc.mjs → formwizard-Bb0LOmIN.mjs} +1 -1
  32. package/dist/{formwizard-DrHKFPfN.js → formwizard-CuDayHm6.js} +1 -1
  33. package/dist/{geofield-Bchfb6__.mjs → geofield-B22-bJ0f.mjs} +1 -1
  34. package/dist/{geofield-thoXisie.js → geofield-DkB-js8Y.js} +1 -1
  35. package/dist/{group-DUnv46e_.mjs → group-B5vjjzsk.mjs} +1 -1
  36. package/dist/{group-B3QBe0YI.js → group-B_WI43pI.js} +1 -1
  37. package/dist/{intlphone-CMXEolsT.js → intlphone-CkHQ2YvK.js} +1 -1
  38. package/dist/{intlphone-BY59PVDg.mjs → intlphone-DnqGCNdx.mjs} +1 -1
  39. package/dist/{keyvaluefield-FBaHQ8Ak.js → keyvaluefield-CX97ykNT.js} +1 -1
  40. package/dist/{keyvaluefield-BAYbTkCY.mjs → keyvaluefield-Dm5dRen5.mjs} +1 -1
  41. package/dist/{line-Bk15u06y.js → line-CjQk91Nq.js} +1 -1
  42. package/dist/{line-Bzbkzk7f.mjs → line-pFBz6CTL.mjs} +1 -1
  43. package/dist/{lineitemlist-PsoQ4LU4.mjs → lineitemlist-B5JJqhjg.mjs} +1 -1
  44. package/dist/{lineitemlist-8NL2THwe.js → lineitemlist-C39r0qRM.js} +1 -1
  45. package/dist/{list-BGzVPlgh.mjs → list-73Pemuh_.mjs} +1 -1
  46. package/dist/{list-BmGiSIoi.js → list-CkVSoMPM.js} +1 -1
  47. package/dist/{locationfield-BG76gNbD.js → locationfield-DLFggIVT.js} +1 -1
  48. package/dist/{locationfield-CupDmXsM.mjs → locationfield-DY8wZ-Vv.mjs} +1 -1
  49. package/dist/{markdowneditor-vDHguMtU.js → markdowneditor-BtF43ekZ.js} +1 -1
  50. package/dist/{markdowneditor-4StkbrKV.mjs → markdowneditor-VfwnN9cX.mjs} +1 -1
  51. package/dist/{matrixfield-CeROIIAj.mjs → matrixfield-BIKQg7FM.mjs} +1 -1
  52. package/dist/{matrixfield-Vptf0zNH.js → matrixfield-BjdsHrtX.js} +1 -1
  53. package/dist/{multitextbox-DtSydHcv.js → multitextbox-BNZ6kVPG.js} +1 -1
  54. package/dist/{multitextbox-DeVv6uzi.mjs → multitextbox-DqLIw1i-.mjs} +1 -1
  55. package/dist/{npsscale-Dwp2T0DQ.js → npsscale-B2JYIHr8.js} +1 -1
  56. package/dist/{npsscale-Cd7PoCJS.mjs → npsscale-CWFVm0wp.mjs} +1 -1
  57. package/dist/{numberstepper-DBKq7hUm.js → numberstepper-Cpb7ceR4.js} +1 -1
  58. package/dist/{numberstepper-BFNTu3Ii.mjs → numberstepper-DLwZsyV1.mjs} +1 -1
  59. package/dist/{pie-DKRRH37e.mjs → pie-AC1_bQ6M.mjs} +1 -1
  60. package/dist/{pie-CE4QV82D.js → pie-BZhroZyG.js} +1 -1
  61. package/dist/{richtexteditor-DdIfi0-T.mjs → richtexteditor-Bwn62mA-.mjs} +1 -1
  62. package/dist/{richtexteditor-B6lK2iIt.js → richtexteditor-DDIzZxki.js} +1 -1
  63. package/dist/{signature-B_drsWTj.js → signature-DtXYAy1a.js} +1 -1
  64. package/dist/{signature-D9B8bFqg.mjs → signature-z2PB3zv7.mjs} +1 -1
  65. package/dist/{stepper-D6e9yWIr.mjs → stepper-B8Blpvp8.mjs} +1 -1
  66. package/dist/{stepper-CO6XiIaw.js → stepper-o3Ef6Czl.js} +1 -1
  67. package/dist/{summaryfield-CR3aNMZU.js → summaryfield-2t_sXF8P.js} +1 -1
  68. package/dist/{summaryfield-BIA2gc1w.mjs → summaryfield-CTQL3W7R.mjs} +1 -1
  69. package/dist/{tabs-B4ZbZQvt.js → tabs-DlIOUQ5z.js} +1 -1
  70. package/dist/{tabs-PgOpdVX1.mjs → tabs-lqveygGh.mjs} +1 -1
  71. package/dist/{tagsinput-G_M0DbpI.mjs → tagsinput-C2awcyJT.mjs} +1 -1
  72. package/dist/{tagsinput-DtNb1IuV.js → tagsinput-g_-HLhtt.js} +1 -1
  73. package/dist/util/collection.d.ts +1 -0
  74. package/package.json +1 -1
  75. package/dist/collection-Cf87KWZM.js +0 -1
@@ -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 { i as m } from "./AIForm-BVJ7qhP5.mjs";
5
+ import { i as m } from "./AIForm-DhR29Z6d.mjs";
6
6
  const c = a.lazy(
7
7
  () => import("@mui/x-charts/PieChart").then((r) => ({ default: r.PieChart }))
8
8
  );
@@ -1 +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-D8_6RVmA.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;
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-CAlzDffx.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;
@@ -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, o as b } from "./AIForm-BVJ7qhP5.mjs";
18
+ import { P as l, o as b } from "./AIForm-DhR29Z6d.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 +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-D8_6RVmA.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,{sx:{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;
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-CAlzDffx.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,{sx:{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;
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),N=require("react"),Dt=require("./AIForm-D8_6RVmA.js"),Y=require("@mui/material"),$t=require("./s3Upload-B0JeoLkS.js");function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},yt.apply(null,arguments)}function Lt(e,r){if(e==null)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.indexOf(t)!==-1)continue;n[t]=e[t]}return n}function zt(e,r){if(e==null)return{};var n,t,o=Lt(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)n=a[t],r.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function mt(e){"@babel/helpers - typeof";return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mt(e)}function qt(e,r,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Ut(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function gt(e,r){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},gt(e,r)}function Bt(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&gt(e,r)}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},at(e)}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(It=function(){return!!e})()}function Ft(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yt(e,r){if(r&&(mt(r)=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ft(e)}function Nt(e){var r=It();return function(){var n,t=at(e);if(r){var o=at(this).constructor;n=Reflect.construct(t,arguments,o)}else n=t.apply(this,arguments);return Yt(this,n)}}var nt={exports:{}},ot={exports:{}},M={};var Et;function Vt(){if(Et)return M;Et=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(d){if(typeof d=="object"&&d!==null){var V=d.$$typeof;switch(V){case r:switch(d=d.type,d){case l:case c:case t:case a:case o:case p:return d;default:switch(d=d&&d.$$typeof,d){case i:case f:case E:case m:case u:return d;default:return V}}case n:return V}}}function j(d){return I(d)===c}return M.AsyncMode=l,M.ConcurrentMode=c,M.ContextConsumer=i,M.ContextProvider=u,M.Element=r,M.ForwardRef=f,M.Fragment=t,M.Lazy=E,M.Memo=m,M.Portal=n,M.Profiler=a,M.StrictMode=o,M.Suspense=p,M.isAsyncMode=function(d){return j(d)||I(d)===l},M.isConcurrentMode=j,M.isContextConsumer=function(d){return I(d)===i},M.isContextProvider=function(d){return I(d)===u},M.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===r},M.isForwardRef=function(d){return I(d)===f},M.isFragment=function(d){return I(d)===t},M.isLazy=function(d){return I(d)===E},M.isMemo=function(d){return I(d)===m},M.isPortal=function(d){return I(d)===n},M.isProfiler=function(d){return I(d)===a},M.isStrictMode=function(d){return I(d)===o},M.isSuspense=function(d){return I(d)===p},M.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===t||d===c||d===a||d===o||d===p||d===v||typeof d=="object"&&d!==null&&(d.$$typeof===E||d.$$typeof===m||d.$$typeof===u||d.$$typeof===i||d.$$typeof===f||d.$$typeof===b||d.$$typeof===w||d.$$typeof===W||d.$$typeof===g)},M.typeOf=I,M}var A={};var wt;function Ht(){return wt||(wt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(h){return typeof h=="string"||typeof h=="function"||h===t||h===c||h===a||h===o||h===p||h===v||typeof h=="object"&&h!==null&&(h.$$typeof===E||h.$$typeof===m||h.$$typeof===u||h.$$typeof===i||h.$$typeof===f||h.$$typeof===b||h.$$typeof===w||h.$$typeof===W||h.$$typeof===g)}function j(h){if(typeof h=="object"&&h!==null){var F=h.$$typeof;switch(F){case r:var rt=h.type;switch(rt){case l:case c:case t:case a:case o:case p:return rt;default:var xt=rt&&rt.$$typeof;switch(xt){case i:case f:case E:case m:case u:return xt;default:return F}}case n:return F}}}var d=l,V=c,X=i,Q=u,tt=r,q=f,H=t,U=E,J=m,Z=n,ct=a,B=o,G=p,et=!1;function ut(h){return et||(et=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),s(h)||j(h)===l}function s(h){return j(h)===c}function y(h){return j(h)===i}function S(h){return j(h)===u}function P(h){return typeof h=="object"&&h!==null&&h.$$typeof===r}function _(h){return j(h)===f}function C(h){return j(h)===t}function x(h){return j(h)===E}function T(h){return j(h)===m}function O(h){return j(h)===n}function D(h){return j(h)===a}function R(h){return j(h)===o}function $(h){return j(h)===p}A.AsyncMode=d,A.ConcurrentMode=V,A.ContextConsumer=X,A.ContextProvider=Q,A.Element=tt,A.ForwardRef=q,A.Fragment=H,A.Lazy=U,A.Memo=J,A.Portal=Z,A.Profiler=ct,A.StrictMode=B,A.Suspense=G,A.isAsyncMode=ut,A.isConcurrentMode=s,A.isContextConsumer=y,A.isContextProvider=S,A.isElement=P,A.isForwardRef=_,A.isFragment=C,A.isLazy=x,A.isMemo=T,A.isPortal=O,A.isProfiler=D,A.isStrictMode=R,A.isSuspense=$,A.isValidElementType=I,A.typeOf=j})()),A}var Pt;function kt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?ot.exports=Vt():ot.exports=Ht()),ot.exports}var ft,Tt;function Xt(){if(Tt)return ft;Tt=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function t(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var u={},i=0;i<10;i++)u["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(u).map(function(f){return u[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ft=o()?Object.assign:function(a,u){for(var i,l=t(a),c,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var p in i)r.call(i,p)&&(l[p]=i[p]);if(e){c=e(i);for(var v=0;v<c.length;v++)n.call(i,c[v])&&(l[c[v]]=i[c[v]])}}return l},ft}var lt,St;function _t(){if(St)return lt;St=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lt=e,lt}var dt,Ct;function Wt(){return Ct||(Ct=1,dt=Function.call.bind(Object.prototype.hasOwnProperty)),dt}var ht,Ot;function Jt(){if(Ot)return ht;Ot=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=_t(),n={},t=Wt();e=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function o(a,u,i,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(t(a,f)){var p;try{if(typeof a[f]!="function"){var v=Error((l||"React class")+": "+i+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}p=a[f](u,f,l,i,null,r)}catch(E){p=E}if(p&&!(p instanceof Error)&&e((l||"React class")+": type specification of "+i+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in n)){n[p.message]=!0;var m=c?c():"";e("Failed "+i+" type: "+p.message+(m??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ht=o,ht}var pt,Rt;function Gt(){if(Rt)return pt;Rt=1;var e=kt(),r=Xt(),n=_t(),t=Wt(),o=Jt(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var l="Warning: "+i;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function u(){return null}return pt=function(i,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(s){var y=s&&(c&&s[c]||s[f]);if(typeof y=="function")return y}var v="<<anonymous>>",m={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:W(),arrayOf:I,element:j(),elementType:d(),instanceOf:V,node:q(),objectOf:Q,oneOf:X,oneOfType:tt,shape:U,exact:J};function E(s,y){return s===y?s!==0||1/s===1/y:s!==s&&y!==y}function g(s,y){this.message=s,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function b(s){if(process.env.NODE_ENV!=="production")var y={},S=0;function P(C,x,T,O,D,R,$){if(O=O||v,R=R||T,$!==n){if(l){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var F=O+":"+T;!y[F]&&S<3&&(a("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+O+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[F]=!0,S++)}}return x[T]==null?C?x[T]===null?new g("The "+D+" `"+R+"` is marked as required "+("in `"+O+"`, but its value is `null`.")):new g("The "+D+" `"+R+"` is marked as required in "+("`"+O+"`, but its value is `undefined`.")):null:s(x,T,O,D,R)}var _=P.bind(null,!1);return _.isRequired=P.bind(null,!0),_}function w(s){function y(S,P,_,C,x,T){var O=S[P],D=B(O);if(D!==s){var R=G(O);return new g("Invalid "+C+" `"+x+"` of type "+("`"+R+"` supplied to `"+_+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return b(y)}function W(){return b(u)}function I(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var T=S[P];if(!Array.isArray(T)){var O=B(T);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an array."))}for(var D=0;D<T.length;D++){var R=s(T,D,_,C,x+"["+D+"]",n);if(R instanceof Error)return R}return null}return b(y)}function j(){function s(y,S,P,_,C){var x=y[S];if(!i(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(s)}function d(){function s(y,S,P,_,C){var x=y[S];if(!e.isValidElementType(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(s)}function V(s){function y(S,P,_,C,x){if(!(S[P]instanceof s)){var T=s.name||v,O=ut(S[P]);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected ")+("instance of `"+T+"`."))}return null}return b(y)}function X(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),u;function y(S,P,_,C,x){for(var T=S[P],O=0;O<s.length;O++)if(E(T,s[O]))return null;var D=JSON.stringify(s,function($,h){var F=G(h);return F==="symbol"?String(h):h});return new g("Invalid "+C+" `"+x+"` of value `"+String(T)+"` "+("supplied to `"+_+"`, expected one of "+D+"."))}return b(y)}function Q(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an object."));for(var D in T)if(t(T,D)){var R=s(T,D,_,C,x+"."+D,n);if(R instanceof Error)return R}return null}return b(y)}function tt(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var y=0;y<s.length;y++){var S=s[y];if(typeof S!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+et(S)+" at index "+y+"."),u}function P(_,C,x,T,O){for(var D=[],R=0;R<s.length;R++){var $=s[R],h=$(_,C,x,T,O,n);if(h==null)return null;h.data&&t(h.data,"expectedType")&&D.push(h.data.expectedType)}var F=D.length>0?", expected one of type ["+D.join(", ")+"]":"";return new g("Invalid "+T+" `"+O+"` supplied to "+("`"+x+"`"+F+"."))}return b(P)}function q(){function s(y,S,P,_,C){return Z(y[S])?null:new g("Invalid "+_+" `"+C+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(s)}function H(s,y,S,P,_){return new g((s||"React class")+": "+y+" type `"+S+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function U(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));for(var D in s){var R=s[D];if(typeof R!="function")return H(_,C,x,D,G(R));var $=R(T,D,_,C,x+"."+D,n);if($)return $}return null}return b(y)}function J(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));var D=r({},S[P],s);for(var R in D){var $=s[R];if(t(s,R)&&typeof $!="function")return H(_,C,x,R,G($));if(!$)return new g("Invalid "+C+" `"+x+"` key `"+R+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(S[P],null," ")+`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),N=require("react"),Dt=require("./AIForm-CAlzDffx.js"),Y=require("@mui/material"),$t=require("./s3Upload-B0JeoLkS.js");function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},yt.apply(null,arguments)}function Lt(e,r){if(e==null)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(r.indexOf(t)!==-1)continue;n[t]=e[t]}return n}function zt(e,r){if(e==null)return{};var n,t,o=Lt(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)n=a[t],r.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function mt(e){"@babel/helpers - typeof";return mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},mt(e)}function qt(e,r,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Ut(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function gt(e,r){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n},gt(e,r)}function Bt(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&gt(e,r)}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},at(e)}function It(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(It=function(){return!!e})()}function Ft(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yt(e,r){if(r&&(mt(r)=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ft(e)}function Nt(e){var r=It();return function(){var n,t=at(e);if(r){var o=at(this).constructor;n=Reflect.construct(t,arguments,o)}else n=t.apply(this,arguments);return Yt(this,n)}}var nt={exports:{}},ot={exports:{}},M={};var Et;function Vt(){if(Et)return M;Et=1;var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(d){if(typeof d=="object"&&d!==null){var V=d.$$typeof;switch(V){case r:switch(d=d.type,d){case l:case c:case t:case a:case o:case p:return d;default:switch(d=d&&d.$$typeof,d){case i:case f:case E:case m:case u:return d;default:return V}}case n:return V}}}function j(d){return I(d)===c}return M.AsyncMode=l,M.ConcurrentMode=c,M.ContextConsumer=i,M.ContextProvider=u,M.Element=r,M.ForwardRef=f,M.Fragment=t,M.Lazy=E,M.Memo=m,M.Portal=n,M.Profiler=a,M.StrictMode=o,M.Suspense=p,M.isAsyncMode=function(d){return j(d)||I(d)===l},M.isConcurrentMode=j,M.isContextConsumer=function(d){return I(d)===i},M.isContextProvider=function(d){return I(d)===u},M.isElement=function(d){return typeof d=="object"&&d!==null&&d.$$typeof===r},M.isForwardRef=function(d){return I(d)===f},M.isFragment=function(d){return I(d)===t},M.isLazy=function(d){return I(d)===E},M.isMemo=function(d){return I(d)===m},M.isPortal=function(d){return I(d)===n},M.isProfiler=function(d){return I(d)===a},M.isStrictMode=function(d){return I(d)===o},M.isSuspense=function(d){return I(d)===p},M.isValidElementType=function(d){return typeof d=="string"||typeof d=="function"||d===t||d===c||d===a||d===o||d===p||d===v||typeof d=="object"&&d!==null&&(d.$$typeof===E||d.$$typeof===m||d.$$typeof===u||d.$$typeof===i||d.$$typeof===f||d.$$typeof===b||d.$$typeof===w||d.$$typeof===W||d.$$typeof===g)},M.typeOf=I,M}var A={};var wt;function Ht(){return wt||(wt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,r=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,t=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,E=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,W=e?Symbol.for("react.scope"):60119;function I(h){return typeof h=="string"||typeof h=="function"||h===t||h===c||h===a||h===o||h===p||h===v||typeof h=="object"&&h!==null&&(h.$$typeof===E||h.$$typeof===m||h.$$typeof===u||h.$$typeof===i||h.$$typeof===f||h.$$typeof===b||h.$$typeof===w||h.$$typeof===W||h.$$typeof===g)}function j(h){if(typeof h=="object"&&h!==null){var F=h.$$typeof;switch(F){case r:var rt=h.type;switch(rt){case l:case c:case t:case a:case o:case p:return rt;default:var xt=rt&&rt.$$typeof;switch(xt){case i:case f:case E:case m:case u:return xt;default:return F}}case n:return F}}}var d=l,V=c,X=i,Q=u,tt=r,q=f,H=t,U=E,J=m,Z=n,ct=a,B=o,G=p,et=!1;function ut(h){return et||(et=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),s(h)||j(h)===l}function s(h){return j(h)===c}function y(h){return j(h)===i}function S(h){return j(h)===u}function P(h){return typeof h=="object"&&h!==null&&h.$$typeof===r}function _(h){return j(h)===f}function C(h){return j(h)===t}function x(h){return j(h)===E}function T(h){return j(h)===m}function O(h){return j(h)===n}function D(h){return j(h)===a}function R(h){return j(h)===o}function $(h){return j(h)===p}A.AsyncMode=d,A.ConcurrentMode=V,A.ContextConsumer=X,A.ContextProvider=Q,A.Element=tt,A.ForwardRef=q,A.Fragment=H,A.Lazy=U,A.Memo=J,A.Portal=Z,A.Profiler=ct,A.StrictMode=B,A.Suspense=G,A.isAsyncMode=ut,A.isConcurrentMode=s,A.isContextConsumer=y,A.isContextProvider=S,A.isElement=P,A.isForwardRef=_,A.isFragment=C,A.isLazy=x,A.isMemo=T,A.isPortal=O,A.isProfiler=D,A.isStrictMode=R,A.isSuspense=$,A.isValidElementType=I,A.typeOf=j})()),A}var Pt;function kt(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?ot.exports=Vt():ot.exports=Ht()),ot.exports}var ft,Tt;function Xt(){if(Tt)return ft;Tt=1;var e=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function t(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function o(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var u={},i=0;i<10;i++)u["_"+String.fromCharCode(i)]=i;var l=Object.getOwnPropertyNames(u).map(function(f){return u[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ft=o()?Object.assign:function(a,u){for(var i,l=t(a),c,f=1;f<arguments.length;f++){i=Object(arguments[f]);for(var p in i)r.call(i,p)&&(l[p]=i[p]);if(e){c=e(i);for(var v=0;v<c.length;v++)n.call(i,c[v])&&(l[c[v]]=i[c[v]])}}return l},ft}var lt,St;function _t(){if(St)return lt;St=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lt=e,lt}var dt,Ct;function Wt(){return Ct||(Ct=1,dt=Function.call.bind(Object.prototype.hasOwnProperty)),dt}var ht,Ot;function Jt(){if(Ot)return ht;Ot=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var r=_t(),n={},t=Wt();e=function(a){var u="Warning: "+a;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function o(a,u,i,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(t(a,f)){var p;try{if(typeof a[f]!="function"){var v=Error((l||"React class")+": "+i+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}p=a[f](u,f,l,i,null,r)}catch(E){p=E}if(p&&!(p instanceof Error)&&e((l||"React class")+": type specification of "+i+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in n)){n[p.message]=!0;var m=c?c():"";e("Failed "+i+" type: "+p.message+(m??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},ht=o,ht}var pt,Rt;function Gt(){if(Rt)return pt;Rt=1;var e=kt(),r=Xt(),n=_t(),t=Wt(),o=Jt(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(i){var l="Warning: "+i;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function u(){return null}return pt=function(i,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(s){var y=s&&(c&&s[c]||s[f]);if(typeof y=="function")return y}var v="<<anonymous>>",m={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:W(),arrayOf:I,element:j(),elementType:d(),instanceOf:V,node:q(),objectOf:Q,oneOf:X,oneOfType:tt,shape:U,exact:J};function E(s,y){return s===y?s!==0||1/s===1/y:s!==s&&y!==y}function g(s,y){this.message=s,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function b(s){if(process.env.NODE_ENV!=="production")var y={},S=0;function P(C,x,T,O,D,R,$){if(O=O||v,R=R||T,$!==n){if(l){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var F=O+":"+T;!y[F]&&S<3&&(a("You are manually calling a React.PropTypes validation function for the `"+R+"` prop on `"+O+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[F]=!0,S++)}}return x[T]==null?C?x[T]===null?new g("The "+D+" `"+R+"` is marked as required "+("in `"+O+"`, but its value is `null`.")):new g("The "+D+" `"+R+"` is marked as required in "+("`"+O+"`, but its value is `undefined`.")):null:s(x,T,O,D,R)}var _=P.bind(null,!1);return _.isRequired=P.bind(null,!0),_}function w(s){function y(S,P,_,C,x,T){var O=S[P],D=B(O);if(D!==s){var R=G(O);return new g("Invalid "+C+" `"+x+"` of type "+("`"+R+"` supplied to `"+_+"`, expected ")+("`"+s+"`."),{expectedType:s})}return null}return b(y)}function W(){return b(u)}function I(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside arrayOf.");var T=S[P];if(!Array.isArray(T)){var O=B(T);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an array."))}for(var D=0;D<T.length;D++){var R=s(T,D,_,C,x+"["+D+"]",n);if(R instanceof Error)return R}return null}return b(y)}function j(){function s(y,S,P,_,C){var x=y[S];if(!i(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(s)}function d(){function s(y,S,P,_,C){var x=y[S];if(!e.isValidElementType(x)){var T=B(x);return new g("Invalid "+_+" `"+C+"` of type "+("`"+T+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(s)}function V(s){function y(S,P,_,C,x){if(!(S[P]instanceof s)){var T=s.name||v,O=ut(S[P]);return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected ")+("instance of `"+T+"`."))}return null}return b(y)}function X(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),u;function y(S,P,_,C,x){for(var T=S[P],O=0;O<s.length;O++)if(E(T,s[O]))return null;var D=JSON.stringify(s,function($,h){var F=G(h);return F==="symbol"?String(h):h});return new g("Invalid "+C+" `"+x+"` of value `"+String(T)+"` "+("supplied to `"+_+"`, expected one of "+D+"."))}return b(y)}function Q(s){function y(S,P,_,C,x){if(typeof s!="function")return new g("Property `"+x+"` of component `"+_+"` has invalid PropType notation inside objectOf.");var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type "+("`"+O+"` supplied to `"+_+"`, expected an object."));for(var D in T)if(t(T,D)){var R=s(T,D,_,C,x+"."+D,n);if(R instanceof Error)return R}return null}return b(y)}function tt(s){if(!Array.isArray(s))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var y=0;y<s.length;y++){var S=s[y];if(typeof S!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+et(S)+" at index "+y+"."),u}function P(_,C,x,T,O){for(var D=[],R=0;R<s.length;R++){var $=s[R],h=$(_,C,x,T,O,n);if(h==null)return null;h.data&&t(h.data,"expectedType")&&D.push(h.data.expectedType)}var F=D.length>0?", expected one of type ["+D.join(", ")+"]":"";return new g("Invalid "+T+" `"+O+"` supplied to "+("`"+x+"`"+F+"."))}return b(P)}function q(){function s(y,S,P,_,C){return Z(y[S])?null:new g("Invalid "+_+" `"+C+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(s)}function H(s,y,S,P,_){return new g((s||"React class")+": "+y+" type `"+S+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+_+"`.")}function U(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));for(var D in s){var R=s[D];if(typeof R!="function")return H(_,C,x,D,G(R));var $=R(T,D,_,C,x+"."+D,n);if($)return $}return null}return b(y)}function J(s){function y(S,P,_,C,x){var T=S[P],O=B(T);if(O!=="object")return new g("Invalid "+C+" `"+x+"` of type `"+O+"` "+("supplied to `"+_+"`, expected `object`."));var D=r({},S[P],s);for(var R in D){var $=s[R];if(t(s,R)&&typeof $!="function")return H(_,C,x,R,G($));if(!$)return new g("Invalid "+C+" `"+x+"` key `"+R+"` supplied to `"+_+"`.\nBad object: "+JSON.stringify(S[P],null," ")+`
2
2
  Valid keys: `+JSON.stringify(Object.keys(s),null," "));var h=$(T,R,_,C,x+"."+R,n);if(h)return h}return null}return b(y)}function Z(s){switch(typeof s){case"number":case"string":case"undefined":return!0;case"boolean":return!s;case"object":if(Array.isArray(s))return s.every(Z);if(s===null||i(s))return!0;var y=p(s);if(y){var S=y.call(s),P;if(y!==s.entries){for(;!(P=S.next()).done;)if(!Z(P.value))return!1}else for(;!(P=S.next()).done;){var _=P.value;if(_&&!Z(_[1]))return!1}}else return!1;return!0;default:return!1}}function ct(s,y){return s==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function B(s){var y=typeof s;return Array.isArray(s)?"array":s instanceof RegExp?"object":ct(y,s)?"symbol":y}function G(s){if(typeof s>"u"||s===null)return""+s;var y=B(s);if(y==="object"){if(s instanceof Date)return"date";if(s instanceof RegExp)return"regexp"}return y}function et(s){var y=G(s);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function ut(s){return!s.constructor||!s.constructor.name?v:s.constructor.name}return m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},pt}var vt,Mt;function Kt(){if(Mt)return vt;Mt=1;var e=_t();function r(){}function n(){}return n.resetWarningCache=r,vt=function(){function t(u,i,l,c,f,p){if(p!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}t.isRequired=t;function o(){return t}var a={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:o,element:t,elementType:t,instanceOf:o,node:t,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:r};return a.PropTypes=a,a},vt}var At;function Zt(){if(At)return nt.exports;if(At=1,process.env.NODE_ENV!=="production"){var e=kt(),r=!0;nt.exports=Gt()(e.isElement,r)}else nt.exports=Kt()();return nt.exports}var Qt=Zt();const L=Dt.getDefaultExportFromCjs(Qt);function K(e,r,n){this.x=e,this.y=r,this.time=n||new Date().getTime()}K.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};K.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};K.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function bt(e,r,n,t){this.startPoint=e,this.control1=r,this.control2=n,this.endPoint=t}bt.prototype.length=function(){for(var e=10,r=0,n=void 0,t=void 0,o=0;o<=e;o+=1){var a=o/e,u=this._point(a,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),i=this._point(a,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(o>0){var l=u-n,c=i-t;r+=Math.sqrt(l*l+c*c)}n=u,t=i}return r};bt.prototype._point=function(e,r,n,t,o){return r*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*t*(1-e)*e*e+o*e*e*e};function te(e,r,n){var t,o,a,u=null,i=0;n||(n={});var l=function(){i=n.leading===!1?0:Date.now(),u=null,a=e.apply(t,o),u||(t=o=null)};return function(){var c=Date.now();!i&&n.leading===!1&&(i=c);var f=r-(c-i);return t=this,o=arguments,f<=0||f>r?(u&&(clearTimeout(u),u=null),i=c,a=e.apply(t,o),u||(t=o=null)):!u&&n.trailing!==!1&&(u=setTimeout(l,f)),a}}function k(e,r){var n=this,t=r||{};this.velocityFilterWeight=t.velocityFilterWeight||.7,this.minWidth=t.minWidth||.5,this.maxWidth=t.maxWidth||2.5,this.throttle="throttle"in t?t.throttle:16,this.minDistance="minDistance"in t?t.minDistance:5,this.throttle?this._strokeMoveUpdate=te(k.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=k.prototype._strokeUpdate,this.dotSize=t.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=t.penColor||"black",this.backgroundColor=t.backgroundColor||"rgba(0,0,0,0)",this.onBegin=t.onBegin,this.onEnd=t.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(o){o.which===1&&(n._mouseButtonDown=!0,n._strokeBegin(o))},this._handleMouseMove=function(o){n._mouseButtonDown&&n._strokeMoveUpdate(o)},this._handleMouseUp=function(o){o.which===1&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(o))},this._handleTouchStart=function(o){if(o.targetTouches.length===1){var a=o.changedTouches[0];n._strokeBegin(a)}},this._handleTouchMove=function(o){o.preventDefault();var a=o.targetTouches[0];n._strokeMoveUpdate(a)},this._handleTouchEnd=function(o){var a=o.target===n._canvas;a&&(o.preventDefault(),n._strokeEnd(o))},this.on()}k.prototype.clear=function(){var e=this._ctx,r=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,r.width,r.height),e.fillRect(0,0,r.width,r.height),this._data=[],this._reset(),this._isEmpty=!0};k.prototype.fromDataURL=function(e){var r=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=new Image,o=n.ratio||window.devicePixelRatio||1,a=n.width||this._canvas.width/o,u=n.height||this._canvas.height/o;this._reset(),t.src=e,t.onload=function(){r._ctx.drawImage(t,0,0,a,u)},this._isEmpty=!1};k.prototype.toDataURL=function(e){var r;switch(e){case"image/svg+xml":return this._toSVG();default:for(var n=arguments.length,t=Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];return(r=this._canvas).toDataURL.apply(r,[e].concat(t))}};k.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()};k.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)};k.prototype.isEmpty=function(){return this._isEmpty};k.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),typeof this.onBegin=="function"&&this.onBegin(e)};k.prototype._strokeUpdate=function(e){var r=e.clientX,n=e.clientY,t=this._createPoint(r,n),o=this._data[this._data.length-1],a=o&&o[o.length-1],u=a&&t.distanceTo(a)<this.minDistance;if(!(a&&u)){var i=this._addPoint(t),l=i.curve,c=i.widths;l&&c&&this._drawCurve(l,c.start,c.end),this._data[this._data.length-1].push({x:t.x,y:t.y,time:t.time,color:this.penColor})}};k.prototype._strokeEnd=function(e){var r=this.points.length>2,n=this.points[0];if(!r&&n&&this._drawDot(n),n){var t=this._data[this._data.length-1],o=t[t.length-1];n.equals(o)||t.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};k.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};k.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};k.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};k.prototype._createPoint=function(e,r,n){var t=this._canvas.getBoundingClientRect();return new K(e-t.left,r-t.top,n||new Date().getTime())};k.prototype._addPoint=function(e){var r=this.points,n=void 0;if(r.push(e),r.length>2){r.length===3&&r.unshift(r[0]),n=this._calculateCurveControlPoints(r[0],r[1],r[2]);var t=n.c2;n=this._calculateCurveControlPoints(r[1],r[2],r[3]);var o=n.c1,a=new bt(r[1],t,o,r[2]),u=this._calculateCurveWidths(a);return r.shift(),{curve:a,widths:u}}return{}};k.prototype._calculateCurveControlPoints=function(e,r,n){var t=e.x-r.x,o=e.y-r.y,a=r.x-n.x,u=r.y-n.y,i={x:(e.x+r.x)/2,y:(e.y+r.y)/2},l={x:(r.x+n.x)/2,y:(r.y+n.y)/2},c=Math.sqrt(t*t+o*o),f=Math.sqrt(a*a+u*u),p=i.x-l.x,v=i.y-l.y,m=f/(c+f),E={x:l.x+p*m,y:l.y+v*m},g=r.x-E.x,b=r.y-E.y;return{c1:new K(i.x+g,i.y+b),c2:new K(l.x+g,l.y+b)}};k.prototype._calculateCurveWidths=function(e){var r=e.startPoint,n=e.endPoint,t={start:null,end:null},o=this.velocityFilterWeight*n.velocityFrom(r)+(1-this.velocityFilterWeight)*this._lastVelocity,a=this._strokeWidth(o);return t.start=this._lastWidth,t.end=a,this._lastVelocity=o,this._lastWidth=a,t};k.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};k.prototype._drawPoint=function(e,r,n){var t=this._ctx;t.moveTo(e,r),t.arc(e,r,n,0,2*Math.PI,!1),this._isEmpty=!1};k.prototype._drawCurve=function(e,r,n){var t=this._ctx,o=n-r,a=Math.floor(e.length());t.beginPath();for(var u=0;u<a;u+=1){var i=u/a,l=i*i,c=l*i,f=1-i,p=f*f,v=p*f,m=v*e.startPoint.x;m+=3*p*i*e.control1.x,m+=3*f*l*e.control2.x,m+=c*e.endPoint.x;var E=v*e.startPoint.y;E+=3*p*i*e.control1.y,E+=3*f*l*e.control2.y,E+=c*e.endPoint.y;var g=r+c*o;this._drawPoint(m,E,g)}t.closePath(),t.fill()};k.prototype._drawDot=function(e){var r=this._ctx,n=typeof this.dotSize=="function"?this.dotSize():this.dotSize;r.beginPath(),this._drawPoint(e.x,e.y,n),r.closePath(),r.fill()};k.prototype._fromData=function(e,r,n){for(var t=0;t<e.length;t+=1){var o=e[t];if(o.length>1)for(var a=0;a<o.length;a+=1){var u=o[a],i=new K(u.x,u.y,u.time),l=u.color;if(a===0)this.penColor=l,this._reset(),this._addPoint(i);else if(a!==o.length-1){var c=this._addPoint(i),f=c.curve,p=c.widths;f&&p&&r(f,p,l)}}else{this._reset();var v=o[0];n(v)}}};k.prototype._toSVG=function(){var e=this,r=this._data,n=this._canvas,t=Math.max(window.devicePixelRatio||1,1),o=0,a=0,u=n.width/t,i=n.height/t,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttributeNS(null,"width",n.width),l.setAttributeNS(null,"height",n.height),this._fromData(r,function(w,W,I){var j=document.createElement("path");if(!isNaN(w.control1.x)&&!isNaN(w.control1.y)&&!isNaN(w.control2.x)&&!isNaN(w.control2.y)){var d="M "+w.startPoint.x.toFixed(3)+","+w.startPoint.y.toFixed(3)+" "+("C "+w.control1.x.toFixed(3)+","+w.control1.y.toFixed(3)+" ")+(w.control2.x.toFixed(3)+","+w.control2.y.toFixed(3)+" ")+(w.endPoint.x.toFixed(3)+","+w.endPoint.y.toFixed(3));j.setAttribute("d",d),j.setAttribute("stroke-width",(W.end*2.25).toFixed(3)),j.setAttribute("stroke",I),j.setAttribute("fill","none"),j.setAttribute("stroke-linecap","round"),l.appendChild(j)}},function(w){var W=document.createElement("circle"),I=typeof e.dotSize=="function"?e.dotSize():e.dotSize;W.setAttribute("r",I),W.setAttribute("cx",w.x),W.setAttribute("cy",w.y),W.setAttribute("fill",w.color),l.appendChild(W)});var c="data:image/svg+xml;base64,",f='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"'+(' viewBox="'+o+" "+a+" "+u+" "+i+'"')+(' width="'+u+'"')+(' height="'+i+'"')+">",p=l.innerHTML;if(p===void 0){var v=document.createElement("dummy"),m=l.childNodes;v.innerHTML="";for(var E=0;E<m.length;E+=1)v.appendChild(m[E].cloneNode(!0));p=v.innerHTML}var g="</svg>",b=f+p+g;return c+btoa(b)};k.prototype.fromData=function(e){var r=this;this.clear(),this._fromData(e,function(n,t){return r._drawCurve(n,t.start,t.end)},function(n){return r._drawDot(n)}),this._data=e};k.prototype.toData=function(){return this._data};var it={exports:{}},ee=it.exports,jt;function re(){return jt||(jt=1,(function(e,r){(function(n,t){e.exports=t()})(ee,function(){return(function(n){function t(a){if(o[a])return o[a].exports;var u=o[a]={exports:{},id:a,loaded:!1};return n[a].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var o={};return t.m=n,t.c=o,t.p="",t(0)})([function(n,t){function o(c){var f=c.getContext("2d"),p=c.width,v=c.height,m=f.getImageData(0,0,p,v).data,E=i(!0,p,v,m),g=i(!1,p,v,m),b=l(!0,p,v,m),w=l(!1,p,v,m),W=w-b+1,I=g-E+1,j=f.getImageData(b,E,W,I);return c.width=W,c.height=I,f.clearRect(0,0,W,I),f.putImageData(j,0,0),c}function a(c,f,p,v){return{red:v[4*(p*f+c)],green:v[4*(p*f+c)+1],blue:v[4*(p*f+c)+2],alpha:v[4*(p*f+c)+3]}}function u(c,f,p,v){return a(c,f,p,v).alpha}function i(c,f,p,v){for(var m=c?1:-1,E=c?0:p-1,g=E;c?g<p:g>-1;g+=m)for(var b=0;b<f;b++)if(u(b,g,f,v))return g;return null}function l(c,f,p,v){for(var m=c?1:-1,E=c?0:f-1,g=E;c?g<f:g>-1;g+=m)for(var b=0;b<p;b++)if(u(g,b,f,v))return g;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o}])})})(it)),it.exports}var ne=re();const oe=Dt.getDefaultExportFromCjs(ne);var ie=["canvasProps","clearOnResize"],st=(function(e){Bt(n,e);var r=Nt(n);function n(){var t;Ut(this,n);for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return t=r.call.apply(r,[this].concat(a)),t.staticThis=t.constructor,t._sigPad=null,t._canvas=null,t.setRef=function(i){t._canvas=i,t._canvas===null&&(t._sigPad=null)},t._excludeOurProps=function(){var i=t.props;i.canvasProps,i.clearOnResize;var l=zt(i,ie);return l},t.componentDidMount=function(){var i=t.getCanvas();t._sigPad=new k(i,t._excludeOurProps()),t._resizeCanvas(),t.on()},t.componentWillUnmount=function(){t.off()},t.componentDidUpdate=function(){Object.assign(t._sigPad,t._excludeOurProps())},t.getCanvas=function(){if(t._canvas===null)throw t.staticThis.refNullError;return t._canvas},t.getTrimmedCanvas=function(){var i=t.getCanvas(),l=document.createElement("canvas");return l.width=i.width,l.height=i.height,l.getContext("2d").drawImage(i,0,0),oe(l)},t.getSignaturePad=function(){if(t._sigPad===null)throw t.staticThis.refNullError;return t._sigPad},t._checkClearOnResize=function(){t.props.clearOnResize&&t._resizeCanvas()},t._resizeCanvas=function(){var i,l,c=(i=t.props.canvasProps)!==null&&i!==void 0?i:{},f=c.width,p=c.height;if(!(typeof f<"u"&&typeof p<"u")){var v=t.getCanvas(),m=Math.max((l=window.devicePixelRatio)!==null&&l!==void 0?l:1,1);typeof f>"u"&&(v.width=v.offsetWidth*m),typeof p>"u"&&(v.height=v.offsetHeight*m),v.getContext("2d").scale(m,m),t.clear()}},t.render=function(){var i=t.props.canvasProps;return N.createElement("canvas",yt({ref:t.setRef},i))},t.on=function(){return window.addEventListener("resize",t._checkClearOnResize),t.getSignaturePad().on()},t.off=function(){return window.removeEventListener("resize",t._checkClearOnResize),t.getSignaturePad().off()},t.clear=function(){return t.getSignaturePad().clear()},t.isEmpty=function(){return t.getSignaturePad().isEmpty()},t.fromDataURL=function(i,l){return t.getSignaturePad().fromDataURL(i,l)},t.toDataURL=function(i,l){return t.getSignaturePad().toDataURL(i,l)},t.fromData=function(i){return t.getSignaturePad().fromData(i)},t.toData=function(){return t.getSignaturePad().toData()},t}return qt(n)})(N.Component);st.propTypes={velocityFilterWeight:L.number,minWidth:L.number,maxWidth:L.number,minDistance:L.number,dotSize:L.oneOfType([L.number,L.func]),penColor:L.string,throttle:L.number,onEnd:L.func,onBegin:L.func,canvasProps:L.object,clearOnResize:L.bool};st.defaultProps={clearOnResize:!0};st.refNullError=new Error("react-signature-canvas is currently mounting or unmounting: React refs are null during this phase.");function ae({attributes:e={},rules:r={},onChange:n}){const{id:t="",MuiAttributes:o={},label:a="Signature",bucket:u="",region:i="",identityPoolId:l="",path:c="",disabled:f=!1,CanvasProps:p={}}=e,v=N.useRef(null),m=N.useRef(null),[E,g]=N.useState(!1),[b,w]=N.useState(e.value||null),[W,I]=N.useState(400),[j,d]=N.useState(!1),V=r?.validation?.some(q=>q.rule==="mandatory")||!1,X=p?.style?.height||150;N.useEffect(()=>{const q=m.current;if(!q)return;const H=new ResizeObserver(U=>{const J=U[0]?.contentRect?.width;J&&J>0&&I(Math.floor(J))});return H.observe(q),()=>H.disconnect()},[]),N.useEffect(()=>{if(!e.value){w(null),d(!1),v.current&&v.current.clear();return}w(e.value)},[e.value]);const Q=()=>{v.current&&v.current.clear(),w(null),d(!1),n&&n({id:t,value:""})},tt=async()=>{if(!v.current||v.current.isEmpty())return;g(!0);const q=v.current.toDataURL("image/png"),H=`${t}-${Date.now()}.png`;try{const U=await $t.uploadToS3(q,H,u,i,l,c);w(U),d(!0),n&&n({id:t,value:U})}catch(U){console.error("Signature upload failed",U)}finally{g(!1)}};return z.jsxs(Y.Box,{sx:{width:"100%",...o.sx},children:[z.jsxs(Y.Typography,{variant:"subtitle2",gutterBottom:!0,sx:{display:"flex"},children:[a,V&&z.jsx(Y.Box,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),z.jsxs(Y.Box,{ref:m,sx:{position:"relative",isolation:"isolate",zIndex:1,border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",bgcolor:"background.paper"},children:[z.jsx(st,{ref:v,penColor:"black",canvasProps:{className:"sigCanvas",width:W,height:X,style:{display:"block",position:"relative",zIndex:1,touchAction:"none",pointerEvents:f?"none":"auto",...p?.style,width:"100%",height:X}},backgroundColor:"transparent"}),b&&z.jsx(Y.Box,{component:"img",src:b,alt:"Signature",sx:{position:"absolute",inset:0,width:"100%",height:X,objectFit:"contain",bgcolor:"background.paper"}})]}),z.jsxs(Y.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1,alignItems:"center",mt:1},children:[z.jsx(Y.Button,{variant:"outlined",color:"secondary",onClick:Q,size:"small",disabled:f||E,children:"Clear"}),z.jsx(Y.Button,{variant:"contained",color:"primary",onClick:tt,size:"small",disabled:f||E||b!==null,startIcon:E?z.jsx(Y.CircularProgress,{size:16,color:"inherit"}):null,children:b?"Saved":"Save"}),j&&b&&z.jsx(Y.Typography,{variant:"caption",sx:{color:"success.main"},children:"Signature Saved!"})]})]})}exports.default=ae;
@@ -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 { ae as Lt } from "./AIForm-BVJ7qhP5.mjs";
3
+ import { ae as Lt } from "./AIForm-DhR29Z6d.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() {
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, Fragment as R, jsxs as E } from "react/jsx-runtime";
2
2
  import { useReducer as _, useEffect as m, useCallback as h } from "react";
3
3
  import { Box as v, Stepper as x, Step as B, StepLabel as C, Typography as M, StepContent as D, Button as A } from "@mui/material";
4
- import { w as k, C as I, x as N } from "./AIForm-BVJ7qhP5.mjs";
4
+ import { w as k, C as I, x as N } from "./AIForm-DhR29Z6d.mjs";
5
5
  function O({ components: t = [], onUpdate: o }) {
6
6
  return /* @__PURE__ */ s(R, { children: t.map((p, r) => {
7
7
  const a = k[p.type];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),S=require("react"),l=require("@mui/material"),m=require("./AIForm-D8_6RVmA.js");function M({components:t=[],onUpdate:r}){return n.jsx(n.Fragment,{children:t.map((p,o)=>{const a=m.mui[p.type];if(!a)return null;const E=m.Controls_default[a.map];if(!E)return null;const u=p.id||p.props?.id||`stepper-comp-${o}`;return n.jsx(E,{attributes:p.props,onChange:r},u)})})}const b={activeStep:0,stepperResponse:{},MuiSteps:[]},A=(t,r)=>{const{type:p,payload:o}=r;switch(p){case"SET_STEPS":return{...t,MuiSteps:o.MuiSteps};case"SET_STEP":return{...t,activeStep:o.currentStep};case"UPDATE_RESPONSE":return{...t,stepperResponse:{...t.stepperResponse,[o.id]:o.value}};case"CHANGE_STEP":return{...t,activeStep:t.activeStep+o.stepChange};default:return t}};function P({attributes:t={},onChange:r,onStepUpdate:p,currentStep:o=0,patch:a={}}){const[E,u]=S.useReducer(A,b,()=>({activeStep:o,stepperResponse:a,MuiSteps:t.MuiSteps||[]})),{activeStep:y,stepperResponse:c,MuiSteps:d}=E;S.useEffect(()=>{u({type:"SET_STEP",payload:{currentStep:o}})},[o]),S.useEffect(()=>{a&&Object.keys(a).length>0&&Object.entries(a).forEach(([e,s])=>{c[e]!==s&&u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}})})},[a]),S.useEffect(()=>{d.forEach(e=>{(e.components||[]).forEach(s=>{const i=s.id||s.props?.id;i&&s.props?.value!==void 0&&c[i]===void 0&&(u({type:"UPDATE_RESPONSE",payload:{id:i,value:s.props.value}}),r&&r({id:i,value:s.props.value}))})})},[]);const x=S.useCallback((e,s,i)=>{u({type:"CHANGE_STEP",payload:{stepChange:e}});const f=y+e;p&&p(f,s&&e>0,i),i&&r&&t.id&&r({id:t.id,value:c})},[y,t.id,r,p,c]),h=S.useCallback(({id:e,value:s})=>{u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}}),r&&r({id:e,value:s})},[r]),v=(e=[],s=[])=>e.some(i=>!c[i])||s.some(i=>c[i.key]===i.value&&i.mandatoryIds.some(f=>!c[f])),j=(e,s,i,f)=>n.jsxs(l.Box,{sx:{mb:2},children:[n.jsx(l.Button,{variant:"contained",onClick:()=>x(1,s,e===d.length-1),disabled:v(i,f),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.next,...e===d.length-1&&{...t.MuiButtonAttributes?.final},children:e===d.length-1?"Finish":"Continue"}),n.jsx(l.Button,{disabled:e===0,onClick:()=>x(-1,s,!1),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.back,children:"Back"})]});return n.jsx(l.Box,{sx:{maxWidth:400},...t.MuiBoxAttributes,children:n.jsx(l.Stepper,{activeStep:y,orientation:"vertical",...t.MuiStepperAttributes,children:d.map((e,s)=>n.jsxs(l.Step,{...t.MuiStepAttributes,children:[n.jsx(l.StepLabel,{optional:s===d.length-1&&n.jsx(l.Typography,{variant:"caption",children:"Last step"}),...t.MuiStepLabelAttributes,children:e.label}),n.jsxs(l.StepContent,{...t.MuiStepContentAttributes,children:[e.components?n.jsx(M,{onUpdate:h,components:m.updatePatchData(e.components,{...c},"",{},e.enableDisableIds)}):n.jsx(l.Typography,{children:e.description}),j(s,e.isScreenChange,e.mandatoryIds,e.optionalMandatoryIds)]})]},e.label))})})}exports.default=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),S=require("react"),l=require("@mui/material"),m=require("./AIForm-CAlzDffx.js");function M({components:t=[],onUpdate:r}){return n.jsx(n.Fragment,{children:t.map((p,o)=>{const a=m.mui[p.type];if(!a)return null;const E=m.Controls_default[a.map];if(!E)return null;const u=p.id||p.props?.id||`stepper-comp-${o}`;return n.jsx(E,{attributes:p.props,onChange:r},u)})})}const b={activeStep:0,stepperResponse:{},MuiSteps:[]},A=(t,r)=>{const{type:p,payload:o}=r;switch(p){case"SET_STEPS":return{...t,MuiSteps:o.MuiSteps};case"SET_STEP":return{...t,activeStep:o.currentStep};case"UPDATE_RESPONSE":return{...t,stepperResponse:{...t.stepperResponse,[o.id]:o.value}};case"CHANGE_STEP":return{...t,activeStep:t.activeStep+o.stepChange};default:return t}};function P({attributes:t={},onChange:r,onStepUpdate:p,currentStep:o=0,patch:a={}}){const[E,u]=S.useReducer(A,b,()=>({activeStep:o,stepperResponse:a,MuiSteps:t.MuiSteps||[]})),{activeStep:y,stepperResponse:c,MuiSteps:d}=E;S.useEffect(()=>{u({type:"SET_STEP",payload:{currentStep:o}})},[o]),S.useEffect(()=>{a&&Object.keys(a).length>0&&Object.entries(a).forEach(([e,s])=>{c[e]!==s&&u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}})})},[a]),S.useEffect(()=>{d.forEach(e=>{(e.components||[]).forEach(s=>{const i=s.id||s.props?.id;i&&s.props?.value!==void 0&&c[i]===void 0&&(u({type:"UPDATE_RESPONSE",payload:{id:i,value:s.props.value}}),r&&r({id:i,value:s.props.value}))})})},[]);const x=S.useCallback((e,s,i)=>{u({type:"CHANGE_STEP",payload:{stepChange:e}});const f=y+e;p&&p(f,s&&e>0,i),i&&r&&t.id&&r({id:t.id,value:c})},[y,t.id,r,p,c]),h=S.useCallback(({id:e,value:s})=>{u({type:"UPDATE_RESPONSE",payload:{id:e,value:s}}),r&&r({id:e,value:s})},[r]),v=(e=[],s=[])=>e.some(i=>!c[i])||s.some(i=>c[i.key]===i.value&&i.mandatoryIds.some(f=>!c[f])),j=(e,s,i,f)=>n.jsxs(l.Box,{sx:{mb:2},children:[n.jsx(l.Button,{variant:"contained",onClick:()=>x(1,s,e===d.length-1),disabled:v(i,f),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.next,...e===d.length-1&&{...t.MuiButtonAttributes?.final},children:e===d.length-1?"Finish":"Continue"}),n.jsx(l.Button,{disabled:e===0,onClick:()=>x(-1,s,!1),sx:{mt:1,mr:1},...t.MuiButtonAttributes?.back,children:"Back"})]});return n.jsx(l.Box,{sx:{maxWidth:400},...t.MuiBoxAttributes,children:n.jsx(l.Stepper,{activeStep:y,orientation:"vertical",...t.MuiStepperAttributes,children:d.map((e,s)=>n.jsxs(l.Step,{...t.MuiStepAttributes,children:[n.jsx(l.StepLabel,{optional:s===d.length-1&&n.jsx(l.Typography,{variant:"caption",children:"Last step"}),...t.MuiStepLabelAttributes,children:e.label}),n.jsxs(l.StepContent,{...t.MuiStepContentAttributes,children:[e.components?n.jsx(M,{onUpdate:h,components:m.updatePatchData(e.components,{...c},"",{},e.enableDisableIds)}):n.jsx(l.Typography,{children:e.description}),j(s,e.isScreenChange,e.mandatoryIds,e.optionalMandatoryIds)]})]},e.label))})})}exports.default=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),o=require("@mui/material/Box"),n=require("@mui/material/Typography"),s=require("./AIForm-D8_6RVmA.js"),c=r=>r==null?"":Array.isArray(r)?r.map(c).join(", "):typeof r=="object"?JSON.stringify(r):String(r),j=r=>r==null?!0:Array.isArray(r)?r.length===0:typeof r=="string"?r.trim()==="":typeof r=="object"?Object.keys(r).length===0:!1;function h({attributes:r={}}){const{id:p="",guid:a,data:l,title:m="Summary",labels:x={},hideEmpty:u=!1,MuiAttributes:d={}}=r,y=l??s.FormData(a)??{},f=Object.entries(y).filter(([,t])=>!(u&&j(t)));return e.jsxs(o,{id:p,...d,sx:s.mergeSx(t=>({...s.premiumSurfaceSx(t),p:0}),d.sx),children:[e.jsx(o,{sx:t=>({px:2,py:1.5,borderBottom:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.action.hover}),children:e.jsx(n,{variant:"subtitle1",sx:{fontWeight:600},children:m})}),e.jsx(o,{component:"dl",sx:{m:0,display:"grid",gridTemplateColumns:"minmax(30%, auto) 1fr",columnGap:2,rowGap:0},children:f.map(([t,g])=>e.jsxs(b.Fragment,{children:[e.jsx(n,{component:"dt",variant:"body2",sx:i=>({px:2,py:1,color:i.palette.text.secondary,fontWeight:500,borderBottom:`1px solid ${i.palette.divider}`}),children:x[t]??t}),e.jsx(n,{component:"dd",variant:"body2",sx:i=>({m:0,px:2,py:1,color:i.palette.text.primary,borderBottom:`1px solid ${i.palette.divider}`,wordBreak:"break-word"}),children:c(g)})]},t))})]})}exports.default=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),o=require("@mui/material/Box"),n=require("@mui/material/Typography"),s=require("./AIForm-CAlzDffx.js"),c=r=>r==null?"":Array.isArray(r)?r.map(c).join(", "):typeof r=="object"?JSON.stringify(r):String(r),j=r=>r==null?!0:Array.isArray(r)?r.length===0:typeof r=="string"?r.trim()==="":typeof r=="object"?Object.keys(r).length===0:!1;function h({attributes:r={}}){const{id:p="",guid:a,data:l,title:m="Summary",labels:x={},hideEmpty:u=!1,MuiAttributes:d={}}=r,y=l??s.FormData(a)??{},f=Object.entries(y).filter(([,t])=>!(u&&j(t)));return e.jsxs(o,{id:p,...d,sx:s.mergeSx(t=>({...s.premiumSurfaceSx(t),p:0}),d.sx),children:[e.jsx(o,{sx:t=>({px:2,py:1.5,borderBottom:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.action.hover}),children:e.jsx(n,{variant:"subtitle1",sx:{fontWeight:600},children:m})}),e.jsx(o,{component:"dl",sx:{m:0,display:"grid",gridTemplateColumns:"minmax(30%, auto) 1fr",columnGap:2,rowGap:0},children:f.map(([t,g])=>e.jsxs(b.Fragment,{children:[e.jsx(n,{component:"dt",variant:"body2",sx:i=>({px:2,py:1,color:i.palette.text.secondary,fontWeight:500,borderBottom:`1px solid ${i.palette.divider}`}),children:x[t]??t}),e.jsx(n,{component:"dd",variant:"body2",sx:i=>({m:0,px:2,py:1,color:i.palette.text.primary,borderBottom:`1px solid ${i.palette.divider}`,wordBreak:"break-word"}),children:c(g)})]},t))})]})}exports.default=h;
@@ -2,7 +2,7 @@ import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
2
  import b from "react";
3
3
  import e from "@mui/material/Box";
4
4
  import n from "@mui/material/Typography";
5
- import { m as h, l as j, q as S } from "./AIForm-BVJ7qhP5.mjs";
5
+ import { m as h, l as j, q as S } from "./AIForm-DhR29Z6d.mjs";
6
6
  const s = (r) => r == null ? "" : Array.isArray(r) ? r.map(s).join(", ") : typeof r == "object" ? JSON.stringify(r) : String(r), A = (r) => r == null ? !0 : Array.isArray(r) ? r.length === 0 : typeof r == "string" ? r.trim() === "" : typeof r == "object" ? Object.keys(r).length === 0 : !1;
7
7
  function k({ attributes: r = {} }) {
8
8
  const {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),a=require("@mui/material"),h=require("./AIForm-D8_6RVmA.js"),m=require("./v4-CqdK_b8Y.js");function j(i){const{children:l,value:n,index:r,...s}=i;return e.jsx("div",{role:"tabpanel",hidden:n!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...s,children:n===r&&e.jsx(a.Box,{sx:{p:3},children:l})})}function p({attributes:i={},patch:l,onChange:n}){const{MuiAttributes:r={},tabs:s=[]}=i,[u,c]=d.useState(0),b=d.useMemo(()=>s.map(()=>m.v4()),[s.length]),x=(o,t)=>{c(t)};return e.jsxs(a.Box,{sx:{width:"100%"},children:[e.jsx(a.Box,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsx(a.Tabs,{value:u,onChange:x,...r,children:s.map((o,t)=>e.jsx(a.Tab,{label:o.label},t))})}),s.map((o,t)=>e.jsx(j,{value:u,index:t,children:e.jsx(h.FormGenerator,{guid:b[t],data:o.subFields||[],patch:l,onChange:n})},t))]})}exports.default=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),a=require("@mui/material"),h=require("./AIForm-CAlzDffx.js"),m=require("./v4-CqdK_b8Y.js");function j(i){const{children:l,value:n,index:r,...s}=i;return e.jsx("div",{role:"tabpanel",hidden:n!==r,id:`simple-tabpanel-${r}`,"aria-labelledby":`simple-tab-${r}`,...s,children:n===r&&e.jsx(a.Box,{sx:{p:3},children:l})})}function p({attributes:i={},patch:l,onChange:n}){const{MuiAttributes:r={},tabs:s=[]}=i,[u,c]=d.useState(0),b=d.useMemo(()=>s.map(()=>m.v4()),[s.length]),x=(o,t)=>{c(t)};return e.jsxs(a.Box,{sx:{width:"100%"},children:[e.jsx(a.Box,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsx(a.Tabs,{value:u,onChange:x,...r,children:s.map((o,t)=>e.jsx(a.Tab,{label:o.label},t))})}),s.map((o,t)=>e.jsx(j,{value:u,index:t,children:e.jsx(h.FormGenerator,{guid:b[t],data:o.subFields||[],patch:l,onChange:n})},t))]})}exports.default=p;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as h, jsx as a } from "react/jsx-runtime";
2
2
  import m from "react";
3
3
  import { Box as i, Tabs as c, Tab as p } from "@mui/material";
4
- import { F as f } from "./AIForm-BVJ7qhP5.mjs";
4
+ import { F as f } from "./AIForm-DhR29Z6d.mjs";
5
5
  import { v } from "./v4-BysszJq8.mjs";
6
6
  function g(s) {
7
7
  const { children: l, value: o, index: t, ...r } = s;
@@ -3,7 +3,7 @@ import { useState as x, useEffect as M, createElement as I } from "react";
3
3
  import j from "@mui/material/Autocomplete";
4
4
  import k from "@mui/material/TextField";
5
5
  import q from "@mui/material/Chip";
6
- import { j as R, m as B, p as F, k as P } from "./AIForm-BVJ7qhP5.mjs";
6
+ import { j as R, m as B, p as F, k as P } from "./AIForm-DhR29Z6d.mjs";
7
7
  const i = (e, a) => Array.isArray(e) ? e.map((t) => String(t)).filter((t) => t !== "") : e == null || e === "" ? [] : String(e).split(new RegExp(`[${a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")},]`)).map((t) => t.trim()).filter((t) => t !== "");
8
8
  function J({ attributes: e = {}, rules: a = {}, onChange: m }) {
9
9
  const {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),u=require("react"),E=require("@mui/material/Autocomplete"),I=require("@mui/material/TextField"),R=require("@mui/material/Chip"),a=require("./AIForm-D8_6RVmA.js"),p=(e,o)=>Array.isArray(e)?e.map(t=>String(t)).filter(t=>t!==""):e==null||e===""?[]:String(e).split(new RegExp(`[${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},]`)).map(t=>t.trim()).filter(t=>t!=="");function F({attributes:e={},rules:o={},onChange:m}){const{MuiAttributes:d={},id:t="",options:y=[],separator:l=";",label:q="",placeholder:v=""}=e,{sx:T,...A}=d,[f,i]=u.useState(()=>p(e.value,l)),[M,g]=u.useState(!1);u.useEffect(()=>{i(p(e.value,l))},[]),a.useUpdateEffect(()=>{i(p(e.value,l))},[e.value]);const x=o?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,S=x&&M&&f.length===0,$=S?o?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||"Required":"",j=(r,c)=>{const n=c.map(s=>String(s).trim()).filter(s=>s!=="");i(n),g(!0),m?.({id:t,value:n,option:n})};return h.jsx(E,{freeSolo:!0,multiple:!0,id:t,options:y,value:f,onChange:j,onBlur:()=>g(!0),renderValue:(r,c)=>r.map((n,s)=>{const C=c({index:s});return u.createElement(R,{label:n,...C,key:`${n}-${s}`,sx:a.premiumChipSx})}),renderInput:r=>h.jsx(I,{...r,label:q,placeholder:v,required:x,error:S,helperText:$,sx:a.mergeSx(a.premiumInputSx,T)}),...A})}exports.default=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),u=require("react"),E=require("@mui/material/Autocomplete"),I=require("@mui/material/TextField"),R=require("@mui/material/Chip"),a=require("./AIForm-CAlzDffx.js"),p=(e,o)=>Array.isArray(e)?e.map(t=>String(t)).filter(t=>t!==""):e==null||e===""?[]:String(e).split(new RegExp(`[${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},]`)).map(t=>t.trim()).filter(t=>t!=="");function F({attributes:e={},rules:o={},onChange:m}){const{MuiAttributes:d={},id:t="",options:y=[],separator:l=";",label:q="",placeholder:v=""}=e,{sx:T,...A}=d,[f,i]=u.useState(()=>p(e.value,l)),[M,g]=u.useState(!1);u.useEffect(()=>{i(p(e.value,l))},[]),a.useUpdateEffect(()=>{i(p(e.value,l))},[e.value]);const x=o?.validation?.some(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")||!1,S=x&&M&&f.length===0,$=S?o?.validation?.find(r=>r.rule==="mandatory"||r.rule==="mandatoryselect")?.message||"Required":"",j=(r,c)=>{const n=c.map(s=>String(s).trim()).filter(s=>s!=="");i(n),g(!0),m?.({id:t,value:n,option:n})};return h.jsx(E,{freeSolo:!0,multiple:!0,id:t,options:y,value:f,onChange:j,onBlur:()=>g(!0),renderValue:(r,c)=>r.map((n,s)=>{const C=c({index:s});return u.createElement(R,{label:n,...C,key:`${n}-${s}`,sx:a.premiumChipSx})}),renderInput:r=>h.jsx(I,{...r,label:q,placeholder:v,required:x,error:S,helperText:$,sx:a.mergeSx(a.premiumInputSx,T)}),...A})}exports.default=F;
@@ -47,6 +47,7 @@ export declare const defaultIconFor: (field: FormField | undefined) => string;
47
47
  */
48
48
  export declare const describeItem: (item: Record<string, any>, config: Partial<CollectionConfig>, index: number) => {
49
49
  title: string;
50
+ rawTitle: string;
50
51
  subtitle: string;
51
52
  details: ItemDetail[];
52
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamic-mui",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "author": "Dinakaran S",
5
5
  "user": "dinakarans",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),L=require("react"),x=require("./AIForm-D8_6RVmA.js"),n=require("@mui/material"),c=require("@mui/material/styles");let Ne=0;const Q=()=>`dmui-col-${++Ne}`,qe=e=>(e.collections||[]).map(o=>o.id),Ue=e=>Object.fromEntries(qe(e).map(o=>[o,[]])),pe=(e,o)=>x.toItems(e).map(r=>{const a=new Set(qe(o)),i=Object.fromEntries(Object.entries(r).filter(([p])=>!a.has(p))),s=Object.fromEntries((o.collections||[]).map(p=>[p.id,pe(r[p.id],p)]));return{key:Q(),data:i,children:s}}),he=(e,o)=>e.map(r=>{const a={...r.data};return(o.collections||[]).forEach(i=>{a[i.id]=he(r.children[i.id]||[],i)}),a}),_e=e=>({key:Q(),data:x.cloneDeep(e.data),children:Object.fromEntries(Object.entries(e.children).map(([o,r])=>[o,r.map(_e)]))});var ne,ve;function Oe(){if(ve)return ne;ve=1;var e=x.require_baseAssignValue(),o=x.requireEq();function r(a,i,s){(s!==void 0&&!o(a[i],s)||s===void 0&&!(i in a))&&e(a,i,s)}return ne=r,ne}var oe,Te;function Ke(){if(Te)return oe;Te=1;var e=x.requireIsArrayLike(),o=x.requireIsObjectLike();function r(a){return o(a)&&e(a)}return oe=r,oe}var re,Ie;function Xe(){if(Ie)return re;Ie=1;var e=x.require_baseGetTag(),o=x.require_getPrototype(),r=x.requireIsObjectLike(),a="[object Object]",i=Function.prototype,s=Object.prototype,p=i.toString,m=s.hasOwnProperty,g=p.call(Object);function h(b){if(!r(b)||e(b)!=a)return!1;var u=o(b);if(u===null)return!0;var l=m.call(u,"constructor")&&u.constructor;return typeof l=="function"&&l instanceof l&&p.call(l)==g}return re=h,re}var ae,Se;function $e(){if(Se)return ae;Se=1;function e(o,r){if(!(r==="constructor"&&typeof o[r]=="function")&&r!="__proto__")return o[r]}return ae=e,ae}var le,Ce;function Je(){if(Ce)return le;Ce=1;var e=x.require_copyObject(),o=x.requireKeysIn();function r(a){return e(a,o(a))}return le=r,le}var ie,Be;function Qe(){if(Be)return ie;Be=1;var e=Oe(),o=x.require_cloneBuffer(),r=x.require_cloneTypedArray(),a=x.require_copyArray(),i=x.require_initCloneObject(),s=x.requireIsArguments(),p=x.requireIsArray(),m=Ke(),g=x.requireIsBuffer(),h=x.requireIsFunction(),b=x.requireIsObject(),u=Xe(),l=x.requireIsTypedArray(),y=$e(),j=Je();function w(C,I,A,_,W,M,q){var S=y(C,A),v=y(I,A),F=q.get(v);if(F){e(C,A,F);return}var z=M?M(S,v,A+"",C,I,q):void 0,O=z===void 0;if(O){var $=p(v),R=!$&&g(v),G=!$&&!R&&l(v);z=v,$||R||G?p(S)?z=S:m(S)?z=a(S):R?(O=!1,z=o(v,!0)):G?(O=!1,z=r(v,!0)):z=[]:u(v)||s(v)?(z=S,s(S)?z=j(S):(!b(S)||h(S))&&(z=i(v))):O=!1}O&&(q.set(v,z),W(z,v,_,M,q),q.delete(v)),e(C,A,z)}return ie=w,ie}var se,we;function Ye(){if(we)return se;we=1;var e=x.require_Stack(),o=Oe(),r=x.require_baseFor(),a=Qe(),i=x.requireIsObject(),s=x.requireKeysIn(),p=$e();function m(g,h,b,u,l){g!==h&&r(h,function(y,j){if(l||(l=new e),i(y))a(g,h,j,b,m,u,l);else{var w=u?u(p(g,j),y,j+"",g,h,l):void 0;w===void 0&&(w=y),o(g,j,w)}},s)}return se=m,se}var ce,ke;function Ze(){if(ke)return ce;ke=1;var e=x.require_baseRest(),o=x.require_isIterateeCall();function r(a){return e(function(i,s){var p=-1,m=s.length,g=m>1?s[m-1]:void 0,h=m>2?s[2]:void 0;for(g=a.length>3&&typeof g=="function"?(m--,g):void 0,h&&o(s[0],s[1],h)&&(g=m<3?void 0:g,m=1),i=Object(i);++p<m;){var b=s[p];b&&a(i,b,p,g)}return i})}return ce=r,ce}var de,Ae;function et(){if(Ae)return de;Ae=1;var e=Ye(),o=Ze(),r=o(function(a,i,s){e(a,i,s)});return de=r,de}var tt=et();const nt=x.getDefaultExportFromCjs(tt),Re=(e,o)=>{const r=e.palette[o||"primary"];if(r&&typeof r=="object"&&r.main)return r;try{return e.palette.augmentColor({color:{main:String(o)}})}catch{return e.palette.primary}},De=(e,o)=>e.palette.mode==="dark"?o.light:o.dark,ot={add:"Add {label}",addMore:"Add another {labelLower}",emptyTitle:"No {pluralLower} yet",emptyText:void 0,edit:"Edit",duplicate:"Duplicate",moveUp:"Move up",moveDown:"Move down",delete:"Delete",more:"More actions",collapse:"Collapse",expand:"Expand",editAria:"Edit {title}",deleteAria:"Delete {title}",viewAria:"View {title}",moreAria:"More actions for {title}",collapseAria:"Collapse {title}",expandAria:"Expand {title}",maxReached:"Maximum of {max} reached",dialogAddTitle:"Add {label}",dialogEditTitle:"Edit {label}",dialogViewTitle:"{label}",dialogContext:"For {parent}",save:"Add {label}",saveChanges:"Save changes",saveAndAddAnother:"Save & add another",cancel:"Cancel",close:"Close",closeAria:"Close dialog",shortcut:"⌘/Ctrl + Enter",deleteTitle:"Delete {labelLower}?",deleteMessage:"{title} will be removed{detail}. This can’t be undone.",deleteDetail:", along with {detail}",deleteConfirm:"Delete"},rt=(e,o)=>e.replace(/\{(\w+)\}/g,(r,a)=>o[a]!=null?String(o[a]):r),at=(e,o)=>{if(e==null)return`repeat(auto-fill, minmax(min(${o}px, 100%), 1fr))`;const r=a=>`repeat(${Math.max(1,a)}, minmax(0, 1fr))`;return typeof e=="number"?r(e):Object.fromEntries(Object.entries(e).map(([a,i])=>[a,r(Number(i))]))},ze=e=>e==null?[]:Array.isArray(e)?e:[e],lt=(e,o,r,a={})=>{const i=r>0,s=Re(e,o.color),p=x.itemLabelOf(o),m=x.titleOf(o),g={...ot,...a,...o.texts||{}},h=o.styles||{},b={label:p,labelLower:p.toLowerCase(),plural:m,pluralLower:m.toLowerCase(),max:o.max};return{config:o,depth:r,nested:i,accent:s,ink:De(e,s),icon:o.icon||(i?"label":"folder_open"),itemLabel:p,plural:m,texts:g,layout:o.layout||(i?"table":"cards"),variant:o.variant||"outlined",addButton:{position:"header",variant:i?"outlined":"contained",icon:"add",...o.addButton||{}},actions:{edit:!0,delete:!0,duplicate:!1,move:!1,collapse:!1,...o.actions||{}},t:(u,l={})=>rt(String(g[u]??""),{...b,...l}),sx:(u,l)=>[...ze(l),...ze(h[u])],merged:(u,l={})=>nt({},l,h[u]||{})}},U="cubic-bezier(0.4, 0, 0.2, 1)";function it({ui:e,n:o}){const r=c.useTheme();return t.jsx(n.Box,{component:"span",sx:e.sx("headerCount",{minWidth:22,height:20,px:.75,borderRadius:"999px",display:"inline-grid",placeItems:"center",fontSize:11.5,fontWeight:700,bgcolor:o>0?c.alpha(e.accent.main,.12):c.alpha(r.palette.text.primary,.07),color:o>0?e.ink:"text.secondary",border:`1px solid ${o>0?c.alpha(e.accent.main,.2):"transparent"}`}),children:o})}const st=e=>e.split(/\s+/).map(o=>o.match(/[A-Za-z0-9]/)?.[0]||"").filter(Boolean).slice(0,2).join("").toUpperCase()||"#";function ct({ui:e,mode:o,title:r,index:a}){return o==="none"?null:t.jsx(n.Box,{sx:e.sx("avatar",{width:40,height:40,flexShrink:0,borderRadius:"10px",display:"grid",placeItems:"center",fontWeight:600,fontSize:14,bgcolor:c.alpha(e.accent.main,.1),color:e.ink,"& .MuiIcon-root":{fontSize:20}}),children:o==="initials"?st(r):o==="index"?a+1:t.jsx(n.Icon,{children:e.icon})})}function dt({ui:e,text:o,color:r}){const a=c.useTheme(),i=r==="default"?null:Re(a,r);return t.jsx(n.Box,{component:"span",sx:e.sx("badge",{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.3,borderRadius:"999px",fontSize:11.5,fontWeight:700,lineHeight:1.6,whiteSpace:"nowrap",letterSpacing:"0.02em",bgcolor:i?c.alpha(i.main,.1):c.alpha(a.palette.text.primary,.06),color:i?De(a,i):"text.secondary",border:`1px solid ${i?c.alpha(i.main,.25):c.alpha(a.palette.text.primary,.12)}`,"&::before":{content:'""',width:6,height:6,borderRadius:"50%",bgcolor:i?i.main:"text.disabled",flexShrink:0}}),children:o})}function Me({ui:e,placement:o,empty:r,disabled:a,onClick:i}){const{variant:s,icon:p,size:m,fullWidth:g}=e.addButton,h=o==="footer"&&!r?e.t("addMore"):e.t("add"),b=e.config.max!=null&&a,u=!!g||s==="dashed"&&g!==!1,l=j=>t.jsx(n.Tooltip,{title:b?e.t("maxReached"):"",children:t.jsx(n.Box,{component:"span",sx:{display:u?"block":"inline-flex",flexShrink:0},children:j})});if(s==="dashed")return l(t.jsxs(n.ButtonBase,{onClick:i,disabled:a,sx:e.sx("addButton",{width:u?"100%":"auto",display:"flex",alignItems:"center",justifyContent:"center",gap:.75,py:1.1,px:2,borderRadius:"8px",border:`1px dashed ${c.alpha(e.accent.main,.5)}`,color:e.ink,fontFamily:"inherit",fontSize:14,fontWeight:600,transition:`background-color .15s ${U}`,"&:hover":{bgcolor:c.alpha(e.accent.main,.06)},"&.Mui-focusVisible":{outline:`2px solid ${c.alpha(e.accent.main,.5)}`,outlineOffset:2},"&.Mui-disabled":{opacity:.5},"& .MuiIcon-root":{fontSize:19}}),children:[t.jsx(n.Icon,{children:p}),h]}));const y={contained:{bgcolor:e.accent.main,color:e.accent.contrastText,"&:hover":{bgcolor:e.accent.dark}},outlined:{color:e.ink,borderColor:c.alpha(e.accent.main,.5),"&:hover":{borderColor:e.accent.main,bgcolor:c.alpha(e.accent.main,.05)}},text:{color:e.ink,"&:hover":{bgcolor:c.alpha(e.accent.main,.07)}},soft:{color:e.ink,bgcolor:c.alpha(e.accent.main,.1),"&:hover":{bgcolor:c.alpha(e.accent.main,.16)}}}[s]||{};return l(t.jsx(n.Button,{onClick:i,disabled:a,variant:s==="soft"?"text":s,color:"inherit",size:m||(e.nested?"small":"medium"),fullWidth:g,disableElevation:!0,startIcon:t.jsx(n.Icon,{children:p}),sx:e.sx("addButton",{textTransform:"none",fontWeight:600,borderRadius:"8px",px:e.nested?1.5:2,whiteSpace:"nowrap",...y}),children:h}))}const xt=e=>/^[aeiou]/i.test(e)?"an":"a",pt=e=>e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`,ht=e=>{if(e.nested)return"";const o=e.itemLabel.toLowerCase(),r=(e.config.collections||[]).map(a=>x.pluralize(x.itemLabelOf(a)).toLowerCase());return r.length?`Add ${xt(o)} ${o}, then add its ${pt(r)}.`:`Add your first ${o} to get started.`};function mt({ui:e,readOnly:o,error:r}){const a=c.useTheme(),i=e.texts.emptyText!=null?e.t("emptyText"):ht(e);return e.nested?t.jsx(n.Typography,{sx:e.sx("empty",{fontSize:13,color:"text.disabled",fontStyle:"italic",py:.75,px:0,display:"block"}),children:e.t("emptyTitle")}):t.jsxs(n.Box,{sx:e.sx("empty",{py:5,px:3,textAlign:"center",borderRadius:"10px",border:`1.5px dashed ${r?a.palette.error.main:c.alpha(a.palette.text.primary,.15)}`,bgcolor:r?c.alpha(a.palette.error.main,.03):c.alpha(a.palette.text.primary,.02)}),children:[t.jsx(n.Box,{sx:{width:48,height:48,borderRadius:"50%",bgcolor:c.alpha(e.accent.main,.1),display:"flex",alignItems:"center",justifyContent:"center",mx:"auto",mb:1.5},children:t.jsx(n.Icon,{sx:{color:e.ink,fontSize:"22px !important"},children:e.icon||"inbox"})}),t.jsx(n.Typography,{sx:e.sx("emptyTitle",{fontSize:15,fontWeight:600,color:"text.primary"}),children:e.t("emptyTitle")}),i&&!o&&t.jsx(n.Typography,{sx:e.sx("emptyText",{fontSize:13.5,color:"text.secondary",mt:.5,maxWidth:380,mx:"auto"}),children:i})]})}function ft({ui:e,open:o,mode:r,guid:a,session:i,initial:s,context:p,onClose:m,onSave:g}){const h=c.useTheme(),b=e.config.dialog||{},u=n.useMediaQuery(h.breakpoints.down("sm")),l=b.fullScreen===!0||b.fullScreen!==!1&&u,y=L.useRef(null),[j,w]=L.useState(0),{accent:C}=e,I=e.t(r==="add"?"dialogAddTitle":r==="edit"?"dialogEditTitle":"dialogViewTitle"),A=`${a}-dialog-${i}-${j}`,_=e.t("dialogContext"),[W,M]=_.includes("{parent}")?_.split("{parent}"):[_,null],q=S=>{const v=y.current;!v||!v.validate()||(g({...v.getValues()},S),S&&w(F=>F+1))};return t.jsxs(n.Dialog,{open:o,onClose:(S,v)=>{v!=="backdropClick"&&m()},fullScreen:l,fullWidth:!0,maxWidth:b.maxWidth||"sm","aria-labelledby":`${a}-dialog-title`,onKeyDown:S=>{r!=="view"&&S.key==="Enter"&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),q(!1))},sx:{"& .MuiDialog-paper":e.merged("dialog",{borderRadius:l?0:"12px",backgroundImage:"none"})},children:[t.jsxs(n.Box,{sx:e.sx("dialogHeader",{display:"flex",alignItems:"flex-start",gap:1,px:{xs:2,sm:3},pt:2.5,pb:2,borderBottom:`1px solid ${h.palette.divider}`}),children:[t.jsxs(n.Box,{sx:{flex:1,minWidth:0},children:[t.jsx(n.Typography,{id:`${a}-dialog-title`,sx:e.sx("dialogTitle",{fontWeight:600,fontSize:18,lineHeight:1.3}),children:I}),p&&t.jsxs(n.Typography,{sx:e.sx("dialogContext",{fontSize:13.5,color:"text.secondary",mt:.25}),children:[W,M!==null&&t.jsx(n.Box,{component:"strong",sx:{color:"text.primary",fontWeight:600},children:p}),M]}),b.description&&t.jsx(n.Typography,{sx:e.sx("dialogDescription",{fontSize:13.5,color:"text.secondary",mt:.25}),children:b.description})]}),t.jsx(n.IconButton,{"aria-label":e.t("closeAria"),onClick:m,size:"small",sx:{mt:-.5,mr:-1,color:"text.secondary"},children:t.jsx(n.Icon,{children:"close"})})]}),t.jsx(n.DialogContent,{sx:e.sx("dialogContent",{px:{xs:2,sm:3},pt:"20px !important",pb:3}),children:t.jsx(x.FormGenerator,{guid:A,data:e.config.fields||[],patch:r==="add"?{}:s||{},apiRef:y,readOnly:r==="view",MuiGridAttributes:{spacing:b.spacing??2}},A)}),t.jsx(n.DialogActions,{sx:e.sx("dialogActions",{px:{xs:2,sm:3},py:1.5,gap:1,flexWrap:"wrap",borderTop:`1px solid ${h.palette.divider}`,"& .MuiButton-root":{textTransform:"none",fontWeight:600,borderRadius:"8px",px:2,whiteSpace:"nowrap",ml:"0 !important"}}),children:r==="view"?t.jsx(n.Button,{variant:"contained",disableElevation:!0,onClick:m,sx:e.sx("dialogSave",{bgcolor:C.main,color:C.contrastText,"&:hover":{bgcolor:C.dark}}),children:e.t("close")}):t.jsxs(t.Fragment,{children:[t.jsx(n.Button,{onClick:m,color:"inherit",sx:e.sx("dialogCancel",{color:"text.secondary"}),children:e.t("cancel")}),r==="add"&&b.addAnother!==!1&&t.jsx(n.Button,{variant:"outlined",color:"inherit",onClick:()=>q(!0),sx:e.sx("dialogSaveAnother",{color:e.ink,borderColor:c.alpha(C.main,.5),"&:hover":{borderColor:C.main,bgcolor:c.alpha(C.main,.06)}}),children:e.t("saveAndAddAnother")}),t.jsx(n.Tooltip,{title:e.t("shortcut"),placement:"top",describeChild:!0,children:t.jsx(n.Button,{variant:"contained",color:"inherit",disableElevation:!0,startIcon:t.jsx(n.Icon,{children:r==="add"?"add":"check"}),onClick:()=>q(!1),sx:e.sx("dialogSave",{bgcolor:C.main,color:C.contrastText,"&:hover":{bgcolor:C.dark}}),children:r==="add"?e.t("save"):e.t("saveChanges")})})]})})]})}function gt({ui:e,count:o,required:r,action:a,alone:i=!1}){const{nested:s}=e;return t.jsxs(n.Box,{sx:e.sx("header",{display:"flex",alignItems:"center",gap:1.5,mb:i?0:s?1.25:2.5,flexWrap:"wrap"}),children:[t.jsxs(n.Box,{sx:{flex:1,minWidth:s?140:{xs:"100%",sm:220}},children:[t.jsxs(n.Box,{sx:{display:"flex",alignItems:"center",gap:s?.75:1},children:[e.config.icon&&t.jsx(n.Box,{sx:{width:s?26:32,height:s?26:32,borderRadius:s?"6px":"8px",bgcolor:c.alpha(e.accent.main,.12),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t.jsx(n.Icon,{sx:e.sx("headerIcon",{color:e.ink,fontSize:`${s?14:18}px !important`}),children:e.icon})}),t.jsxs(n.Typography,{sx:e.sx("headerTitle",{fontWeight:700,fontSize:s?14:19,lineHeight:1.3,color:"text.primary"}),children:[e.plural,r&&t.jsx(n.Box,{component:"span",sx:{color:"error.main",ml:.25},children:"*"})]}),t.jsx(it,{ui:e,n:o})]}),e.config.description&&t.jsx(n.Typography,{sx:e.sx("headerDescription",{fontSize:13.5,color:"text.secondary",mt:.5,ml:s?0:e.config.icon?"44px":0}),children:e.config.description})]}),a]})}function me({ui:e,title:o,canEdit:r,onOpen:a,size:i}){return t.jsx(n.ButtonBase,{onClick:a,"aria-label":r?void 0:e.t("viewAria",{title:o}),"aria-haspopup":"dialog",sx:e.sx("itemTitle",{borderRadius:"4px",textAlign:"left",justifyContent:"flex-start",fontFamily:"inherit",fontWeight:600,fontSize:i,lineHeight:1.4,color:"text.primary",wordBreak:"break-word","&:hover":{color:e.ink,textDecoration:"underline"},"&.Mui-focusVisible":{outline:`2px solid ${c.alpha(e.accent.main,.5)}`,outlineOffset:2}}),children:o})}function fe({ui:e,data:o}){const r=e.config.display||{},a=typeof r.badge=="string"?{field:r.badge}:r.badge;if(!a)return null;const i=o[a.field],s=x.formatValue(x.findField(e.config.fields||[],a.field),i);if(!s)return null;const p=a.colors?.[String(i)]??a.colors?.[s]??"default";return t.jsx(dt,{ui:e,text:s,color:p})}function ut({ui:e,title:o,readOnly:r,open:a,canToggle:i,onEdit:s,onDelete:p,onMenu:m,onToggle:g}){const h=c.useTheme(),b=!r&&e.actions.edit,u=!r&&e.actions.delete,l=!r&&(e.actions.duplicate||e.actions.move),y=(j,w)=>({width:30,height:30,borderRadius:"8px",color:j,transition:`background-color .15s ${U}, color .15s ${U}`,"&:hover":{bgcolor:w}});return t.jsxs(n.Box,{sx:e.sx("actions",{display:"flex",alignItems:"center",gap:.25,flexShrink:0}),children:[b&&t.jsx(n.Tooltip,{title:e.t("edit"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("editAria",{title:o}),onClick:s,sx:e.sx("actionButton",y(e.ink,c.alpha(e.accent.main,.1))),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"edit"})})}),u&&t.jsx(n.Tooltip,{title:e.t("delete"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("deleteAria",{title:o}),onClick:p,sx:e.sx("actionButton",y(h.palette.error.main,c.alpha(h.palette.error.main,.08))),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"delete_outline"})})}),l&&t.jsx(n.Tooltip,{title:e.t("more"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("moreAria",{title:o}),onClick:j=>m(j.currentTarget),sx:e.sx("actionButton",y(h.palette.text.secondary,c.alpha(h.palette.text.primary,.07))),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"more_vert"})})}),i&&t.jsx(n.Tooltip,{title:a?e.t("collapse"):e.t("expand"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t(a?"collapseAria":"expandAria",{title:o}),"aria-expanded":a,onClick:g,sx:e.sx("actionButton",y(h.palette.text.secondary,c.alpha(h.palette.text.primary,.07))),children:t.jsx(n.Icon,{sx:{fontSize:"19px !important",transition:`transform .2s ${U}`,transform:a?"rotate(180deg)":"none"},children:"expand_more"})})})]})}function Ee({ui:e,node:o,guid:r,readOnly:a,issues:i,showErrors:s,texts:p,parentTitle:m,onChildChange:g}){const h=c.useTheme(),b=e.config.collections||[];return t.jsx(n.Box,{sx:e.sx("sections",{display:"grid",gridTemplateColumns:at(e.config.sectionColumns??1,320)}),children:b.map((u,l)=>t.jsx(n.Box,{sx:e.sx("section",{borderTop:`1px solid ${h.palette.divider}`,bgcolor:h.palette.mode==="dark"?c.alpha(h.palette.common.white,.02):c.alpha(h.palette.grey[500],.03),minWidth:0,...l>0?{borderLeft:`1px solid ${h.palette.divider}`}:{}}),children:t.jsx(n.Box,{sx:{px:{xs:2,sm:2.5},pt:{xs:1.5,sm:1.75},pb:{xs:1.25,sm:1.5}},children:t.jsx(We,{config:u,nodes:o.children[u.id]||[],onChange:y=>g(u.id,y),guid:`${r}-${o.key}`,depth:e.depth+1,readOnly:a,issues:i.filter(y=>y.path[0]===u.id).map(y=>({...y,path:y.path.slice(1)})),showErrors:s,parentTitle:m,texts:p})})},u.id))})}function bt({ui:e,node:o,index:r,guid:a,readOnly:i,collapsed:s,issues:p,showErrors:m,texts:g,onOpen:h,onDelete:b,onMenu:u,onToggle:l,onChildChange:y}){const j=c.useTheme(),{config:w}=e,C=w.display||{},{title:I,subtitle:A,details:_}=x.describeItem(o.data,w,r),W=w.collections||[],M=W.length>0,q=m&&p.length>0,S=C.avatar||"none",v=!i&&e.actions.edit,F=!i&&e.actions.delete,z=!i&&(e.actions.duplicate||e.actions.move),O=_.length>0||M,$=!s,R=q?c.alpha(j.palette.error.main,.05):c.alpha(e.accent.main,.05),G=q?c.alpha(j.palette.error.main,.2):c.alpha(e.accent.main,.15),P=(f,T)=>({width:30,height:30,borderRadius:"8px",color:f,transition:`background-color .15s ${U}`,"&:hover":{bgcolor:T}});return t.jsxs(n.Box,{sx:e.sx("item",{border:`1px solid ${q?j.palette.error.main:j.palette.divider}`,borderRadius:"14px",overflow:"hidden",bgcolor:"background.paper",boxShadow:`0 1px 3px ${c.alpha(j.palette.common.black,.06)}, 0 4px 12px ${c.alpha(j.palette.common.black,.04)}`}),children:[t.jsxs(n.Box,{sx:e.sx("itemHeader",{px:{xs:2,sm:2.5},pt:{xs:1.75,sm:2},pb:{xs:1.5,sm:1.75},bgcolor:R,borderBottom:$&&O?`1px solid ${G}`:"1px solid transparent",transition:`border-color .2s ${U}`,display:"flex",alignItems:"flex-start",gap:1.5}),children:[S!=="none"&&t.jsx(ct,{ui:e,mode:S,title:I,index:r}),t.jsxs(n.Box,{sx:{flex:1,minWidth:0},children:[t.jsxs(n.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.75,mb:A?.25:0},children:[t.jsx(me,{ui:e,title:I,canEdit:v,onOpen:h,size:15.5}),t.jsx(fe,{ui:e,data:o.data})]}),A&&t.jsxs(n.Typography,{sx:e.sx("subtitle",{display:"flex",alignItems:"center",gap:.4,fontSize:13,color:"text.secondary",wordBreak:"break-word","& .MuiIcon-root":{fontSize:14,color:"text.disabled"}}),children:[C.subtitleIcon&&t.jsx(n.Icon,{children:C.subtitleIcon}),A]}),!$&&M&&t.jsx(n.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.6},children:W.map(f=>{const T=(o.children[f.id]||[]).length;return t.jsxs(n.Box,{component:"span",sx:{fontSize:12,fontWeight:600,px:1,py:.2,borderRadius:"999px",bgcolor:c.alpha(e.accent.main,.08),color:e.ink,border:`1px solid ${c.alpha(e.accent.main,.18)}`},children:[T," ",x.pluralize(x.itemLabelOf(f),T).toLowerCase()]},f.id)})})]}),t.jsxs(n.Box,{sx:{display:"flex",alignItems:"center",flexShrink:0,gap:.25,mt:-.25},children:[v&&t.jsx(n.Tooltip,{title:e.t("edit"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("editAria",{title:I}),onClick:h,sx:P(e.ink,c.alpha(e.accent.main,.1)),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"edit"})})}),F&&t.jsx(n.Tooltip,{title:e.t("delete"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("deleteAria",{title:I}),onClick:b,sx:P(j.palette.error.main,c.alpha(j.palette.error.main,.08)),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"delete_outline"})})}),z&&t.jsx(n.Tooltip,{title:e.t("more"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t("moreAria",{title:I}),onClick:f=>u(f.currentTarget),sx:P(j.palette.text.secondary,c.alpha(j.palette.text.primary,.07)),children:t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"more_vert"})})}),O&&t.jsx(n.Tooltip,{title:$?e.t("collapse"):e.t("expand"),children:t.jsx(n.IconButton,{size:"small","aria-label":e.t($?"collapseAria":"expandAria",{title:I}),onClick:l,sx:P(j.palette.text.secondary,c.alpha(j.palette.text.primary,.07)),children:t.jsx(n.Icon,{sx:{fontSize:"19px !important",transition:`transform .25s ${U}`,transform:$?"rotate(180deg)":"none"},children:"expand_more"})})})]})]}),O&&t.jsxs(n.Collapse,{in:$,timeout:220,children:[_.length>0&&t.jsx(n.Box,{sx:e.sx("details",{display:"flex",overflowX:"auto",borderBottom:M?`1px solid ${j.palette.divider}`:"none","&::-webkit-scrollbar":{height:0}}),children:_.map((f,T)=>t.jsxs(n.Box,{sx:e.sx("detail",{flex:"1 1 0",minWidth:90,maxWidth:220,px:{xs:2,sm:2.5},py:1.5,borderLeft:T>0?`1px solid ${j.palette.divider}`:"none"}),children:[t.jsxs(n.Typography,{sx:e.sx("detailLabel",{fontSize:10.5,fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:"text.disabled",mb:.25,display:"flex",alignItems:"center",gap:.4,whiteSpace:"nowrap"}),children:[f.icon&&t.jsx(n.Icon,{sx:{fontSize:"11px !important"},children:f.icon}),f.label]}),t.jsx(n.Typography,{sx:e.sx("detailValue",{fontSize:13.5,fontWeight:600,color:f.value?"text.primary":"text.disabled",wordBreak:"break-word",lineHeight:1.4}),children:f.value||"—"})]},f.id))}),M&&t.jsx(Ee,{ui:e,node:o,guid:a,readOnly:i,issues:p,showErrors:m,texts:g,parentTitle:I,onChildChange:y})]})]})}function yt({ui:e,nodes:o,guid:r,readOnly:a,issues:i,showErrors:s,texts:p,isCollapsed:m,onToggle:g,onOpen:h,onDelete:b,onMenu:u,onChildChange:l}){const y=c.useTheme(),j=n.useMediaQuery(y.breakpoints.down("sm")),{config:w}=e,C=w.fields||[],I=w.display||{},A=x.detailSpecs(w),_=typeof I.badge=="string"?I.badge:I.badge?.field,W=typeof I.badge=="object"&&I.badge?.label||(_?x.fieldLabel(x.findField(C,_))||_:""),M=(w.collections||[]).length>0,q=!a&&e.actions.edit,S=!a&&(e.actions.edit||e.actions.delete||e.actions.duplicate||e.actions.move),v=f=>i.filter(T=>T.path[0]===f).map(T=>({...T,path:T.path.slice(1)})),F=t.jsx(n.Box,{component:"span",sx:{color:"text.disabled"},children:"—"}),z=(f,T,E)=>M&&t.jsx(n.Collapse,{in:!m(f.key),timeout:200,unmountOnExit:!0,children:t.jsx(Ee,{ui:e,node:f,guid:r,readOnly:a,issues:v(T),showErrors:s,texts:p,parentTitle:E,onChildChange:(V,N)=>l(T,V,N)})}),O=(f,T,E)=>t.jsx(ut,{ui:e,title:E,readOnly:a,open:!m(f.key),canToggle:M,onEdit:()=>h(T),onDelete:()=>b(T),onMenu:V=>u(V,T),onToggle:()=>g(f.key)}),$=c.alpha(y.palette.error.main,.06);if(j)return t.jsx(n.Box,{sx:e.sx("table",{border:`1px solid ${y.palette.divider}`,borderRadius:"8px",overflow:"hidden",bgcolor:"background.paper"}),children:o.map((f,T)=>{const{title:E,details:V}=x.describeItem(f.data,w,T),N=s&&v(T).length>0;return t.jsxs(n.Box,{sx:e.sx("mobileRow",{borderTop:T?`1px solid ${y.palette.divider}`:"none",...N?{bgcolor:$}:{}}),children:[t.jsxs(n.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1,p:1.5},children:[t.jsxs(n.Box,{sx:{flex:1,minWidth:0},children:[t.jsxs(n.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1},children:[t.jsx(me,{ui:e,title:E,canEdit:q,onOpen:()=>h(T),size:14.5}),t.jsx(fe,{ui:e,data:f.data})]}),V.length>0&&t.jsx(n.Box,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:1.5,rowGap:.25,mt:.75},children:V.map(H=>t.jsxs(L.Fragment,{children:[t.jsx(n.Typography,{sx:e.sx("detailLabel",{fontSize:13,color:"text.secondary"}),children:H.label}),t.jsx(n.Typography,{sx:e.sx("detailValue",{fontSize:13,fontWeight:500,wordBreak:"break-word"}),children:H.value})]},H.id))})]}),(S||M)&&O(f,T,E)]}),z(f,T,E)]},f.key)})});const R=e.sx("tableHeadCell",{fontSize:12.5,fontWeight:600,color:"text.secondary",whiteSpace:"nowrap",py:1,px:1.75}),G=e.sx("tableCell",{fontSize:14,color:"text.primary",whiteSpace:"nowrap",py:1.1,px:1.75}),P=1+A.length+(_?1:0)+(S||M?1:0);return t.jsx(n.Box,{sx:e.sx("table",{border:`1px solid ${y.palette.divider}`,borderRadius:"8px",overflowX:"auto",bgcolor:"background.paper"}),children:t.jsxs(n.Table,{size:"small",children:[t.jsx(n.TableHead,{children:t.jsxs(n.TableRow,{sx:e.sx("tableHead",{bgcolor:c.alpha(y.palette.text.primary,y.palette.mode==="dark"?.05:.03)}),children:[t.jsx(n.TableCell,{sx:R,children:I.titleLabel||e.itemLabel}),A.map(f=>t.jsx(n.TableCell,{sx:R,children:f.label},f.id)),_&&t.jsx(n.TableCell,{sx:R,children:W}),(S||M)&&t.jsx(n.TableCell,{sx:R})]})}),t.jsx(n.TableBody,{children:o.map((f,T)=>{const{title:E}=x.describeItem(f.data,w,T),V=s&&v(T).length>0,N=T===o.length-1,H=N&&!(M&&!m(f.key))?{"& > td":{borderBottom:0}}:{};return t.jsxs(L.Fragment,{children:[t.jsxs(n.TableRow,{hover:!0,sx:e.sx("tableRow",{...H,...V?{bgcolor:$}:{}}),children:[t.jsx(n.TableCell,{sx:G,children:t.jsx(me,{ui:e,title:E,canEdit:q,onOpen:()=>h(T),size:14})}),A.map(K=>t.jsx(n.TableCell,{sx:G,children:x.formatValue(x.findField(C,K.id),f.data[K.id])||F},K.id)),_&&t.jsx(n.TableCell,{sx:G,children:t.jsx(fe,{ui:e,data:f.data})}),(S||M)&&t.jsx(n.TableCell,{align:"right",sx:e.sx("rowActions",{width:"1%",whiteSpace:"nowrap",py:.25}),children:t.jsx(n.Box,{sx:{display:"inline-flex"},children:O(f,T,E)})})]}),M&&!m(f.key)&&t.jsx(n.TableRow,{children:t.jsx(n.TableCell,{colSpan:P,sx:{p:0,...N?{borderBottom:0}:{}},children:z(f,T,E)})})]},f.key)})})]})})}function We({config:e,nodes:o,onChange:r,guid:a,depth:i=0,readOnly:s=!1,issues:p=[],showErrors:m=!1,required:g=!1,parentTitle:h,texts:b}){const u=c.useTheme(),l=lt(u,e,i,b),{emptyTitle:y,emptyText:j,...w}={...b||{},...e.texts||{}},C=e.max!=null?Number(e.max):void 0,I=!s&&(C===void 0||o.length<C),A=s?"none":l.addButton.position,_=A==="header"||A==="both",W=A==="footer"||A==="both",M=e.showEmpty??!l.nested,q=o.length===0&&M&&!(W&&l.addButton.variant==="dashed"),S=o.length===0&&!q&&!W,[v,F]=L.useState({open:!1,mode:"add",index:-1,session:0}),[z,O]=L.useState({open:!1,index:-1,title:"",detail:""}),[$,R]=L.useState(null),[G,P]=L.useState({}),f=(d,B=-1)=>F(k=>({open:!0,mode:d,index:B,session:k.session+1})),T=()=>F(d=>({...d,open:!1})),E=()=>f("add"),V=d=>f(!s&&l.actions.edit?"edit":"view",d),N=e.defaultCollapsed??l.layout==="table",H=d=>G[d]??N,K=d=>P(B=>({...B,[d]:!H(d)})),Le=(d,B)=>{if(v.mode==="add"){const k={key:Q(),data:d,children:Ue(e)};l.layout==="cards"&&P(te=>({...te,[k.key]:!1})),r([...o,k]);const D=C!==void 0&&o.length+1>=C;(!B||D)&&T();return}v.mode==="edit"&&r(o.map((k,D)=>D===v.index?{...k,data:d}:k)),T()},ge=d=>r(o.filter((B,k)=>k!==d)),ue=d=>{if(e.confirmDelete===!1){ge(d);return}const B=o[d];O({open:!0,index:d,title:x.describeItem(B.data,e,d).title,detail:x.describeDescendants({...B.data,...B.children},e)})},Fe=d=>{const B=[...o];B.splice(d+1,0,_e(o[d])),r(B)},be=(d,B)=>{const k=d+B;if(k<0||k>=o.length)return;const D=[...o];[D[d],D[k]]=[D[k],D[d]],r(D)},ye=(d,B,k)=>r(o.map((D,te)=>te===d?{...D,children:{...D.children,[B]:k}}:D)),J=m?p.find(d=>d.path.length===0)?.message:void 0,Pe=v.index>=0?o[v.index]:void 0,X=$?.index??-1,Y=d=>{R(null),d()},Ve=()=>P(Object.fromEntries(o.map(d=>[d.key,!0]))),Ge=()=>P(Object.fromEntries(o.map(d=>[d.key,!1]))),Z=o.length>0&&o.every(d=>H(d.key)),ee=l.t("deleteMessage",{detail:z.detail?l.t("deleteDetail",{detail:z.detail}):""}),[He,je]=ee.includes("{title}")?ee.split("{title}"):[ee,null];return t.jsxs(n.Box,{"data-collection":e.id,sx:l.sx("root",{width:"100%",minWidth:0}),children:[t.jsx(gt,{ui:l,count:o.length,required:g||(Number(e.min)||0)>0,alone:S&&!J,action:t.jsxs(n.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:[l.layout==="cards"&&o.length>=2&&t.jsx(n.Button,{size:"small",variant:"text",onClick:Z?Ge:Ve,sx:{fontSize:12.5,fontWeight:600,color:"text.secondary",px:1,minWidth:0,textTransform:"none","&:hover":{color:"text.primary",bgcolor:c.alpha(u.palette.text.primary,.05)}},startIcon:t.jsx(n.Icon,{sx:{fontSize:"15px !important"},children:Z?"unfold_more":"unfold_less"}),children:Z?"Expand all":"Collapse all"}),_&&t.jsx(Me,{ui:l,placement:"header",empty:o.length===0,disabled:!I,onClick:E})]})}),J&&t.jsxs(n.Typography,{role:"alert",sx:l.sx("error",{display:"flex",alignItems:"center",gap:.5,color:"error.main",fontSize:13,fontWeight:500,mt:-.5,mb:1.25}),children:[t.jsx(n.Icon,{sx:{fontSize:"17px !important"},children:"error_outline"}),J]}),q&&t.jsx(mt,{ui:l,readOnly:s,error:!!J}),o.length>0&&l.layout==="table"&&t.jsx(yt,{ui:l,nodes:o,guid:a,readOnly:s,issues:p,showErrors:m,texts:w,isCollapsed:H,onToggle:K,onOpen:V,onDelete:ue,onMenu:(d,B)=>R({anchor:d,index:B}),onChildChange:ye}),o.length>0&&l.layout==="cards"&&t.jsx(n.Box,{sx:l.sx("list",{display:"flex",flexDirection:"column",gap:2}),children:o.map((d,B)=>t.jsx(bt,{ui:l,node:d,index:B,guid:a,readOnly:s,collapsed:H(d.key),issues:p.filter(k=>k.path[0]===B).map(k=>({...k,path:k.path.slice(1)})),showErrors:m,texts:w,onOpen:()=>V(B),onDelete:()=>ue(B),onMenu:k=>R({anchor:k,index:B}),onToggle:()=>K(d.key),onChildChange:(k,D)=>ye(B,k,D)},d.key))}),W&&t.jsx(n.Box,{sx:{mt:o.length||l.addButton.variant!=="dashed"?1.25:0},children:t.jsx(Me,{ui:l,placement:"footer",empty:o.length===0,disabled:!I,onClick:E})}),t.jsx(ft,{ui:l,open:v.open,mode:v.mode,session:v.session,guid:`${a}-${e.id}`,initial:Pe?.data,context:h,onClose:T,onSave:Le}),t.jsxs(n.Menu,{anchorEl:$?.anchor,open:!!$,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{"& .MuiPaper-root":l.merged("menu",{borderRadius:"10px",minWidth:170})},children:[l.actions.duplicate&&t.jsxs(n.MenuItem,{sx:l.sx("menuItem"),disabled:!I,onClick:()=>Y(()=>Fe(X)),children:[t.jsx(n.ListItemIcon,{children:t.jsx(n.Icon,{fontSize:"small",children:"content_copy"})}),t.jsx(n.ListItemText,{children:l.t("duplicate")})]}),l.actions.move&&t.jsxs(n.MenuItem,{sx:l.sx("menuItem"),disabled:X<=0,onClick:()=>Y(()=>be(X,-1)),children:[t.jsx(n.ListItemIcon,{children:t.jsx(n.Icon,{fontSize:"small",children:"arrow_upward"})}),t.jsx(n.ListItemText,{children:l.t("moveUp")})]}),l.actions.move&&t.jsxs(n.MenuItem,{sx:l.sx("menuItem"),disabled:X>=o.length-1,onClick:()=>Y(()=>be(X,1)),children:[t.jsx(n.ListItemIcon,{children:t.jsx(n.Icon,{fontSize:"small",children:"arrow_downward"})}),t.jsx(n.ListItemText,{children:l.t("moveDown")})]})]}),t.jsxs(n.Dialog,{open:z.open,onClose:()=>O(d=>({...d,open:!1})),maxWidth:"xs",fullWidth:!0,sx:{"& .MuiDialog-paper":l.merged("confirm",{borderRadius:"12px",backgroundImage:"none"})},children:[t.jsxs(n.DialogContent,{sx:{pt:3,pb:1},children:[t.jsx(n.Typography,{sx:l.sx("confirmTitle",{fontWeight:600,fontSize:17}),children:l.t("deleteTitle")}),t.jsxs(n.Typography,{sx:l.sx("confirmText",{fontSize:14,color:"text.secondary",mt:1}),children:[He,je!==null&&t.jsx(n.Box,{component:"strong",sx:{color:"text.primary",fontWeight:600},children:z.title}),je]})]}),t.jsxs(n.DialogActions,{sx:{px:3,pb:2.5,pt:2,gap:1,"& .MuiButton-root":{textTransform:"none",fontWeight:600,borderRadius:"8px"}},children:[t.jsx(n.Button,{color:"inherit",onClick:()=>O(d=>({...d,open:!1})),sx:l.sx("confirmCancel",{color:"text.secondary"}),children:l.t("cancel")}),t.jsx(n.Button,{variant:"contained",color:"error",disableElevation:!0,onClick:()=>{ge(z.index),O(d=>({...d,open:!1}))},sx:l.sx("confirmDelete"),children:l.t("deleteConfirm")})]})]})]})}const jt=["mandatory","mandatoryselect"],xe=e=>{try{return JSON.stringify(e)}catch{return""}};function vt({attributes:e={},rules:o={},onChange:r,submitTick:a}){const{id:i="",value:s}=e,p={...e,id:i,fields:e.fields||[]},m=!!(e.readOnly||e.disabled||e.MuiAttributes?.disabled),g=o?.validation?.find(I=>jt.includes(I.rule)),[h]=L.useState(Q),[b,u]=L.useState(()=>pe(s,p)),[l,y]=L.useState(!1),j=L.useRef(xe(x.toItems(s)));x.useUpdateEffect(()=>{const I=xe(x.toItems(s));I!==j.current&&(j.current=I,u(pe(s,p)))},[s]),x.useUpdateEffect(()=>{a&&y(!0)},[a]);const w=I=>{u(I);const A=he(I,p);j.current=xe(A),r?.({id:i,value:A})},C=x.collectionIssues(he(b,p),p,{required:!!g,requiredMessage:g?.message});return t.jsx(We,{config:p,nodes:b,onChange:w,guid:`${h}-${i}`,readOnly:m,issues:C,showErrors:l,required:!!g})}exports.default=vt;