@dartech/arsenal-ui 1.11.13 → 1.11.15

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.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{useTheme as e,createTheme as r,responsiveFontSizes as n,ThemeProvider as l}from"@mui/material/styles";import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{__rest as a,__awaiter as s}from"tslib";import d from"@mui/material/TextField";import c from"@mui/material/MenuItem";import*as u from"react";import p,{memo as m,useMemo as h,useEffect as f,useRef as g,useState as b,useCallback as v,createElement as C,forwardRef as y,useImperativeHandle as x,createContext as E,useContext as O,Suspense as w}from"react";import{useController as V,useWatch as L,Controller as T,useFormContext as k,useFieldArray as R,useForm as F}from"react-hook-form";import S from"@mui/material/SvgIcon";import A from"@mui/material/IconButton";import N from"@mui/material/InputAdornment";import M from"@mui/material/Button";import D from"@mui/material/Dialog";import I from"@mui/material/DialogActions";import P from"@mui/material/DialogContent";import q from"@mui/material/DialogContentText";import B from"@mui/material/DialogTitle";import z from"@mui/material/Box";import j from"@mui/material/Typography";import $ from"@mui/material/CircularProgress";import H from"@mui/material/FormControl";import _ from"@mui/material/FormControlLabel";import J from"@mui/material/FormHelperText";import W from"@mui/material/Checkbox";import G from"@mui/material/Radio";import Y from"@mui/material/RadioGroup";import Z from"@mui/material/FormLabel";import K from"@mui/material/Autocomplete";import U from"lodash/get";import X from"@mui/material/useMediaQuery";import Q from"@mui/material/ListSubheader";import{VariableSizeList as ee}from"react-window";import{useInfiniteQuery as re}from"@tanstack/react-query";import ne from"@mui/material/Tooltip";import{useNavigate as le,useLocation as te,Link as oe,useSearchParams as ie,Outlet as ae}from"react-router-dom";import se from"@uiw/react-codemirror";import{langs as de}from"@uiw/codemirror-extensions-langs";import{abcdef as ce}from"@uiw/codemirror-theme-abcdef";import ue from"@mui/icons-material/Fullscreen";import pe from"@mui/icons-material/FullscreenExit";import{format as me,parse as he,isValid as fe,isMatch as ge,startOfTomorrow as be,endOfYesterday as ve,isToday as Ce,isAfter as ye,isBefore as xe}from"date-fns";import Ee from"classnames";import{styled as Oe}from"@mui/system";import we from"@mui/material/Switch";import{DatePicker as Ve}from"@mui/x-date-pickers/DatePicker";import{DateTimePicker as Le}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as Te}from"@mui/x-date-pickers/TimePicker";import{renderTimeViewClock as ke}from"@mui/x-date-pickers/timeViewRenderers";import Re from"@mui/material/Chip";import Fe from"@mui/material/Grid2";import{toString as Se,parse as Ae}from"duration-fns";import{IMaskInput as Ne}from"react-imask";import Me from"@mui/material/Pagination";import De from"@mui/material/TablePagination";import{useGridApiContext as Ie,useGridSelector as Pe,gridPageSelector as qe,gridPageCountSelector as Be,gridRowCountSelector as ze,gridPageSizeSelector as je,DataGrid as $e,GridActionsCellItem as He}from"@mui/x-data-grid";import _e from"@mui/material/Table";import Je from"@mui/material/TableBody";import We from"@mui/material/TableCell";import Ge from"@mui/material/TableContainer";import Ye from"@mui/material/TableHead";import Ze from"@mui/material/TableRow";import Ke from"@mui/material/TableFooter";import Ue from"@mui/material/Backdrop";import Xe from"@mui/material/TableSortLabel";import Qe from"@mui/material/Menu";import er from"@mui/icons-material/MoreHoriz";import rr from"@mui/material/Paper";import nr from"@mui/material/Tab";import lr from"@mui/material/Tabs";import tr from"@mui/icons-material/DeleteOutline";import or from"@mui/material/Stepper";import ir from"@mui/material/Step";import ar from"@mui/material/StepLabel";import sr from"@mui/material/StepContent";import dr from"@mui/material/StepConnector";import cr from"lodash/isPlainObject";import ur from"@mui/material/Accordion";import pr from"@mui/material/AccordionSummary";import mr from"@mui/material/AccordionDetails";import hr from"@mui/material/AccordionActions";import{ExpandMore as fr}from"@mui/icons-material";import{AdapterDateFns as gr}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as br}from"@mui/x-date-pickers/LocalizationProvider";import vr from"@mui/material/Select";import Cr from"@mui/material/InputLabel";import yr from"@mui/material/ListItem";import xr from"@mui/icons-material/CheckBoxOutlineBlank";import Er from"@mui/icons-material/CheckBox";import Or from"lodash/isNil";import{toast as wr}from"react-toastify";import Vr from"@mui/material/CssBaseline";import Lr from"@mui/material/Drawer";import Tr from"@mui/material/List";import kr from"@mui/material/ListItemIcon";import Rr from"@mui/material/ListItemButton";import Fr from"@mui/material/ListItemText";import Sr from"@mui/material/Toolbar";import Ar from"@mui/material/ButtonBase";import Nr from"@mui/material/Collapse";import Mr from"@mui/material/Breadcrumbs";import Dr from"@mui/icons-material/NavigateNext";var Ir,Pr;!function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.LONG="LONG",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.OBJECT="OBJECT",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.ANY="ANY",e.ARRAY="ARRAY",e.SHORT="SHORT",e.LOCALIZED_STRING="LOCALIZED_STRING"}(Ir||(Ir={})),function(e){e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY"}(Pr||(Pr={}));const qr=m((function({transparent:e=.3,position:r="absolute",bgcolor:n="#fff"}){const l=h((()=>e?"number"==typeof e?e:0:.3),[e]);return f((()=>{if("number"==typeof e&&(e>1||e<0))throw Error("'transparency' prop must be in 0 to 1 range")}),[e]),t(z,{position:r,top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,children:[o($,{sx:{zIndex:1,position:"relative"}}),o(z,{sx:{opacity:l},position:"absolute",top:0,left:0,width:"100%",height:"100%",bgcolor:n})]})})),Br=({open:e,title:r,description:n,closeButtonTitle:l="Close",onClose:i,confirmButtonTitle:a="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:d=!1,onConfirm:c,children:u,dialogProps:p,loading:m,maxWidth:h="xs",hideCloseButton:f=!1})=>o("div",{children:t(D,Object.assign({open:e,onClose:d?(e,r)=>{if("backdropClick"===r)return null;i()}:i,disableEscapeKeyDown:d,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:h},p,{children:[m&&o(qr,{}),t(B,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[o(j,{variant:"inherit",children:r}),!f&&o(A,{sx:{padding:0,height:"28px",width:"28px"},onClick:i,children:o(S,{children:o("g",{opacity:"0.6",children:o("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})})})})]}),t(P,{children:[n&&o(q,{id:"alert-dialog-description",children:n}),o(z,{maxWidth:"100%",overflow:"hidden",children:u})]}),t(I,{children:[!f&&o(M,{onClick:i,variant:"outlined",children:l}),a&&c?o(M,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))}),zr={code:"",name:"",version:0,properties:[]},jr={code:"",name:"",version:0,properties:{}},$r="Please, fill this field",Hr="Incorrect date format",_r="yyyy-MM-dd",Jr="HH:mm:ss",Wr="yyyy-MM-dd'T'HH:mm:ss.SSSZ",Gr=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m="",disabled:h=!1,textarea:f=!1,hideErrorMessage:g=!1,onChange:b,requiredErrorText:v=""}=e,C=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const y=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&(v||$r),validate:s}}),x=y.field,{ref:E,onChange:O,value:w}=x,L=a(x,["ref","onChange","value"]),{fieldState:{error:T}}=y;return o(d,Object.assign({},L,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:E,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!T,helperText:!g&&(null==T?void 0:T.message),disabled:h,multiline:f,minRows:f?3:1,value:null!=w?w:"",slotProps:{formHelperText:{variant:"standard"},inputLabel:{shrink:!!C.placeholder},htmlInput:Object.assign(Object.assign({},null!==(n=null===(r=null==C?void 0:C.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==n?n:{}),{value:null!=w?w:""})},onChange:b||O},C))};function Yr(e,r){const n=g();f((()=>()=>{n.current&&clearTimeout(n.current)}),[]);return(...l)=>{clearTimeout(n.current),n.current=setTimeout((()=>{e(...l)}),r)}}const Zr=()=>{const[e,r]=b(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Kr=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m="",disabled:h=!1,textarea:g=!1,hideErrorMessage:C=!1,onChange:y,requiredErrorText:x="",debounceTime:E=200}=e,O=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText","debounceTime"]);const{field:{ref:w,onChange:T},fieldState:{error:k}}=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&(x||$r),validate:s}}),R=L({control:l,name:c}),[F,S]=b("");f((()=>{!F&&R&&S(R)}),[F,R]);const A=Yr((e=>{T(e)}),200),N=v((e=>{S(e.target.value),A(e.target.value)}),[A]);return o(d,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:w,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!k,helperText:!C&&(null==k?void 0:k.message),disabled:h,multiline:g,minRows:g?3:1,value:null!=F?F:"",onChange:N,slotProps:{formHelperText:{variant:"standard"},htmlInput:Object.assign(Object.assign({},null!==(n=null===(r=null==O?void 0:O.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==n?n:{}),{value:null!=F?F:""})}},O))},Ur=()=>o(S,{children:o("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),Xr=e=>{var r,n,l,{control:s,validate:u,name:p="",label:m="",required:h=!1,defaultValue:f="",disabled:g=!1,hideErrorMessage:b=!1,onChange:C,labelKey:y,valueKey:x,options:E=[],requiredErrorText:O=""}=e,w=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const L=V({name:p,control:s,defaultValue:f,rules:{required:!!h&&(O||$r),validate:u}}),T=L.field,{ref:k,onChange:R,value:F}=T,M=a(T,["ref","onChange","value"]),{fieldState:{error:D}}=L,I=v((e=>"string"==typeof e?e:x?e[x]:e.value),[x]),P=v((e=>"string"==typeof e?e:y?e[y]:e.label),[y]),q=v((()=>{C?C(null):R(null)}),[R,C]);return o(d,Object.assign({},M,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:k,name:p,label:h?t(i,{children:[m," ",o("span",{children:"*"})]}):m,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!D,helperText:!b&&(null==D?void 0:D.message),disabled:g,value:null!=F?F:"",onChange:C||R,slotProps:{input:Object.assign({endAdornment:!h&&F?o(N,{position:"end",sx:{mr:0},children:o(A,{onClick:q,size:"small",children:o(S,{fontSize:"small",children:o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})}):null},null===(r=null==w?void 0:w.slotProps)||void 0===r?void 0:r.input),select:{sx:{"& .MuiSelect-select .notranslate::after":w.placeholder?{content:`"${w.placeholder}"`,opacity:.42}:{}}},formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==w?void 0:w.placeholder)},htmlInput:Object.assign(Object.assign({},null!==(l=null===(n=null==w?void 0:w.slotProps)||void 0===n?void 0:n.htmlInput)&&void 0!==l?l:{}),{value:null!=F?F:""})}},w,{children:E.map(((e,r)=>o(c,{value:I(e),children:P(e)},r)))}))},Qr=e=>{var{control:r,validate:n,name:l="",label:i="",required:s=!1,defaultValue:d,disabled:c=!1,hideErrorMessage:u=!1,onChange:p}=e,m=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const f=V({name:l,control:r,defaultValue:null!=d&&d}),g=f.field,{ref:b,onChange:v,value:C}=g,y=a(g,["ref","onChange","value"]),{fieldState:{error:x}}=f,E=h((()=>{if("boolean"==typeof C)return C;if("string"==typeof C){if("false"===C)return v(!1),!1;if("true"===C)return v(!0),!0}return!1}),[C,v]);return t(H,{error:!!x,component:"fieldset",variant:"standard",disabled:c,children:[o(_,{control:o(W,Object.assign({},y,{checked:E,onChange:p||v,name:l,ref:b,disabled:c,color:"secondary"},m)),label:i}),!u&&(null==x?void 0:x.message)&&o(J,{variant:"standard",children:x.message})]})},en=({name:e,label:r,values:n=[],control:l,required:i,defaultValue:s,disabled:d,hideErrorMessage:c,labelKey:u,valueKey:p,validate:m,onChange:h,row:f,radioProps:g,requiredErrorText:b=""})=>{const C=V({name:e,control:l,defaultValue:s,rules:{required:!!i&&(b||$r),validate:m}}),y=C.field,{onChange:x}=y,E=a(y,["onChange"]),{fieldState:{error:O}}=C,w=v((e=>"string"==typeof e?e:p?e[p]:e.value),[p]),L=v((e=>"string"==typeof e?e:(console.log(e),u?e[u]:e.label)),[u]),T=v((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),k=v((e=>{"true"===e.target.value||"false"===e.target.value?x("true"===e.target.value):x(e)}),[x]);return t(H,{disabled:d,error:!!O,children:[o(Z,{id:"radio-buttons-group",children:r}),o(Y,Object.assign({},E,{row:f,"aria-labelledby":"radio-buttons-group",onChange:h||k,children:n.map(((e,r)=>o(_,{value:w(e),control:o(G,Object.assign({},g,{checked:T(w(e))})),label:L(e)},r)))})),!c&&(null==O?void 0:O.message)&&o(J,{variant:"standard",children:O.message})]})},rn=({valueKey:e,labelKey:r})=>{const n=v(((r,n)=>{if(r&&n){if("string"==typeof r)return r===n;if(e)return U(r,e)===U(n,e)||U(r,e)===n;if(r.value)return r.value===n.value||r.value===n}return!1}),[e]),l=v((e=>e?"string"==typeof e?e:r&&U(e,r,"")?U(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),t=v(((e,r)=>C(z,Object.assign({},e,{component:"li",key:e.id}),l(r))),[l]);return{isOptionEqualToValue:n,getOptionLabel:l,renderOption:t}},nn=u.createContext({}),ln=u.forwardRef(((e,r)=>{const n=u.useContext(nn);return o("div",Object.assign({ref:r},e,n))}));function tn(e){const{data:r,index:n,style:l}=e,t=r[n],i=Object.assign(Object.assign({},l),{top:l.top+8});if(t.hasOwnProperty("group"))return o(Q,{component:"div",style:i,children:t.group},t.key);const{key:s}=t,d=a(t,["key"]);return o(j,Object.assign({component:"li"},d,{noWrap:!0,style:i,children:t}),s)}const on=u.forwardRef((function(r,n){const{children:l}=r,t=a(r,["children"]),i=[];l.forEach((e=>{i.push(e),i.push(...e.children||[])}));const s=e(),d=X(s.breakpoints.up("sm"),{noSsr:!0}),c=i.length,p=d?36:48,m=e=>e.hasOwnProperty("group")?48:p,h=function(e){const r=u.useRef(null);return u.useEffect((()=>{null!=r.current&&r.current.resetAfterIndex(0,!0)}),[e]),r}(c);return o("div",{ref:n,children:o(nn.Provider,{value:t,children:o(ee,{itemData:i,height:(c>8?8*p:i.map(m).reduce(((e,r)=>e+r),0))+16,width:"100%",ref:h,outerElementType:ln,innerElementType:"ul",itemSize:e=>m(i[e]),overscanCount:5,itemCount:c,children:tn})})})})),an=e=>{var{control:r,validate:n,name:l="",label:s="",required:c=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:m=!1,onChange:h,labelKey:g,valueKey:v,options:C=[],multiple:y,textFieldProps:x={},disableCloseOnSelect:E,useStringValue:O,requiredErrorText:w="",startAdornment:L,endAdornment:T,useVirtualList:k}=e,R=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment","useVirtualList"]);const F=V({name:l,control:r,defaultValue:u||(y?[]:null),rules:{required:!!c&&(w||$r),validate:n}}),S=F.field,{ref:A,onChange:N,value:M}=S,D=a(S,["ref","onChange","value"]),{fieldState:{error:I}}=F,[P,q]=b(),{getOptionLabel:B,isOptionEqualToValue:z,renderOption:j}=rn({valueKey:v,labelKey:g});return f((()=>{"string"==typeof M&&v&&O&&void 0===P&&C.length&&C[0]&&"object"==typeof C[0]&&q(C.find((e=>U(e,v)===M)))}),[P,C,O,M,v]),o(K,Object.assign({},D,{value:O?null!=P?P:null:M,fullWidth:!0,disablePortal:!0,size:"small",readOnly:p,options:C,multiple:y,disableListWrap:k,getOptionLabel:B,isOptionEqualToValue:z,disableCloseOnSelect:E||y,filterSelectedOptions:y,onChange:h||((e,r)=>{N(O&&v?U(r,v):r),q(r)}),renderOption:j,slotProps:{listbox:{component:k?on:null}},renderInput:e=>o(d,Object.assign({},e,{variant:"outlined",name:l,label:c?t(i,{children:[s," ",o("span",{children:"*"})]}):s,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==R?void 0:R.placeholder,error:!!I,inputRef:A,helperText:!m&&(null==I?void 0:I.message),slotProps:{input:Object.assign(Object.assign({},e.InputProps),{startAdornment:L||e.InputProps.startAdornment,endAdornment:T||e.InputProps.endAdornment}),formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==R?void 0:R.placeholder)}}},x))},R))};const sn=()=>o("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function dn(e){var{name:r,label:n,control:l,required:s=!1,searchBy:c,labelKey:u,multiple:m=!1,mongoQueryJson:g,disabled:C,valueKey:y,sortBy:x="",hideErrorMessage:E,disableCloseOnSelect:O,textFieldProps:w,onChange:L,queryFunction:T,validate:k,itemQueryFunction:R,requiredErrorText:F="",startAdornment:S,endAdornment:A,useVirtualList:M}=e,D=a(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment","useVirtualList"]);const I=V({control:l,name:r,defaultValue:m?[]:null,rules:{required:!!s&&(F||$r),validate:k}}),P=I.field,{ref:q,onChange:B,value:z}=P,j=a(P,["ref","onChange","value"]),{fieldState:{error:H,isDirty:_}}=I,{getOptionLabel:J,isOptionEqualToValue:W,renderOption:G}=rn({valueKey:y,labelKey:u}),[Y,Z]=b([]),[X,Q]=b(!1),[ee,ne]=b(""),[le,te]=b(""),oe=h((()=>!!Y.length&&X),[X,Y]),{data:ie,isFetching:ae,isFetchingNextPage:se,hasNextPage:de,fetchNextPage:ce}=re({initialPageParam:0,queryKey:["options",x,le],queryFn:({pageParam:e})=>T(Object.assign({page:`${e}`,size:"20",sort:x},le?{[c]:le}:{})),getNextPageParam:(e,r,n)=>e.totalPages&&e.totalPages!==n+1?n+1:null}),ue=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>ue(e,r)));{const n={};for(const l in e)n[l]=ue(e[l],r);return n}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},pe=Yr((e=>{if(g){const r=ue(g,e);te(JSON.stringify(r))}else te(e)}),500),me=v(((e,r)=>{Z([]),ne(r),pe(r)}),[pe]),he=v(((e,r,...n)=>{B(r),L&&L(e,r,...n)}),[B,L]);f((()=>{(null==ie?void 0:ie.pages)&&Z(le?ie.pages[0].collection:ie.pages.reduce(((e,r)=>(e.push(...r.collection),e)),[]))}),[ie,le]),f((()=>{if(!_&&z&&R){let e=z;"object"==typeof z&&y in z&&(e=U(z,y)),R(e).then((e=>{B(e),ne(U(e,u))})).catch(console.error)}}),[z,_,y,u,R,B]);const fe=v((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&de&&!se&&ce()}),[de,se,ce]);return o(K,Object.assign({},j,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:C,options:Y,multiple:m,getOptionLabel:J,isOptionEqualToValue:W,disableCloseOnSelect:O||m,filterSelectedOptions:m,inputValue:ee,value:z,onChange:he,disableListWrap:M,loading:ae,clearOnBlur:!1,open:oe,filterOptions:e=>e,onOpen:()=>{Q(!0)},onClose:()=>{Q(!1),te("")},onInputChange:me,renderOption:G,popupIcon:o(sn,{}),slotProps:{listbox:{component:M?on:null,onScroll:fe}},renderInput:e=>o(d,Object.assign({},e,{label:s?t(i,{children:[n," ",o("span",{children:"*"})]}):n,placeholder:null==D?void 0:D.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!H,inputRef:q,helperText:!E&&(null==H?void 0:H.message),slotProps:{formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==D?void 0:D.placeholder)},input:Object.assign(Object.assign({},e.InputProps),{endAdornment:A||t(p.Fragment,{children:[ae?o(N,{position:"end",children:o($,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:S||e.InputProps.startAdornment})}},w))},D))}const cn=({copyText:e,helpText:r="Copy"})=>{const[n,l]=b(r);return n?o(ne,{title:n,placement:"top",children:o(A,{onClick:()=>{navigator.clipboard.writeText(e),l("Copied!"),setTimeout((()=>{l(r)}),1e3)},children:o(S,{fontSize:"small",children:o("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})})})}):null},un=({text:e,buttonProps:r={}})=>{const n=le(),{state:l}=te(),t=h((()=>null==l?void 0:l.from),[l]),i=v((()=>{n(t||-1)}),[n,t]);return o(z,{mr:2,children:e?o(M,Object.assign({color:"inherit",onClick:t?null:i,component:oe,to:null!=t?t:""},r,{children:e})):o(A,{onClick:i,children:o(S,{children:o("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},pn=(e,r)=>{const n=[...e];return n.splice(r,1),n},mn=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function hn(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const fn=(e,r,n,l="asc")=>{const t=e[n],o=r[n];return t<o?"asc"===l?-1:1:t>o?"asc"===l?1:-1:0},gn=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},bn=e=>{try{return JSON.parse(e)}catch(e){return null}},vn=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=vn(r[e])})),r}catch(r){return e}},Cn=({children:e})=>{const[r,n]=b(!1),l=v((e=>{n((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{n((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return o(ne,{title:e,arrow:!0,disableHoverListener:!r,children:o("div",{ref:l,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})},yn=Oe(z)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),xn=({text:e,status:r="default"})=>o(yn,{className:Ee("root",{[r]:!0}),children:e}),En=y((({value:e,height:r=200,fontSize:n=16},l)=>{const[i,a]=b(!0),s=g(null),{toggleFullScreen:d,fullScreen:c}=jn(s.current),u=v((e=>{const r=n=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-n.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===n.target.scrollTop&&(a(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(a(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):a(!1)}),[]);return t(z,{position:"relative",ref:s,children:[i&&o(qr,{bgcolor:"#fff"}),o(A,{size:"small",onClick:d,sx:{position:"absolute",zIndex:3,top:0,right:0,padding:"3px",borderRadius:"0"},children:o(c?pe:ue,{fontSize:"small"})}),o(se,{ref:l,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:c?"100vh":`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:u,extensions:[de.json()],style:{fontSize:n,width:"100%"}})]})})),On=({open:e,onClose:r,value:n,jsonViewProps:l})=>{const i=g();return t(D,{disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"},children:[o(P,{children:o(En,Object.assign({value:n},l,{ref:i}))}),t(I,{children:[o(cn,{copyText:n}),o(M,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})},wn=({value:e,copyButton:r=!1,textField:n=!1})=>{const{open:l,onOpen:i,onClose:a}=Zr(),s=v((e=>{e.stopPropagation(),i()}),[i]);return t(z,{width:"100%",children:[t(z,{display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2,children:[r&&o(cn,{copyText:gn(e)}),o(ne,{title:"Open",placement:"top",children:o(A,{size:"small",onClick:s,children:o(S,{children:o("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),n?o(z,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):o(En,{value:e}),o(On,{open:l,value:gn(e),onClose:a,jsonViewProps:{height:450}})]})},Vn={100:"#E3EBFC",200:"#CCD9F9",300:"#ACC2F5",400:"#8EABF1",500:"#7196ED",600:"#527FE9",700:"#376BE5",800:"#1744AE",900:"#00267F"},Ln={100:"#DDF5F2",200:"#BAEAE5",300:"#92E2D8",400:"#76D3C8",500:"#53BAAD",600:"#2CAB9B",700:"#148C7D",800:"#08675B",900:"#014239"},Tn={0:"#FFF",20:"#F7F7FA",50:"#F4F4F6",100:"#E4E4EA",200:"#CDCDDB",300:"#AAABBF",400:"#8D8EA6",500:"#71718C",600:"#575773",700:"#3E3F59",800:"#2C2D45",900:"#1F1F33",1e3:"#171829"},kn={100:"#E5FEF1",200:"#CAFCE3",300:"#AAF2CE",400:"#8AE6B8",500:"#6CD9A3",600:"#53CF91",700:"#3BC480",800:"#138049",900:"#014221"},Rn={100:"#FCEADF",200:"#FDDFCE",300:"#F9C8AC",400:"#F7B189",500:"#F69E6B",600:"#F4884A",700:"#F4772E",800:"#C96226",900:"#9A4716"},Fn={100:"#FFE9E6",200:"#F8D2CD",300:"#F1ADA5",400:"#EB8E83",500:"#E46D5E",600:"#DD4F3E",700:"#D6331F",800:"#AA2111",900:"#831002"},Sn={0:"#171829",20:"#1F1F33",50:"#2C2D45",100:"#3E3F59",200:"#575773",300:"#71718C",400:"#8D8EA6",500:"#AAABBF",600:"#CDCDDB",700:"#E4E4EA",800:"#F4F4F6",900:"#F7F7FA",1e3:"#FFF"},An={100:"#FFFBDE",200:"#FFF7C4",300:"#FFF1A3",400:"#FFEF85",500:"#FFEB69",600:"#FFE249",700:"#FFCE1F",800:"#FFB60F",900:"#EF9A00"},Nn={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"},bg:{accent:{blue:{primary:Vn[700],secondary:Vn[300],tertiary:Vn[100]},green:{primary:kn[700],secondary:kn[300],tertiary:kn[100]},orange:{primary:Rn[700],secondary:Rn[300],tertiary:Rn[100]},red:{primary:Fn[700],secondary:Fn[300],tertiary:Fn[100]},yellow:{primary:An[700],secondary:An[300],tertiary:An[100]}},brand:{high:Ln[700],mid:Ln[200],low:Ln[100]},default:{hard:Sn[1e3],high:Tn[200],inverse:Tn[1e3],low:Tn[20],mid:Tn[100]},system:{critical:Fn[800],disabled:Tn[500],success:kn[800],warning:Rn[800]}},button:{primary:{default:Ln[700],disabled:Tn[50],focused:Ln[900],hover:Ln[800]},secondary:{default:Sn[1e3],disabled:Tn[100],focused:Tn[400],hover:Sn[900]},warning:{default:Rn[700],disabled:Rn[200],focused:Rn[900],hover:Rn[800]}},stroke:{primary:{brand:Ln[700],default:Tn[200],focused:Ln[700],hover:Tn[300],inverse:Sn[100],hard:Tn[1e3]},secondary:{brand:Ln[500],default:Tn[100],focused:Ln[700],hover:Tn[200],inverse:Sn[50]},tertiary:{brand:Ln[300],default:Tn[50],focused:Ln[700],hover:Tn[100],inverse:Sn[20]},system:{critical:Fn[800],success:kn[800],warning:Rn[800]}},surface:{primary:Sn[1e3],secondary:Sn[900]},textIcon:{accent:{blue:{primary:Vn[700],secondary:Vn[500],tertiary:Vn[300]},green:{primary:kn[800],secondary:kn[500],tertiary:kn[300]}},brand:{primary:Ln[700],secondary:Ln[500],tertiary:Ln[300]},disabled:{default:Tn[200],onColor:Tn[50]},primary:{default:Tn[1e3],inverse:Sn[1e3],onDark:Sn[1e3],onLight:Tn[1e3]},secondary:{default:Tn[500],inverse:Sn[400],onColor:Tn[200]},tertiary:{default:Tn[300],inverse:Sn[200],onColor:Tn[100]},system:{critical:Fn[700],link:Vn[800],success:kn[700],warning:Rn[700]}}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var Mn=r(Nn);const Dn={components:{MuiButtonBase:{defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:Mn.palette.button.warning.hover},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:Mn.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:Mn.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:Mn.spacing(3),minWidth:Mn.spacing(25),background:Mn.palette.background.default,paddingRight:Mn.spacing(3)},input:{minWidth:Mn.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:Ur},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:Mn.spacing(25)}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:Mn.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto",whiteSpace:"normal","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:Mn.spacing(3),minWidth:Mn.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:Mn.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:o(Ur,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:Mn.palette.secondary.dark,padding:Mn.spacing(2,3),borderRadius:8,textAlign:"center"}}}},In={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:Mn.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:Mn.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:Mn.spacing(4)}},head:{padding:Mn.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:0,"& .MuiSelect-select":{zIndex:2,color:Mn.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}},"& img":{position:"absolute",right:0}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{columnHeaderHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:Mn.spacing(3),width:"100%",color:Mn.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{borderTopLeftRadius:Mn.spacing(3),borderTopRightRadius:Mn.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},"container--top":{'& [role="row"]':{backgroundColor:Mn.palette.grey[100],'& [role="columnheader"]':{borderBottom:"none"}}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:Mn.spacing(1.25,3),display:"flex",alignItems:"center",borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}},Pn={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:Mn.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:Mn.palette.secondary.main}}}}}},qn={components:{MuiTypography:{styleOverrides:{h1:{[Mn.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[Mn.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[Mn.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}},Bn=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return n(r(Mn,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Dn.components),In.components),Pn.components),qn.components),{MuiToolbar:{styleOverrides:{root:{[Mn.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:Mn.spacing(2.5),padding:Mn.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:Mn.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:Mn.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:Mn.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:Mn.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:Mn.palette.secondary.main}}}}})}))})(),zn=({value:e,canCopy:r,copyValue:n,shortId:l,fullText:i=!1,textParams:a})=>{const{displayAs:s="text",tooltipLinkComponent:d=null,dateFormat:c=null,statusVariant:u=null}=a||{};switch(s){case"boolean":return o(S,e?{color:"primary",fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})});case"date":return e?c?o(Cn,{children:c.map(((r,n)=>o(z,{children:me(new Date(e),r)},n)))}):t(Cn,{children:[o(z,{children:me(new Date(e),"dd.MM.yyyy")}),o(z,{children:me(new Date(e),"HH:mm:ss")})]}):"";case"status":return o(Cn,{children:o(xn,{text:e,status:u||"default"})});case"json_text":return o(wn,{value:e,textField:!0});case"json_code":return o(wn,{value:e,copyButton:!0});case"array":return o(z,{children:null==e?void 0:e.map(((e,r)=>o(z,{children:e},r)))});case"collapsed_array":return e&&o(z,{children:o(ne,{arrow:!0,title:d||e.map(((e,r)=>o(z,{fontSize:14,style:{paddingTop:Bn.spacing(1)},children:e},r))),children:o(z,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})})});case"number":return o(z,{display:"flex",justifyContent:"flex-end",children:o(Cn,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?t(z,{display:"flex",alignItems:"center",width:"100%",children:[l?o(Cn,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):i?o(z,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):o(Cn,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&o(cn,{copyText:n?"string"==typeof n?n:JSON.stringify(n):e})]}):""}},jn=e=>{const[r,n]=b(!1),l=v((()=>{if(r)n(!1),document.exitFullscreen();else switch(n(!0),!0){case"string"==typeof e:{const r=document.querySelector(e);r&&r.requestFullscreen();break}case e instanceof HTMLElement:e.requestFullscreen()}}),[r,e]);return f((()=>{const e=()=>{!document.fullscreenElement&&r&&n(!1)};return document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("fullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("fullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[r]),{fullScreen:r,toggleFullScreen:l}},$n=new RegExp("^[-+]?[0-9]+$"),Hn=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),_n=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const n of e)if(_n(n,r))return!0;if("object"==typeof e)for(const n in e)if(_n(e[n],r))return!0}return!1},Jn=new Intl.NumberFormat("ru-RU",{style:"decimal"}),Wn=e=>!e&&0!==e&&!1!==e,Gn=(e,r,n)=>{if(null==r)return null;if(_n(r))return r;let l=r;switch(el(e)){case Ir.BOOLEAN:l=!!r||!(!r&&null!==r)&&null;break;case Ir.INTEGER:case Ir.BIG_INTEGER:case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.LONG:case Ir.DOUBLE:case Ir.SHORT:l=Number(r);break;case Ir.DATE:case Ir.DATE_TIME:case Ir.TIME:if(r)try{const e=n.formatText.replace(/[Z,z,x]+/g,"XX");l=me(he(r,e,new Date),e)}catch(e){console.error(e)}break;case Ir.ANY:try{l="string"==typeof r?JSON.parse(l):r}catch(e){l=r}break;case Ir.OBJECT:l=Yn(e,r)}return l},Yn=(e,r)=>{var n;let l={};if(r){const t=el(e);return t===Ir.OBJECT?Array.isArray(e.properties)?null===(n=e.properties)||void 0===n||n.forEach((function(e){const{key:n}=e,t=r[n];Array.isArray(t)?l[n]=t.map((r=>Gn(e,r,{formatText:e.format,properties:e.properties}))):l[n]=Gn(e,t,{formatText:e.format,properties:e.properties})})):l=cr(r)?r:{}:l=t===Ir.ARRAY&&Array.isArray(r)?r.map((r=>e.memberNodes?Gn(e.memberNodes,r):r)):Gn(e,r),l}return null},Zn=(e,r)=>{return n(e);function n(e){const{name:l,isRequired:t,sortOrder:o,isEnabled:i,uiSettings:a,validationNode:s}=e,d=el(e),c=Object.assign({name:l,nodeType:d,isRequired:null!==t&&t,sortOrder:o,isEnabled:null!==i&&i,validationNode:s,uiSettings:a},((e,r)=>{const n={};let l,t="";return r?e.nodeType===Ir.ARRAY?(t="values",l=e.value):(t="value",l=e.value):e.nodeType===Ir.ARRAY?(t="defaultValues",l=e.defaultValue):(t="defaultValue",l=e.defaultValue),Array.isArray(l)?n[t]=l.map((r=>Gn(e,r,{formatText:e.format,properties:e.properties}))):n[t]=Gn(e,l,{formatText:e.format,properties:e.properties}),n})(e,r));if("isViewableInList"in e&&(c.isViewableInList=e.isViewableInList),a)if("string"==typeof a)try{c.uiSettings=JSON.parse(a)}catch(e){console.log(e),c.uiSettings=a}else c.uiSettings=a;else c.uiSettings=null;if(d===Ir.BIG_DECIMAL&&(c.precisionScale=e.precisionScale,c.roundingMode=e.roundingMode),d!==Ir.DATE&&d!==Ir.TIME&&d!==Ir.DATE_TIME||(c.format=e.format),d===Ir.STRING&&(c.restrictedValues=e.restrictedValues),d===Ir.ENTITY_REFERENCE){const{definitionCode:r,definitionVersion:n,labelPropertyCode:l,valuePropertyCode:t}=e;c.definitionCode=r,c.definitionVersion=n,c.labelPropertyCode=l,c.valuePropertyCode=t}return d===Ir.ARRAY&&(c.memberNodes=e.memberNodes?n(e.memberNodes):null),d===Ir.OBJECT&&(c.properties=function(e){if(!Array.isArray(e)||!e.length)return null;const r={};return e.forEach((e=>{r[e.key]=n(e)})),r}(e.properties)),c}};function Kn(e,r){var n;return e&&e.nodeType===Ir.OBJECT&&e.properties&&(e.properties=(n=e.properties)?Array.isArray(n)?n:Object.keys(n).map((e=>{let l=Object.assign(Object.assign({key:e},n[e]),r||{});const t=el(l);return t===Ir.OBJECT&&(l=Kn(l,r)),t===Ir.ARRAY&&l.memberNodes&&(l.memberNodes=Kn(l.memberNodes,r),"defaultValues"in l&&(l.defaultValue=l.defaultValues),"values"in l&&(l.value=l.values)),l})).sort(((e,r)=>fn(e,r,"sortOrder"))):[]),e&&e.nodeType===Ir.ARRAY&&e.memberNodes&&(e.memberNodes=Kn(e.memberNodes,r)),e}const Un=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return me(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},Xn=e=>(Array.isArray(e.properties)?e:Kn(e)).properties.reduce(((r,n)=>{const l=JSON.parse(JSON.stringify(r));return e.nodeType===Ir.OBJECT?l[e.key]=Xn(e):l[e.key]=e.nodeType,l}),{}),Qn=({nodeType:e,useExpression:r,required:n})=>{let l=[{value:"widget",label:"Fill array",sortOrder:1}];return n||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Ir.OBJECT||e===Ir.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e!==Ir.ANY&&e!==Ir.OBJECT&&e!==Ir.ARRAY||l.push({value:"json_valid",label:"JSON editor",sortOrder:2}),l=l.sort(((e,r)=>fn(e,r,"sortOrder"))),l},el=e=>{var r;return e?"string"==typeof e.nodeType?e.nodeType:null===(r=e.nodeType)||void 0===r?void 0:r.value:Ir.ANY},rl=({nodeType:e,useExpression:r,required:n})=>{let l=[{value:"widget",label:"Widget",sortOrder:1}];switch(n||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Ir.OBJECT||e===Ir.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e){case Ir.STRING:l[0].label="Text input";break;case Ir.INTEGER:case Ir.BIG_INTEGER:case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.LONG:case Ir.DOUBLE:case Ir.SHORT:l[0].label="Number input";break;case Ir.BOOLEAN:l[0].label="Switch";break;case Ir.ENTITY_REFERENCE:l[0].label="Entity reference field";break;case Ir.ARRAY:l[0].label="Array editor";break;case Ir.DATE:l[0].label="Date picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.DATE_TIME:l[0].label="Date & Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.TIME:l[0].label="Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.ANY:l[0].label="JSON"}return l=l.sort(((e,r)=>fn(e,r,"sortOrder"))),l},nl=y(((e,r)=>{var{control:n,name:l,mode:s="json",label:d,width:c="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:f=!1,hideErrorMessage:b=!1,fontSize:C=16,validate:y=!0,parseValue:x,requiredErrorText:E="",useCleanValue:O}=e,w=a(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const L=V({control:n,name:l,rules:{required:!!m&&(E||$r),validate:e=>{if(e&&f&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),T=L.field,{onChange:k,value:R,ref:F}=T,S=a(T,["onChange","value","ref"]),{fieldState:{error:N}}=L,M=g(null),{toggleFullScreen:D,fullScreen:I}=jn(M.current),P=h((()=>({json:[de.json()],javascript:[de.javascript()],python:[de.python()]})),[]),q=h((()=>"text"===s&&"string"!=typeof R?JSON.stringify(R,null,2):"json"===s&&"string"!=typeof R?null===R?"":O?JSON.stringify(R,null,2).replace(/\\"/g,""):JSON.stringify(R,null,2):"string"==typeof R&&"text"!==s&&O?R.replace(/\\"/g,""):R),[R,O,s]),B=v((e=>{if(x)try{const r=JSON.parse(e);k(r)}catch(r){k(e)}else k(e)}),[k,x]);return t(z,{display:"flex",flexDirection:"column",width:"100%",position:"relative",ref:M,children:[o(A,{size:"small",onClick:D,sx:{position:"absolute",zIndex:3,top:0,right:0,color:"#fff",padding:"3px",borderRadius:"0",backgroundColor:"#000"},children:o(I?pe:ue,{fontSize:"small"})}),o(z,{children:d&&o(j,{display:"inline",style:{marginRight:10},children:m?t(i,{children:[d," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):d})}),t(i,{children:[o(se,Object.assign({},S,{ref:r||F,basicSetup:{autocompletion:!0,history:!0},theme:ce,width:c,height:I?"100vh":u,style:{fontSize:C,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:q,onChange:B,extensions:"text"===s?[]:P[s]},w)),N&&!b&&o(J,{variant:"standard",error:!0,children:N.message})]})]})})),ll={required:$r,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},tl=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m=null,disabled:f=!1,hideErrorMessage:g=!1,onChange:b,decimal:v=!1,valueAsNumber:C=!0,useFormattedInputValue:y=!1,errorText:x}=e,E=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const O=h((()=>x||ll),[x]),w=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&O.required,validate:e=>s?"function"!=typeof s||s(e):0===+e||(null===e?!p||O.required:v&&!Hn.test(e)||/^-*0+$/.test(e)?O.notValidNumber:!(!v&&!$n.test(e))||O.notValidInteger)}}),L=w.field,{ref:T,onChange:k,value:R}=L,F=a(L,["ref","onChange","value"]),{fieldState:{error:S}}=w;return o(d,Object.assign({},F,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:T,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!g&&(null==S?void 0:S.message),disabled:f,value:y?null!==(r=null==R?void 0:R.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=R?R:"",onChange:e=>{let r=e.target.value.replace(/\s/g,"");const n=e.nativeEvent.data;if(!(v?/^-?\d*[.,]?\d*$/:/^-?\d*$/).test(r))return;if(!((r.match(/[.,]/g)||[]).length>1||r.lastIndexOf("-")>0))if(r=r.replace(/,/g,"."),!isNaN(n)||v&&"."===n||"-"===n||"+"===n||r)if(b)b(e);else if(C)if(r)if("0"===r)k(0);else if(v){const e=r.replace(",",".").split(".")[1],n=parseFloat(r.replace(",","."));k(!Hn.test(r.replace(",","."))||/^0+$/.test(e)||/^-*0+$/.test(r)||Number.isNaN(n)?r:n)}else k(Number.isNaN(+r.replace(",","."))?r:+r.replace(",","."));else k(null);else k(r);else k(r)},slotProps:{formHelperText:{variant:"standard"},htmlInput:null===(n=null==E?void 0:E.slotProps)||void 0===n?void 0:n.htmlInput}},E))},ol=e=>{var{control:r,name:n,label:l,defaultValue:t}=e,i=a(e,["control","name","label","defaultValue"]);const s=V({control:r,name:n,defaultValue:t}).field,{ref:d,onChange:c,value:u}=s,p=a(s,["ref","onChange","value"]),m=h((()=>{if("boolean"==typeof u)return u;if("string"==typeof u){if("false"===u)return c(!1),!1;if("true"===u)return c(!0),!0}return!1}),[u,c]);f((()=>{null===u&&c(!1)}),[u,c]);return o(_,{label:l,name:n,control:o(we,Object.assign({},p,{color:"primary",size:"small",inputRef:d,onChange:e=>{const{checked:r}=e.target;c(r)},checked:m},i))})};var il="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const al=()=>o("img",{src:il,alt:""}),sl=e=>{var{control:r,name:n,required:l,label:s,placeholder:d,defaultValue:c,format:u=_r,hideErrorMessage:p=!1,requiredErrorText:m="",validate:g,dateCondition:C,validateErrorText:y,slotProps:x}=e,E=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","requiredErrorText","validate","dateCondition","validateErrorText","slotProps"]);const[O,w]=b(_r),L=V({control:r,name:n,defaultValue:c,rules:{required:!!l&&(m||$r),validate:g||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!ge(e,O))return null!=y?y:Hr;if(C&&e){const r=he(e,O,new Date),n=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,n)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,n)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,n))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,n))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),T=L.field,{value:k,onChange:R}=T,F=a(T,["value","onChange"]),{fieldState:{error:S}}=L,A=v((e=>{R(fe(e)&&O?me(e,O):"")}),[R,O]),N=h((()=>{if(k instanceof Date)return"Invalid Date"==`${k}`?null:k;if("string"==typeof k&&k.length&&O){const e=he(k,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[k,O]);return f((()=>{if(u){const e=u.replace(/[Zzx]+/g,"XX");try{ge(me(new Date,e),e),w(e)}catch(e){console.error(e)}}}),[u]),t(i,{children:[o(Z,{required:l,children:s}),o(Ve,Object.assign({},F,O?{format:O}:{},{value:N,onChange:A,disableFuture:"lte"===C||"current"===C,disablePast:"gte"===C||"current"===C,maxDate:"lt"===C?ve():null,minDate:"gt"===C?be():null,slotProps:Object.assign(Object.assign({},x),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!S,placeholder:d,name:n,helperText:!p&&(null==S?void 0:S.message),slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:al}},E))]})},dl=()=>o("img",{src:il,alt:""}),cl=e=>{var{control:r,name:n,required:l,label:s,placeholder:d,defaultValue:c,format:u=Wr,hideErrorMessage:p=!1,requiredErrorText:m="",validate:g,dateCondition:C,validateErrorText:y,slotProps:x}=e,E=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","requiredErrorText","validate","dateCondition","validateErrorText","slotProps"]);const[O,w]=b(),L=V({control:r,name:n,defaultValue:c,rules:{required:!!l&&(m||$r),validate:g||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!ge(e,O))return null!=y?y:Hr;if(C&&e){const r=he(e,O,new Date),n=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,n)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,n)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,n))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,n))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),T=L.field,{value:k,onChange:R}=T,F=a(T,["value","onChange"]),{fieldState:{error:S}}=L,A=v((e=>{R(fe(e)&&O?me(e,O):"")}),[R,O]),N=h((()=>{if(k instanceof Date)return"Invalid Date"==`${k}`?null:k;if("string"==typeof k&&k.length&&O){const e=he(k,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[k,O]);return f((()=>{if(u){const e=u.replace(/[Zzx]+/g,"XX");try{ge(me(new Date,e),e),w(e)}catch(e){console.error(e)}}}),[u]),o(Le,Object.assign({},F,{ampm:!1,label:l?t(i,{children:[s," ",o("span",{children:"*"})]}):s,value:N},O?{format:O}:{},{onChange:A,disableFuture:"lte"===C||"current"===C,disablePast:"gte"===C||"current"===C,maxDate:"lt"===C?ve():null,minDate:"gt"===C?be():null,reduceAnimations:!0,slotProps:Object.assign(Object.assign({},x),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!S,placeholder:d,name:n,helperText:!p&&(null==S?void 0:S.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:dl}},E))},ul=e=>{var{control:r,name:n,required:l,label:s,format:d=Jr,hideErrorMessage:c=!1,requiredErrorText:u="",placeholder:p,defaultValue:m,slotProps:h}=e,g=a(e,["control","name","required","label","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue","slotProps"]);const v=V({control:r,name:n,defaultValue:m,rules:{required:!!l&&(u||$r),validate:e=>"Invalid Date"==`${e}`?"Invalid Date":!!ge(e,d)||"Incorrect date format"}}),C=v.field,{onChange:y,ref:x,value:E}=C,O=a(C,["onChange","ref","value"]),{fieldState:{error:w}}=v,[L,T]=b(null);return f((()=>{if(E&&d)try{let e=he(E,d,new Date);fe(e)||(e=he(E,"HH:mm:ss.SSS",new Date)),T(e)}catch(e){T(E)}}),[E,d]),o(Te,Object.assign({},O,{inputRef:x,label:l?t(i,{children:[s," ",o("span",{children:"*"})]}):s,ampm:!1,value:L,format:d,onChange:e=>{T(e),y(fe(e)?me(e,d):void 0)},viewRenderers:{hours:ke,minutes:ke},slotProps:Object.assign(Object.assign({},h),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!w,placeholder:p,name:n,helperText:!c&&(null==w?void 0:w.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==h?void 0:h.textField)})},g))},pl=e=>{var r,n,l,{name:s,control:c,label:u,required:p,defaultValue:m=null,onChange:f,textFieldLabel:g}=e,C=a(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[y,x]=b(""),[E,O]=b(null),w=V({control:c,name:s,defaultValue:m,rules:{required:p&&$r}}),L=w.field,{onChange:T,value:k}=L,R=a(L,["onChange","value"]),{formState:{errors:F}}=w,N=h((()=>f||T),[f,T]),M=v((e=>{const{value:r}=e.target;x(r)}),[]),D=v((()=>{O(null),!y||Array.isArray(k)&&k.includes(y)?Array.isArray(k)&&k.includes(y)&&O("This value already exists"):(N([...null!=k?k:[],y]),x(""))}),[y,N,k]),I=v((e=>{N(k.filter((r=>r!==e)))}),[k,N]),P=v((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),D())}),[D]);return t(i,{children:[o(Z,{required:p,children:u}),o(z,{display:"flex",flexWrap:"wrap",children:null==k?void 0:k.map(((e,r)=>o(Re,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>I(e)},r)))}),o("input",Object.assign({type:"hidden"},null==c?void 0:c.register(s),{onChange:N,value:k},R)),o(d,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:g||""===g?g:`Add ${null!=u?u:""}`,value:y,onChange:M,error:!!(null===(r=F[s])||void 0===r?void 0:r.message),helperText:null===(n=F[s])||void 0===n?void 0:n.message,slotProps:{htmlInput:null===(l=C.slotProps)||void 0===l?void 0:l.htmlInput,formHelperText:{variant:"standard"},input:{endAdornment:o(A,{size:"small",onClick:D,children:o(S,{children:o("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}},name:s,onKeyDown:P},C)),E&&o(J,{error:!0,children:E})]})},ml=({name:e="period",control:r,label:n="Period",required:l,isSecondsVisible:a=!1})=>{var s;const[c,u]=b(),p=L({control:r,name:e}),{field:{onChange:m},formState:{errors:g}}=V({name:e,control:r,rules:{required:!!l&&"Please, fill one of the fields"}}),C=v((e=>{const{name:r,value:n}=e.target,l=Object.assign({},null!=c?c:{});n?(l[r]=+n,m(Se(l))):(delete l[r],m(Object.keys(l).length?Se(l):"")),u(l)}),[m,e,c]),y=null===(s=g[e])||void 0===s?void 0:s.message,x=h((()=>({variant:"outlined",size:"small",error:!!y,type:"number",onChange:C,fullWidth:!0,slotProps:{formHelperText:{variant:"standard"}}})),[y,C]);return f((()=>{p&&!c&&u(Ae(p))}),[c,p]),t(i,{children:[o(j,{variant:"subtitle1",children:l?t(i,{children:[n," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):n}),y&&o(J,{error:!0,children:y}),t(Fe,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.years)||"",name:"years",label:"Years"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.months)||"",name:"months",label:"Months"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.days)||"",name:"days",label:"Days"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes"}))}),a&&o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds"}))})]})]})};const hl=e=>{var{onChange:r,onBlur:n,mask:l,ref:t}=e,i=a(e,["onChange","onBlur","mask","ref"]);return o(Ne,Object.assign({inputRef:t,mask:l,lazy:!1,overwrite:!0,unmask:!1,onAccept:e=>r({target:{value:e}}),placeholderChar:" ",onBlur:n},i))},fl=e=>{var{control:r,name:n,label:l,required:s,mask:c="+{7} (700) 000 00 00",requiredErrorText:u="",inputMaskProps:p,disabled:m,validate:h,invalidErrorText:f}=e,g=a(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","validate","invalidErrorText"]);return o(T,{control:r,name:n,rules:{required:!!s&&(u||$r),validate:e=>!s&&!e||(/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)?!h||("function"!=typeof h||h(e)):f||"Incorrect phone number format")},render:({field:e,fieldState:{error:r}})=>o(d,Object.assign({},e,{name:n,fullWidth:!0,size:"small",label:s&&l?t(i,{children:[l," ",o("span",{children:"*"})]}):l,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",slotProps:{formHelperText:{variant:"standard"},input:{inputComponent:hl,startAdornment:o(N,{position:"start",children:o("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})}),inputProps:Object.assign({mask:c,disabled:m},p)}}},g,{error:!!r,helperText:null==r?void 0:r.message}))})};var gl="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const bl=()=>o("img",{src:gl,alt:""}),vl=()=>{const e=Ie(),r=Pe(e,qe),n=Pe(e,Be),l=Pe(e,ze),i=Pe(e,je),a=r=>e.current.setPage(r);return t(z,{px:2,display:"flex",alignItems:"center",children:[o(De,{component:"div",page:r,count:l,rowsPerPage:i,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>a(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:n})=>`${e}–${r} из ${-1!==n?n:`более ${r}`}`,ActionsComponent:void 0,slotProps:{select:{IconComponent:bl}}}),o(Me,{count:n,page:r+1,onChange:(e,r)=>a(r-1)})]})};var Cl="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",yl="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",xl="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const El=()=>o("img",{src:Cl,alt:"sort"}),Ol=()=>o("img",{src:yl,alt:"asc"}),wl=()=>o("img",{src:xl,alt:"desc"}),Vl=Oe($e)((({theme:e})=>({"& .MuiDataGrid-row":{cursor:"pointer"},"& .MuiDataGrid-cell:focus-within, & .MuiDataGrid-cell:focus":{outline:"none !important"},"& .MuiDataGrid-columnHeader:focus-within, & .MuiDataGrid-columnHeader:focus":{outline:"none !important"},"& .MuiDataGrid-columnHeader--sortable":{"& .MuiDataGrid-iconButtonContainer":{visibility:"visible !important",width:"auto !important"},"& .MuiDataGrid-sortIcon":{visibility:"visible !important",opacity:1}}}))),Ll=e=>{var{columns:r,rows:n,rowCount:l,loading:t,disableMargin:i,mode:s="server",initialPageSize:d=10,pagination:c=!0,onCellClick:u}=e,p=a(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const[m,C]=b({pageSize:d,page:0}),{serverPaginationModel:y,onPaginationChange:x}=(({mode:e,pagination:r})=>{const[n,l]=ie(),t=+n.get("page")||0,o=+n.get("size")||10,i=v((({page:e,pageSize:r})=>{n.set("page",e),n.set("size",r),l(n,{replace:!0})}),[l,n]);return f((()=>{"server"===e&&r&&(n.has("page")||n.set("page","0"),n.has("size")||n.set("size","10"),l(n,{replace:!0}))}),[e,r,n,l]),h((()=>({serverPaginationModel:{pageSize:o,page:t},onPaginationChange:i})),[t,o,i])})({mode:s,pagination:c}),{onColumnHeaderClick:E,onSortModelChange:O,sortModel:w}=(()=>{const[e,r]=ie(),n=g(""),l=e.getAll("sort").map((e=>e.split(","))),t=h((()=>l.length?l.map((e=>({field:e[0],sort:e[1]}))):[]),[l]),o=v((n=>{e.delete("sort"),n.length&&n.forEach((r=>e.set("sort",`${r.field},${r.sort}`))),r(e,{replace:!0})}),[e,r]),i=v((e=>e.map((e=>{const r=l.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))),[l]),a=v((({field:e})=>{n.current=e}),[]);return h((()=>({onSortModelChange:o,getSortedColumns:i,sortModel:t,onColumnHeaderClick:a})),[o,i,t,a])})();return o(z,{mt:i?0:2,display:"flex",flexDirection:"column",children:o(Vl,Object.assign({hideFooterPagination:!c,hideFooter:!c,loading:t,rows:n,sortingMode:s,paginationMode:s,paginationModel:"server"===s?y:m,rowCount:l||-1,disableColumnMenu:!0,columns:r,initialState:{sorting:{sortModel:w}},onSortModelChange:"server"===s?O:null,disableRowSelectionOnClick:!0,onPaginationModelChange:"server"===s?x:C,pageSizeOptions:[10,20,50,100],onCellClick:u,onColumnHeaderClick:E,slots:{baseTooltip:ne,pagination:vl,columnUnsortedIcon:El,columnSortedAscendingIcon:Ol,columnSortedDescendingIcon:wl},sx:{"--DataGrid-overlayHeight":"300px"}},p))})},Tl=({icon:e,label:r,showInMenu:n,onClick:l,location:t})=>{var i;return t?o(A,{component:oe,to:t.pathname,state:null!==(i=t.state)&&void 0!==i?i:null,size:"small",children:o(ne,{title:r,arrow:!0,children:p.cloneElement(e,{fontSize:"small"})})}):o(He,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:o(ne,{title:r,arrow:!0,children:e}),onClick:l,label:r,showInMenu:n})},kl=Oe(Xe)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),Rl=()=>o("img",{src:gl,alt:""}),Fl=()=>o("img",{src:Cl,alt:""}),Sl=()=>o("img",{src:yl,alt:""}),Al=()=>o("img",{src:xl,alt:""});function Nl({columns:e=[],rows:r=[],rowCount:n,children:l,pagination:i=!0,loading:a=!1,onRowClick:s,emptyDataText:d,verticalAlign:c="middle",labelRowsPerPage:u},p){const{page:m,size:g,onPageChange:b,onSizeChange:C}=(e=>{const[r,n]=ie(),l=h((()=>{var e;return null!==(e=r.get("page"))&&void 0!==e?e:0}),[r]),t=h((()=>{var e;return null!==(e=r.get("size"))&&void 0!==e?e:10}),[r]),o=v((e=>{n((r=>(r.set("page",`${e}`),r)))}),[n]),i=v((e=>{n((r=>(r.set("size",`${e}`),r)))}),[n]);return f((()=>{e&&(r.has("page")||n((e=>(e.set("page","0"),e))),r.has("size")||n((e=>(e.set("size","10"),e))))}),[r,n,e]),{page:l,size:t,onPageChange:o,onSizeChange:i}})(i),{onSortChanged:y,getColumnSorting:x}=(()=>{const[e,r]=ie(),n=h((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),l=v((e=>{r((r=>{r.delete("sort");let l=!1;return n.forEach((([n,t])=>{n===e?(l=!0,"asc"===t&&r.append("sort",`${n},desc`)):r.append("sort",`${n},${t}`)})),l||r.append("sort",`${e},asc`),r}))}),[n,r]),t=v((e=>{const r=n.find((([r,n])=>r===e));return!!r&&r[1]}),[n]);return{sortParams:n,onSortChanged:l,getColumnSorting:t}})();return o(z,{sx:{overflow:"auto"},children:t(Ge,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[o(Ue,{open:a,sx:{position:"absolute",top:0,left:0},children:o(qr,{})}),t(_e,{ref:p,children:[o(Ye,{children:o(Ze,{children:e.map(((e,r)=>{const n=!!e.sortKey&&x(e.sortKey);return o(We,{align:e.align?e.align:"left",sortDirection:n,sx:{width:e.width?`${e.width}%`:"unset"},children:o(kl,{active:!!n,hideSortIcon:!e.sortKey,direction:n||"asc",IconComponent:"asc"===n?Sl:"desc"===n?Al:Fl,onClick:()=>e.sortKey?y(e.sortKey):{},children:e.label})},r)}))})}),o(Je,{children:r.length?r.map(((r,n)=>o(Ze,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,l)=>o(We,{align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"},children:o(z,{sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)},children:o(z,{children:e.renderCell?e.renderCell(r,n):r[e.id]})})},l)))},n))):o(Ze,{sx:{verticalAlign:c},children:o(We,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),i||l?o(Ke,{children:t(Ze,{children:[l&&o(We,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:l}),i&&r.length?o(De,{rowsPerPageOptions:[5,10,25],count:n,rowsPerPage:+g,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:n})=>`${e}–${r} из ${-1!==n?n:`более ${r}`}`:void 0,slotProps:{select:{IconComponent:Rl}},onPageChange:(e,r)=>b(r),onRowsPerPageChange:e=>C(+e.target.value)}):null]})}):null]})]})})}const Ml=y(Nl),Dl=({actionsList:e})=>{const[r,n]=b(null),l=Boolean(r),i=()=>{n(null)};return t("div",{children:[o(A,{"aria-label":"more",id:"more-button","aria-controls":l?"more-menu":void 0,"aria-expanded":l?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),n(e.currentTarget)},children:o(er,{})}),o(Qe,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:l,onClose:e=>{e.stopPropagation(),i()},slotProps:{paper:{sx:{minWidth:"127px"}}},children:e.map((e=>o(c,{onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),i()},children:e.title},e.title)))})]})},Il=e=>{const{children:r,value:n,index:l}=e,t=a(e,["children","value","index"]);return o("div",Object.assign({role:"tabpanel",hidden:n!==l,id:`simple-tabpanel-${l}`,"aria-labelledby":`simple-tab-${l}`},t,{children:n===l?r:null}))},Pl=e=>{var r;const{tabs:n}=e,l=le(),i=te(),a=h((()=>new URLSearchParams(i.search)),[i.search]),s=a.get("tab");return t(z,{children:[o(rr,{children:o(lr,{value:s||(null===(r=n[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),l({pathname:i.pathname,search:a.toString()},{replace:!0})},children:n.map((e=>o(nr,{value:e.name,label:e.label},e.name)))})}),o(z,{mt:2,children:n.map((e=>{var r;return o(Il,{value:s||(null===(r=n[0])||void 0===r?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},ql=({title:e,text:r,json:n})=>t(z,{sx:{paddingBottom:8},children:[o(z,{sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"},children:e}),r&&o(z,{sx:{fontSize:"18px",wordWrap:"break-word"},children:r}),n&&o(En,{value:n,height:300})]}),Bl=({control:e,name:r,label:n,required:l,restrictedValues:i,requiredErrorText:a="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:p}}=V({control:e,name:r,rules:{required:!!l&&(Array.isArray(i)&&i.length?s||"Please, select a value":a||$r)}}),m=L({control:e,name:r});return Array.isArray(i)&&i.length?t(H,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[o(Cr,{htmlFor:"type-select",children:n}),o(vr,{labelId:"type-select",label:n,value:m||"",onChange:d,ref:u,children:i.map((e=>o(c,{value:e,children:e},e)))})]}):o(Gr,{hideErrorMessage:!0,required:l,control:e,name:r,label:n})},zl=({name:e})=>{const{control:r,setValue:n,register:l}=k(),a=L({control:r,name:e}),d=v((r=>s(void 0,void 0,void 0,(function*(){const l=r.target.files[0];(new FileReader).readAsDataURL(l);const t=yield(e=>new Promise(((r,n)=>{const l=new FileReader;l.readAsDataURL(e),l.onload=()=>{r(l.result)},l.onerror=e=>{n(e)}})))(l);n(e,t)}))),[e,n]);return t(i,{children:[t(z,{mb:2,display:"flex",flex:"row",children:[o(j,{children:"Does file uploaded:"}),o(S,a?{sx:{paddingLeft:2},children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{sx:{paddingLeft:2},children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})})]}),t(M,{component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4},children:[a?"Change file":"Upload file",o("input",Object.assign({type:"hidden"},l(`${e}`,{required:!0}))),o("input",{type:"file",hidden:!0,onChange:d})]})]})},jl=()=>o(z,{component:"span",sx:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),$l=({data:e})=>t(or,{nonLinear:!0,orientation:"vertical",connector:o(dr,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>t(ir,{expanded:!0,children:[o(ar,{sx:{display:"flex",alignItems:"flex-start"},slots:{stepIcon:jl},slotProps:{stepIcon:{icon:"",completed:!1,active:!0}},children:e.label}),o(sr,{sx:{marginLeft:4},children:Array.isArray(e.content)?o($l,{data:e.content}):e.content})]},r))),o(ir,{})]}),Hl=({value:e,node:r,label:n,isDirty:l,required:t=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const a=h((()=>n?`${n} (value)`:`${r.name} (value)`),[n,r]),s=h((()=>n?`${n} (widget)`:`${r.name} (widget)`),[n,r]),d=h((()=>el(r)),[r]),[c,u]=b(null),p=h((()=>i?Qn({nodeType:d,required:t,useExpression:o}):rl({nodeType:d,required:t,useExpression:o})),[o,t,d,i]),m=h((()=>{switch(d){case Ir.STRING:case Ir.DATE:case Ir.TIME:case Ir.DATE_TIME:case Ir.ENTITY_REFERENCE:case Ir.ANY:case Ir.FILE:case Ir.FILE_REFERENCE:return"";case Ir.OBJECT:return{};case Ir.ARRAY:return[];case Ir.BOOLEAN:return!1;case Ir.INTEGER:case Ir.BIG_DECIMAL:case Ir.BIG_INTEGER:case Ir.DOUBLE:case Ir.LONG:case Ir.FLOAT:case Ir.SHORT:return 0;default:return null}}),[d]),g=h((()=>d===Ir.ANY||d===Ir.ARRAY),[d]),C=v((()=>{_n(e,g)?u("expression"):d===Ir.ARRAY||null==e||_n(e,g)||"widget"===c||"string"===c||"json_valid"===c||u("widget")}),[e,c,g,d]);return f((()=>{c?l||C():!Wn(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&_n(e,g)?u("expression"):u("widget"):u("null")}),[e,c,p,o,l,C,g,t,r]),{nodeType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:p,setFillOption:u,defaultProperyValue:m,checkFillOption:C}},_l=Oe(Cr)((()=>({inputLabel:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"}}))),Jl=({control:e,node:r,name:n,useExpression:l,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{field:{value:m,onChange:h},fieldState:{error:b,isDirty:C}}=V({name:n,control:e,rules:{validate:e=>!a||null!==e||(p||$r)}}),y=g({}),{nodeType:x,valueLabel:E,fillOptionLabel:O,fillOption:w,fillOptions:L,setFillOption:T,defaultProperyValue:k}=Hl({value:m,node:r,isDirty:C,label:i,required:a,useExpression:l}),R=v((e=>{const l=e.target.value;y.current=Object.assign(Object.assign({},y.current),{[w]:m}),T(l);const t=y.current[l];if("null"===l)h(null);else if("widget"===l)if(x===Ir.OBJECT&&m&&"string"!=typeof m&&"dem_builder"===w&&"node"in m){const e=Zn(m);try{h(null!=t?t:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else h(null!=t?t:r.defaultValue||k);else if("expression"===l||"string"===l)h(n,null!=t?t:"");else if("dem_builder"===l){const e={code:"",name:"",version:0,node:null};if(m)try{const e=JSON.parse(m);e.properties=Kn(e.properties||{}),h(null!=t?t:e)}catch(r){h(null!=t?t:e)}else h(null!=t?t:e,{shouldDirty:!0})}}),[n,m,T,w,x,h,k,r]);return f((()=>{C||Or(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!Or(m)||h(n,r.defaultValue||r.value)}),[C,r,h,m,n]),f((()=>{var e;(void 0===m||r.isRequired&&null===m&&!r.defaultValue&&!r.value)&&h(null!==(e=y.current[w])&&void 0!==e?e:k),void 0!==m||r.isRequired||null!==r.defaultValue&&null!==r.value||h(null)}),[m,h,n,k,r,w]),t(Fe,{size:12,children:[s&&o(z,{mb:2,children:o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),L?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:O}),o(vr,{labelId:"type-select",label:O,value:w||"",onChange:R,children:L.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(x===Ir.OBJECT||x===Ir.ANY?o(nl,{name:n,control:e,label:E,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:x===Ir.ANY?"text":"json"}):o(Gr,{control:e,name:n,label:E,hideErrorMessage:!0})),"string"===w&&o(Gr,{control:e,name:n,label:E,hideErrorMessage:!0}),"widget"===w&&o(et,{control:e,node:r,name:n,useExpression:l,label:E,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),b&&o(J,{error:!0,children:b.message})]})},Wl=({control:e,name:r,node:n,useExpression:l,required:i,label:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{fields:c,append:u,remove:p}=R({control:e,name:r});return t(Fe,{container:!0,spacing:2,direction:"column",size:12,children:[Array.isArray(c)&&c.length?c.map(((c,u)=>o(Fe,{size:12,children:t(z,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[o(Jl,{control:e,required:i,node:n,useExpression:l,name:`${r}.${u}`,label:`${a||n.name} (${u+1})`,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(z,{mt:"8px",ml:"4px",children:o(A,{id:"close-button",size:"small",onClick:()=>p(u),children:o(S,{fontSize:"small",children:o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u))):null,o(Fe,{children:o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>u(null),children:"Add value"})})]})},Gl={nodeType:Ir.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},Yl=({node:e,name:r,useExpression:n,required:l,label:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{var m,h,v,C;const[y,x]=b(!1),{control:E,clearErrors:O,setValue:w,watch:L}=k(),{field:{ref:T,onChange:R},fieldState:{error:F,isDirty:S}}=V({control:E,name:r,defaultValue:null!==(m=e.defaultValue)&&void 0!==m?m:[],rules:{validate:e=>!(l&&!e)||(p||$r)}}),A=L(r),N=g({}),{valueLabel:M,fillOptionLabel:D,fillOption:I,fillOptions:P,setFillOption:q,checkFillOption:B}=Hl({node:e,value:A,isDirty:S,label:a,required:l,useExpression:n,multipleOptions:!0});return f((()=>{!A&&e.isRequired&&R([]),cr(A)&&!e.isRequired&&R(null)}),[A,e,R]),f((()=>{A&&!y&&(x(!0),B())}),[B,y,A]),t(i,{children:[s&&o(z,{mb:2,children:o(j,{variant:"h6",children:s})}),P?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:D}),o(vr,{labelId:"type-select",label:D,value:I||"",onChange:e=>{x(!0),N.current=Object.assign(Object.assign({},N.current),{[I]:A});const n=e.target.value,l=N.current[n];"null"===n?w(r,null):w(r,null!=l?l:[],{shouldDirty:!0}),q(n),O(r)},children:P.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===I||"json_valid"===I)&&o(nl,{name:r,control:E,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===I&&o(Wl,{control:E,node:null!==(h=e.memberNodes)&&void 0!==h?h:Gl,name:r,useExpression:n,required:l,label:null!==(C=null===(v=e.memberNodes)||void 0===v?void 0:v.name)&&void 0!==C?C:e.name,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),F&&o(J,{error:!0,children:F.message})]})},Zl=({node:e,dataFieldName:r,locales:n,useExpression:l=!1,title:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=v(((e,r)=>el(e)===Ir.ARRAY?o(Yl,{node:e,name:r,useExpression:l,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s}):o(rt,{node:e,name:r,locales:n,useExpression:l,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s})),[l,s,a]),c=v(((e,r)=>{if(e){const n=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:`${e.key?e.key+" | ":""}${n}`})]}),content:d(e,r)}}return null}),[d]);return o(br,{dateAdapter:gr,children:t(Fe,{container:!0,direction:"column",spacing:2,children:[i&&o(Fe,{size:12,children:o("div",{style:{fontWeight:"600"},children:i})}),o($l,{data:[c(Kn(e),r)]})]})})},Kl=o(xr,{fontSize:"small"}),Ul=o(Er,{fontSize:"small",color:"secondary"}),Xl=({localesCollection:e,onChange:r,onLocaleRemove:n,receivedObject:l})=>{const[i,s]=b(null==e?void 0:e.filter((e=>e.isRequired)));f((()=>{const n=null==e?void 0:e.filter((e=>e.isRequired)),t=null==e?void 0:e.filter((e=>null==l?void 0:l.hasOwnProperty(e.code))),o=[...new Set([...n,...t])];s(o),null==r||r(o)}),[e]);const c=v(((r,n,{selected:l})=>t(yr,Object.assign({},r,{onClick:e=>{n.isRequired||r.onClick(e)},sx:{fontSize:14,paddingLeft:1,'&.MuiAutocomplete-option[aria-selected="true"]':{background:"rgba(38, 40, 66, 0.08)","&.Mui-focused":{background:"rgba(38, 40, 66, 0.08)"}}},children:[o(W,{icon:Kl,checkedIcon:Ul,sx:{marginRight:1,padding:1},checked:l||n.isRequired||"all"===n.code&&(null==i?void 0:i.length)===(null==e?void 0:e.length),disabled:n.isRequired}),o(z,{component:"span",textTransform:"capitalize",children:n.name}),n.isRequired&&t(z,{color:"#D6331F",component:"span",children:[" ","*"]})]}))),[i,null==e?void 0:e.length]),u=v((e=>e.isRequired),[]),p=v(((e,r)=>e.map(((e,n)=>{const l=r({index:n}),{onDelete:i}=l,d=a(l,["onDelete"]);return t(z,Object.assign({},d,{bgcolor:"secondary.main",color:"#fff",borderRadius:"6px",py:1,px:1.5,textTransform:"capitalize",display:"flex",alignItems:"center",lineHeight:"16px",children:[o(z,{mr:1,children:e.name}),!e.isRequired&&"all"!==e.code&&o(Ql,{sx:{width:16,height:16,cursor:"pointer"},onClick:()=>{s((r=>null==r?void 0:r.filter((r=>r.code!==e.code)))),i()}})]}))}))),[]);return o(K,{multiple:!0,disableCloseOnSelect:!0,options:[{code:"all",name:"Все",isRequired:!1},...e],value:i,getOptionLabel:e=>e.name,isOptionEqualToValue:(e,r)=>e.code===r.code,onChange:(l,t)=>{const o=null==t?void 0:t.some((e=>"all"===e.code)),a=(null==i?void 0:i.length)===(null==e?void 0:e.length);if(o)if(a){const n=null==e?void 0:e.filter((e=>e.isRequired));s(n),null==r||r(n)}else{const n=null==e?void 0:e.filter((e=>"all"!==e.code));s(n),null==r||r(n)}else{const e=i.filter((e=>!t.some((r=>r.code===e.code))));s(t),null==r||r(t),e.length>0&&(null==n||n(e))}},renderOption:c,getOptionDisabled:u,renderTags:p,renderInput:e=>o(d,Object.assign({},e,{label:"Languages",placeholder:"Select"}))})},Ql=e=>o(S,Object.assign({},e,{viewBox:"0 0 16 16",children:o("path",{d:"M2.93133 3.0358L2.97999 2.9798C3.06465 2.89512 3.17689 2.84364 3.29629 2.8347C3.4157 2.82577 3.53435 2.85999 3.63066 2.93113L3.68666 2.9798L7.99999 7.29247L12.3133 2.97913C12.3595 2.9314 12.4147 2.89333 12.4757 2.86716C12.5367 2.84098 12.6023 2.82722 12.6687 2.82668C12.7351 2.82613 12.8009 2.83881 12.8624 2.86398C12.9238 2.88915 12.9796 2.92631 13.0265 2.97327C13.0734 3.02024 13.1105 3.07608 13.1357 3.13754C13.1608 3.199 13.1734 3.26485 13.1728 3.33124C13.1722 3.39763 13.1584 3.46323 13.1321 3.52422C13.1059 3.58521 13.0678 3.64036 13.02 3.68647L8.70733 7.9998L13.0207 12.3131C13.1052 12.3979 13.1566 12.5102 13.1654 12.6296C13.1742 12.749 13.1399 12.8676 13.0687 12.9638L13.02 13.0198C12.9353 13.1045 12.8231 13.156 12.7037 13.1649C12.5843 13.1738 12.4656 13.1396 12.3693 13.0685L12.3133 13.0198L7.99999 8.70713L3.68666 13.0205C3.59232 13.1115 3.46599 13.1618 3.33489 13.1606C3.20379 13.1594 3.07841 13.1068 2.98575 13.014C2.89309 12.9213 2.84057 12.7959 2.83949 12.6648C2.83841 12.5337 2.88887 12.4074 2.97999 12.3131L7.29266 7.9998L2.97933 3.68647Z",fill:"white"})})),et=({node:e,name:r,locales:n,label:l,useExpression:i,control:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{var c,u;const{setValue:p,getValues:m}=k();switch("string"==typeof e.nodeType?e.nodeType:null===(c=e.nodeType)||void 0===c?void 0:c.value){case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.DOUBLE:return o(tl,{required:!0,decimal:!0,hideErrorMessage:!0,control:a,name:r,label:l,valueAsNumber:!0});case Ir.INTEGER:case Ir.SHORT:case Ir.BIG_INTEGER:case Ir.LONG:return o(tl,{required:!0,hideErrorMessage:!0,control:a,name:r,label:l,valueAsNumber:!0});case Ir.BOOLEAN:return o(ol,{control:a,name:r,defaultValue:!1});case Ir.DATE:return o(sl,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.TIME:return o(ul,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.DATE_TIME:return o(cl,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.STRING:return o(Bl,{control:a,name:r,label:l,restrictedValues:e.restrictedValues});case Ir.ENTITY_REFERENCE:return s?o(s,{name:r,node:e}):o(Bl,{name:r,label:l,control:a});case Ir.FILE:return o(zl,{name:r});case Ir.FILE_REFERENCE:return d?o(d,{name:r}):o(Bl,{name:r,label:l,control:a});case Ir.ANY:return o(nl,{control:a,name:r,hideErrorMessage:!0,label:l,parseValue:!0});case Ir.LOCALIZED_STRING:const c=(e,r)=>Object.assign(Object.assign({},e),{properties:null==r?void 0:r.map((e=>({key:e.code,name:e.name,nodeType:{value:"STRING",label:"String"},isRequired:e.isRequired,isEnabled:!0,defaultValue:"",sortOrder:0})))}),[h,f]=b(c(e,null==n?void 0:n.filter((e=>e.isRequired))).properties),g=r=>{const n=c(e,r);f(n.properties)};return t("div",{style:{borderLeft:"1px solid #bdbdbd",paddingLeft:20},children:[null==h?void 0:h.map((e=>o(Gr,{hideErrorMessage:!0,required:e.isRequired,control:a,name:`${r}.${e.key}`,label:e.name,sx:{mb:3,textTransform:"capitalize"}}))),(null==n?void 0:n.length)?o(Xl,{localesCollection:n,receivedObject:null!==(u=m(r))&&void 0!==u?u:{},onChange:g,onLocaleRemove:e=>{e.forEach((({code:e})=>{p(`${r}.${e}`,void 0,{shouldDirty:!0})}))}}):null]});case Ir.OBJECT:return e.properties?o("div",{children:e.properties.map((e=>o(Zl,{node:e,dataFieldName:`${r}.${e.key}`,useExpression:i,entityReferenceValueComponent:s,fileReferenceValueComponent:d,locales:n})))}):o(nl,{control:a,name:r,hideErrorMessage:!0,label:l,parseValue:!0,mode:"json"});default:return o("div",{children:"No widget"})}},rt=({node:e,name:r,locales:n,useExpression:l,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{control:m,clearErrors:h,setValue:b}=k(),{field:{value:C},fieldState:{error:y,isDirty:x}}=V({name:r,control:m,rules:{validate:e=>!a||null!==e||(p||$r)}}),E=g({}),{nodeType:O,valueLabel:w,fillOptionLabel:L,fillOption:T,fillOptions:R,setFillOption:F,defaultProperyValue:S}=Hl({value:C,node:e,isDirty:x,label:i,required:a,useExpression:l}),A=v((n=>{const l=n.target.value;E.current=Object.assign(Object.assign({},E.current),{[T]:C}),F(l);const t=E.current[l];if("null"===l)b(r,null,{shouldDirty:!0});else if("widget"===l)if((O===Ir.OBJECT||O===Ir.LOCALIZED_STRING)&&C&&"string"!=typeof C&&"dem_builder"===T&&"node"in C){const e=Zn(C);try{b(r,null!=t?t:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else b(r,null!=t?t:e.defaultValue||S);else if("expression"===l||"string"===l)b(r,null!=t?t:"",{shouldDirty:!0});else if("dem_builder"===l){const e={code:"",name:"",version:0,node:null};if(C)try{const e=JSON.parse(C);e.properties=Kn(e.properties||{}),b(r,null!=t?t:e,{shouldDirty:!0})}catch(n){b(r,null!=t?t:e,{shouldDirty:!0})}else b(r,null!=t?t:e,{shouldDirty:!0})}h()}),[r,h,C,F,T,O,b,S,e]);return f((()=>{x||Or(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!Or(C)||b(r,e.defaultValue||e.value)}),[x,e,b,C,r]),f((()=>{var n;(void 0===C||e.isRequired&&null===C&&!e.defaultValue&&!e.value)&&b(r,null!==(n=E.current[T])&&void 0!==n?n:S),void 0!==C||e.isRequired||null!==e.defaultValue&&null!==e.value||b(r,null)}),[C,b,r,S,e,T]),t(Fe,{size:12,children:[s&&o(z,{mb:2,children:o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),R?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:L}),o(vr,{labelId:"type-select",label:L,value:T||"",onChange:A,children:R.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===T&&(O===Ir.OBJECT||O===Ir.ANY?o(nl,{name:r,control:m,label:w,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"expression"===T?"text":"json"}):o(nl,{control:m,name:r,hideErrorMessage:!0,label:i,height:"40px"})),"string"===T&&o(Gr,{control:m,name:r,label:w,hideErrorMessage:!0}),"widget"===T&&o(et,{control:m,locales:n,node:e,name:r,useExpression:l,label:w,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),y&&o(J,{error:!0,children:y.message})]})},nt={nodeType:Ir.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},lt=({control:e,node:r,name:n,useExpression:l,required:a,label:s,title:d,entityReferenceValueComponent:u,fileReferenceValueComponent:p,requiredErrorText:m=""})=>{var h,v,C,y;const[x,E]=b(!1),{field:{value:O,onChange:w},fieldState:{error:L,isDirty:T}}=V({control:e,name:n,defaultValue:null!==(h=r.defaultValue)&&void 0!==h?h:[],rules:{validate:e=>!(a&&!e)||(m||$r)}}),k=g({}),{valueLabel:R,fillOptionLabel:F,fillOption:S,fillOptions:A,setFillOption:N,checkFillOption:M}=Hl({node:r,value:O,isDirty:T,label:s,required:a,useExpression:l,multipleOptions:!0});return f((()=>{!O&&r.isRequired&&w([])}),[O,r,w]),f((()=>{(null==O?void 0:O.length)&&!x&&(E(!0),M())}),[M,x,O]),t(i,{children:[d&&o(z,{mb:2,children:o(j,{variant:"h6",children:d})}),A?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:F}),o(vr,{labelId:"type-select",label:F,value:S||"",onChange:e=>{E(!0),k.current=Object.assign(Object.assign({},k.current),{[S]:O});const r=e.target.value,n=k.current[r];w("null"===r?null:null!=n?n:[]),N(r)},children:A.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===S||"json_valid"===S)&&o(nl,{name:n,control:e,label:R,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===S&&o(Wl,{control:e,node:null!==(v=r.memberNodes)&&void 0!==v?v:nt,name:n,useExpression:l,required:a,label:null!==(y=null===(C=r.memberNodes)||void 0===C?void 0:C.name)&&void 0!==y?y:r.name,entityReferenceValueComponent:u,fileReferenceValueComponent:p}),L&&o(J,{error:!0,children:L.message})]})},tt={name:"Name",key:"Key",nodeType:"Node Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node",memberNodes:"Member Nodes"},ot=({value:e,type:r})=>r!==Ir.OBJECT&&r!==Ir.ANY||!e?o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):o(En,{value:e}),it=(e,r,n)=>{switch(r){case"nodeType":return o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:n});case"isRequired":case"isEnabled":case"isViewableInList":return e?o(S,{color:"primary",fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):null;case"restrictedValues":return e?o(z,{display:"flex",flexWrap:"wrap",children:e.map((e=>o(Re,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return o(ot,{value:e,type:n});case"values":case"defaultValues":return e?Array.isArray(e)&&n!==Ir.OBJECT&&n!==Ir.ANY?t("div",{children:["[",null==e?void 0:e.map(((e,r)=>o("div",{children:o(ot,{value:e,type:n})},r))),"]"]}):o(En,{value:e}):null;case"uiSettings":case"validationNode":return e?o(En,{value:e}):null;case"memberNodes":return e?o(ct,{node:e,defaultExpanded:!1}):null;default:return o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}},at=({node:e})=>{const r=h((()=>(e&&(el(e)===Ir.ARRAY?(delete e.restrictedValues,delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return o(_e,{size:"small",children:o(Je,{children:Object.keys(tt).map((e=>e in r?t(Ze,{children:[o(We,{width:"30%",children:o(j,{children:tt[e]})}),o(We,{children:it(r[e],e,el(r))})]},e):null))})})},st=({properties:e,parentNames:r=[]})=>{const n=h((()=>{if(!e)return!1;let r=!1;return e.every((e=>e.nodeType!==Ir.OBJECT||(r=!0,!1))),r}),[e]);return t(z,{mt:4,children:[o(j,{variant:"h6",children:"Properties"}),t(or,{orientation:"vertical",style:{paddingLeft:"4px"},children:[Array.isArray(e)?e.map((e=>t(ir,{expanded:!0,children:[o(ar,{slotProps:{stepIcon:{icon:"",completed:!1,active:!0}}}),o(sr,{children:o(ct,{node:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))):null,n&&o(ir,{})]})]})};var dt=m(st);const ct=({node:e,parentNames:r=[],defaultExpanded:n=!0})=>{const[l,i]=b(!0);return f((()=>{i(n)}),[n]),e?t(ur,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff",maxHeight:"none",width:"100%"},expanded:l,onChange:()=>i((e=>!e)),children:[o(pr,{expandIcon:o(S,{children:o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:o(j,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),o(mr,{children:t(z,{width:"100%",children:[o(at,{node:e}),el(e)===Ir.OBJECT&&o(dt,{properties:Kn(e).properties,parentNames:[...r,e.name]})]})})]}):null},ut=Object.values(Pr).sort(((e,r)=>e.localeCompare(r))),pt=({nodeFieldName:e,control:r})=>t(i,{children:[o(Fe,{children:o(tl,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),o(Fe,{children:o(Xr,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Pr.HALF_UP,options:ut})})]}),mt=({setValue:e,nodeFieldName:r,control:n,defaultValue:l=""})=>(f((()=>{l&&e(`${r}.format`,l)}),[l,e,r]),o(Fe,{children:o(Gr,{required:!0,control:n,defaultValue:l,name:`${r}.format`,label:"Format"})})),ht={key:"",nodeType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ft=({setValue:e,control:r,parentNodeFieldName:n,entityDefinition:l=!1,globalParameter:a=!1,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const c=L({control:r,name:`${n}.memberNodes`});return t(i,{children:[o(j,{variant:"h6",children:"Member Nodes"}),c?t(z,{p:4,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:3,my:2,children:[o(It,{setValue:e,control:r,nodeFieldName:`${n}.memberNodes`,entityDefinition:l,globalParameter:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(M,{sx:{marginTop:4},variant:"contained",size:"small",color:"primary",onClick:()=>e(`${n}.memberNodes`,null),children:"Delete"})]}):o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>e(`${n}.memberNodes`,ht),sx:{margin:"8px 0"},children:"Add node"})]})},gt=({entityDefinition:e,globalParameter:r,customPropertyFields:n,index:l,watch:i,arrLength:a,entityReferenceValueComponent:s,control:d,setValue:c,fileReferenceValueComponent:u,handleRemoveParameter:p,error:m,item:h,extRefs:f,rootNode:g})=>{const[v,C]=b(l===a&&!h.key);return o(Fe,{size:12,ref:e=>f.current[l]=e,children:t(ur,{expanded:v,onChange:()=>C(!v),elevation:3,children:[o(pr,{expandIcon:o(fr,{}),children:o(j,{color:m&&m[l]?"secondary":"initial",style:{wordBreak:"break-word"},children:h.name||`Property ${l+1}`})}),o(mr,{children:v&&o(It,{isObjectProperty:!0,control:d,setValue:c,nodeFieldName:`properties.${l}`,entityDefinition:e,globalParameter:r,customPropertyFields:n,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),!g&&o(hr,{children:o(M,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(l),children:"Remove"})})]})})},bt={propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},vt=y((({properties:e,hideAddButton:r,focusOnIndex:n,required:l,entityDefinition:a=!1,globalParameter:s=!1,customPropertyFields:d=[],parentRemove:c,entityReferenceValueComponent:u,fileReferenceValueComponent:p,rootNode:m},h)=>{var b;const{clearErrors:C,control:y,setValue:E,getValues:O,reset:w,trigger:L,watch:T}=F({mode:"all",defaultValues:{properties:e}}),{fields:k,append:S,remove:A}=R({control:y,name:"properties"}),{fieldState:{error:N}}=V({control:y,name:"properties",defaultValue:null,rules:{validate:e=>!l||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=g([]),I=v((()=>{S(bt),C("properties")}),[S,C]),P=v((e=>{c&&c(e),A(e)}),[c,A]);return f((()=>{"number"==typeof n&&D.current[n]&&D.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,D]),f((()=>{var r;(null==e?void 0:e.length)&&!(null===(r=O("properties"))||void 0===r?void 0:r.length)&&w({properties:e})}),[e,O,w]),x(h,(()=>({getProperties:()=>O("properties"),addProperty:I,removeProperty:P,trigger:L})),[O,I,P,L]),t(i,{children:[N&&N.message&&o(Fe,{size:12,children:o(j,{color:"secondary",children:N.message})}),Array.isArray(k)&&k.map(((e,r,n)=>o(gt,{item:e,index:r,arrLength:n.length-1,control:y,watch:T,setValue:E,customPropertyFields:d,entityDefinition:a,globalParameter:s,error:N,rootNode:m,handleRemoveParameter:P,fileReferenceValueComponent:p,entityReferenceValueComponent:u,extRefs:D},e.id))),!r&&t(Fe,{size:12,children:[o(M,{variant:"contained",size:"small",color:"primary",onClick:I,children:"Add property"}),N&&o(J,{error:!0,children:null===(b=N.root)||void 0===b?void 0:b.message})]})]})})),Ct=({properties:e=[]})=>{const r=h((()=>Array.isArray(e)?e.map((e=>{const r=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[t("b",{children:[e.name,e.isRequired&&"*"]}),""+(e.key?" | "+e.key:"")]}),o("span",{children:r})]}),content:r===Ir.OBJECT&&Array.isArray(e.properties)?o(Ct,{properties:e.properties}):(null==e?void 0:e.memberNodes)&&o(Ct,{properties:e.memberNodes.properties})}})):[]),[e]);return o($l,{data:r})},yt={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},xt=({control:e,parentNodeFieldName:r,entityDefinition:n=!1,globalParameter:l=!1,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const d=g(null),{field:{onChange:c}}=V({control:e,name:`${r}.properties`,defaultValue:null}),u=L({control:e,name:`${r}.properties`,defaultValue:null}),p=L({control:e,name:`${r}.name`}),m=v((e=>{c((null==u?void 0:u.length)?[...u,e]:[e])}),[u,c]),h=v((e=>{c(u.filter(((r,n)=>e!==n)))}),[u,c]),f=Zr(),[C,y]=b(0),x=v((()=>{if((null==u?void 0:u.length)>0){m(yt);const e=u.length;y(e)}else m(yt);d.current.addProperty(),c(d.current.getProperties())}),[u,c,m]),E=()=>s(void 0,void 0,void 0,(function*(){(yield d.current.trigger())&&(c(d.current.getProperties()),f.onClose())}));return t(Fe,{container:!0,spacing:2,direction:"column",children:[o(Fe,{children:o(j,{variant:"h6",children:"Properties"})}),o(Fe,{children:o(Ct,{properties:u})}),o(Fe,{children:o(M,{variant:"contained",color:"primary",onClick:f.onOpen,children:"Edit properties"})}),t(D,{disableEscapeKeyDown:!0,open:f.open,onClose:E,fullWidth:!0,maxWidth:"md",children:[t(B,{children:[p||"Entity"," Properties"]}),o(P,{style:{height:"500px",overflow:"hidden"},children:t(Fe,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[t(Fe,{size:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[o(or,{nonLinear:!0,activeStep:C,orientation:"vertical",style:{paddingLeft:"4px"},children:Array.isArray(u)&&(null==u?void 0:u.map(((e,r)=>t(ir,{onClick:()=>(e=>y(e))(r),style:{cursor:"pointer"},children:[o(ar,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),o(sr,{})]},r))))}),o(M,{variant:"contained",size:"small",color:"primary",onClick:x,sx:{marginTop:2},children:"Add property"})]}),o(Fe,{size:9,style:{height:"100%",overflowY:"auto"},children:o(Fe,{container:!0,direction:"column",spacing:2,children:o(vt,{ref:d,properties:u,hideAddButton:!0,parentRemove:h,focusOnIndex:C,entityDefinition:n,globalParameter:l,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})})]})}),o(I,{children:o(M,{variant:"contained",color:"primary",onClick:E,children:"Ok"})})]})]})},Et=({propertyFieldName:e,control:r})=>t(i,{children:[o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]}),Ot=({setValue:e,control:r,nodeType:n,nodeFieldName:l,entityDefinition:a=!1,globalParameter:s=!1,fileReferenceValueComponent:d,entityReferenceValueComponent:c})=>{switch(n){case Ir.STRING:return t(i,{children:[o(j,{variant:"h6",mb:1,children:"Restricted Values"}),o(pl,{name:`${l}.restrictedValues`,control:r})]});case Ir.BIG_DECIMAL:return o(pt,{nodeFieldName:l,control:r});case Ir.DATE:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:_r});case Ir.TIME:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:Jr});case Ir.DATE_TIME:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:Wr});case Ir.ENTITY_REFERENCE:return o(Et,{control:r,propertyFieldName:l});case Ir.OBJECT:return o(xt,{control:r,parentNodeFieldName:l,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});case Ir.ARRAY:return o(ft,{setValue:e,control:r,parentNodeFieldName:l,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});default:return null}},wt=({control:e,nodeFieldName:r,name:n,label:l="",required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const s=L({control:e,name:`${r}.nodeType`}),d=L({control:e,name:`${r}.format`}),c=L({control:e,name:`${r}.restrictedValues`}),u=L({control:e,name:`${r}.properties`}),p=L({control:e,name:`${r}.isRequired`}),m=h((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:l,isRequired:null!=t?t:p},!!d&&{format:d}),{restrictedValues:c}),!!u&&{properties:u}),{nodeType:"string"==typeof s?s:s.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[s,d,c,l,p,u,t]);return o(br,{dateAdapter:gr,children:"ARRAY"===m.nodeType?o(lt,{control:e,name:n,node:m,title:l,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a}):o(Jl,{control:e,name:n,node:m,title:l,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})},Vt=({name:e,control:r,setValue:n})=>{const l=h((()=>({type:""})),[]),{fields:i,append:a,remove:s}=R({control:r,name:e});return t(z,{mt:2,children:[o(M,{variant:"outlined",size:"small",onClick:()=>a(l),children:"Add node"}),i.map((({id:l},t)=>o(Nt,{setValue:n,control:r,removeHandle:()=>s(t),name:`${e}.${t}`},l)))]})},Lt=E(""),Tt=({name:e,control:r})=>t(i,{children:[o(j,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Gr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),kt=({name:e,control:r})=>t(i,{children:[o(j,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Gr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),t(z,{mt:2,children:[o(Qr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),o(Qr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),Rt=["STRING_REGEX","JSON_SCHEMA"],Ft=new Set([Ir.INTEGER,Ir.FLOAT,Ir.DOUBLE,Ir.BIG_DECIMAL,Ir.BIG_INTEGER,Ir.LONG]),St=({name:e,control:r,setValue:n})=>{const l=O(Lt),a=L({control:r,name:`${e}.type`}),s=h((()=>{if("STRING_REGEX"===a)return o(Gr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case l===Ir.STRING:return o(Tt,{name:`${e}.node`,control:r});case Ft.has(l):return o(kt,{name:`${e}.node`,control:r});case l===Ir.OBJECT:case l===Ir.ARRAY:return o(nl,{label:"Properties",control:r,name:`${e}.node.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+l}return null}),[l,a,r,e]);return f((()=>{Ft.has(l)&&"JSON_SCHEMA"===a&&(n(`${e}.node.exclusiveMinimum`,!1),n(`${e}.node.exclusiveMaximum`,!1))}),[l,a,n,e]),o($l,{data:[{label:"Validator",content:t(i,{children:[o(z,{children:o(Xr,{control:r,name:`${e}.type`,label:"Type",options:Rt,onChange:r=>{n(e,{type:r.target.value})}})}),o(z,{mt:2,children:s})]})}]})},At=["AND","OR","NOT","NODE"],Nt=({name:e,removeHandle:r,control:n,setValue:l})=>{const a=O(Lt),s=g(a),d=L({control:n,name:`${e}.type`}),c=h((()=>({AND:o(Vt,{name:`${e}.nodes`,control:n,setValue:l}),OR:o(Vt,{name:`${e}.nodes`,control:n,setValue:l}),NODE:o(St,{name:`${e}.validator`,control:n,setValue:l}),NOT:o(Nt,{name:`${e}.node`,control:n,setValue:l})})),[e,n,l]),u=v((r=>{l(e,{type:r.target.value})}),[]);return f((()=>{d&&s.current!==a&&(s.current=a,l(e,{type:""}))}),[l,a,s.current,d,e]),o($l,{data:[{label:"Node Type",content:t(i,{children:[t(z,{display:"flex",alignItems:"flex-start",children:[o(Xr,{required:!0,onChange:u,control:n,name:`${e}.type`,label:"Type",options:At}),r&&o(z,{ml:2,mt:6,children:o(A,{onClick:r,children:o(tr,{})})})]}),o(z,{children:c[d]})]})}]})},Mt=({name:e,control:r,setValue:n,enable:l})=>{const[a,s]=b(!1),d=v((r=>{s(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return f((()=>{l&&!a&&s(!0)}),[l,a]),t(i,{children:[t(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o(j,{component:"h6",color:"initial",style:{wordBreak:"break-word",fontSize:18},children:"Validator"}),o(_,{label:"Enable",control:o(W,{color:"primary",checked:l,onChange:d})})]}),a&&o(Nt,{name:e,control:r,setValue:n})]})},Dt=Object.values(Ir).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),It=m((({setValue:e,control:r,nodeFieldName:n,entityDefinition:l=!1,globalParameter:a=!1,customPropertyFields:s=[],fileReferenceValueComponent:d,isObjectProperty:c,isObjectNode:u})=>{var p,m;const g=L({control:r,name:`${n}.nodeType`}),b=L({control:r,name:`${n}.isRequired`}),C=L({control:r,name:`${n}.validationNode`}),{customCheckboxes:y,validateKey:x}={customCheckboxes:h((()=>E.length?E.filter((e=>"checkbox"===e.type)):[]),[E=s]),customFields:h((()=>E.length?E.filter((e=>"checkbox"!==e.type)):[]),[E]),validateKey:v((e=>{const r=[...new Set(e.replace(/[a-zA-Z0-9]/g,"").replaceAll("_","").split(""))];return!((null==r?void 0:r.length)>0)||"Delete invalid characters: "+r.join(", ").replace(", ,",",")}),[])};var E;const O=h((()=>a?"Value":"Default Value"),[a]);f((()=>{g&&"string"==typeof g&&!u?e(`${n}.nodeType`,Dt.find((e=>e.value===g))):u&&e(`${n}.nodeType`,Dt.find((e=>e.value===Ir.OBJECT)))}),[g,e,n,u]);const w=h((()=>{let e=Dt;return a&&(e=Dt.filter((e=>e.value!==Ir.ANY))),e}),[a]),V=!a||(null!==(p=null==g?void 0:g.value)&&void 0!==p?p:g)!==Ir.OBJECT;return t(Fe,{container:!0,direction:"column",spacing:2,children:[c&&o(Fe,{children:o(Gr,{required:!0,control:r,name:`${n}.key`,label:"Key",validate:x})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${n}.name`,label:"Name"})}),o(Fe,{children:o(an,{required:!0,control:r,name:`${n}.nodeType`,label:"Type",options:w,disabled:u,onChange:(r,l)=>{const t=`${n}.nodeType`;e(`${n}.${a?"value":"defaultValue"}`,null),e(t,l)}})}),o(Fe,{children:o(tl,{required:!0,control:r,name:`${n}.sortOrder`,label:"Sort Order"})}),o(Fe,{children:o(nl,{control:r,name:`${n}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),t(Fe,{children:[o(Qr,{control:r,name:`${n}.isEnabled`,label:"Enabled"}),o(Qr,{control:r,name:`${n}.isRequired`,label:"Required"}),l&&o(Qr,{control:r,name:`${n}.isViewableInList`,label:"Is viewable in list"}),y.length?o(i,{children:y.map(((e,l)=>o(Qr,{control:r,name:`${n}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},l)))}):null]}),g&&t(i,{children:[o(Fe,{children:o(Lt.Provider,{value:null!==(m=g.value)&&void 0!==m?m:g,children:o(Mt,{control:r,setValue:e,enable:C,name:`${n}.validationNode`})})}),o(Fe,{children:o(Ot,{setValue:e,control:r,nodeType:"string"==typeof g?g:g.value,nodeFieldName:n,globalParameter:a,entityDefinition:l,fileReferenceValueComponent:d})}),V&&o(Fe,{children:o(wt,{control:r,nodeFieldName:n,name:`${n}.${a?"value":"defaultValue"}`,label:O,required:!!a&&b,fileReferenceValueComponent:d})})]})]})})),Pt=y((({node:e,entityDefinition:r=!1,globalParameter:n=!1,customPropertyFields:l=[],entityReferenceValueComponent:i,fileReferenceValueComponent:a,isObjectNode:s},d)=>{const{control:c,setValue:u,trigger:p,getValues:m,watch:h,reset:g}=F({mode:"all",defaultValues:{node:e}});return x(d,(()=>({getValues:()=>m("node"),trigger:p})),[m,p]),f((()=>{e&&g({node:e})}),[e,g]),t(z,{mt:2,children:[o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(It,{control:c,setValue:u,nodeFieldName:"node",isObjectNode:s,entityDefinition:r,globalParameter:n,customPropertyFields:l,entityReferenceValueComponent:i,fileReferenceValueComponent:a})]})})),qt=({control:e,parentFieldName:r,required:n,entityDefinition:l=!1,globalParameter:i=!1,customPropertyFields:a=[],entityReferenceValueComponent:s,fileReferenceValueComponent:d,isObjectNode:c})=>{const u=h((()=>r?`${r}.node`:"node"),[r]),{setValue:p,watch:m}=k(),{fieldState:{error:f}}=V({control:e,name:u,rules:{validate:e=>!n||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}});return t(z,{mt:2,children:[f&&f.message&&o(Fe,{size:12,children:o(j,{color:"secondary",children:f.message})}),o(j,{component:"h6",color:"initial",mb:3,sx:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(It,{control:e,setValue:p,isObjectNode:c,nodeFieldName:u,entityDefinition:l,globalParameter:i,customPropertyFields:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})]})},Bt=y((({control:e,definitionFieldName:r,isObjectNode:n,title:l,hideCodeField:i,hideVersionField:a,hideNameField:s,required:d=!1,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=k(),f=h(r?`${r}.node`:"node");return t(Fe,{container:!0,direction:"column",spacing:2,children:[l&&o(Fe,{size:12,children:o(z,{my:2,children:o(j,{variant:"h6",children:l})})}),!s&&o(Fe,{size:12,children:o(Gr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!i&&o(Fe,{size:12,children:o(Gr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!a&&o(Fe,{size:12,children:o(tl,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),o(Fe,{size:12,children:p?o(Pt,{node:f,ref:p,isObjectNode:n,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):o(qt,{control:e,required:d,isObjectNode:n,parentFieldName:r,entityReferenceValueComponent:c,fileReferenceValueComponent:u})})]})})),zt=({node:e,data:r})=>{const{name:n}=e,l=v(((e,r)=>{const n=e,l=document.createElement("a");document.body.appendChild(l),l.href=n,l.target="_self",l.download=r,l.click()}),[]);return o(M,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>l(r,n),children:"Download File"})},jt=({node:e,data:r})=>{var n;const l=e=>o(z,{sx:{borderRadius:"4px",padding:"4px",wordBreak:"auto-phrase"},children:Or(e)?"null":cr(e)?JSON.stringify(e,null,2):e.toString()});switch(el(e)){case Ir.ARRAY:return Array.isArray(r)?o("div",{children:null==r?void 0:r.map(((r,n)=>o(jt,{node:e.memberNodes,data:cr(r)?r:r+","},n)))}):l(r);case Ir.OBJECT:return Array.isArray(e.properties)&&(null===(n=e.properties)||void 0===n?void 0:n.length)?o(Ht,{node:e,data:r}):"object"==typeof r?o(En,{value:r}):l(r);case Ir.ANY:return"object"==typeof r?o(En,{value:r}):l(r);case Ir.FILE_REFERENCE:return null===r?l(r):o(M,{component:oe,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case Ir.FILE:return Or(r)?l(r):"string"==typeof r?o(zt,{data:r,node:e}):l(r);default:return l(r)}},$t=({node:e,data:r,hasBackground:n=!1})=>o(z,{sx:{backgroundColor:n?"#f1f1f1":"none"},children:o(jt,{node:e,data:r})}),Ht=({node:e,data:r})=>{const n=v(((e,r)=>{var l;if(e&&r){console.log(e,r);const i=e.key?r[e.key]:r,a=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("span",{children:[t("b",{children:[e.name,e.isRequired&&"*"]}),""+(e.key?" | "+e.key:"")]}),o("span",{children:a})]}),content:a===Ir.OBJECT&&Array.isArray(e.properties)&&(null===(l=e.properties)||void 0===l?void 0:l.length)?e.properties.map((e=>n(e,i))):o($t,{node:e,data:i})}}return null}),[]);return o(Fe,{container:!0,direction:"column",spacing:2,children:o($l,{data:[n(e,r)]})})},_t=({properties:e,parentKey:r="",activePath:n="",prefix:l="",onClick:i})=>o(or,{orientation:"vertical",onClick:e=>e.stopPropagation(),children:e&&e.map((e=>{var a;const s=r?`${r}.${e.key}`:e.key,d=null!==(a=e.nodeType.value)&&void 0!==a?a:e.nodeType;return t(ir,{expanded:!0,onClick:()=>{return e=s,void i(l?`${l}.${e}`:e);var e},children:[o(ar,{slotProps:{stepIcon:{icon:"",completed:!1,active:n===s}},children:t(z,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),o(sr,{children:o("div",{children:d===Ir.OBJECT&&o(_t,{onClick:i,activePath:n,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))}),Jt=({open:e=!1,onClose:r,onPaste:n,properties:l})=>{const[i,a]=b("");return t(D,{open:e,onClose:r,fullWidth:!0,maxWidth:"md",children:[o(B,{children:"JSON path picker"}),t(P,{children:[(null==l?void 0:l.length)?l.map(((e,r)=>t("div",{children:[o(j,{variant:"h6",children:e.title}),o(_t,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:i})]},r))):o(j,{children:"Please, add properties"}),i&&t(j,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",i,")"]})]}),t(I,{children:[o(M,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${i})`),wr.success("Copied!")},children:"Copy"}),o(M,{variant:"contained",color:"primary",onClick:()=>{n(`$(${i})`),wr.success("Pasted!")},children:"Paste"}),o(M,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},Wt=E({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Gt=()=>O(Wt),Yt=({children:e})=>{const[r,n]=b("true"===localStorage.getItem("sidebar_collapsed")),l=v((()=>{n(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),t=v(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return o(Wt.Provider,{value:{collapsed:r,toggleCollapse:l,toggleRootElementLink:t},children:e})},Zt=Oe("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Kt=Oe(Lr)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out",zIndex:999,"& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),Ut=Oe(Sr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Xt=Oe(Tr)((e=>({padding:e.theme.spacing(3),margin:0}))),Qt=Oe(yr)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),eo=Oe(Rr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),ro=Oe(kr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),no=Oe(Q)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),lo=Oe(Fr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),to=Oe(Tr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),oo=Oe(Ar)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:1e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}}))),io=({route:e,isActive:r,isSubmenu:n})=>{const{collapsed:l}=Gt(),[a,s]=p.useState(null),d=Boolean(a),c=e=>{s(e.currentTarget)},u=()=>{s(null)},m=v((({children:r})=>l&&!n?o(ne,{title:e.name,placement:"right",children:r}):r),[l,e,n]);return e.link?o(Qt,{disablePadding:!0,component:oe,replace:!0,to:{pathname:e.link,search:e.query},children:o(m,{children:t(eo,{className:Ee({active:r,main:e.main,collapsed:l}),children:[e.icon&&o(ro,{className:Ee({collapsed:l}),children:e.icon}),o(lo,{primary:e.name,className:Ee({collapsed:l,main:e.main}),sx:l&&!n?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}})]})})}):e.children&&l?t(i,{children:[o(no,{className:"collapsed",children:o(ne,{title:e.name,placement:"right",children:o(eo,{className:Ee({active:r,main:e.main,collapsed:l}),sx:{justifyContent:"center"},onClick:c,children:e.name.substring(0,1)})})}),o(Qe,{open:d,anchorEl:a,onClose:u,MenuListProps:{sx:{bgcolor:"secondary.main"}},slotProps:{paper:{sx:{width:300,maxHeight:440}}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.children.map(((e,r)=>o(uo,{route:e,isSubmenu:!0},r)))})]}):o(no,{children:e.name})};var ao="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";const so=({route:e,isActive:r,isListOpen:n,handleClick:l,isSubmenu:i})=>o(no,{children:o(Xt,{sx:{padding:0,margin:0},children:o(Qt,{disablePadding:!0,onClick:l,children:t(eo,{className:Ee({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[o(lo,{primary:e.name,className:Ee({main:e.main}),sx:i?{}:{display:"none"}}),e.name,o(z,{component:"img",src:ao,mr:3,sx:{transition:"transform .3s",transform:`rotate(${n?0:"-90deg"})`}})]})})})});function co({route:e,isActive:r,isListOpen:n,handleClick:l,isSubmenu:i}){const{collapsed:a}=Gt();return(null==e?void 0:e.link)?o(Qt,{disablePadding:!0,onClick:l,children:t(eo,{className:Ee({active:r,main:e.main,collapsed:a}),children:[e.icon&&o(ro,{children:e.icon}),o(lo,{primary:e.name,className:Ee({collapsed:a,main:e.main}),sx:a&&!i?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}}),o(z,{component:"img",src:ao,mr:3,sx:{transition:"transform .3s",transform:`rotate(${n?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?o(so,{route:e,handleClick:l,isListOpen:n}):o(no,{children:e.name})}const uo=({route:e,isSubmenu:r})=>{var n,l,a;const s=te(),{collapsed:d,toggleRootElementLink:c}=Gt(),[u,p]=b(!1),[m,g]=b("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),C=h((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),y=v((()=>{e&&e.rootLink&&(c(e.name,m),g(!m))}),[m,e,c]);return f((()=>{p(C)}),[C]),(null==e?void 0:e.rootLink)&&(null===(n=e.children)||void 0===n?void 0:n.length)&&(!d||d&&r)?t(i,{children:[o(co,{route:e,isActive:C,handleClick:y,isListOpen:m,isSubmenu:r}),o(Nr,{in:!m,timeout:"auto",children:o(to,{children:e.children.map((e=>o(uo,{route:e,isSubmenu:r},e.name)))})})]}):(null===(l=e.children)||void 0===l?void 0:l.length)&&(!d||d&&r)?t(i,{children:[o(co,{route:e,isActive:C,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),o(Nr,{in:u||!e.link,timeout:"auto",children:o(to,{children:null===(a=e.children)||void 0===a?void 0:a.map(((e,n)=>o(uo,{route:e,isSubmenu:r},e.name)))})})]}):o(io,{route:e,isActive:C,isSubmenu:r})};const po=({title:e,routes:r,id:n,logo:l,collapsedLogo:i,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=Gt();return t(Zt,{children:[o(oo,{className:Ee("button-collapse",{collapsed:d}),onClick:c,children:o("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})}),t(Kt,{variant:"permanent",anchor:"left",className:Ee({collapsed:d}),id:n,children:[(!!e||!!l)&&o(Ut,{className:Ee({collapsed:d}),"data-title":e.substring(0,1),children:t(z,{display:"flex",flexDirection:"column",children:[!!e&&o(z,{component:"span",children:e}),!!l&&o(z,{component:"img",src:d?i:l,alt:"Lending Hub KZ"})]})}),t(z,{height:""+(l||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[o(Xt,{sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}},children:r.map((e=>o(uo,{route:e},e.name)))}),a&&o(z,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})},mo=({routes:e,theme:r=Bn,title:n="",id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>t(l,{theme:r,children:[o(Vr,{}),o(Yt,{children:o(po,{title:n,routes:e,id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),ho=({src:e,alt:r})=>o(z,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:o("img",{src:e,alt:r})}),fo=({children:e,toolbar:r,contentSx:n,sx:l})=>t(z,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},l),children:[o(Sr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),o(z,{sx:Object.assign(Object.assign({},n),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:o(w,{fallback:o(qr,{}),children:null!=e?e:o(ae,{})})})]}),go=Oe(oe)((()=>({textDecoration:"none",color:"inherit"}))),bo=({crumbs:e})=>o(Mr,{separator:o(Dr,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?o(go,{to:e.link,className:"breadcrumb",children:e.title},r):o(j,{className:"breadcrumb",children:e.title},r)))});export{Br as AlertDialog,Yl as ArrayNodeFormBuilder,lt as ArrayNodeFormBuilderControl,un as BackButton,bo as Breadcrumbs,fo as ContentLayout,pl as ControlArrayInput,an as ControlAutocomplete,Qr as ControlCheckbox,nl as ControlCodeEditor,sl as ControlDate,cl as ControlDateTime,Kr as ControlDebouncedInput,Gr as ControlInput,tl as ControlNumberInput,ml as ControlPeriodInput,fl as ControlPhoneInput,dn as ControlQueryAutocomplete,en as ControlRadio,Xr as ControlSelect,ol as ControlSwitch,ul as ControlTime,cn as CopyButton,Bt as CreateDefinition,Pt as CreateNode,qt as CreateNodeWithContext,_r as DATE_DEFAULT_FORMAT,Wr as DATE_TIME_DEFAULT_FORMAT,Hr as DEFAULT_DATE_VALIDATION_ERROR_TEXT,ll as DEFAULT_ERROR_TEXT,$r as DEFAULT_REQUIRED_ERROR_TEXT,Zl as DefinitionFiller,Ht as DefinitionView,ql as InfoItem,On as JsonModalView,Jt as JsonPathPicker,En as JsonView,qr as Loader,ho as MenuIcon,rt as NodeFormBuilderContext,Jl as NodeFormBuilderControl,Ir as NodeType,vt as ObjectNodeProperties,st as ObjectNodeView,Cn as OverflowTip,Ur as PopupIconComponent,Pr as RoundingMode,Pl as RouteTabs,mo as Sidebar,Ml as SimpleTable,xn as Status,$l as StepperView,Jr as TIME_DEFAULT_FORMAT,Il as TabPanel,Ll as Table,Tl as TableAction,Dl as TableActionCell,ct as ViewNode,Vn as blue,Ln as brand,hn as capitalize,Tn as dark,vn as deepParseJson,zr as defaultDefinitionArrayValue,jr as defaultDefinitionObjectValue,$n as digitsOnly,Hn as floatsOnly,Yn as formatDefinitionNodeData,zn as formatTableRowValue,Un as getDemNodeDateFormat,gn as getJsonStringValue,Qn as getMultipleNodeFillOptions,el as getNodeType,Xn as getObjectStarterValue,rl as getSingleNodeFillOptions,kn as green,_n as isExpression,Wn as isValueEmpty,Zn as nodePropertiesArrayToObject,Kn as nodePropertiesObjectToArray,Jn as numberFormat,Rn as orange,Fn as red,pn as removeArrayItem,bn as safeParseJson,fn as sortArrayOfObjects,Bn as theme,Yr as useDebounce,jn as useFullScreen,Zr as useToggle,mn as validateJson,Sn as white,An as yellow};
1
+ import{useTheme as e,createTheme as r,responsiveFontSizes as n,ThemeProvider as l}from"@mui/material/styles";import{jsxs as t,jsx as o,Fragment as i}from"react/jsx-runtime";import{__rest as a,__awaiter as s}from"tslib";import d from"@mui/material/TextField";import c from"@mui/material/MenuItem";import*as u from"react";import p,{memo as m,useMemo as h,useEffect as g,useRef as f,useState as b,useCallback as v,createElement as C,forwardRef as y,useImperativeHandle as x,createContext as E,useContext as O,Suspense as w}from"react";import{useController as V,useWatch as L,Controller as T,useFormContext as k,useFieldArray as R,useForm as F}from"react-hook-form";import S from"@mui/material/SvgIcon";import A from"@mui/material/IconButton";import N from"@mui/material/InputAdornment";import M from"@mui/material/Button";import D from"@mui/material/Dialog";import I from"@mui/material/DialogActions";import P from"@mui/material/DialogContent";import q from"@mui/material/DialogContentText";import B from"@mui/material/DialogTitle";import z from"@mui/material/Box";import j from"@mui/material/Typography";import $ from"@mui/material/CircularProgress";import H from"@mui/material/FormControl";import _ from"@mui/material/FormControlLabel";import J from"@mui/material/FormHelperText";import W from"@mui/material/Checkbox";import G from"@mui/material/Radio";import Y from"@mui/material/RadioGroup";import Z from"@mui/material/FormLabel";import K from"@mui/material/Autocomplete";import U from"lodash/get";import X from"@mui/material/useMediaQuery";import Q from"@mui/material/ListSubheader";import{VariableSizeList as ee}from"react-window";import{useInfiniteQuery as re}from"@tanstack/react-query";import ne from"@mui/material/Tooltip";import{useNavigate as le,useLocation as te,Link as oe,useSearchParams as ie,Outlet as ae}from"react-router-dom";import se from"@uiw/react-codemirror";import{langs as de}from"@uiw/codemirror-extensions-langs";import{abcdef as ce}from"@uiw/codemirror-theme-abcdef";import ue from"@mui/icons-material/Fullscreen";import pe from"@mui/icons-material/FullscreenExit";import{format as me,parse as he,isValid as ge,isMatch as fe,startOfTomorrow as be,endOfYesterday as ve,isToday as Ce,isAfter as ye,isBefore as xe}from"date-fns";import Ee from"classnames";import{styled as Oe}from"@mui/system";import we from"@mui/material/Switch";import{DatePicker as Ve}from"@mui/x-date-pickers/DatePicker";import{DateTimePicker as Le}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as Te}from"@mui/x-date-pickers/TimePicker";import{renderTimeViewClock as ke}from"@mui/x-date-pickers/timeViewRenderers";import Re from"@mui/material/Chip";import Fe from"@mui/material/Grid2";import{toString as Se,parse as Ae}from"duration-fns";import{IMaskInput as Ne}from"react-imask";import Me from"@mui/material/Pagination";import De from"@mui/material/TablePagination";import{useGridApiContext as Ie,useGridSelector as Pe,gridPageSelector as qe,gridPageCountSelector as Be,gridRowCountSelector as ze,gridPageSizeSelector as je,DataGrid as $e,GridActionsCellItem as He}from"@mui/x-data-grid";import _e from"@mui/material/Table";import Je from"@mui/material/TableBody";import We from"@mui/material/TableCell";import Ge from"@mui/material/TableContainer";import Ye from"@mui/material/TableHead";import Ze from"@mui/material/TableRow";import Ke from"@mui/material/TableFooter";import Ue from"@mui/material/Backdrop";import Xe from"@mui/material/TableSortLabel";import Qe from"@mui/material/Menu";import er from"@mui/icons-material/MoreHoriz";import rr from"@mui/material/Paper";import nr from"@mui/material/Tab";import lr from"@mui/material/Tabs";import tr from"@mui/icons-material/DeleteOutline";import or from"@mui/material/Stepper";import ir from"@mui/material/Step";import ar from"@mui/material/StepLabel";import sr from"@mui/material/StepContent";import dr from"@mui/material/StepConnector";import cr from"lodash/isPlainObject";import ur from"@mui/material/Accordion";import pr from"@mui/material/AccordionSummary";import mr from"@mui/material/AccordionDetails";import hr from"@mui/material/AccordionActions";import{ExpandMore as gr}from"@mui/icons-material";import{AdapterDateFns as fr}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as br}from"@mui/x-date-pickers/LocalizationProvider";import vr from"@mui/material/Select";import Cr from"@mui/material/InputLabel";import yr from"@mui/material/ListItem";import xr from"@mui/icons-material/CheckBoxOutlineBlank";import Er from"@mui/icons-material/CheckBox";import Or from"lodash/isNil";import{toast as wr}from"react-toastify";import Vr from"@mui/material/CssBaseline";import Lr from"@mui/material/Drawer";import Tr from"@mui/material/List";import kr from"@mui/material/ListItemIcon";import Rr from"@mui/material/ListItemButton";import Fr from"@mui/material/ListItemText";import Sr from"@mui/material/Toolbar";import Ar from"@mui/material/ButtonBase";import Nr from"@mui/material/Collapse";import Mr from"@mui/material/Breadcrumbs";import Dr from"@mui/icons-material/NavigateNext";var Ir,Pr;!function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.LONG="LONG",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.OBJECT="OBJECT",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.ANY="ANY",e.ARRAY="ARRAY",e.SHORT="SHORT",e.LOCALIZED_STRING="LOCALIZED_STRING"}(Ir||(Ir={})),function(e){e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY"}(Pr||(Pr={}));const qr=m((function({transparent:e=.3,position:r="absolute",bgcolor:n="#fff"}){const l=h((()=>e?"number"==typeof e?e:0:.3),[e]);return g((()=>{if("number"==typeof e&&(e>1||e<0))throw Error("'transparency' prop must be in 0 to 1 range")}),[e]),t(z,{position:r,top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10,children:[o($,{sx:{zIndex:1,position:"relative"}}),o(z,{sx:{opacity:l},position:"absolute",top:0,left:0,width:"100%",height:"100%",bgcolor:n})]})})),Br=({open:e,title:r,description:n,closeButtonTitle:l="Close",onClose:i,confirmButtonTitle:a="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:d=!1,onConfirm:c,children:u,dialogProps:p,loading:m,maxWidth:h="xs",hideCloseButton:g=!1})=>o("div",{children:t(D,Object.assign({open:e,onClose:d?(e,r)=>{if("backdropClick"===r)return null;i()}:i,disableEscapeKeyDown:d,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:h},p,{children:[m&&o(qr,{}),t(B,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[o(j,{variant:"inherit",children:r}),!g&&o(A,{sx:{padding:0,height:"28px",width:"28px"},onClick:i,children:o(S,{children:o("g",{opacity:"0.6",children:o("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})})})})]}),t(P,{children:[n&&o(q,{id:"alert-dialog-description",children:n}),o(z,{maxWidth:"100%",overflow:"hidden",children:u})]}),t(I,{children:[!g&&o(M,{onClick:i,variant:"outlined",children:l}),a&&c?o(M,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))}),zr={code:"",name:"",version:0,properties:[]},jr={code:"",name:"",version:0,properties:{}},$r="Please, fill this field",Hr="Incorrect date format",_r="yyyy-MM-dd",Jr="HH:mm:ss",Wr="yyyy-MM-dd'T'HH:mm:ss.SSSZ",Gr=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m="",disabled:h=!1,textarea:g=!1,hideErrorMessage:f=!1,onChange:b,requiredErrorText:v=""}=e,C=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const y=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&(v||$r),validate:s}}),x=y.field,{ref:E,onChange:O,value:w}=x,L=a(x,["ref","onChange","value"]),{fieldState:{error:T}}=y;return o(d,Object.assign({},L,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:E,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!T,helperText:!f&&(null==T?void 0:T.message),disabled:h,multiline:g,minRows:g?3:1,value:null!=w?w:"",slotProps:{formHelperText:{variant:"standard"},inputLabel:{shrink:!!C.placeholder},htmlInput:Object.assign(Object.assign({},null!==(n=null===(r=null==C?void 0:C.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==n?n:{}),{value:null!=w?w:""})},onChange:b||O},C))};function Yr(e,r){const n=f();g((()=>()=>{n.current&&clearTimeout(n.current)}),[]);return(...l)=>{clearTimeout(n.current),n.current=setTimeout((()=>{e(...l)}),r)}}const Zr=()=>{const[e,r]=b(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Kr=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m="",disabled:h=!1,textarea:f=!1,hideErrorMessage:C=!1,onChange:y,requiredErrorText:x="",debounceTime:E=200}=e,O=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText","debounceTime"]);const{field:{ref:w,onChange:T},fieldState:{error:k}}=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&(x||$r),validate:s}}),R=L({control:l,name:c}),[F,S]=b("");g((()=>{!F&&R&&S(R)}),[F,R]);const A=Yr((e=>{T(e)}),200),N=v((e=>{S(e.target.value),A(e.target.value)}),[A]);return o(d,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:w,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!k,helperText:!C&&(null==k?void 0:k.message),disabled:h,multiline:f,minRows:f?3:1,value:null!=F?F:"",onChange:N,slotProps:{formHelperText:{variant:"standard"},htmlInput:Object.assign(Object.assign({},null!==(n=null===(r=null==O?void 0:O.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==n?n:{}),{value:null!=F?F:""})}},O))},Ur=()=>o(S,{children:o("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),Xr=e=>{var r,n,l,{control:s,validate:u,name:p="",label:m="",required:h=!1,defaultValue:g="",disabled:f=!1,hideErrorMessage:b=!1,onChange:C,labelKey:y,valueKey:x,options:E=[],requiredErrorText:O=""}=e,w=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const L=V({name:p,control:s,defaultValue:g,rules:{required:!!h&&(O||$r),validate:u}}),T=L.field,{ref:k,onChange:R,value:F}=T,M=a(T,["ref","onChange","value"]),{fieldState:{error:D}}=L,I=v((e=>"string"==typeof e?e:x?e[x]:e.value),[x]),P=v((e=>"string"==typeof e?e:y?e[y]:e.label),[y]),q=v((()=>{C?C(null):R(null)}),[R,C]);return o(d,Object.assign({},M,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:k,name:p,label:h?t(i,{children:[m," ",o("span",{children:"*"})]}):m,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!D,helperText:!b&&(null==D?void 0:D.message),disabled:f,value:null!=F?F:"",onChange:C||R,slotProps:{input:Object.assign({endAdornment:!h&&F?o(N,{position:"end",sx:{mr:0},children:o(A,{onClick:q,size:"small",children:o(S,{fontSize:"small",children:o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})}):null},null===(r=null==w?void 0:w.slotProps)||void 0===r?void 0:r.input),select:{sx:{"& .MuiSelect-select .notranslate::after":w.placeholder?{content:`"${w.placeholder}"`,opacity:.42}:{}}},formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==w?void 0:w.placeholder)},htmlInput:Object.assign(Object.assign({},null!==(l=null===(n=null==w?void 0:w.slotProps)||void 0===n?void 0:n.htmlInput)&&void 0!==l?l:{}),{value:null!=F?F:""})}},w,{children:E.map(((e,r)=>o(c,{value:I(e),children:P(e)},r)))}))},Qr=e=>{var{control:r,validate:n,name:l="",label:i="",required:s=!1,defaultValue:d,disabled:c=!1,hideErrorMessage:u=!1,onChange:p}=e,m=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const g=V({name:l,control:r,defaultValue:null!=d&&d}),f=g.field,{ref:b,onChange:v,value:C}=f,y=a(f,["ref","onChange","value"]),{fieldState:{error:x}}=g,E=h((()=>{if("boolean"==typeof C)return C;if("string"==typeof C){if("false"===C)return v(!1),!1;if("true"===C)return v(!0),!0}return!1}),[C,v]);return t(H,{error:!!x,component:"fieldset",variant:"standard",disabled:c,children:[o(_,{control:o(W,Object.assign({},y,{checked:E,onChange:p||v,name:l,ref:b,disabled:c,color:"secondary"},m)),label:i}),!u&&(null==x?void 0:x.message)&&o(J,{variant:"standard",children:x.message})]})},en=({name:e,label:r,values:n=[],control:l,required:i,defaultValue:s,disabled:d,hideErrorMessage:c,labelKey:u,valueKey:p,validate:m,onChange:h,row:g,radioProps:f,requiredErrorText:b=""})=>{const C=V({name:e,control:l,defaultValue:s,rules:{required:!!i&&(b||$r),validate:m}}),y=C.field,{onChange:x}=y,E=a(y,["onChange"]),{fieldState:{error:O}}=C,w=v((e=>"string"==typeof e?e:p?e[p]:e.value),[p]),L=v((e=>"string"==typeof e?e:(console.log(e),u?e[u]:e.label)),[u]),T=v((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),k=v((e=>{"true"===e.target.value||"false"===e.target.value?x("true"===e.target.value):x(e)}),[x]);return t(H,{disabled:d,error:!!O,children:[o(Z,{id:"radio-buttons-group",children:r}),o(Y,Object.assign({},E,{row:g,"aria-labelledby":"radio-buttons-group",onChange:h||k,children:n.map(((e,r)=>o(_,{value:w(e),control:o(G,Object.assign({},f,{checked:T(w(e))})),label:L(e)},r)))})),!c&&(null==O?void 0:O.message)&&o(J,{variant:"standard",children:O.message})]})},rn=({valueKey:e,labelKey:r})=>{const n=v(((r,n)=>{if(r&&n){if("string"==typeof r)return r===n;if(e)return U(r,e)===U(n,e)||U(r,e)===n;if(r.value)return r.value===n.value||r.value===n}return!1}),[e]),l=v((e=>e?"string"==typeof e?e:r&&U(e,r,"")?U(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),t=v(((e,r)=>C(z,Object.assign({},e,{component:"li",key:e.id}),l(r))),[l]);return{isOptionEqualToValue:n,getOptionLabel:l,renderOption:t}},nn=u.createContext({}),ln=u.forwardRef(((e,r)=>{const n=u.useContext(nn);return o("div",Object.assign({ref:r},e,n))}));function tn(e){const{data:r,index:n,style:l}=e,t=r[n],i=Object.assign(Object.assign({},l),{top:l.top+8});if(t.hasOwnProperty("group"))return o(Q,{component:"div",style:i,children:t.group},t.key);const{key:s}=t,d=a(t,["key"]);return o(j,Object.assign({component:"li"},d,{noWrap:!0,style:i,children:t}),s)}const on=u.forwardRef((function(r,n){const{children:l}=r,t=a(r,["children"]),i=[];l.forEach((e=>{i.push(e),i.push(...e.children||[])}));const s=e(),d=X(s.breakpoints.up("sm"),{noSsr:!0}),c=i.length,p=d?36:48,m=e=>e.hasOwnProperty("group")?48:p,h=function(e){const r=u.useRef(null);return u.useEffect((()=>{null!=r.current&&r.current.resetAfterIndex(0,!0)}),[e]),r}(c);return o("div",{ref:n,children:o(nn.Provider,{value:t,children:o(ee,{itemData:i,height:(c>8?8*p:i.map(m).reduce(((e,r)=>e+r),0))+16,width:"100%",ref:h,outerElementType:ln,innerElementType:"ul",itemSize:e=>m(i[e]),overscanCount:5,itemCount:c,children:tn})})})})),an=e=>{var{control:r,validate:n,name:l="",label:s="",required:c=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:m=!1,onChange:f,labelKey:v,valueKey:C,options:y=[],multiple:x,textFieldProps:E={},disableCloseOnSelect:O,useStringValue:w,requiredErrorText:L="",startAdornment:T,endAdornment:k,useVirtualList:R}=e,F=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment","useVirtualList"]);const S=V({name:l,control:r,defaultValue:u||(x?[]:null),rules:{required:!!c&&(L||$r),validate:n}}),A=S.field,{ref:N,onChange:M,value:D}=A,I=a(A,["ref","onChange","value"]),{fieldState:{error:P}}=S,[q,B]=b(x?[]:void 0),{getOptionLabel:z,isOptionEqualToValue:j,renderOption:$}=rn({valueKey:C,labelKey:v}),H=h((()=>D.length&&w&&C&&y.length&&y.every((e=>"object"==typeof e))),[w,C,y,D]);return g((()=>{"string"==typeof D&&void 0===q&&H&&B(y.find((e=>U(e,C)===D)))}),[q,y,H,D]),g((()=>{Array.isArray(D)&&x&&!(null==q?void 0:q.length)&&H&&B(D.map((e=>y.find((r=>U(r,C)===e)))))}),[q,y,H,x,D]),o(K,Object.assign({},I,{value:w?null!=q?q:null:D,fullWidth:!0,disablePortal:!0,size:"small",readOnly:p,options:y,multiple:x,disableListWrap:R,getOptionLabel:z,isOptionEqualToValue:j,disableCloseOnSelect:O||x,filterSelectedOptions:x,onChange:f||((e,r)=>{const n=x&&Array.isArray(r)?r.map((e=>U(e,C))):U(r,C);M(w&&C?n:r),B(r)}),renderOption:$,slotProps:{listbox:{component:R?on:null}},renderInput:e=>o(d,Object.assign({},e,{variant:"outlined",name:l,label:c?t(i,{children:[s," ",o("span",{children:"*"})]}):s,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==F?void 0:F.placeholder,error:!!P,inputRef:N,helperText:!m&&(null==P?void 0:P.message),slotProps:{input:Object.assign(Object.assign({},e.InputProps),{startAdornment:T||e.InputProps.startAdornment,endAdornment:k||e.InputProps.endAdornment}),formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==F?void 0:F.placeholder)}}},E))},F))};const sn=()=>o("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function dn(e){var{name:r,label:n,control:l,required:s=!1,searchBy:c,labelKey:u,multiple:m=!1,mongoQueryJson:f,disabled:C,valueKey:y,sortBy:x="",hideErrorMessage:E,queryParams:O={},disableCloseOnSelect:w,textFieldProps:L,onChange:T,queryFunction:k,validate:R,itemQueryFunction:F,requiredErrorText:S="",startAdornment:A,endAdornment:M,useVirtualList:D}=e,I=a(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","queryParams","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment","useVirtualList"]);const P=V({control:l,name:r,defaultValue:m?[]:null,rules:{required:!!s&&(S||$r),validate:R}}),q=P.field,{ref:B,onChange:z,value:j}=q,H=a(q,["ref","onChange","value"]),{fieldState:{error:_,isDirty:J}}=P,{getOptionLabel:W,isOptionEqualToValue:G,renderOption:Y}=rn({valueKey:y,labelKey:u}),[Z,X]=b([]),[Q,ee]=b(!1),[ne,le]=b(""),[te,oe]=b(""),ie=h((()=>!!Z.length&&Q),[Q,Z]),{data:ae,isFetching:se,isFetchingNextPage:de,hasNextPage:ce,fetchNextPage:ue}=re({initialPageParam:0,queryKey:["options",x,te],queryFn:({pageParam:e})=>k(Object.assign(Object.assign({page:`${e}`,size:"20",sort:x},te?{[c]:te}:{}),O)),getNextPageParam:(e,r,n)=>e.totalPages&&e.totalPages!==n+1?n+1:null}),pe=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>pe(e,r)));{const n={};for(const l in e)n[l]=pe(e[l],r);return n}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},me=Yr((e=>{if(f){const r=pe(f,e);oe(JSON.stringify(r))}else oe(e)}),500),he=v(((e,r)=>{X([]),le(r),me(r)}),[me]),ge=v(((e,r,...n)=>{z(r),T&&T(e,r,...n)}),[z,T]);g((()=>{(null==ae?void 0:ae.pages)&&X(te?ae.pages[0].collection:ae.pages.reduce(((e,r)=>(e.push(...r.collection),e)),[]))}),[ae,te]),g((()=>{if(!J&&j&&F){let e=j;"object"==typeof j&&y in j&&(e=U(j,y)),F(e).then((e=>{z(e),le(U(e,u))})).catch(console.error)}}),[j,J,y,u,F,z]);const fe=v((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&ce&&!de&&ue()}),[ce,de,ue]);return o(K,Object.assign({},H,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:C,options:Z,multiple:m,getOptionLabel:W,isOptionEqualToValue:G,disableCloseOnSelect:w||m,filterSelectedOptions:m,inputValue:ne,value:j,onChange:ge,disableListWrap:D,loading:se,clearOnBlur:!1,open:ie,filterOptions:e=>e,onOpen:()=>{ee(!0)},onClose:()=>{ee(!1),oe("")},onInputChange:he,renderOption:Y,popupIcon:o(sn,{}),slotProps:{listbox:{component:D?on:null,onScroll:fe}},renderInput:e=>o(d,Object.assign({},e,{label:s?t(i,{children:[n," ",o("span",{children:"*"})]}):n,placeholder:null==I?void 0:I.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!_,inputRef:B,helperText:!E&&(null==_?void 0:_.message),slotProps:{formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==I?void 0:I.placeholder)},input:Object.assign(Object.assign({},e.InputProps),{endAdornment:M||t(p.Fragment,{children:[se?o(N,{position:"end",children:o($,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:A||e.InputProps.startAdornment})}},L))},I))}const cn=({copyText:e,helpText:r="Copy"})=>{const[n,l]=b(r);return n?o(ne,{title:n,placement:"top",children:o(A,{onClick:()=>{navigator.clipboard.writeText(e),l("Copied!"),setTimeout((()=>{l(r)}),1e3)},children:o(S,{fontSize:"small",children:o("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})})})}):null},un=({text:e,buttonProps:r={}})=>{const n=le(),{state:l}=te(),t=h((()=>null==l?void 0:l.from),[l]),i=v((()=>{n(t||-1)}),[n,t]);return o(z,{mr:2,children:e?o(M,Object.assign({color:"inherit",onClick:t?null:i,component:oe,to:null!=t?t:""},r,{children:e})):o(A,{onClick:i,children:o(S,{children:o("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},pn=(e,r)=>{const n=[...e];return n.splice(r,1),n},mn=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function hn(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const gn=(e,r,n,l="asc")=>{const t=e[n],o=r[n];return t<o?"asc"===l?-1:1:t>o?"asc"===l?1:-1:0},fn=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},bn=e=>{try{return JSON.parse(e)}catch(e){return null}},vn=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=vn(r[e])})),r}catch(r){return e}},Cn=({children:e})=>{const[r,n]=b(!1),l=v((e=>{n((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{n((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return o(ne,{title:e,arrow:!0,disableHoverListener:!r,children:o("div",{ref:l,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})},yn=Oe(z)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),xn=({text:e,status:r="default"})=>o(yn,{className:Ee("root",{[r]:!0}),children:e}),En=y((({value:e,height:r=200,fontSize:n=16},l)=>{const[i,a]=b(!0),s=f(null),{toggleFullScreen:d,fullScreen:c}=jn(s.current),u=v((e=>{const r=n=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-n.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===n.target.scrollTop&&(a(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(a(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):a(!1)}),[]);return t(z,{position:"relative",ref:s,children:[i&&o(qr,{bgcolor:"#fff"}),o(A,{size:"small",onClick:d,sx:{position:"absolute",zIndex:3,top:0,right:0,padding:"3px",borderRadius:"0"},children:o(c?pe:ue,{fontSize:"small"})}),o(se,{ref:l,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:c?"100vh":`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:u,extensions:[de.json()],style:{fontSize:n,width:"100%"}})]})})),On=({open:e,onClose:r,value:n,jsonViewProps:l})=>{const i=f();return t(D,{disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"},children:[o(P,{children:o(En,Object.assign({value:n},l,{ref:i}))}),t(I,{children:[o(cn,{copyText:n}),o(M,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})},wn=({value:e,copyButton:r=!1,textField:n=!1})=>{const{open:l,onOpen:i,onClose:a}=Zr(),s=v((e=>{e.stopPropagation(),i()}),[i]);return t(z,{width:"100%",children:[t(z,{display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2,children:[r&&o(cn,{copyText:fn(e)}),o(ne,{title:"Open",placement:"top",children:o(A,{size:"small",onClick:s,children:o(S,{children:o("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),n?o(z,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):o(En,{value:e}),o(On,{open:l,value:fn(e),onClose:a,jsonViewProps:{height:450}})]})},Vn={100:"#E3EBFC",200:"#CCD9F9",300:"#ACC2F5",400:"#8EABF1",500:"#7196ED",600:"#527FE9",700:"#376BE5",800:"#1744AE",900:"#00267F"},Ln={100:"#DDF5F2",200:"#BAEAE5",300:"#92E2D8",400:"#76D3C8",500:"#53BAAD",600:"#2CAB9B",700:"#148C7D",800:"#08675B",900:"#014239"},Tn={0:"#FFF",20:"#F7F7FA",50:"#F4F4F6",100:"#E4E4EA",200:"#CDCDDB",300:"#AAABBF",400:"#8D8EA6",500:"#71718C",600:"#575773",700:"#3E3F59",800:"#2C2D45",900:"#1F1F33",1e3:"#171829"},kn={100:"#E5FEF1",200:"#CAFCE3",300:"#AAF2CE",400:"#8AE6B8",500:"#6CD9A3",600:"#53CF91",700:"#3BC480",800:"#138049",900:"#014221"},Rn={100:"#FCEADF",200:"#FDDFCE",300:"#F9C8AC",400:"#F7B189",500:"#F69E6B",600:"#F4884A",700:"#F4772E",800:"#C96226",900:"#9A4716"},Fn={100:"#FFE9E6",200:"#F8D2CD",300:"#F1ADA5",400:"#EB8E83",500:"#E46D5E",600:"#DD4F3E",700:"#D6331F",800:"#AA2111",900:"#831002"},Sn={0:"#171829",20:"#1F1F33",50:"#2C2D45",100:"#3E3F59",200:"#575773",300:"#71718C",400:"#8D8EA6",500:"#AAABBF",600:"#CDCDDB",700:"#E4E4EA",800:"#F4F4F6",900:"#F7F7FA",1e3:"#FFF"},An={100:"#FFFBDE",200:"#FFF7C4",300:"#FFF1A3",400:"#FFEF85",500:"#FFEB69",600:"#FFE249",700:"#FFCE1F",800:"#FFB60F",900:"#EF9A00"},Nn={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"},bg:{accent:{blue:{primary:Vn[700],secondary:Vn[300],tertiary:Vn[100]},green:{primary:kn[700],secondary:kn[300],tertiary:kn[100]},orange:{primary:Rn[700],secondary:Rn[300],tertiary:Rn[100]},red:{primary:Fn[700],secondary:Fn[300],tertiary:Fn[100]},yellow:{primary:An[700],secondary:An[300],tertiary:An[100]}},brand:{high:Ln[700],mid:Ln[200],low:Ln[100]},default:{hard:Sn[1e3],high:Tn[200],inverse:Tn[1e3],low:Tn[20],mid:Tn[100]},system:{critical:Fn[800],disabled:Tn[500],success:kn[800],warning:Rn[800]}},button:{primary:{default:Ln[700],disabled:Tn[50],focused:Ln[900],hover:Ln[800]},secondary:{default:Sn[1e3],disabled:Tn[100],focused:Tn[400],hover:Sn[900]},warning:{default:Rn[700],disabled:Rn[200],focused:Rn[900],hover:Rn[800]}},stroke:{primary:{brand:Ln[700],default:Tn[200],focused:Ln[700],hover:Tn[300],inverse:Sn[100],hard:Tn[1e3]},secondary:{brand:Ln[500],default:Tn[100],focused:Ln[700],hover:Tn[200],inverse:Sn[50]},tertiary:{brand:Ln[300],default:Tn[50],focused:Ln[700],hover:Tn[100],inverse:Sn[20]},system:{critical:Fn[800],success:kn[800],warning:Rn[800]}},surface:{primary:Sn[1e3],secondary:Sn[900]},textIcon:{accent:{blue:{primary:Vn[700],secondary:Vn[500],tertiary:Vn[300]},green:{primary:kn[800],secondary:kn[500],tertiary:kn[300]}},brand:{primary:Ln[700],secondary:Ln[500],tertiary:Ln[300]},disabled:{default:Tn[200],onColor:Tn[50]},primary:{default:Tn[1e3],inverse:Sn[1e3],onDark:Sn[1e3],onLight:Tn[1e3]},secondary:{default:Tn[500],inverse:Sn[400],onColor:Tn[200]},tertiary:{default:Tn[300],inverse:Sn[200],onColor:Tn[100]},system:{critical:Fn[700],link:Vn[800],success:kn[700],warning:Rn[700]}}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var Mn=r(Nn);const Dn={components:{MuiButtonBase:{defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:Mn.palette.button.warning.hover},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:Mn.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:Mn.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:Mn.spacing(3),minWidth:Mn.spacing(25),background:Mn.palette.background.default,paddingRight:Mn.spacing(3)},input:{minWidth:Mn.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:Ur},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:Mn.spacing(25)}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:Mn.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto",whiteSpace:"normal","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:Mn.spacing(3),minWidth:Mn.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:Mn.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:o(Ur,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:Mn.palette.secondary.dark,padding:Mn.spacing(2,3),borderRadius:8,textAlign:"center"}}}},In={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:Mn.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:Mn.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:Mn.spacing(4)}},head:{padding:Mn.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:0,"& .MuiSelect-select":{zIndex:2,color:Mn.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}},"& img":{position:"absolute",right:0}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{columnHeaderHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:Mn.spacing(3),width:"100%",color:Mn.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{borderTopLeftRadius:Mn.spacing(3),borderTopRightRadius:Mn.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},"container--top":{'& [role="row"]':{backgroundColor:Mn.palette.grey[100],'& [role="columnheader"]':{borderBottom:"none"}}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:Mn.spacing(1.25,3),display:"flex",alignItems:"center",borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}},Pn={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:Mn.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:Mn.palette.secondary.main}}}}}},qn={components:{MuiTypography:{styleOverrides:{h1:{[Mn.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[Mn.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[Mn.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}},Bn=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return n(r(Mn,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Dn.components),In.components),Pn.components),qn.components),{MuiToolbar:{styleOverrides:{root:{[Mn.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:Mn.spacing(2.5),padding:Mn.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:Mn.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:Mn.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:Mn.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:Mn.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:Mn.palette.secondary.main}}}}})}))})(),zn=({value:e,canCopy:r,copyValue:n,shortId:l,fullText:i=!1,textParams:a})=>{const{displayAs:s="text",tooltipLinkComponent:d=null,dateFormat:c=null,statusVariant:u=null}=a||{};switch(s){case"boolean":return o(S,e?{color:"primary",fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})});case"date":return e?c?o(Cn,{children:c.map(((r,n)=>o(z,{children:me(new Date(e),r)},n)))}):t(Cn,{children:[o(z,{children:me(new Date(e),"dd.MM.yyyy")}),o(z,{children:me(new Date(e),"HH:mm:ss")})]}):"";case"status":return o(Cn,{children:o(xn,{text:e,status:u||"default"})});case"json_text":return o(wn,{value:e,textField:!0});case"json_code":return o(wn,{value:e,copyButton:!0});case"array":return o(z,{children:null==e?void 0:e.map(((e,r)=>o(z,{children:e},r)))});case"collapsed_array":return e&&o(z,{children:o(ne,{arrow:!0,title:d||e.map(((e,r)=>o(z,{fontSize:14,style:{paddingTop:Bn.spacing(1)},children:e},r))),children:o(z,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})})});case"number":return o(z,{display:"flex",justifyContent:"flex-end",children:o(Cn,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?t(z,{display:"flex",alignItems:"center",width:"100%",children:[l?o(Cn,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):i?o(z,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):o(Cn,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&o(cn,{copyText:n?"string"==typeof n?n:JSON.stringify(n):e})]}):""}},jn=e=>{const[r,n]=b(!1),l=v((()=>{if(r)n(!1),document.exitFullscreen();else switch(n(!0),!0){case"string"==typeof e:{const r=document.querySelector(e);r&&r.requestFullscreen();break}case e instanceof HTMLElement:e.requestFullscreen()}}),[r,e]);return g((()=>{const e=()=>{!document.fullscreenElement&&r&&n(!1)};return document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("fullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("fullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[r]),{fullScreen:r,toggleFullScreen:l}},$n=new RegExp("^[-+]?[0-9]+$"),Hn=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),_n=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const n of e)if(_n(n,r))return!0;if("object"==typeof e)for(const n in e)if(_n(e[n],r))return!0}return!1},Jn=new Intl.NumberFormat("ru-RU",{style:"decimal"}),Wn=e=>!e&&0!==e&&!1!==e,Gn=(e,r,n)=>{if(null==r)return null;if(_n(r))return r;let l=r;switch(el(e)){case Ir.BOOLEAN:l=!!r||!(!r&&null!==r)&&null;break;case Ir.INTEGER:case Ir.BIG_INTEGER:case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.LONG:case Ir.DOUBLE:case Ir.SHORT:l=Number(r);break;case Ir.DATE:case Ir.DATE_TIME:case Ir.TIME:if(r)try{const e=n.formatText.replace(/[Z,z,x]+/g,"XX");l=me(he(r,e,new Date),e)}catch(e){console.error(e)}break;case Ir.ANY:try{l="string"==typeof r?JSON.parse(l):r}catch(e){l=r}break;case Ir.OBJECT:l=Yn(e,r)}return l},Yn=(e,r)=>{var n;let l={};if(r){const t=el(e);return t===Ir.OBJECT?Array.isArray(e.properties)?null===(n=e.properties)||void 0===n||n.forEach((function(e){const{key:n}=e,t=r[n];Array.isArray(t)?l[n]=t.map((r=>Gn(e,r,{formatText:e.format,properties:e.properties}))):l[n]=Gn(e,t,{formatText:e.format,properties:e.properties})})):l=cr(r)?r:{}:l=t===Ir.ARRAY&&Array.isArray(r)?r.map((r=>e.memberNodes?Gn(e.memberNodes,r):r)):Gn(e,r),l}return null},Zn=(e,r)=>{return n(e);function n(e){const{name:l,isRequired:t,sortOrder:o,isEnabled:i,uiSettings:a,validationNode:s}=e,d=el(e),c=Object.assign({name:l,nodeType:d,isRequired:null!==t&&t,sortOrder:o,isEnabled:null!==i&&i,validationNode:s,uiSettings:a},((e,r)=>{const n={};let l,t="";return r?e.nodeType===Ir.ARRAY?(t="values",l=e.value):(t="value",l=e.value):e.nodeType===Ir.ARRAY?(t="defaultValues",l=e.defaultValue):(t="defaultValue",l=e.defaultValue),Array.isArray(l)?n[t]=l.map((r=>Gn(e,r,{formatText:e.format,properties:e.properties}))):n[t]=Gn(e,l,{formatText:e.format,properties:e.properties}),n})(e,r));if("isViewableInList"in e&&(c.isViewableInList=e.isViewableInList),a)if("string"==typeof a)try{c.uiSettings=JSON.parse(a)}catch(e){console.log(e),c.uiSettings=a}else c.uiSettings=a;else c.uiSettings=null;if(d===Ir.BIG_DECIMAL&&(c.precisionScale=e.precisionScale,c.roundingMode=e.roundingMode),d!==Ir.DATE&&d!==Ir.TIME&&d!==Ir.DATE_TIME||(c.format=e.format),d===Ir.STRING&&(c.restrictedValues=e.restrictedValues),d===Ir.ENTITY_REFERENCE){const{definitionCode:r,definitionVersion:n,labelPropertyCode:l,valuePropertyCode:t}=e;c.definitionCode=r,c.definitionVersion=n,c.labelPropertyCode=l,c.valuePropertyCode=t}return d===Ir.ARRAY&&(c.memberNodes=e.memberNodes?n(e.memberNodes):null),d===Ir.OBJECT&&(c.properties=function(e){if(!Array.isArray(e)||!e.length)return null;const r={};return e.forEach((e=>{r[e.key]=n(e)})),r}(e.properties)),c}};function Kn(e,r){var n;return e&&e.nodeType===Ir.OBJECT&&e.properties&&(e.properties=(n=e.properties)?Array.isArray(n)?n:Object.keys(n).map((e=>{let l=Object.assign(Object.assign({key:e},n[e]),r||{});const t=el(l);return t===Ir.OBJECT&&(l=Kn(l,r)),t===Ir.ARRAY&&l.memberNodes&&(l.memberNodes=Kn(l.memberNodes,r),"defaultValues"in l&&(l.defaultValue=l.defaultValues),"values"in l&&(l.value=l.values)),l})).sort(((e,r)=>gn(e,r,"sortOrder"))):[]),e&&e.nodeType===Ir.ARRAY&&e.memberNodes&&(e.memberNodes=Kn(e.memberNodes,r)),e}const Un=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return me(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},Xn=e=>(Array.isArray(e.properties)?e:Kn(e)).properties.reduce(((r,n)=>{const l=JSON.parse(JSON.stringify(r));return e.nodeType===Ir.OBJECT?l[e.key]=Xn(e):l[e.key]=e.nodeType,l}),{}),Qn=({nodeType:e,useExpression:r,required:n})=>{let l=[{value:"widget",label:"Fill array",sortOrder:1}];return n||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Ir.OBJECT||e===Ir.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e!==Ir.ANY&&e!==Ir.OBJECT&&e!==Ir.ARRAY||l.push({value:"json_valid",label:"JSON editor",sortOrder:2}),l=l.sort(((e,r)=>gn(e,r,"sortOrder"))),l},el=e=>{var r;return e?"string"==typeof e.nodeType?e.nodeType:null===(r=e.nodeType)||void 0===r?void 0:r.value:Ir.ANY},rl=({nodeType:e,useExpression:r,required:n})=>{let l=[{value:"widget",label:"Widget",sortOrder:1}];switch(n||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Ir.OBJECT||e===Ir.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e){case Ir.STRING:l[0].label="Text input";break;case Ir.INTEGER:case Ir.BIG_INTEGER:case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.LONG:case Ir.DOUBLE:case Ir.SHORT:l[0].label="Number input";break;case Ir.BOOLEAN:l[0].label="Switch";break;case Ir.ENTITY_REFERENCE:l[0].label="Entity reference field";break;case Ir.ARRAY:l[0].label="Array editor";break;case Ir.DATE:l[0].label="Date picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.DATE_TIME:l[0].label="Date & Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.TIME:l[0].label="Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case Ir.ANY:l[0].label="JSON"}return l=l.sort(((e,r)=>gn(e,r,"sortOrder"))),l},nl=y(((e,r)=>{var{control:n,name:l,mode:s="json",label:d,width:c="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:g=!1,hideErrorMessage:b=!1,fontSize:C=16,validate:y=!0,parseValue:x,requiredErrorText:E="",useCleanValue:O}=e,w=a(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const L=V({control:n,name:l,rules:{required:!!m&&(E||$r),validate:e=>{if(e&&g&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),T=L.field,{onChange:k,value:R,ref:F}=T,S=a(T,["onChange","value","ref"]),{fieldState:{error:N}}=L,M=f(null),{toggleFullScreen:D,fullScreen:I}=jn(M.current),P=h((()=>({json:[de.json()],javascript:[de.javascript()],python:[de.python()]})),[]),q=h((()=>"text"===s&&"string"!=typeof R?JSON.stringify(R,null,2):"json"===s&&"string"!=typeof R?null===R?"":O?JSON.stringify(R,null,2).replace(/\\"/g,""):JSON.stringify(R,null,2):"string"==typeof R&&"text"!==s&&O?R.replace(/\\"/g,""):R),[R,O,s]),B=v((e=>{if(x)try{const r=JSON.parse(e);k(r)}catch(r){k(e)}else k(e)}),[k,x]);return t(z,{display:"flex",flexDirection:"column",width:"100%",position:"relative",ref:M,children:[o(A,{size:"small",onClick:D,sx:{position:"absolute",zIndex:3,top:0,right:0,color:"#fff",padding:"3px",borderRadius:"0",backgroundColor:"#000"},children:o(I?pe:ue,{fontSize:"small"})}),o(z,{children:d&&o(j,{display:"inline",style:{marginRight:10},children:m?t(i,{children:[d," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):d})}),t(i,{children:[o(se,Object.assign({},S,{ref:r||F,basicSetup:{autocompletion:!0,history:!0},theme:ce,width:c,height:I?"100vh":u,style:{fontSize:C,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:q,onChange:B,extensions:"text"===s?[]:P[s]},w)),N&&!b&&o(J,{variant:"standard",error:!0,children:N.message})]})]})})),ll={required:$r,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},tl=e=>{var r,n,{control:l,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m=null,disabled:g=!1,hideErrorMessage:f=!1,onChange:b,decimal:v=!1,valueAsNumber:C=!0,useFormattedInputValue:y=!1,errorText:x}=e,E=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const O=h((()=>x||ll),[x]),w=V({name:c,control:l,defaultValue:m,rules:{required:!!p&&O.required,validate:e=>s?"function"!=typeof s||s(e):0===+e||(null===e?!p||O.required:v&&!Hn.test(e)||/^-*0+$/.test(e)?O.notValidNumber:!(!v&&!$n.test(e))||O.notValidInteger)}}),L=w.field,{ref:T,onChange:k,value:R}=L,F=a(L,["ref","onChange","value"]),{fieldState:{error:S}}=w;return o(d,Object.assign({},F,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:T,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!f&&(null==S?void 0:S.message),disabled:g,value:y?null!==(r=null==R?void 0:R.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=R?R:"",onChange:e=>{let r=e.target.value.replace(/\s/g,"");const n=e.nativeEvent.data;if(!(v?/^-?\d*[.,]?\d*$/:/^-?\d*$/).test(r))return;if(!((r.match(/[.,]/g)||[]).length>1||r.lastIndexOf("-")>0))if(r=r.replace(/,/g,"."),!isNaN(n)||v&&"."===n||"-"===n||"+"===n||r)if(b)b(e);else if(C)if(r)if("0"===r)k(0);else if(v){const e=r.replace(",",".").split(".")[1],n=parseFloat(r.replace(",","."));k(!Hn.test(r.replace(",","."))||/^0+$/.test(e)||/^-*0+$/.test(r)||Number.isNaN(n)?r:n)}else k(Number.isNaN(+r.replace(",","."))?r:+r.replace(",","."));else k(null);else k(r);else k(r)},slotProps:{formHelperText:{variant:"standard"},htmlInput:null===(n=null==E?void 0:E.slotProps)||void 0===n?void 0:n.htmlInput}},E))},ol=e=>{var{control:r,name:n,label:l,defaultValue:t}=e,i=a(e,["control","name","label","defaultValue"]);const s=V({control:r,name:n,defaultValue:t}).field,{ref:d,onChange:c,value:u}=s,p=a(s,["ref","onChange","value"]),m=h((()=>{if("boolean"==typeof u)return u;if("string"==typeof u){if("false"===u)return c(!1),!1;if("true"===u)return c(!0),!0}return!1}),[u,c]);g((()=>{null===u&&c(!1)}),[u,c]);return o(_,{label:l,name:n,control:o(we,Object.assign({},p,{color:"primary",size:"small",inputRef:d,onChange:e=>{const{checked:r}=e.target;c(r)},checked:m},i))})};var il="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const al=()=>o("img",{src:il,alt:""}),sl=e=>{var{control:r,name:n,required:l,label:s,placeholder:d,defaultValue:c,format:u=_r,hideErrorMessage:p=!1,requiredErrorText:m="",validate:f,dateCondition:C,validateErrorText:y,slotProps:x}=e,E=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","requiredErrorText","validate","dateCondition","validateErrorText","slotProps"]);const[O,w]=b(_r),L=V({control:r,name:n,defaultValue:c,rules:{required:!!l&&(m||$r),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:Hr;if(C&&e){const r=he(e,O,new Date),n=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,n)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,n)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,n))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,n))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),T=L.field,{value:k,onChange:R}=T,F=a(T,["value","onChange"]),{fieldState:{error:S}}=L,A=v((e=>{R(ge(e)&&O?me(e,O):"")}),[R,O]),N=h((()=>{if(k instanceof Date)return"Invalid Date"==`${k}`?null:k;if("string"==typeof k&&k.length&&O){const e=he(k,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[k,O]);return g((()=>{if(u){const e=u.replace(/[Zzx]+/g,"XX");try{fe(me(new Date,e),e),w(e)}catch(e){console.error(e)}}}),[u]),t(i,{children:[o(Z,{required:l,children:s}),o(Ve,Object.assign({},F,O?{format:O}:{},{value:N,onChange:A,disableFuture:"lte"===C||"current"===C,disablePast:"gte"===C||"current"===C,maxDate:"lt"===C?ve():null,minDate:"gt"===C?be():null,slotProps:Object.assign(Object.assign({},x),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!S,placeholder:d,name:n,helperText:!p&&(null==S?void 0:S.message),slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:al}},E))]})},dl=()=>o("img",{src:il,alt:""}),cl=e=>{var{control:r,name:n,required:l,label:s,placeholder:d,defaultValue:c,format:u=Wr,hideErrorMessage:p=!1,requiredErrorText:m="",validate:f,dateCondition:C,validateErrorText:y,slotProps:x}=e,E=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","requiredErrorText","validate","dateCondition","validateErrorText","slotProps"]);const[O,w]=b(),L=V({control:r,name:n,defaultValue:c,rules:{required:!!l&&(m||$r),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:Hr;if(C&&e){const r=he(e,O,new Date),n=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,n)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,n)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,n))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,n))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),T=L.field,{value:k,onChange:R}=T,F=a(T,["value","onChange"]),{fieldState:{error:S}}=L,A=v((e=>{R(ge(e)&&O?me(e,O):"")}),[R,O]),N=h((()=>{if(k instanceof Date)return"Invalid Date"==`${k}`?null:k;if("string"==typeof k&&k.length&&O){const e=he(k,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[k,O]);return g((()=>{if(u){const e=u.replace(/[Zzx]+/g,"XX");try{fe(me(new Date,e),e),w(e)}catch(e){console.error(e)}}}),[u]),o(Le,Object.assign({},F,{ampm:!1,label:l?t(i,{children:[s," ",o("span",{children:"*"})]}):s,value:N},O?{format:O}:{},{onChange:A,disableFuture:"lte"===C||"current"===C,disablePast:"gte"===C||"current"===C,maxDate:"lt"===C?ve():null,minDate:"gt"===C?be():null,reduceAnimations:!0,slotProps:Object.assign(Object.assign({},x),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!S,placeholder:d,name:n,helperText:!p&&(null==S?void 0:S.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:dl}},E))},ul=e=>{var{control:r,name:n,required:l,label:s,format:d=Jr,hideErrorMessage:c=!1,requiredErrorText:u="",placeholder:p,defaultValue:m,slotProps:h}=e,f=a(e,["control","name","required","label","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue","slotProps"]);const v=V({control:r,name:n,defaultValue:m,rules:{required:!!l&&(u||$r),validate:e=>"Invalid Date"==`${e}`?"Invalid Date":!!fe(e,d)||"Incorrect date format"}}),C=v.field,{onChange:y,ref:x,value:E}=C,O=a(C,["onChange","ref","value"]),{fieldState:{error:w}}=v,[L,T]=b(null);return g((()=>{if(E&&d)try{let e=he(E,d,new Date);ge(e)||(e=he(E,"HH:mm:ss.SSS",new Date)),T(e)}catch(e){T(E)}}),[E,d]),o(Te,Object.assign({},O,{inputRef:x,label:l?t(i,{children:[s," ",o("span",{children:"*"})]}):s,ampm:!1,value:L,format:d,onChange:e=>{T(e),y(ge(e)?me(e,d):void 0)},viewRenderers:{hours:ke,minutes:ke},slotProps:Object.assign(Object.assign({},h),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!w,placeholder:p,name:n,helperText:!c&&(null==w?void 0:w.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==h?void 0:h.textField)})},f))},pl=e=>{var r,n,l,{name:s,control:c,label:u,required:p,defaultValue:m=null,onChange:g,textFieldLabel:f}=e,C=a(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[y,x]=b(""),[E,O]=b(null),w=V({control:c,name:s,defaultValue:m,rules:{required:p&&$r}}),L=w.field,{onChange:T,value:k}=L,R=a(L,["onChange","value"]),{formState:{errors:F}}=w,N=h((()=>g||T),[g,T]),M=v((e=>{const{value:r}=e.target;x(r)}),[]),D=v((()=>{O(null),!y||Array.isArray(k)&&k.includes(y)?Array.isArray(k)&&k.includes(y)&&O("This value already exists"):(N([...null!=k?k:[],y]),x(""))}),[y,N,k]),I=v((e=>{N(k.filter((r=>r!==e)))}),[k,N]),P=v((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),D())}),[D]);return t(i,{children:[o(Z,{required:p,children:u}),o(z,{display:"flex",flexWrap:"wrap",children:null==k?void 0:k.map(((e,r)=>o(Re,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>I(e)},r)))}),o("input",Object.assign({type:"hidden"},null==c?void 0:c.register(s),{onChange:N,value:k},R)),o(d,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:f||""===f?f:`Add ${null!=u?u:""}`,value:y,onChange:M,error:!!(null===(r=F[s])||void 0===r?void 0:r.message),helperText:null===(n=F[s])||void 0===n?void 0:n.message,slotProps:{htmlInput:null===(l=C.slotProps)||void 0===l?void 0:l.htmlInput,formHelperText:{variant:"standard"},input:{endAdornment:o(A,{size:"small",onClick:D,children:o(S,{children:o("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}},name:s,onKeyDown:P},C)),E&&o(J,{error:!0,children:E})]})},ml=({name:e="period",control:r,label:n="Period",required:l,isSecondsVisible:a=!1})=>{var s;const[c,u]=b(),p=L({control:r,name:e}),{field:{onChange:m},formState:{errors:f}}=V({name:e,control:r,rules:{required:!!l&&"Please, fill one of the fields"}}),C=v((e=>{const{name:r,value:n}=e.target,l=Object.assign({},null!=c?c:{});n?(l[r]=+n,m(Se(l))):(delete l[r],m(Object.keys(l).length?Se(l):"")),u(l)}),[m,e,c]),y=null===(s=f[e])||void 0===s?void 0:s.message,x=h((()=>({variant:"outlined",size:"small",error:!!y,type:"number",onChange:C,fullWidth:!0,slotProps:{formHelperText:{variant:"standard"}}})),[y,C]);return g((()=>{p&&!c&&u(Ae(p))}),[c,p]),t(i,{children:[o(j,{variant:"subtitle1",children:l?t(i,{children:[n," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):n}),y&&o(J,{error:!0,children:y}),t(Fe,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.years)||"",name:"years",label:"Years"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.months)||"",name:"months",label:"Months"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.days)||"",name:"days",label:"Days"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours"}))}),o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes"}))}),a&&o(Fe,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds"}))})]})]})};const hl=e=>{var{onChange:r,onBlur:n,mask:l,ref:t}=e,i=a(e,["onChange","onBlur","mask","ref"]);return o(Ne,Object.assign({inputRef:t,mask:l,lazy:!1,overwrite:!0,unmask:!1,onAccept:e=>r({target:{value:e}}),placeholderChar:" ",onBlur:n},i))},gl=e=>{var{control:r,name:n,label:l,required:s,mask:c="+{7} (700) 000 00 00",requiredErrorText:u="",inputMaskProps:p,disabled:m,validate:h,invalidErrorText:g,slotProps:f}=e,b=a(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","validate","invalidErrorText","slotProps"]);return o(T,{control:r,name:n,rules:{required:!!s&&(u||$r),validate:e=>!s&&!e||(/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)?!h||("function"!=typeof h||h(e)):g||"Incorrect phone number format")},render:({field:e,fieldState:{error:r}})=>{var a;return o(d,Object.assign({},e,{name:n,fullWidth:!0,size:"small",label:s&&l?t(i,{children:[l," ",o("span",{children:"*"})]}):l,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",slotProps:Object.assign({formHelperText:{variant:"standard"},input:Object.assign({inputComponent:hl,startAdornment:o(N,{position:"start",children:o("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})}),inputProps:Object.assign({mask:c,disabled:m},p)},null!==(a=null==f?void 0:f.input)&&void 0!==a?a:{})},null!=f?f:{})},b,{error:!!r,helperText:null==r?void 0:r.message}))}})};var fl="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const bl=()=>o("img",{src:fl,alt:""}),vl=()=>{const e=Ie(),r=Pe(e,qe),n=Pe(e,Be),l=Pe(e,ze),i=Pe(e,je),a=r=>e.current.setPage(r);return t(z,{px:2,display:"flex",alignItems:"center",children:[o(De,{component:"div",page:r,count:l,rowsPerPage:i,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>a(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:n})=>`${e}–${r} из ${-1!==n?n:`более ${r}`}`,ActionsComponent:void 0,slotProps:{select:{IconComponent:bl}}}),o(Me,{count:n,page:r+1,onChange:(e,r)=>a(r-1)})]})};var Cl="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",yl="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",xl="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const El=()=>o("img",{src:Cl,alt:"sort"}),Ol=()=>o("img",{src:yl,alt:"asc"}),wl=()=>o("img",{src:xl,alt:"desc"}),Vl=Oe($e)((({theme:e})=>({"& .MuiDataGrid-row":{cursor:"pointer"},"& .MuiDataGrid-cell:focus-within, & .MuiDataGrid-cell:focus":{outline:"none !important"},"& .MuiDataGrid-columnHeader:focus-within, & .MuiDataGrid-columnHeader:focus":{outline:"none !important"},"& .MuiDataGrid-columnHeader--sortable":{"& .MuiDataGrid-iconButtonContainer":{visibility:"visible !important",width:"auto !important"},"& .MuiDataGrid-sortIcon":{visibility:"visible !important",opacity:1}}}))),Ll=e=>{var{columns:r,rows:n,rowCount:l,loading:t,disableMargin:i,mode:s="server",initialPageSize:d=10,pagination:c=!0,onCellClick:u}=e,p=a(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const[m,C]=b({pageSize:d,page:0}),{serverPaginationModel:y,onPaginationChange:x}=(({mode:e,pagination:r})=>{const[n,l]=ie(),t=+n.get("page")||0,o=+n.get("size")||10,i=v((({page:e,pageSize:r})=>{n.set("page",e),n.set("size",r),l(n,{replace:!0})}),[l,n]);return g((()=>{"server"===e&&r&&(n.has("page")||n.set("page","0"),n.has("size")||n.set("size","10"),l(n,{replace:!0}))}),[e,r,n,l]),h((()=>({serverPaginationModel:{pageSize:o,page:t},onPaginationChange:i})),[t,o,i])})({mode:s,pagination:c}),{onColumnHeaderClick:E,onSortModelChange:O,sortModel:w}=(()=>{const[e,r]=ie(),n=f(""),l=e.getAll("sort").map((e=>e.split(","))),t=h((()=>l.length?l.map((e=>({field:e[0],sort:e[1]}))):[]),[l]),o=v((n=>{e.delete("sort"),n.length&&n.forEach((r=>e.set("sort",`${r.field},${r.sort}`))),r(e,{replace:!0})}),[e,r]),i=v((e=>e.map((e=>{const r=l.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))),[l]),a=v((({field:e})=>{n.current=e}),[]);return h((()=>({onSortModelChange:o,getSortedColumns:i,sortModel:t,onColumnHeaderClick:a})),[o,i,t,a])})();return o(z,{mt:i?0:2,display:"flex",flexDirection:"column",children:o(Vl,Object.assign({hideFooterPagination:!c,hideFooter:!c,loading:t,rows:n,sortingMode:s,paginationMode:s,paginationModel:"server"===s?y:m,rowCount:l||-1,disableColumnMenu:!0,columns:r,initialState:{sorting:{sortModel:w}},onSortModelChange:"server"===s?O:null,disableRowSelectionOnClick:!0,onPaginationModelChange:"server"===s?x:C,pageSizeOptions:[10,20,50,100],onCellClick:u,onColumnHeaderClick:E,slots:{baseTooltip:ne,pagination:vl,columnUnsortedIcon:El,columnSortedAscendingIcon:Ol,columnSortedDescendingIcon:wl},sx:{"--DataGrid-overlayHeight":"300px"}},p))})},Tl=({icon:e,label:r,showInMenu:n,onClick:l,location:t})=>{var i;return t?o(A,{component:oe,to:t.pathname,state:null!==(i=t.state)&&void 0!==i?i:null,size:"small",children:o(ne,{title:r,arrow:!0,children:p.cloneElement(e,{fontSize:"small"})})}):o(He,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:o(ne,{title:r,arrow:!0,children:e}),onClick:l,label:r,showInMenu:n})},kl=Oe(Xe)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),Rl=()=>o("img",{src:fl,alt:""}),Fl=()=>o("img",{src:Cl,alt:""}),Sl=()=>o("img",{src:yl,alt:""}),Al=()=>o("img",{src:xl,alt:""});function Nl({columns:e=[],rows:r=[],rowCount:n,children:l,pagination:i=!0,loading:a=!1,onRowClick:s,emptyDataText:d,verticalAlign:c="middle",labelRowsPerPage:u},p){const{page:m,size:f,onPageChange:b,onSizeChange:C}=(e=>{const[r,n]=ie(),l=h((()=>{var e;return null!==(e=r.get("page"))&&void 0!==e?e:0}),[r]),t=h((()=>{var e;return null!==(e=r.get("size"))&&void 0!==e?e:10}),[r]),o=v((e=>{n((r=>(r.set("page",`${e}`),r)))}),[n]),i=v((e=>{n((r=>(r.set("size",`${e}`),r)))}),[n]);return g((()=>{e&&(r.has("page")||n((e=>(e.set("page","0"),e))),r.has("size")||n((e=>(e.set("size","10"),e))))}),[r,n,e]),{page:l,size:t,onPageChange:o,onSizeChange:i}})(i),{onSortChanged:y,getColumnSorting:x}=(()=>{const[e,r]=ie(),n=h((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),l=v((e=>{r((r=>{r.delete("sort");let l=!1;return n.forEach((([n,t])=>{n===e?(l=!0,"asc"===t&&r.append("sort",`${n},desc`)):r.append("sort",`${n},${t}`)})),l||r.append("sort",`${e},asc`),r}))}),[n,r]),t=v((e=>{const r=n.find((([r,n])=>r===e));return!!r&&r[1]}),[n]);return{sortParams:n,onSortChanged:l,getColumnSorting:t}})();return o(z,{sx:{overflow:"auto"},children:t(Ge,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[o(Ue,{open:a,sx:{position:"absolute",top:0,left:0},children:o(qr,{})}),t(_e,{ref:p,children:[o(Ye,{children:o(Ze,{children:e.map(((e,r)=>{const n=!!e.sortKey&&x(e.sortKey);return o(We,{align:e.align?e.align:"left",sortDirection:n,sx:{width:e.width?`${e.width}%`:"unset"},children:o(kl,{active:!!n,hideSortIcon:!e.sortKey,direction:n||"asc",IconComponent:"asc"===n?Sl:"desc"===n?Al:Fl,onClick:()=>e.sortKey?y(e.sortKey):{},children:e.label})},r)}))})}),o(Je,{children:r.length?r.map(((r,n)=>o(Ze,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,l)=>o(We,{align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"},children:o(z,{sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)},children:o(z,{children:e.renderCell?e.renderCell(r,n):r[e.id]})})},l)))},n))):o(Ze,{sx:{verticalAlign:c},children:o(We,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),i||l?o(Ke,{children:t(Ze,{children:[l&&o(We,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:l}),i&&r.length?o(De,{rowsPerPageOptions:[5,10,25],count:n,rowsPerPage:+f,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:n})=>`${e}–${r} из ${-1!==n?n:`более ${r}`}`:void 0,slotProps:{select:{IconComponent:Rl}},onPageChange:(e,r)=>b(r),onRowsPerPageChange:e=>C(+e.target.value)}):null]})}):null]})]})})}const Ml=y(Nl),Dl=({actionsList:e})=>{const[r,n]=b(null),l=Boolean(r),i=()=>{n(null)};return t("div",{children:[o(A,{"aria-label":"more",id:"more-button","aria-controls":l?"more-menu":void 0,"aria-expanded":l?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),n(e.currentTarget)},children:o(er,{})}),o(Qe,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:l,onClose:e=>{e.stopPropagation(),i()},slotProps:{paper:{sx:{minWidth:"127px"}}},children:e.map((e=>o(c,{onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),i()},children:e.title},e.title)))})]})},Il=e=>{const{children:r,value:n,index:l}=e,t=a(e,["children","value","index"]);return o("div",Object.assign({role:"tabpanel",hidden:n!==l,id:`simple-tabpanel-${l}`,"aria-labelledby":`simple-tab-${l}`},t,{children:n===l?r:null}))},Pl=e=>{var r;const{tabs:n}=e,l=le(),i=te(),a=h((()=>new URLSearchParams(i.search)),[i.search]),s=a.get("tab");return t(z,{children:[o(rr,{children:o(lr,{value:s||(null===(r=n[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),l({pathname:i.pathname,search:a.toString()},{replace:!0})},children:n.map((e=>o(nr,{value:e.name,label:e.label},e.name)))})}),o(z,{mt:2,children:n.map((e=>{var r;return o(Il,{value:s||(null===(r=n[0])||void 0===r?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},ql=({title:e,text:r,json:n})=>t(z,{sx:{paddingBottom:8},children:[o(z,{sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"},children:e}),r&&o(z,{sx:{fontSize:"18px",wordWrap:"break-word"},children:r}),n&&o(En,{value:n,height:300})]}),Bl=({control:e,name:r,label:n,required:l,restrictedValues:i,requiredErrorText:a="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:p}}=V({control:e,name:r,rules:{required:!!l&&(Array.isArray(i)&&i.length?s||"Please, select a value":a||$r)}}),m=L({control:e,name:r});return Array.isArray(i)&&i.length?t(H,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[o(Cr,{htmlFor:"type-select",children:n}),o(vr,{labelId:"type-select",label:n,value:m||"",onChange:d,ref:u,children:i.map((e=>o(c,{value:e,children:e},e)))})]}):o(Gr,{hideErrorMessage:!0,required:l,control:e,name:r,label:n})},zl=({name:e})=>{const{control:r,setValue:n,register:l}=k(),a=L({control:r,name:e}),d=v((r=>s(void 0,void 0,void 0,(function*(){const l=r.target.files[0];(new FileReader).readAsDataURL(l);const t=yield(e=>new Promise(((r,n)=>{const l=new FileReader;l.readAsDataURL(e),l.onload=()=>{r(l.result)},l.onerror=e=>{n(e)}})))(l);n(e,t)}))),[e,n]);return t(i,{children:[t(z,{mb:2,display:"flex",flex:"row",children:[o(j,{children:"Does file uploaded:"}),o(S,a?{sx:{paddingLeft:2},children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{sx:{paddingLeft:2},children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})})]}),t(M,{component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4},children:[a?"Change file":"Upload file",o("input",Object.assign({type:"hidden"},l(`${e}`,{required:!0}))),o("input",{type:"file",hidden:!0,onChange:d})]})]})},jl=()=>o(z,{component:"span",sx:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),$l=({data:e})=>t(or,{nonLinear:!0,orientation:"vertical",connector:o(dr,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>t(ir,{expanded:!0,children:[o(ar,{sx:{display:"flex",alignItems:"flex-start"},slots:{stepIcon:jl},slotProps:{stepIcon:{icon:"",completed:!1,active:!0}},children:e.label}),o(sr,{sx:{marginLeft:4},children:Array.isArray(e.content)?o($l,{data:e.content}):e.content})]},r))),o(ir,{})]}),Hl=({value:e,node:r,label:n,isDirty:l,required:t=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const a=h((()=>n?`${n} (value)`:`${r.name} (value)`),[n,r]),s=h((()=>n?`${n} (widget)`:`${r.name} (widget)`),[n,r]),d=h((()=>el(r)),[r]),[c,u]=b(null),p=h((()=>i?Qn({nodeType:d,required:t,useExpression:o}):rl({nodeType:d,required:t,useExpression:o})),[o,t,d,i]),m=h((()=>{switch(d){case Ir.STRING:case Ir.DATE:case Ir.TIME:case Ir.DATE_TIME:case Ir.ENTITY_REFERENCE:case Ir.ANY:case Ir.FILE:case Ir.FILE_REFERENCE:return"";case Ir.OBJECT:return{};case Ir.ARRAY:return[];case Ir.BOOLEAN:return!1;case Ir.INTEGER:case Ir.BIG_DECIMAL:case Ir.BIG_INTEGER:case Ir.DOUBLE:case Ir.LONG:case Ir.FLOAT:case Ir.SHORT:return 0;default:return null}}),[d]),f=h((()=>d===Ir.ANY||d===Ir.ARRAY),[d]),C=v((()=>{_n(e,f)?u("expression"):d===Ir.ARRAY||null==e||_n(e,f)||"widget"===c||"string"===c||"json_valid"===c||u("widget")}),[e,c,f,d]);return g((()=>{c?l||C():!Wn(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&_n(e,f)?u("expression"):u("widget"):u("null")}),[e,c,p,o,l,C,f,t,r]),{nodeType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:p,setFillOption:u,defaultProperyValue:m,checkFillOption:C}},_l=Oe(Cr)((()=>({inputLabel:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"}}))),Jl=({control:e,node:r,name:n,useExpression:l,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{field:{value:m,onChange:h},fieldState:{error:b,isDirty:C}}=V({name:n,control:e,rules:{validate:e=>!a||null!==e||(p||$r)}}),y=f({}),{nodeType:x,valueLabel:E,fillOptionLabel:O,fillOption:w,fillOptions:L,setFillOption:T,defaultProperyValue:k}=Hl({value:m,node:r,isDirty:C,label:i,required:a,useExpression:l}),R=v((e=>{const l=e.target.value;y.current=Object.assign(Object.assign({},y.current),{[w]:m}),T(l);const t=y.current[l];if("null"===l)h(null);else if("widget"===l)if(x===Ir.OBJECT&&m&&"string"!=typeof m&&"dem_builder"===w&&"node"in m){const e=Zn(m);try{h(null!=t?t:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else h(null!=t?t:r.defaultValue||k);else if("expression"===l||"string"===l)h(n,null!=t?t:"");else if("dem_builder"===l){const e={code:"",name:"",version:0,node:null};if(m)try{const e=JSON.parse(m);e.properties=Kn(e.properties||{}),h(null!=t?t:e)}catch(r){h(null!=t?t:e)}else h(null!=t?t:e,{shouldDirty:!0})}}),[n,m,T,w,x,h,k,r]);return g((()=>{C||Or(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!Or(m)||h(n,r.defaultValue||r.value)}),[C,r,h,m,n]),g((()=>{var e;(void 0===m||r.isRequired&&null===m&&!r.defaultValue&&!r.value)&&h(null!==(e=y.current[w])&&void 0!==e?e:k),void 0!==m||r.isRequired||null!==r.defaultValue&&null!==r.value||h(null)}),[m,h,n,k,r,w]),t(Fe,{size:12,children:[s&&o(z,{mb:2,children:o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),L?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:O}),o(vr,{labelId:"type-select",label:O,value:w||"",onChange:R,children:L.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(x===Ir.OBJECT||x===Ir.ANY?o(nl,{name:n,control:e,label:E,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:x===Ir.ANY?"text":"json"}):o(Gr,{control:e,name:n,label:E,hideErrorMessage:!0})),"string"===w&&o(Gr,{control:e,name:n,label:E,hideErrorMessage:!0}),"widget"===w&&o(et,{control:e,node:r,name:n,useExpression:l,label:E,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),b&&o(J,{error:!0,children:b.message})]})},Wl=({control:e,name:r,node:n,useExpression:l,required:i,label:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{fields:c,append:u,remove:p}=R({control:e,name:r});return t(Fe,{container:!0,spacing:2,direction:"column",size:12,children:[Array.isArray(c)&&c.length?c.map(((c,u)=>o(Fe,{size:12,children:t(z,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[o(Jl,{control:e,required:i,node:n,useExpression:l,name:`${r}.${u}`,label:`${a||n.name} (${u+1})`,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(z,{mt:"8px",ml:"4px",children:o(A,{id:"close-button",size:"small",onClick:()=>p(u),children:o(S,{fontSize:"small",children:o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u))):null,o(Fe,{children:o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>u(null),children:"Add value"})})]})},Gl={nodeType:Ir.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},Yl=({node:e,name:r,useExpression:n,required:l,label:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{var m,h,v,C;const[y,x]=b(!1),{control:E,clearErrors:O,setValue:w,watch:L}=k(),{field:{ref:T,onChange:R},fieldState:{error:F,isDirty:S}}=V({control:E,name:r,defaultValue:null!==(m=e.defaultValue)&&void 0!==m?m:[],rules:{validate:e=>!(l&&!e)||(p||$r)}}),A=L(r),N=f({}),{valueLabel:M,fillOptionLabel:D,fillOption:I,fillOptions:P,setFillOption:q,checkFillOption:B}=Hl({node:e,value:A,isDirty:S,label:a,required:l,useExpression:n,multipleOptions:!0});return g((()=>{!A&&e.isRequired&&R([]),cr(A)&&!e.isRequired&&R(null)}),[A,e,R]),g((()=>{A&&!y&&(x(!0),B())}),[B,y,A]),t(i,{children:[s&&o(z,{mb:2,children:o(j,{variant:"h6",children:s})}),P?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:D}),o(vr,{labelId:"type-select",label:D,value:I||"",onChange:e=>{x(!0),N.current=Object.assign(Object.assign({},N.current),{[I]:A});const n=e.target.value,l=N.current[n];"null"===n?w(r,null):w(r,null!=l?l:[],{shouldDirty:!0}),q(n),O(r)},children:P.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===I||"json_valid"===I)&&o(nl,{name:r,control:E,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===I&&o(Wl,{control:E,node:null!==(h=e.memberNodes)&&void 0!==h?h:Gl,name:r,useExpression:n,required:l,label:null!==(C=null===(v=e.memberNodes)||void 0===v?void 0:v.name)&&void 0!==C?C:e.name,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),F&&o(J,{error:!0,children:F.message})]})},Zl=({node:e,dataFieldName:r,locales:n,useExpression:l=!1,title:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=v(((e,r)=>el(e)===Ir.ARRAY?o(Yl,{node:e,name:r,useExpression:l,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s}):o(rt,{node:e,name:r,locales:n,useExpression:l,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s})),[l,s,a]),c=v(((e,r)=>{if(e){const n=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:`${e.key?e.key+" | ":""}${n}`})]}),content:d(e,r)}}return null}),[d]);return o(br,{dateAdapter:fr,children:t(Fe,{container:!0,direction:"column",spacing:2,children:[i&&o(Fe,{size:12,children:o("div",{style:{fontWeight:"600"},children:i})}),o($l,{data:[c(Kn(e),r)]})]})})},Kl=o(xr,{fontSize:"small"}),Ul=o(Er,{fontSize:"small",color:"secondary"}),Xl=({localesCollection:e,onChange:r,onLocaleRemove:n,receivedObject:l})=>{const[i,s]=b(null==e?void 0:e.filter((e=>e.isRequired)));g((()=>{const n=null==e?void 0:e.filter((e=>e.isRequired)),t=null==e?void 0:e.filter((e=>null==l?void 0:l.hasOwnProperty(e.code))),o=[...new Set([...n,...t])];s(o),null==r||r(o)}),[e]);const c=v(((r,n,{selected:l})=>t(yr,Object.assign({},r,{onClick:e=>{n.isRequired||r.onClick(e)},sx:{fontSize:14,paddingLeft:1,'&.MuiAutocomplete-option[aria-selected="true"]':{background:"rgba(38, 40, 66, 0.08)","&.Mui-focused":{background:"rgba(38, 40, 66, 0.08)"}}},children:[o(W,{icon:Kl,checkedIcon:Ul,sx:{marginRight:1,padding:1},checked:l||n.isRequired||"all"===n.code&&(null==i?void 0:i.length)===(null==e?void 0:e.length),disabled:n.isRequired}),o(z,{component:"span",textTransform:"capitalize",children:n.name}),n.isRequired&&t(z,{color:"#D6331F",component:"span",children:[" ","*"]})]}))),[i,null==e?void 0:e.length]),u=v((e=>e.isRequired),[]),p=v(((e,r)=>e.map(((e,n)=>{const l=r({index:n}),{onDelete:i}=l,d=a(l,["onDelete"]);return t(z,Object.assign({},d,{bgcolor:"secondary.main",color:"#fff",borderRadius:"6px",py:1,px:1.5,textTransform:"capitalize",display:"flex",alignItems:"center",lineHeight:"16px",children:[o(z,{mr:1,children:e.name}),!e.isRequired&&"all"!==e.code&&o(Ql,{sx:{width:16,height:16,cursor:"pointer"},onClick:()=>{s((r=>null==r?void 0:r.filter((r=>r.code!==e.code)))),i()}})]}))}))),[]);return o(K,{multiple:!0,disableCloseOnSelect:!0,options:[{code:"all",name:"Все",isRequired:!1},...e],value:i,getOptionLabel:e=>e.name,isOptionEqualToValue:(e,r)=>e.code===r.code,onChange:(l,t)=>{const o=null==t?void 0:t.some((e=>"all"===e.code)),a=(null==i?void 0:i.length)===(null==e?void 0:e.length);if(o)if(a){const n=null==e?void 0:e.filter((e=>e.isRequired));s(n),null==r||r(n)}else{const n=null==e?void 0:e.filter((e=>"all"!==e.code));s(n),null==r||r(n)}else{const e=i.filter((e=>!t.some((r=>r.code===e.code))));s(t),null==r||r(t),e.length>0&&(null==n||n(e))}},renderOption:c,getOptionDisabled:u,renderTags:p,renderInput:e=>o(d,Object.assign({},e,{label:"Languages",placeholder:"Select"}))})},Ql=e=>o(S,Object.assign({},e,{viewBox:"0 0 16 16",children:o("path",{d:"M2.93133 3.0358L2.97999 2.9798C3.06465 2.89512 3.17689 2.84364 3.29629 2.8347C3.4157 2.82577 3.53435 2.85999 3.63066 2.93113L3.68666 2.9798L7.99999 7.29247L12.3133 2.97913C12.3595 2.9314 12.4147 2.89333 12.4757 2.86716C12.5367 2.84098 12.6023 2.82722 12.6687 2.82668C12.7351 2.82613 12.8009 2.83881 12.8624 2.86398C12.9238 2.88915 12.9796 2.92631 13.0265 2.97327C13.0734 3.02024 13.1105 3.07608 13.1357 3.13754C13.1608 3.199 13.1734 3.26485 13.1728 3.33124C13.1722 3.39763 13.1584 3.46323 13.1321 3.52422C13.1059 3.58521 13.0678 3.64036 13.02 3.68647L8.70733 7.9998L13.0207 12.3131C13.1052 12.3979 13.1566 12.5102 13.1654 12.6296C13.1742 12.749 13.1399 12.8676 13.0687 12.9638L13.02 13.0198C12.9353 13.1045 12.8231 13.156 12.7037 13.1649C12.5843 13.1738 12.4656 13.1396 12.3693 13.0685L12.3133 13.0198L7.99999 8.70713L3.68666 13.0205C3.59232 13.1115 3.46599 13.1618 3.33489 13.1606C3.20379 13.1594 3.07841 13.1068 2.98575 13.014C2.89309 12.9213 2.84057 12.7959 2.83949 12.6648C2.83841 12.5337 2.88887 12.4074 2.97999 12.3131L7.29266 7.9998L2.97933 3.68647Z",fill:"white"})})),et=({node:e,name:r,locales:n,label:l,useExpression:i,control:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{var c,u;const{setValue:p,getValues:m}=k();switch("string"==typeof e.nodeType?e.nodeType:null===(c=e.nodeType)||void 0===c?void 0:c.value){case Ir.BIG_DECIMAL:case Ir.FLOAT:case Ir.DOUBLE:return o(tl,{required:!0,decimal:!0,hideErrorMessage:!0,control:a,name:r,label:l,valueAsNumber:!0});case Ir.INTEGER:case Ir.SHORT:case Ir.BIG_INTEGER:case Ir.LONG:return o(tl,{required:!0,hideErrorMessage:!0,control:a,name:r,label:l,valueAsNumber:!0});case Ir.BOOLEAN:return o(ol,{control:a,name:r,defaultValue:!1});case Ir.DATE:return o(sl,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.TIME:return o(ul,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.DATE_TIME:return o(cl,{hideErrorMessage:!0,control:a,name:r,label:l,format:e.format});case Ir.STRING:return o(Bl,{control:a,name:r,label:l,restrictedValues:e.restrictedValues});case Ir.ENTITY_REFERENCE:return s?o(s,{name:r,node:e}):o(Bl,{name:r,label:l,control:a});case Ir.FILE:return o(zl,{name:r});case Ir.FILE_REFERENCE:return d?o(d,{name:r}):o(Bl,{name:r,label:l,control:a});case Ir.ANY:return o(nl,{control:a,name:r,hideErrorMessage:!0,label:l,parseValue:!0});case Ir.LOCALIZED_STRING:const c=(e,r)=>Object.assign(Object.assign({},e),{properties:null==r?void 0:r.map((e=>({key:e.code,name:e.name,nodeType:{value:"STRING",label:"String"},isRequired:e.isRequired,isEnabled:!0,defaultValue:"",sortOrder:0})))}),[h,g]=b(c(e,null==n?void 0:n.filter((e=>e.isRequired))).properties),f=r=>{const n=c(e,r);g(n.properties)};return t("div",{style:{borderLeft:"1px solid #bdbdbd",paddingLeft:20},children:[null==h?void 0:h.map((e=>o(Gr,{hideErrorMessage:!0,required:e.isRequired,control:a,name:`${r}.${e.key}`,label:e.name,sx:{mb:3,textTransform:"capitalize"}}))),(null==n?void 0:n.length)?o(Xl,{localesCollection:n,receivedObject:null!==(u=m(r))&&void 0!==u?u:{},onChange:f,onLocaleRemove:e=>{e.forEach((({code:e})=>{p(`${r}.${e}`,void 0,{shouldDirty:!0})}))}}):null]});case Ir.OBJECT:return e.properties?o("div",{children:e.properties.map((e=>o(Zl,{node:e,dataFieldName:`${r}.${e.key}`,useExpression:i,entityReferenceValueComponent:s,fileReferenceValueComponent:d,locales:n})))}):o(nl,{control:a,name:r,hideErrorMessage:!0,label:l,parseValue:!0,mode:"json"});default:return o("div",{children:"No widget"})}},rt=({node:e,name:r,locales:n,useExpression:l,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{control:m,clearErrors:h,setValue:b}=k(),{field:{value:C},fieldState:{error:y,isDirty:x}}=V({name:r,control:m,rules:{validate:e=>!a||null!==e||(p||$r)}}),E=f({}),{nodeType:O,valueLabel:w,fillOptionLabel:L,fillOption:T,fillOptions:R,setFillOption:F,defaultProperyValue:S}=Hl({value:C,node:e,isDirty:x,label:i,required:a,useExpression:l}),A=v((n=>{const l=n.target.value;E.current=Object.assign(Object.assign({},E.current),{[T]:C}),F(l);const t=E.current[l];if("null"===l)b(r,null,{shouldDirty:!0});else if("widget"===l)if((O===Ir.OBJECT||O===Ir.LOCALIZED_STRING)&&C&&"string"!=typeof C&&"dem_builder"===T&&"node"in C){const e=Zn(C);try{b(r,null!=t?t:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else b(r,null!=t?t:e.defaultValue||S);else if("expression"===l||"string"===l)b(r,null!=t?t:"",{shouldDirty:!0});else if("dem_builder"===l){const e={code:"",name:"",version:0,node:null};if(C)try{const e=JSON.parse(C);e.properties=Kn(e.properties||{}),b(r,null!=t?t:e,{shouldDirty:!0})}catch(n){b(r,null!=t?t:e,{shouldDirty:!0})}else b(r,null!=t?t:e,{shouldDirty:!0})}h()}),[r,h,C,F,T,O,b,S,e]);return g((()=>{x||Or(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!Or(C)||b(r,e.defaultValue||e.value)}),[x,e,b,C,r]),g((()=>{var n;(void 0===C||e.isRequired&&null===C&&!e.defaultValue&&!e.value)&&b(r,null!==(n=E.current[T])&&void 0!==n?n:S),void 0!==C||e.isRequired||null!==e.defaultValue&&null!==e.value||b(r,null)}),[C,b,r,S,e,T]),t(Fe,{size:12,children:[s&&o(z,{mb:2,children:o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),R?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:L}),o(vr,{labelId:"type-select",label:L,value:T||"",onChange:A,children:R.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===T&&(O===Ir.OBJECT||O===Ir.ANY?o(nl,{name:r,control:m,label:w,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"expression"===T?"text":"json"}):o(nl,{control:m,name:r,hideErrorMessage:!0,label:i,height:"40px"})),"string"===T&&o(Gr,{control:m,name:r,label:w,hideErrorMessage:!0}),"widget"===T&&o(et,{control:m,locales:n,node:e,name:r,useExpression:l,label:w,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),y&&o(J,{error:!0,children:y.message})]})},nt={nodeType:Ir.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},lt=({control:e,node:r,name:n,useExpression:l,required:a,label:s,title:d,entityReferenceValueComponent:u,fileReferenceValueComponent:p,requiredErrorText:m=""})=>{var h,v,C,y;const[x,E]=b(!1),{field:{value:O,onChange:w},fieldState:{error:L,isDirty:T}}=V({control:e,name:n,defaultValue:null!==(h=r.defaultValue)&&void 0!==h?h:[],rules:{validate:e=>!(a&&!e)||(m||$r)}}),k=f({}),{valueLabel:R,fillOptionLabel:F,fillOption:S,fillOptions:A,setFillOption:N,checkFillOption:M}=Hl({node:r,value:O,isDirty:T,label:s,required:a,useExpression:l,multipleOptions:!0});return g((()=>{!O&&r.isRequired&&w([])}),[O,r,w]),g((()=>{(null==O?void 0:O.length)&&!x&&(E(!0),M())}),[M,x,O]),t(i,{children:[d&&o(z,{mb:2,children:o(j,{variant:"h6",children:d})}),A?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(_l,{htmlFor:"type-select",children:F}),o(vr,{labelId:"type-select",label:F,value:S||"",onChange:e=>{E(!0),k.current=Object.assign(Object.assign({},k.current),{[S]:O});const r=e.target.value,n=k.current[r];w("null"===r?null:null!=n?n:[]),N(r)},children:A.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===S||"json_valid"===S)&&o(nl,{name:n,control:e,label:R,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===S&&o(Wl,{control:e,node:null!==(v=r.memberNodes)&&void 0!==v?v:nt,name:n,useExpression:l,required:a,label:null!==(y=null===(C=r.memberNodes)||void 0===C?void 0:C.name)&&void 0!==y?y:r.name,entityReferenceValueComponent:u,fileReferenceValueComponent:p}),L&&o(J,{error:!0,children:L.message})]})},tt={name:"Name",key:"Key",nodeType:"Node Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node",memberNodes:"Member Nodes"},ot=({value:e,type:r})=>r!==Ir.OBJECT&&r!==Ir.ANY||!e?o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):o(En,{value:e}),it=(e,r,n)=>{switch(r){case"nodeType":return o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:n});case"isRequired":case"isEnabled":case"isViewableInList":return e?o(S,{color:"primary",fontSize:"small",children:o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):null;case"restrictedValues":return e?o(z,{display:"flex",flexWrap:"wrap",children:e.map((e=>o(Re,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return o(ot,{value:e,type:n});case"values":case"defaultValues":return e?Array.isArray(e)&&n!==Ir.OBJECT&&n!==Ir.ANY?t("div",{children:["[",null==e?void 0:e.map(((e,r)=>o("div",{children:o(ot,{value:e,type:n})},r))),"]"]}):o(En,{value:e}):null;case"uiSettings":case"validationNode":return e?o(En,{value:e}):null;case"memberNodes":return e?o(ct,{node:e,defaultExpanded:!1}):null;default:return o(j,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}},at=({node:e})=>{const r=h((()=>(e&&(el(e)===Ir.ARRAY?(delete e.restrictedValues,delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return o(_e,{size:"small",children:o(Je,{children:Object.keys(tt).map((e=>e in r?t(Ze,{children:[o(We,{width:"30%",children:o(j,{children:tt[e]})}),o(We,{children:it(r[e],e,el(r))})]},e):null))})})},st=({properties:e,parentNames:r=[]})=>{const n=h((()=>{if(!e)return!1;let r=!1;return e.every((e=>e.nodeType!==Ir.OBJECT||(r=!0,!1))),r}),[e]);return t(z,{mt:4,children:[o(j,{variant:"h6",children:"Properties"}),t(or,{orientation:"vertical",style:{paddingLeft:"4px"},children:[Array.isArray(e)?e.map((e=>t(ir,{expanded:!0,children:[o(ar,{slotProps:{stepIcon:{icon:"",completed:!1,active:!0}}}),o(sr,{children:o(ct,{node:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))):null,n&&o(ir,{})]})]})};var dt=m(st);const ct=({node:e,parentNames:r=[],defaultExpanded:n=!0})=>{const[l,i]=b(!0);return g((()=>{i(n)}),[n]),e?t(ur,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff",maxHeight:"none",width:"100%"},expanded:l,onChange:()=>i((e=>!e)),children:[o(pr,{expandIcon:o(S,{children:o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:o(j,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),o(mr,{children:t(z,{width:"100%",children:[o(at,{node:e}),el(e)===Ir.OBJECT&&o(dt,{properties:Kn(e).properties,parentNames:[...r,e.name]})]})})]}):null},ut=Object.values(Pr).sort(((e,r)=>e.localeCompare(r))),pt=({nodeFieldName:e,control:r})=>t(i,{children:[o(Fe,{children:o(tl,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),o(Fe,{children:o(Xr,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Pr.HALF_UP,options:ut})})]}),mt=({setValue:e,nodeFieldName:r,control:n,defaultValue:l=""})=>(g((()=>{l&&e(`${r}.format`,l)}),[l,e,r]),o(Fe,{children:o(Gr,{required:!0,control:n,defaultValue:l,name:`${r}.format`,label:"Format"})})),ht={key:"",nodeType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},gt=({setValue:e,control:r,parentNodeFieldName:n,entityDefinition:l=!1,globalParameter:a=!1,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const c=L({control:r,name:`${n}.memberNodes`});return t(i,{children:[o(j,{variant:"h6",children:"Member Nodes"}),c?t(z,{p:4,border:"1px solid rgba(0, 0, 0, 0.23)",borderRadius:3,my:2,children:[o(It,{setValue:e,control:r,nodeFieldName:`${n}.memberNodes`,entityDefinition:l,globalParameter:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(M,{sx:{marginTop:4},variant:"contained",size:"small",color:"primary",onClick:()=>e(`${n}.memberNodes`,null),children:"Delete"})]}):o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>e(`${n}.memberNodes`,ht),sx:{margin:"8px 0"},children:"Add node"})]})},ft=({entityDefinition:e,globalParameter:r,customPropertyFields:n,index:l,watch:i,arrLength:a,entityReferenceValueComponent:s,control:d,setValue:c,fileReferenceValueComponent:u,handleRemoveParameter:p,error:m,item:h,extRefs:g,rootNode:f})=>{const[v,C]=b(l===a&&!h.key);return o(Fe,{size:12,ref:e=>g.current[l]=e,children:t(ur,{expanded:v,onChange:()=>C(!v),elevation:3,children:[o(pr,{expandIcon:o(gr,{}),children:o(j,{color:m&&m[l]?"secondary":"initial",style:{wordBreak:"break-word"},children:h.name||`Property ${l+1}`})}),o(mr,{children:v&&o(It,{isObjectProperty:!0,control:d,setValue:c,nodeFieldName:`properties.${l}`,entityDefinition:e,globalParameter:r,customPropertyFields:n,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),!f&&o(hr,{children:o(M,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(l),children:"Remove"})})]})})},bt={propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},vt=y((({properties:e,hideAddButton:r,focusOnIndex:n,required:l,entityDefinition:a=!1,globalParameter:s=!1,customPropertyFields:d=[],parentRemove:c,entityReferenceValueComponent:u,fileReferenceValueComponent:p,rootNode:m},h)=>{var b;const{clearErrors:C,control:y,setValue:E,getValues:O,reset:w,trigger:L,watch:T}=F({mode:"all",defaultValues:{properties:e}}),{fields:k,append:S,remove:A}=R({control:y,name:"properties"}),{fieldState:{error:N}}=V({control:y,name:"properties",defaultValue:null,rules:{validate:e=>!l||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=f([]),I=v((()=>{S(bt),C("properties")}),[S,C]),P=v((e=>{c&&c(e),A(e)}),[c,A]);return g((()=>{"number"==typeof n&&D.current[n]&&D.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,D]),g((()=>{var r;(null==e?void 0:e.length)&&!(null===(r=O("properties"))||void 0===r?void 0:r.length)&&w({properties:e})}),[e,O,w]),x(h,(()=>({getProperties:()=>O("properties"),addProperty:I,removeProperty:P,trigger:L})),[O,I,P,L]),t(i,{children:[N&&N.message&&o(Fe,{size:12,children:o(j,{color:"secondary",children:N.message})}),Array.isArray(k)&&k.map(((e,r,n)=>o(ft,{item:e,index:r,arrLength:n.length-1,control:y,watch:T,setValue:E,customPropertyFields:d,entityDefinition:a,globalParameter:s,error:N,rootNode:m,handleRemoveParameter:P,fileReferenceValueComponent:p,entityReferenceValueComponent:u,extRefs:D},e.id))),!r&&t(Fe,{size:12,children:[o(M,{variant:"contained",size:"small",color:"primary",onClick:I,children:"Add property"}),N&&o(J,{error:!0,children:null===(b=N.root)||void 0===b?void 0:b.message})]})]})})),Ct=({properties:e=[]})=>{const r=h((()=>Array.isArray(e)?e.map((e=>{const r=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[t("b",{children:[e.name,e.isRequired&&"*"]}),""+(e.key?" | "+e.key:"")]}),o("span",{children:r})]}),content:r===Ir.OBJECT&&Array.isArray(e.properties)?o(Ct,{properties:e.properties}):(null==e?void 0:e.memberNodes)&&o(Ct,{properties:e.memberNodes.properties})}})):[]),[e]);return o($l,{data:r})},yt={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},xt=({control:e,parentNodeFieldName:r,entityDefinition:n=!1,globalParameter:l=!1,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const d=f(null),{field:{onChange:c}}=V({control:e,name:`${r}.properties`,defaultValue:null}),u=L({control:e,name:`${r}.properties`,defaultValue:null}),p=L({control:e,name:`${r}.name`}),m=v((e=>{c((null==u?void 0:u.length)?[...u,e]:[e])}),[u,c]),h=v((e=>{c(u.filter(((r,n)=>e!==n)))}),[u,c]),g=Zr(),[C,y]=b(0),x=v((()=>{if((null==u?void 0:u.length)>0){m(yt);const e=u.length;y(e)}else m(yt);d.current.addProperty(),c(d.current.getProperties())}),[u,c,m]),E=()=>s(void 0,void 0,void 0,(function*(){(yield d.current.trigger())&&(c(d.current.getProperties()),g.onClose())}));return t(Fe,{container:!0,spacing:2,direction:"column",children:[o(Fe,{children:o(j,{variant:"h6",children:"Properties"})}),o(Fe,{children:o(Ct,{properties:u})}),o(Fe,{children:o(M,{variant:"contained",color:"primary",onClick:g.onOpen,children:"Edit properties"})}),t(D,{disableEscapeKeyDown:!0,open:g.open,onClose:E,fullWidth:!0,maxWidth:"md",children:[t(B,{children:[p||"Entity"," Properties"]}),o(P,{style:{height:"500px",overflow:"hidden"},children:t(Fe,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[t(Fe,{size:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[o(or,{nonLinear:!0,activeStep:C,orientation:"vertical",style:{paddingLeft:"4px"},children:Array.isArray(u)&&(null==u?void 0:u.map(((e,r)=>t(ir,{onClick:()=>(e=>y(e))(r),style:{cursor:"pointer"},children:[o(ar,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),o(sr,{})]},r))))}),o(M,{variant:"contained",size:"small",color:"primary",onClick:x,sx:{marginTop:2},children:"Add property"})]}),o(Fe,{size:9,style:{height:"100%",overflowY:"auto"},children:o(Fe,{container:!0,direction:"column",spacing:2,children:o(vt,{ref:d,properties:u,hideAddButton:!0,parentRemove:h,focusOnIndex:C,entityDefinition:n,globalParameter:l,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})})]})}),o(I,{children:o(M,{variant:"contained",color:"primary",onClick:E,children:"Ok"})})]})]})},Et=({propertyFieldName:e,control:r})=>t(i,{children:[o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]}),Ot=({setValue:e,control:r,nodeType:n,nodeFieldName:l,entityDefinition:a=!1,globalParameter:s=!1,fileReferenceValueComponent:d,entityReferenceValueComponent:c})=>{switch(n){case Ir.STRING:return t(i,{children:[o(j,{variant:"h6",mb:1,children:"Restricted Values"}),o(pl,{name:`${l}.restrictedValues`,control:r})]});case Ir.BIG_DECIMAL:return o(pt,{nodeFieldName:l,control:r});case Ir.DATE:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:_r});case Ir.TIME:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:Jr});case Ir.DATE_TIME:return o(mt,{setValue:e,control:r,nodeFieldName:l,defaultValue:Wr});case Ir.ENTITY_REFERENCE:return o(Et,{control:r,propertyFieldName:l});case Ir.OBJECT:return o(xt,{control:r,parentNodeFieldName:l,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});case Ir.ARRAY:return o(gt,{setValue:e,control:r,parentNodeFieldName:l,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});default:return null}},wt=({control:e,nodeFieldName:r,name:n,label:l="",required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const s=L({control:e,name:`${r}.nodeType`}),d=L({control:e,name:`${r}.format`}),c=L({control:e,name:`${r}.restrictedValues`}),u=L({control:e,name:`${r}.properties`}),p=L({control:e,name:`${r}.isRequired`}),m=h((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:l,isRequired:null!=t?t:p},!!d&&{format:d}),{restrictedValues:c}),!!u&&{properties:u}),{nodeType:"string"==typeof s?s:s.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[s,d,c,l,p,u,t]);return o(br,{dateAdapter:fr,children:"ARRAY"===m.nodeType?o(lt,{control:e,name:n,node:m,title:l,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a}):o(Jl,{control:e,name:n,node:m,title:l,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})},Vt=({name:e,control:r,setValue:n})=>{const l=h((()=>({type:""})),[]),{fields:i,append:a,remove:s}=R({control:r,name:e});return t(z,{mt:2,children:[o(M,{variant:"outlined",size:"small",onClick:()=>a(l),children:"Add node"}),i.map((({id:l},t)=>o(Nt,{setValue:n,control:r,removeHandle:()=>s(t),name:`${e}.${t}`},l)))]})},Lt=E(""),Tt=({name:e,control:r})=>t(i,{children:[o(j,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Gr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),kt=({name:e,control:r})=>t(i,{children:[o(j,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Gr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),o(z,{mt:2,children:o(Gr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),t(z,{mt:2,children:[o(Qr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),o(Qr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),Rt=["STRING_REGEX","JSON_SCHEMA"],Ft=new Set([Ir.INTEGER,Ir.FLOAT,Ir.DOUBLE,Ir.BIG_DECIMAL,Ir.BIG_INTEGER,Ir.LONG]),St=({name:e,control:r,setValue:n})=>{const l=O(Lt),a=L({control:r,name:`${e}.type`}),s=h((()=>{if("STRING_REGEX"===a)return o(Gr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case l===Ir.STRING:return o(Tt,{name:`${e}.node`,control:r});case Ft.has(l):return o(kt,{name:`${e}.node`,control:r});case l===Ir.OBJECT:case l===Ir.ARRAY:return o(nl,{label:"Properties",control:r,name:`${e}.node.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+l}return null}),[l,a,r,e]);return g((()=>{Ft.has(l)&&"JSON_SCHEMA"===a&&(n(`${e}.node.exclusiveMinimum`,!1),n(`${e}.node.exclusiveMaximum`,!1))}),[l,a,n,e]),o($l,{data:[{label:"Validator",content:t(i,{children:[o(z,{children:o(Xr,{control:r,name:`${e}.type`,label:"Type",options:Rt,onChange:r=>{n(e,{type:r.target.value})}})}),o(z,{mt:2,children:s})]})}]})},At=["AND","OR","NOT","NODE"],Nt=({name:e,removeHandle:r,control:n,setValue:l})=>{const a=O(Lt),s=f(a),d=L({control:n,name:`${e}.type`}),c=h((()=>({AND:o(Vt,{name:`${e}.nodes`,control:n,setValue:l}),OR:o(Vt,{name:`${e}.nodes`,control:n,setValue:l}),NODE:o(St,{name:`${e}.validator`,control:n,setValue:l}),NOT:o(Nt,{name:`${e}.node`,control:n,setValue:l})})),[e,n,l]),u=v((r=>{l(e,{type:r.target.value})}),[]);return g((()=>{d&&s.current!==a&&(s.current=a,l(e,{type:""}))}),[l,a,s.current,d,e]),o($l,{data:[{label:"Node Type",content:t(i,{children:[t(z,{display:"flex",alignItems:"flex-start",children:[o(Xr,{required:!0,onChange:u,control:n,name:`${e}.type`,label:"Type",options:At}),r&&o(z,{ml:2,mt:6,children:o(A,{onClick:r,children:o(tr,{})})})]}),o(z,{children:c[d]})]})}]})},Mt=({name:e,control:r,setValue:n,enable:l})=>{const[a,s]=b(!1),d=v((r=>{s(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return g((()=>{l&&!a&&s(!0)}),[l,a]),t(i,{children:[t(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o(j,{component:"h6",color:"initial",style:{wordBreak:"break-word",fontSize:18},children:"Validator"}),o(_,{label:"Enable",control:o(W,{color:"primary",checked:l,onChange:d})})]}),a&&o(Nt,{name:e,control:r,setValue:n})]})},Dt=Object.values(Ir).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),It=m((({setValue:e,control:r,nodeFieldName:n,entityDefinition:l=!1,globalParameter:a=!1,customPropertyFields:s=[],fileReferenceValueComponent:d,isObjectProperty:c,isObjectNode:u})=>{var p,m;const f=L({control:r,name:`${n}.nodeType`}),b=L({control:r,name:`${n}.isRequired`}),C=L({control:r,name:`${n}.validationNode`}),{customCheckboxes:y,validateKey:x}={customCheckboxes:h((()=>E.length?E.filter((e=>"checkbox"===e.type)):[]),[E=s]),customFields:h((()=>E.length?E.filter((e=>"checkbox"!==e.type)):[]),[E]),validateKey:v((e=>{const r=[...new Set(e.replace(/[a-zA-Z0-9]/g,"").replaceAll("_","").split(""))];return!((null==r?void 0:r.length)>0)||"Delete invalid characters: "+r.join(", ").replace(", ,",",")}),[])};var E;const O=h((()=>a?"Value":"Default Value"),[a]);g((()=>{f&&"string"==typeof f&&!u?e(`${n}.nodeType`,Dt.find((e=>e.value===f))):u&&e(`${n}.nodeType`,Dt.find((e=>e.value===Ir.OBJECT)))}),[f,e,n,u]);const w=h((()=>{let e=Dt;return a&&(e=Dt.filter((e=>e.value!==Ir.ANY))),e}),[a]),V=!a||(null!==(p=null==f?void 0:f.value)&&void 0!==p?p:f)!==Ir.OBJECT;return t(Fe,{container:!0,direction:"column",spacing:2,children:[c&&o(Fe,{children:o(Gr,{required:!0,control:r,name:`${n}.key`,label:"Key",validate:x})}),o(Fe,{children:o(Gr,{required:!0,control:r,name:`${n}.name`,label:"Name"})}),o(Fe,{children:o(an,{required:!0,control:r,name:`${n}.nodeType`,label:"Type",options:w,disabled:u,onChange:(r,l)=>{const t=`${n}.nodeType`;e(`${n}.${a?"value":"defaultValue"}`,null),e(t,l)}})}),o(Fe,{children:o(tl,{required:!0,control:r,name:`${n}.sortOrder`,label:"Sort Order"})}),o(Fe,{children:o(nl,{control:r,name:`${n}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),t(Fe,{children:[o(Qr,{control:r,name:`${n}.isEnabled`,label:"Enabled"}),o(Qr,{control:r,name:`${n}.isRequired`,label:"Required"}),l&&o(Qr,{control:r,name:`${n}.isViewableInList`,label:"Is viewable in list"}),y.length?o(i,{children:y.map(((e,l)=>o(Qr,{control:r,name:`${n}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},l)))}):null]}),f&&t(i,{children:[o(Fe,{children:o(Lt.Provider,{value:null!==(m=f.value)&&void 0!==m?m:f,children:o(Mt,{control:r,setValue:e,enable:C,name:`${n}.validationNode`})})}),o(Fe,{children:o(Ot,{setValue:e,control:r,nodeType:"string"==typeof f?f:f.value,nodeFieldName:n,globalParameter:a,entityDefinition:l,fileReferenceValueComponent:d})}),V&&o(Fe,{children:o(wt,{control:r,nodeFieldName:n,name:`${n}.${a?"value":"defaultValue"}`,label:O,required:!!a&&b,fileReferenceValueComponent:d})})]})]})})),Pt=y((({node:e,entityDefinition:r=!1,globalParameter:n=!1,customPropertyFields:l=[],entityReferenceValueComponent:i,fileReferenceValueComponent:a,isObjectNode:s},d)=>{const{control:c,setValue:u,trigger:p,getValues:m,watch:h,reset:f}=F({mode:"all",defaultValues:{node:e}});return x(d,(()=>({getValues:()=>m("node"),trigger:p})),[m,p]),g((()=>{e&&f({node:e})}),[e,f]),t(z,{mt:2,children:[o(j,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(It,{control:c,setValue:u,nodeFieldName:"node",isObjectNode:s,entityDefinition:r,globalParameter:n,customPropertyFields:l,entityReferenceValueComponent:i,fileReferenceValueComponent:a})]})})),qt=({control:e,parentFieldName:r,required:n,entityDefinition:l=!1,globalParameter:i=!1,customPropertyFields:a=[],entityReferenceValueComponent:s,fileReferenceValueComponent:d,isObjectNode:c})=>{const u=h((()=>r?`${r}.node`:"node"),[r]),{setValue:p,watch:m}=k(),{fieldState:{error:g}}=V({control:e,name:u,rules:{validate:e=>!n||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}});return t(z,{mt:2,children:[g&&g.message&&o(Fe,{size:12,children:o(j,{color:"secondary",children:g.message})}),o(j,{component:"h6",color:"initial",mb:3,sx:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(It,{control:e,setValue:p,isObjectNode:c,nodeFieldName:u,entityDefinition:l,globalParameter:i,customPropertyFields:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})]})},Bt=y((({control:e,definitionFieldName:r,isObjectNode:n,title:l,hideCodeField:i,hideVersionField:a,hideNameField:s,required:d=!1,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=k(),g=h(r?`${r}.node`:"node");return t(Fe,{container:!0,direction:"column",spacing:2,children:[l&&o(Fe,{size:12,children:o(z,{my:2,children:o(j,{variant:"h6",children:l})})}),!s&&o(Fe,{size:12,children:o(Gr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!i&&o(Fe,{size:12,children:o(Gr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!a&&o(Fe,{size:12,children:o(tl,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),o(Fe,{size:12,children:p?o(Pt,{node:g,ref:p,isObjectNode:n,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):o(qt,{control:e,required:d,isObjectNode:n,parentFieldName:r,entityReferenceValueComponent:c,fileReferenceValueComponent:u})})]})})),zt=({node:e,data:r})=>{const{name:n}=e,l=v(((e,r)=>{const n=e,l=document.createElement("a");document.body.appendChild(l),l.href=n,l.target="_self",l.download=r,l.click()}),[]);return o(M,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>l(r,n),children:"Download File"})},jt=({node:e,data:r})=>{var n;const l=e=>o(z,{sx:{borderRadius:"4px",padding:"4px",wordBreak:"auto-phrase"},children:Or(e)?"null":cr(e)?JSON.stringify(e,null,2):e.toString()});switch(el(e)){case Ir.ARRAY:return Array.isArray(r)?o("div",{children:null==r?void 0:r.map(((r,n)=>o(jt,{node:e.memberNodes,data:cr(r)?r:r+","},n)))}):l(r);case Ir.OBJECT:return Array.isArray(e.properties)&&(null===(n=e.properties)||void 0===n?void 0:n.length)?o(Ht,{node:e,data:r}):"object"==typeof r?o(En,{value:r}):l(r);case Ir.ANY:return"object"==typeof r?o(En,{value:r}):l(r);case Ir.FILE_REFERENCE:return null===r?l(r):o(M,{component:oe,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case Ir.FILE:return Or(r)?l(r):"string"==typeof r?o(zt,{data:r,node:e}):l(r);default:return l(r)}},$t=({node:e,data:r,hasBackground:n=!1})=>o(z,{sx:{backgroundColor:n?"#f1f1f1":"none"},children:o(jt,{node:e,data:r})}),Ht=({node:e,data:r})=>{const n=v(((e,r)=>{var l;if(e&&r){console.log(e,r);const i=e.key?r[e.key]:r,a=el(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("span",{children:[t("b",{children:[e.name,e.isRequired&&"*"]}),""+(e.key?" | "+e.key:"")]}),o("span",{children:a})]}),content:a===Ir.OBJECT&&Array.isArray(e.properties)&&(null===(l=e.properties)||void 0===l?void 0:l.length)?e.properties.map((e=>n(e,i))):o($t,{node:e,data:i})}}return null}),[]);return o(Fe,{container:!0,direction:"column",spacing:2,children:o($l,{data:[n(e,r)]})})},_t=({properties:e,parentKey:r="",activePath:n="",prefix:l="",onClick:i})=>o(or,{orientation:"vertical",onClick:e=>e.stopPropagation(),children:e&&e.map((e=>{var a;const s=r?`${r}.${e.key}`:e.key,d=null!==(a=e.nodeType.value)&&void 0!==a?a:e.nodeType;return t(ir,{expanded:!0,onClick:()=>{return e=s,void i(l?`${l}.${e}`:e);var e},children:[o(ar,{slotProps:{stepIcon:{icon:"",completed:!1,active:n===s}},children:t(z,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),o(sr,{children:o("div",{children:d===Ir.OBJECT&&o(_t,{onClick:i,activePath:n,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))}),Jt=({open:e=!1,onClose:r,onPaste:n,properties:l})=>{const[i,a]=b("");return t(D,{open:e,onClose:r,fullWidth:!0,maxWidth:"md",children:[o(B,{children:"JSON path picker"}),t(P,{children:[(null==l?void 0:l.length)?l.map(((e,r)=>t("div",{children:[o(j,{variant:"h6",children:e.title}),o(_t,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:i})]},r))):o(j,{children:"Please, add properties"}),i&&t(j,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",i,")"]})]}),t(I,{children:[o(M,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${i})`),wr.success("Copied!")},children:"Copy"}),o(M,{variant:"contained",color:"primary",onClick:()=>{n(`$(${i})`),wr.success("Pasted!")},children:"Paste"}),o(M,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},Wt=E({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Gt=()=>O(Wt),Yt=({children:e})=>{const[r,n]=b("true"===localStorage.getItem("sidebar_collapsed")),l=v((()=>{n(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),t=v(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return o(Wt.Provider,{value:{collapsed:r,toggleCollapse:l,toggleRootElementLink:t},children:e})},Zt=Oe("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Kt=Oe(Lr)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out",zIndex:999,"& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),Ut=Oe(Sr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Xt=Oe(Tr)((e=>({padding:e.theme.spacing(3),margin:0}))),Qt=Oe(yr)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),eo=Oe(Rr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),ro=Oe(kr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),no=Oe(Q)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),lo=Oe(Fr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),to=Oe(Tr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),oo=Oe(Ar)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:1e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}}))),io=({route:e,isActive:r,isSubmenu:n})=>{const{collapsed:l}=Gt(),[a,s]=p.useState(null),d=Boolean(a),c=e=>{s(e.currentTarget)},u=()=>{s(null)},m=v((({children:r})=>l&&!n?o(ne,{title:e.name,placement:"right",children:r}):r),[l,e,n]);return e.link?o(Qt,{disablePadding:!0,component:oe,replace:!0,to:{pathname:e.link,search:e.query},children:o(m,{children:t(eo,{className:Ee({active:r,main:e.main,collapsed:l}),children:[e.icon&&o(ro,{className:Ee({collapsed:l}),children:e.icon}),o(lo,{primary:e.name,className:Ee({collapsed:l,main:e.main}),sx:l&&!n?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}})]})})}):e.children&&l?t(i,{children:[o(no,{className:"collapsed",children:o(ne,{title:e.name,placement:"right",children:o(eo,{className:Ee({active:r,main:e.main,collapsed:l}),sx:{justifyContent:"center"},onClick:c,children:e.name.substring(0,1)})})}),o(Qe,{open:d,anchorEl:a,onClose:u,MenuListProps:{sx:{bgcolor:"secondary.main"}},slotProps:{paper:{sx:{width:300,maxHeight:440}}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.children.map(((e,r)=>o(uo,{route:e,isSubmenu:!0},r)))})]}):o(no,{children:e.name})};var ao="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";const so=({route:e,isActive:r,isListOpen:n,handleClick:l,isSubmenu:i})=>o(no,{children:o(Xt,{sx:{padding:0,margin:0},children:o(Qt,{disablePadding:!0,onClick:l,children:t(eo,{className:Ee({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[o(lo,{primary:e.name,className:Ee({main:e.main}),sx:i?{}:{display:"none"}}),e.name,o(z,{component:"img",src:ao,mr:3,sx:{transition:"transform .3s",transform:`rotate(${n?0:"-90deg"})`}})]})})})});function co({route:e,isActive:r,isListOpen:n,handleClick:l,isSubmenu:i}){const{collapsed:a}=Gt();return(null==e?void 0:e.link)?o(Qt,{disablePadding:!0,onClick:l,children:t(eo,{className:Ee({active:r,main:e.main,collapsed:a}),children:[e.icon&&o(ro,{children:e.icon}),o(lo,{primary:e.name,className:Ee({collapsed:a,main:e.main}),sx:a&&!i?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}}),o(z,{component:"img",src:ao,mr:3,sx:{transition:"transform .3s",transform:`rotate(${n?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?o(so,{route:e,handleClick:l,isListOpen:n}):o(no,{children:e.name})}const uo=({route:e,isSubmenu:r})=>{var n,l,a;const s=te(),{collapsed:d,toggleRootElementLink:c}=Gt(),[u,p]=b(!1),[m,f]=b("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),C=h((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),y=v((()=>{e&&e.rootLink&&(c(e.name,m),f(!m))}),[m,e,c]);return g((()=>{p(C)}),[C]),(null==e?void 0:e.rootLink)&&(null===(n=e.children)||void 0===n?void 0:n.length)&&(!d||d&&r)?t(i,{children:[o(co,{route:e,isActive:C,handleClick:y,isListOpen:m,isSubmenu:r}),o(Nr,{in:!m,timeout:"auto",children:o(to,{children:e.children.map((e=>o(uo,{route:e,isSubmenu:r},e.name)))})})]}):(null===(l=e.children)||void 0===l?void 0:l.length)&&(!d||d&&r)?t(i,{children:[o(co,{route:e,isActive:C,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),o(Nr,{in:u||!e.link,timeout:"auto",children:o(to,{children:null===(a=e.children)||void 0===a?void 0:a.map(((e,n)=>o(uo,{route:e,isSubmenu:r},e.name)))})})]}):o(io,{route:e,isActive:C,isSubmenu:r})};const po=({title:e,routes:r,id:n,logo:l,collapsedLogo:i,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=Gt();return t(Zt,{children:[o(oo,{className:Ee("button-collapse",{collapsed:d}),onClick:c,children:o("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})}),t(Kt,{variant:"permanent",anchor:"left",className:Ee({collapsed:d}),id:n,children:[(!!e||!!l)&&o(Ut,{className:Ee({collapsed:d}),"data-title":e.substring(0,1),children:t(z,{display:"flex",flexDirection:"column",children:[!!e&&o(z,{component:"span",children:e}),!!l&&o(z,{component:"img",src:d?i:l,alt:"Lending Hub KZ"})]})}),t(z,{height:""+(l||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[o(Xt,{sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}},children:r.map((e=>o(uo,{route:e},e.name)))}),a&&o(z,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})},mo=({routes:e,theme:r=Bn,title:n="",id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>t(l,{theme:r,children:[o(Vr,{}),o(Yt,{children:o(po,{title:n,routes:e,id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),ho=({src:e,alt:r})=>o(z,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:o("img",{src:e,alt:r})}),go=({children:e,toolbar:r,contentSx:n,sx:l})=>t(z,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},l),children:[o(Sr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),o(z,{sx:Object.assign(Object.assign({},n),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:o(w,{fallback:o(qr,{}),children:null!=e?e:o(ae,{})})})]}),fo=Oe(oe)((()=>({textDecoration:"none",color:"inherit"}))),bo=({crumbs:e})=>o(Mr,{separator:o(Dr,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?o(fo,{to:e.link,className:"breadcrumb",children:e.title},r):o(j,{className:"breadcrumb",children:e.title},r)))});export{Br as AlertDialog,Yl as ArrayNodeFormBuilder,lt as ArrayNodeFormBuilderControl,un as BackButton,bo as Breadcrumbs,go as ContentLayout,pl as ControlArrayInput,an as ControlAutocomplete,Qr as ControlCheckbox,nl as ControlCodeEditor,sl as ControlDate,cl as ControlDateTime,Kr as ControlDebouncedInput,Gr as ControlInput,tl as ControlNumberInput,ml as ControlPeriodInput,gl as ControlPhoneInput,dn as ControlQueryAutocomplete,en as ControlRadio,Xr as ControlSelect,ol as ControlSwitch,ul as ControlTime,cn as CopyButton,Bt as CreateDefinition,Pt as CreateNode,qt as CreateNodeWithContext,_r as DATE_DEFAULT_FORMAT,Wr as DATE_TIME_DEFAULT_FORMAT,Hr as DEFAULT_DATE_VALIDATION_ERROR_TEXT,ll as DEFAULT_ERROR_TEXT,$r as DEFAULT_REQUIRED_ERROR_TEXT,Zl as DefinitionFiller,Ht as DefinitionView,ql as InfoItem,On as JsonModalView,Jt as JsonPathPicker,En as JsonView,qr as Loader,ho as MenuIcon,rt as NodeFormBuilderContext,Jl as NodeFormBuilderControl,Ir as NodeType,vt as ObjectNodeProperties,st as ObjectNodeView,Cn as OverflowTip,Ur as PopupIconComponent,Pr as RoundingMode,Pl as RouteTabs,mo as Sidebar,Ml as SimpleTable,xn as Status,$l as StepperView,Jr as TIME_DEFAULT_FORMAT,Il as TabPanel,Ll as Table,Tl as TableAction,Dl as TableActionCell,ct as ViewNode,Vn as blue,Ln as brand,hn as capitalize,Tn as dark,vn as deepParseJson,zr as defaultDefinitionArrayValue,jr as defaultDefinitionObjectValue,$n as digitsOnly,Hn as floatsOnly,Yn as formatDefinitionNodeData,zn as formatTableRowValue,Un as getDemNodeDateFormat,fn as getJsonStringValue,Qn as getMultipleNodeFillOptions,el as getNodeType,Xn as getObjectStarterValue,rl as getSingleNodeFillOptions,kn as green,_n as isExpression,Wn as isValueEmpty,Zn as nodePropertiesArrayToObject,Kn as nodePropertiesObjectToArray,Jn as numberFormat,Rn as orange,Fn as red,pn as removeArrayItem,bn as safeParseJson,gn as sortArrayOfObjects,Bn as theme,Yr as useDebounce,jn as useFullScreen,Zr as useToggle,mn as validateJson,Sn as white,An as yellow};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.11.13",
3
+ "version": "1.11.15",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,14 @@ export interface UiSettings {
56
56
  radioValues?: string[] | {
57
57
  value: string | boolean;
58
58
  label: ReactNode;
59
- }[] | NodeUnion[];
59
+ }[];
60
+ viewLabel?: string;
61
+ isRadioGroup?: boolean;
62
+ isRadioControl?: boolean;
63
+ isTab?: boolean;
64
+ isTabContainer?: boolean;
65
+ tabsLabel?: string;
66
+ name?: string;
60
67
  maxLength?: number;
61
68
  placeholder?: string;
62
69
  description?: string;
@@ -1,8 +1,8 @@
1
+ import { ReactNode } from 'react';
1
2
  import { AutocompleteProps } from '@mui/material/Autocomplete';
2
3
  import { TextFieldProps } from '@mui/material/TextField';
3
4
  import { InputProps } from '@mui/material/Input';
4
5
  import { Control } from 'react-hook-form';
5
- import { ReactNode } from 'react';
6
6
  import { ValidateFunc } from '../../../interfaces';
7
7
  /**
8
8
  * This interface is referencing the [[ControlAutocomplete]] component props.
@@ -14,7 +14,8 @@ export type ControlQueryAutocompleteProps<T> = Omit<ControlAutocompleteProps, 'o
14
14
  queryFunction: (params: PaginateParams) => Promise<PaginateData<T>>;
15
15
  itemQueryFunction?: (valueKey: string) => Promise<T>;
16
16
  requiredErrorText?: string;
17
+ queryParams?: Record<string, any>;
17
18
  renderInput?: AutocompleteProps<unknown, boolean, boolean, boolean, React.ElementType<any>>['renderInput'];
18
19
  };
19
- export declare function ControlQueryAutocomplete<T>({ name, label, control, required, searchBy, labelKey, multiple, mongoQueryJson, disabled, valueKey, sortBy, hideErrorMessage, disableCloseOnSelect, textFieldProps, onChange, queryFunction, validate, itemQueryFunction, requiredErrorText, startAdornment, endAdornment, useVirtualList, ...autocompleteProps }: ControlQueryAutocompleteProps<T>): import("react/jsx-runtime").JSX.Element;
20
+ export declare function ControlQueryAutocomplete<T>({ name, label, control, required, searchBy, labelKey, multiple, mongoQueryJson, disabled, valueKey, sortBy, hideErrorMessage, queryParams, disableCloseOnSelect, textFieldProps, onChange, queryFunction, validate, itemQueryFunction, requiredErrorText, startAdornment, endAdornment, useVirtualList, ...autocompleteProps }: ControlQueryAutocompleteProps<T>): import("react/jsx-runtime").JSX.Element;
20
21
  export default ControlQueryAutocomplete;
@@ -19,5 +19,5 @@ export type ControlPhoneInputProps = TextFieldProps & {
19
19
  * MUI `TextField` controlled component with `react-input-mask`. Used with react-hook-form
20
20
  * @category Forms
21
21
  */
22
- export declare const ControlPhoneInput: ({ control, name, label, required, mask, requiredErrorText, inputMaskProps, disabled, validate, invalidErrorText, ...textFieldProps }: ControlPhoneInputProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const ControlPhoneInput: ({ control, name, label, required, mask, requiredErrorText, inputMaskProps, disabled, validate, invalidErrorText, slotProps, ...textFieldProps }: ControlPhoneInputProps) => import("react/jsx-runtime").JSX.Element;
23
23
  export default ControlPhoneInput;