@dartech/arsenal-ui 1.11.7 → 1.11.8
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 +1 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{useTheme as e,createTheme as r,responsiveFontSizes as l,ThemeProvider as n}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 T,Controller as L,useFormContext as R,useFieldArray as k,useForm as F}from"react-hook-form";import A from"@mui/material/SvgIcon";import S 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 $ from"@mui/material/Typography";import j 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 le from"@mui/material/Tooltip";import{useNavigate as ne,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/material/Switch";import{DatePicker as pe}from"@mui/x-date-pickers/DatePicker";import{format as me,isValid as he,parse as ge,isMatch as fe,startOfTomorrow as be,endOfYesterday as ve,isToday as Ce,isAfter as ye,isBefore as xe}from"date-fns";import{DateTimePicker as Ee}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as Oe}from"@mui/x-date-pickers/TimePicker";import{renderTimeViewClock as we}from"@mui/x-date-pickers/timeViewRenderers";import Ve from"@mui/material/Chip";import Te from"@mui/material/Grid2";import{toString as Le,parse as Re}from"duration-fns";import ke from"react-input-mask";import Fe from"@mui/material/Pagination";import Ae from"@mui/material/TablePagination";import{useGridApiContext as Se,useGridSelector as Ne,gridPageSelector as Me,gridPageCountSelector as De,gridRowCountSelector as Ie,gridPageSizeSelector as Pe,DataGrid as qe,GridActionsCellItem as Be}from"@mui/x-data-grid";import{styled as ze}from"@mui/system";import $e from"@mui/material/Table";import je from"@mui/material/TableBody";import He from"@mui/material/TableCell";import _e from"@mui/material/TableContainer";import Je from"@mui/material/TableHead";import We from"@mui/material/TableRow";import Ge from"@mui/material/TableFooter";import Ye from"@mui/material/Backdrop";import Ze from"@mui/material/TableSortLabel";import Ke from"@mui/material/Menu";import Ue from"@mui/icons-material/MoreHoriz";import Xe from"@mui/material/Paper";import Qe from"@mui/material/Tab";import er from"@mui/material/Tabs";import rr from"@mui/icons-material/DeleteOutline";import lr from"@mui/material/Stepper";import nr from"@mui/material/Step";import tr from"@mui/material/StepLabel";import or from"@mui/material/StepContent";import ir from"@mui/material/StepConnector";import ar from"lodash/isPlainObject";import sr from"@mui/material/Accordion";import dr from"@mui/material/AccordionSummary";import cr from"@mui/material/AccordionDetails";import ur from"@mui/material/AccordionActions";import{ExpandMore as pr}from"@mui/icons-material";import{AdapterDateFns as mr}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as hr}from"@mui/x-date-pickers/LocalizationProvider";import gr from"@mui/material/Select";import fr from"@mui/material/InputLabel";import br from"@mui/material/ListItem";import vr from"@mui/icons-material/CheckBoxOutlineBlank";import Cr from"@mui/icons-material/CheckBox";import yr from"lodash/isNil";import xr from"classnames";import{toast as Er}from"react-toastify";import Or from"@mui/material/CssBaseline";import wr from"@mui/material/Drawer";import Vr from"@mui/material/List";import Tr from"@mui/material/ListItemIcon";import Lr from"@mui/material/ListItemButton";import Rr from"@mui/material/ListItemText";import kr from"@mui/material/Toolbar";import Fr from"@mui/material/ButtonBase";import Ar from"@mui/material/Collapse";import Sr from"@mui/material/Breadcrumbs";import Nr from"@mui/icons-material/NavigateNext";var Mr,Dr;!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"}(Mr||(Mr={})),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"}(Dr||(Dr={}));const Ir=m((function({transparent:e=.3,position:r="absolute",bgcolor:l="#fff"}){const n=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(j,{sx:{zIndex:1,position:"relative"}}),o(z,{sx:{opacity:n},position:"absolute",top:0,left:0,width:"100%",height:"100%",bgcolor:l})]})})),Pr=({open:e,title:r,description:l,closeButtonTitle:n="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(Ir,{}),t(B,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[o($,{variant:"inherit",children:r}),!g&&o(S,{sx:{padding:0,height:"28px",width:"28px"},onClick:i,children:o(A,{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:[l&&o(q,{id:"alert-dialog-description",children:l}),o(z,{maxWidth:"100%",overflow:"hidden",children:u})]}),t(I,{children:[!g&&o(M,{onClick:i,variant:"outlined",children:n}),a&&c?o(M,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))}),qr={code:"",name:"",version:0,properties:[]},Br={code:"",name:"",version:0,properties:{}},zr="Please, fill this field",$r="Incorrect date format",jr="yyyy-MM-dd",Hr="HH:mm:ss",_r="yyyy-MM-dd'T'HH:mm:ss.SSSZ",Jr=e=>{var r,l,{control:n,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:n,defaultValue:m,rules:{required:!!p&&(v||zr),validate:s}}),x=y.field,{ref:E,onChange:O,value:w}=x,T=a(x,["ref","onChange","value"]),{fieldState:{error:L}}=y;return o(d,Object.assign({},T,{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:!!L,helperText:!f&&(null==L?void 0:L.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!==(l=null===(r=null==C?void 0:C.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==l?l:{}),{value:null!=w?w:""})},onChange:b||O},C))};function Wr(e,r){const l=f();g((()=>()=>{l.current&&clearTimeout(l.current)}),[]);return(...n)=>{clearTimeout(l.current),l.current=setTimeout((()=>{e(...n)}),r)}}const Gr=()=>{const[e,r]=b(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Yr=e=>{var r,l,{control:n,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:L},fieldState:{error:R}}=V({name:c,control:n,defaultValue:m,rules:{required:!!p&&(x||zr),validate:s}}),k=T({control:n,name:c}),[F,A]=b("");g((()=>{!F&&k&&A(k)}),[F,k]);const S=Wr((e=>{L(e)}),200),N=v((e=>{A(e.target.value),S(e.target.value)}),[S]);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:!!R,helperText:!C&&(null==R?void 0:R.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!==(l=null===(r=null==O?void 0:O.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==l?l:{}),{value:null!=F?F:""})}},O))},Zr=()=>o(A,{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"})}),Kr=e=>{var r,l,n,{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 T=V({name:p,control:s,defaultValue:g,rules:{required:!!h&&(O||zr),validate:u}}),L=T.field,{ref:R,onChange:k,value:F}=L,M=a(L,["ref","onChange","value"]),{fieldState:{error:D}}=T,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):k(null)}),[k,C]);return o(d,Object.assign({},M,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:R,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||k,slotProps:{input:Object.assign({endAdornment:!h&&F?o(N,{position:"end",sx:{mr:0},children:o(S,{onClick:q,size:"small",children:o(A,{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!==(n=null===(l=null==w?void 0:w.slotProps)||void 0===l?void 0:l.htmlInput)&&void 0!==n?n:{}),{value:null!=F?F:""})}},w,{children:E.map(((e,r)=>o(c,{value:I(e),children:P(e)},r)))}))},Ur=e=>{var{control:r,validate:l,name:n="",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:n,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:n,ref:b,disabled:c,color:"secondary"},m)),label:i}),!u&&(null==x?void 0:x.message)&&o(J,{variant:"standard",children:x.message})]})},Xr=({name:e,label:r,values:l=[],control:n,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:n,defaultValue:s,rules:{required:!!i&&(b||zr),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]),T=v((e=>"string"==typeof e?e:u?e[u]:e.label),[u]),L=v((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),R=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||R,children:l.map(((e,r)=>o(_,{value:w(e),control:o(G,Object.assign({},f,{checked:L(w(e))})),label:T(e)},r)))})),!c&&(null==O?void 0:O.message)&&o(J,{variant:"standard",children:O.message})]})},Qr=({valueKey:e,labelKey:r})=>{const l=v(((r,l)=>{if(r&&l){if("string"==typeof r)return r===l;if(e)return U(r,e)===U(l,e)||U(r,e)===l;if(r.value)return r.value===l.value||r.value===l}return!1}),[e]),n=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}),n(r))),[n]);return{isOptionEqualToValue:l,getOptionLabel:n,renderOption:t}},el=u.createContext({}),rl=u.forwardRef(((e,r)=>{const l=u.useContext(el);return o("div",Object.assign({ref:r},e,l))}));function ll(e){const{data:r,index:l,style:n}=e,t=r[l],i=Object.assign(Object.assign({},n),{top:n.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($,Object.assign({component:"li"},d,{noWrap:!0,style:i,children:t}),s)}const nl=u.forwardRef((function(r,l){const{children:n}=r,t=a(r,["children"]),i=[];n.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:l,children:o(el.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:rl,innerElementType:"ul",itemSize:e=>m(i[e]),overscanCount:5,itemCount:c,children:ll})})})})),tl=e=>{var{control:r,validate:l,name:n="",label:s="",required:c=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:m=!1,onChange:h,labelKey:f,valueKey:v,options:C=[],multiple:y,textFieldProps:x={},disableCloseOnSelect:E,useStringValue:O,requiredErrorText:w="",startAdornment:T,endAdornment:L,useVirtualList:R}=e,k=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:n,control:r,defaultValue:u||(y?[]:null),rules:{required:!!c&&(w||zr),validate:l}}),A=F.field,{ref:S,onChange:N,value:M}=A,D=a(A,["ref","onChange","value"]),{fieldState:{error:I}}=F,[P,q]=b(),{getOptionLabel:B,isOptionEqualToValue:z,renderOption:$}=Qr({valueKey:v,labelKey:f});return g((()=>{"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:R,getOptionLabel:B,isOptionEqualToValue:z,disableCloseOnSelect:E||y,filterSelectedOptions:y,onChange:h||((e,r)=>{N(O&&v?U(r,v):r),q(r)}),renderOption:$,slotProps:{listbox:{component:R?nl:null}},renderInput:e=>o(d,Object.assign({},e,{variant:"outlined",name:n,label:c?t(i,{children:[s," ",o("span",{children:"*"})]}):s,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==k?void 0:k.placeholder,error:!!I,inputRef:S,helperText:!m&&(null==I?void 0:I.message),slotProps:{input:Object.assign(Object.assign({},e.InputProps),{startAdornment:T||e.InputProps.startAdornment,endAdornment:L||e.InputProps.endAdornment}),formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==k?void 0:k.placeholder)}}},x))},k))};const ol=()=>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 il(e){var{name:r,label:l,control:n,required:s=!1,searchBy:c,labelKey:u,multiple:m=!1,mongoQueryJson:f,disabled:C,valueKey:y,sortBy:x="",hideErrorMessage:E,disableCloseOnSelect:O,textFieldProps:w,onChange:T,queryFunction:L,validate:R,itemQueryFunction:k,requiredErrorText:F="",startAdornment:A,endAdornment:S,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:n,name:r,defaultValue:m?[]:null,rules:{required:!!s&&(F||zr),validate:R}}),P=I.field,{ref:q,onChange:B,value:z}=P,$=a(P,["ref","onChange","value"]),{fieldState:{error:H,isDirty:_}}=I,{getOptionLabel:J,isOptionEqualToValue:W,renderOption:G}=Qr({valueKey:y,labelKey:u}),[Y,Z]=b([]),[X,Q]=b(!1),[ee,le]=b(""),[ne,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,ne],queryFn:({pageParam:e})=>L(Object.assign({page:`${e}`,size:"20",sort:x},ne?{[c]:ne}:{})),getNextPageParam:(e,r,l)=>e.totalPages&&e.totalPages!==l+1?l+1:null}),ue=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>ue(e,r)));{const l={};for(const n in e)l[n]=ue(e[n],r);return l}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},pe=Wr((e=>{if(f){const r=ue(f,e);te(JSON.stringify(r))}else te(e)}),500),me=v(((e,r)=>{Z([]),le(r),pe(r)}),[pe]),he=v(((e,r,...l)=>{B(r),T&&T(e,r,...l)}),[B,T]);g((()=>{(null==ie?void 0:ie.pages)&&Z(ne?ie.pages[0].collection:ie.pages.reduce(((e,r)=>(e.push(...r.collection),e)),[]))}),[ie,ne]),g((()=>{if(!_&&z&&k){let e=z;"object"==typeof z&&y in z&&(e=U(z,y)),k(e).then((e=>{B(e),le(U(e,u))})).catch(console.error)}}),[z,_,y,u,k,B]);const ge=v((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&de&&!se&&ce()}),[de,se,ce]);return o(K,Object.assign({},$,{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(ol,{}),slotProps:{listbox:{component:M?nl:null,onScroll:ge}},renderInput:e=>o(d,Object.assign({},e,{label:s?t(i,{children:[l," ",o("span",{children:"*"})]}):l,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:S||t(p.Fragment,{children:[ae?o(N,{position:"end",children:o(j,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:A||e.InputProps.startAdornment})}},w))},D))}const al=({copyText:e,helpText:r="Copy"})=>{const[l,n]=b(r);return l?o(le,{title:l,placement:"top",children:o(S,{onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)},children:o(A,{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},sl=({text:e,buttonProps:r={}})=>{const l=ne(),{state:n}=te(),t=h((()=>null==n?void 0:n.from),[n]),i=v((()=>{l(t||-1)}),[l,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(S,{onClick:i,children:o(A,{children:o("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},dl=y(((e,r)=>{var{control:l,name:n,mode:s="json",label:d,width:c="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:g=!1,hideErrorMessage:f=!1,fontSize:b=16,validate:C=!0,parseValue:y,requiredErrorText:x="",useCleanValue:E}=e,O=a(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const w=V({control:l,name:n,rules:{required:!!m&&(x||zr),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=w.field,{onChange:L,value:R,ref:k}=T,F=a(T,["onChange","value","ref"]),{fieldState:{error:A}}=w,S=h((()=>({json:[de.json()],javascript:[de.javascript()],python:[de.python()]})),[]);console.log("mode",s);const N=h((()=>"text"===s&&"string"!=typeof R?(console.log("first case",R),JSON.stringify(R,null,2)):"json"===s&&"string"!=typeof R?(console.log("second case",R),null===R?"":E?JSON.stringify(R,null,2).replace(/\\"/g,""):JSON.stringify(R,null,2)):"string"==typeof R&&"text"!==s?(console.log("third case",R),E?R.replace(/\\"/g,""):R):(console.log("default case",R),R)),[R,E,s]),M=v((e=>{if(y)try{const r=JSON.parse(e);L(r)}catch(r){L(e)}else L(e)}),[L,y]);return t(z,{display:"flex",flexDirection:"column",width:"100%",children:[o(z,{children:d&&o($,{variant:"subtitle1",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({},F,{ref:r||k,basicSetup:{autocompletion:!0,history:!0},theme:ce,width:c,height:u,style:{fontSize:b,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:N,onChange:M,extensions:"text"===s?[]:S[s]},O)),A&&!f&&o(J,{variant:"standard",error:!0,children:A.message})]})]})})),cl=new RegExp("^[-+]?[0-9]+$"),ul=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),pl=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const l of e)if(pl(l,r))return!0;if("object"==typeof e)for(const l in e)if(pl(e[l],r))return!0}return!1},ml=new Intl.NumberFormat("ru-RU",{style:"decimal"}),hl={required:zr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},gl=e=>{var r,l,{control:n,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||hl),[x]),w=V({name:c,control:n,defaultValue:m,rules:{required:!!p&&O.required,validate:e=>s?"function"!=typeof s||s(e):0===+e||(null===e?!p||O.required:v&&!ul.test(e)||/^-*0+$/.test(e)?O.notValidNumber:!(!v&&!cl.test(e))||O.notValidInteger)}}),T=w.field,{ref:L,onChange:R,value:k}=T,F=a(T,["ref","onChange","value"]),{fieldState:{error:A}}=w;return o(d,Object.assign({},F,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:L,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!A,helperText:!f&&(null==A?void 0:A.message),disabled:g,value:y?null!==(r=null==k?void 0:k.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=k?k:"",onChange:e=>{let r=e.target.value.replace(/\s/g,"");const l=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(l)||v&&"."===l||"-"===l||"+"===l||r)if(b)b(e);else if(C)if(r)if("0"===r)R(0);else if(v){const e=r.replace(",",".").split(".")[1],l=parseFloat(r.replace(",","."));R(!ul.test(r.replace(",","."))||/^0+$/.test(e)||/^-*0+$/.test(r)||Number.isNaN(l)?r:l)}else R(Number.isNaN(+r.replace(",","."))?r:+r.replace(",","."));else R(null);else R(r);else R(r)},slotProps:{formHelperText:{variant:"standard"},htmlInput:null===(l=null==E?void 0:E.slotProps)||void 0===l?void 0:l.htmlInput}},E))},fl=e=>{var{control:r,name:l,label:n,defaultValue:t}=e,i=a(e,["control","name","label","defaultValue"]);const s=V({control:r,name:l,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:n,name:l,control:o(ue,Object.assign({},p,{color:"primary",size:"small",inputRef:d,onChange:e=>{const{checked:r}=e.target;c(r)},checked:m},i))})};var bl="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 vl=()=>o("img",{src:bl,alt:""}),Cl=e=>{var{control:r,name:l,required:n,label:s,placeholder:d,defaultValue:c,format:u=jr,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(jr),T=V({control:r,name:l,defaultValue:c,rules:{required:!!n&&(m||zr),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:$r;if(C&&e){const r=ge(e,O,new Date),l=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,l)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,l)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,l))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,l))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),L=T.field,{value:R,onChange:k}=L,F=a(L,["value","onChange"]),{fieldState:{error:A}}=T,S=v((e=>{k(he(e)&&O?me(e,O):"")}),[k,O]),N=h((()=>{if(R instanceof Date)return"Invalid Date"==`${R}`?null:R;if("string"==typeof R&&R.length&&O){const e=ge(R,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[R,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:n,children:s}),o(pe,Object.assign({},F,O?{format:O}:{},{value:N,onChange:S,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:!!A,placeholder:d,name:l,helperText:!p&&(null==A?void 0:A.message),slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:vl}},E))]})},yl=()=>o("img",{src:bl,alt:""}),xl=e=>{var{control:r,name:l,required:n,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(),T=V({control:r,name:l,defaultValue:c,rules:{required:!!n&&(m||zr),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:$r;if(C&&e){const r=ge(e,O,new Date),l=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,l)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,l)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,l))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,l))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),L=T.field,{value:R,onChange:k}=L,F=a(L,["value","onChange"]),{fieldState:{error:A}}=T,S=v((e=>{k(he(e)&&O?me(e,O):"")}),[k,O]),N=h((()=>{if(R instanceof Date)return"Invalid Date"==`${R}`?null:R;if("string"==typeof R&&R.length&&O){const e=ge(R,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[R,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(Ee,Object.assign({},F,{ampm:!1,label:n?t(i,{children:[s," ",o("span",{children:"*"})]}):s,value:N},O?{format:O}:{},{onChange:S,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:!!A,placeholder:d,name:l,helperText:!p&&(null==A?void 0:A.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:yl}},E))},El=e=>{var{control:r,name:l,required:n,label:s,format:d=Hr,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:l,defaultValue:m,rules:{required:!!n&&(u||zr),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,[T,L]=b(null);return g((()=>{if(E&&d)try{let e=ge(E,d,new Date);he(e)||(e=ge(E,"HH:mm:ss.SSS",new Date)),L(e)}catch(e){L(E)}}),[E,d]),o(Oe,Object.assign({},O,{inputRef:x,label:n?t(i,{children:[s," ",o("span",{children:"*"})]}):s,ampm:!1,value:T,format:d,onChange:e=>{L(e),y(he(e)?me(e,d):void 0)},viewRenderers:{hours:we,minutes:we},slotProps:Object.assign(Object.assign({},h),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!w,placeholder:p,name:l,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))},Ol=e=>{var r,l,n,{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&&zr}}),T=w.field,{onChange:L,value:R}=T,k=a(T,["onChange","value"]),{formState:{errors:F}}=w,N=h((()=>g||L),[g,L]),M=v((e=>{const{value:r}=e.target;x(r)}),[]),D=v((()=>{O(null),!y||Array.isArray(R)&&R.includes(y)?Array.isArray(R)&&R.includes(y)&&O("This value already exists"):(N([...null!=R?R:[],y]),x(""))}),[y,N,R]),I=v((e=>{N(R.filter((r=>r!==e)))}),[R,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==R?void 0:R.map(((e,r)=>o(Ve,{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:R},k)),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===(l=F[s])||void 0===l?void 0:l.message,slotProps:{htmlInput:null===(n=C.slotProps)||void 0===n?void 0:n.htmlInput,formHelperText:{variant:"standard"},input:{endAdornment:o(S,{size:"small",onClick:D,children:o(A,{children:o("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}},name:s,onKeyDown:P},C)),E&&o(J,{error:!0,children:E})]})},wl=({name:e="period",control:r,label:l="Period",required:n,isSecondsVisible:a=!1})=>{var s;const[c,u]=b(),p=T({control:r,name:e}),{field:{onChange:m},formState:{errors:f}}=V({name:e,control:r,rules:{required:!!n&&"Please, fill one of the fields"}}),C=v((e=>{const{name:r,value:l}=e.target,n=Object.assign({},null!=c?c:{});l?(n[r]=+l,m(Le(n))):(delete n[r],m(Object.keys(n).length?Le(n):"")),u(n)}),[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(Re(p))}),[c,p]),t(i,{children:[o($,{variant:"subtitle1",children:n?t(i,{children:[l," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):l}),y&&o(J,{error:!0,children:y}),t(Te,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.years)||"",name:"years",label:"Years"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.months)||"",name:"months",label:"Months"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.days)||"",name:"days",label:"Days"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes"}))}),a&&o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds"}))})]})]})};const Vl=e=>{var{control:r,name:l,label:n,required:s,mask:c="+7 (799) 999 99 99",requiredErrorText:u="",inputMaskProps:p,disabled:m,validate:h,invalidErrorText:g}=e,f=a(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","validate","invalidErrorText"]);return o(L,{control:r,name:l,rules:{required:!!s&&(u||zr),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}})=>o(ke,Object.assign({disabled:m,mask:c,value:e.value,onChange:e.onChange,onBlur:e.onBlur},p,{children:o(d,Object.assign({name:l,fullWidth:!0,size:"small",label:s&&n?t(i,{children:[n," ",o("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",slotProps:{formHelperText:{variant:"standard"},input:{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:""})})}}},f,{error:!!r,helperText:null==r?void 0:r.message}))}))})};var Tl="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 Ll=()=>o("img",{src:Tl,alt:""}),Rl=()=>{const e=Se(),r=Ne(e,Me),l=Ne(e,De),n=Ne(e,Ie),i=Ne(e,Pe),a=r=>e.current.setPage(r);return t(z,{px:2,display:"flex",alignItems:"center",children:[o(Ae,{component:"div",page:r,count:n,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:l})=>`${e}–${r} из ${-1!==l?l:`более ${r}`}`,ActionsComponent:void 0,slotProps:{select:{IconComponent:Ll}}}),o(Fe,{count:l,page:r+1,onChange:(e,r)=>a(r-1)})]})};var kl="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",Fl="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",Al="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 Sl=()=>o("img",{src:kl,alt:"sort"}),Nl=()=>o("img",{src:Fl,alt:"asc"}),Ml=()=>o("img",{src:Al,alt:"desc"}),Dl=ze(qe)((({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}}}))),Il=e=>{var{columns:r,rows:l,rowCount:n,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[l,n]=ie(),t=+l.get("page")||0,o=+l.get("size")||10,i=v((({page:e,pageSize:r})=>{l.set("page",e),l.set("size",r),n(l,{replace:!0})}),[n,l]);return g((()=>{"server"===e&&r&&(l.has("page")||l.set("page","0"),l.has("size")||l.set("size","10"),n(l,{replace:!0}))}),[e,r,l,n]),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(),l=f(""),n=e.getAll("sort").map((e=>e.split(","))),t=h((()=>n.length?n.map((e=>({field:e[0],sort:e[1]}))):[]),[n]),o=v((l=>{e.delete("sort"),l.length&&l.forEach((r=>e.set("sort",`${r.field},${r.sort}`))),r(e,{replace:!0})}),[e,r]),i=v((e=>e.map((e=>{const r=n.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))),[n]),a=v((({field:e})=>{l.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(Dl,Object.assign({hideFooterPagination:!c,hideFooter:!c,loading:t,rows:l,sortingMode:s,paginationMode:s,paginationModel:"server"===s?y:m,rowCount:n||-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:le,pagination:Rl,columnUnsortedIcon:Sl,columnSortedAscendingIcon:Nl,columnSortedDescendingIcon:Ml},sx:{"--DataGrid-overlayHeight":"300px"}},p))})},Pl=({icon:e,label:r,showInMenu:l,onClick:n,location:t})=>{var i;return t?o(S,{component:oe,to:t.pathname,state:null!==(i=t.state)&&void 0!==i?i:null,size:"small",children:o(le,{title:r,arrow:!0,children:p.cloneElement(e,{fontSize:"small"})})}):o(Be,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:o(le,{title:r,arrow:!0,children:e}),onClick:n,label:r,showInMenu:l})},ql=ze(Ze)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),Bl=()=>o("img",{src:Tl,alt:""}),zl=()=>o("img",{src:kl,alt:""}),$l=()=>o("img",{src:Fl,alt:""}),jl=()=>o("img",{src:Al,alt:""});function Hl({columns:e=[],rows:r=[],rowCount:l,children:n,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,l]=ie(),n=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=>{l((r=>(r.set("page",`${e}`),r)))}),[l]),i=v((e=>{l((r=>(r.set("size",`${e}`),r)))}),[l]);return g((()=>{e&&(r.has("page")||l((e=>(e.set("page","0"),e))),r.has("size")||l((e=>(e.set("size","10"),e))))}),[r,l,e]),{page:n,size:t,onPageChange:o,onSizeChange:i}})(i),{onSortChanged:y,getColumnSorting:x}=(()=>{const[e,r]=ie(),l=h((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=v((e=>{r((r=>{r.delete("sort");let n=!1;return l.forEach((([l,t])=>{l===e?(n=!0,"asc"===t&&r.append("sort",`${l},desc`)):r.append("sort",`${l},${t}`)})),n||r.append("sort",`${e},asc`),r}))}),[l,r]),t=v((e=>{const r=l.find((([r,l])=>r===e));return!!r&&r[1]}),[l]);return{sortParams:l,onSortChanged:n,getColumnSorting:t}})();return o(z,{sx:{overflow:"auto"},children:t(_e,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[o(Ye,{open:a,sx:{position:"absolute",top:0,left:0},children:o(Ir,{})}),t($e,{ref:p,children:[o(Je,{children:o(We,{children:e.map(((e,r)=>{const l=!!e.sortKey&&x(e.sortKey);return o(He,{align:e.align?e.align:"left",sortDirection:l,sx:{width:e.width?`${e.width}%`:"unset"},children:o(ql,{active:!!l,hideSortIcon:!e.sortKey,direction:l||"asc",IconComponent:"asc"===l?$l:"desc"===l?jl:zl,onClick:()=>e.sortKey?y(e.sortKey):{},children:e.label})},r)}))})}),o(je,{children:r.length?r.map(((r,l)=>o(We,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,n)=>o(He,{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,l):r[e.id]})})},n)))},l))):o(We,{sx:{verticalAlign:c},children:o(He,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),i||n?o(Ge,{children:t(We,{children:[n&&o(He,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:n}),i&&r.length?o(Ae,{rowsPerPageOptions:[5,10,25],count:l,rowsPerPage:+f,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:l})=>`${e}–${r} из ${-1!==l?l:`более ${r}`}`:void 0,slotProps:{select:{IconComponent:Bl}},onPageChange:(e,r)=>b(r),onRowsPerPageChange:e=>C(+e.target.value)}):null]})}):null]})]})})}const _l=y(Hl),Jl=({actionsList:e})=>{const[r,l]=b(null),n=Boolean(r),i=()=>{l(null)};return t("div",{children:[o(S,{"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),l(e.currentTarget)},children:o(Ue,{})}),o(Ke,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,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)))})]})},Wl=e=>{const{children:r,value:l,index:n}=e,t=a(e,["children","value","index"]);return o("div",Object.assign({role:"tabpanel",hidden:l!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},t,{children:l===n?r:null}))},Gl=e=>{var r;const{tabs:l}=e,n=ne(),i=te(),a=h((()=>new URLSearchParams(i.search)),[i.search]),s=a.get("tab");return t(z,{children:[o(Xe,{children:o(er,{value:s||(null===(r=l[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),n({pathname:i.pathname,search:a.toString()},{replace:!0})},children:l.map((e=>o(Qe,{value:e.name,label:e.label},e.name)))})}),o(z,{mt:2,children:l.map((e=>{var r;return o(Wl,{value:s||(null===(r=l[0])||void 0===r?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},Yl=y((({value:e,height:r=200,fontSize:l=16},n)=>{const[i,a]=b(!0),s=v((e=>{const r=l=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-l.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===l.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",children:[i&&o(Ir,{bgcolor:"#fff"}),o(se,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[de.json()],style:{fontSize:l,width:"100%"}})]})})),Zl=({open:e,onClose:r,value:l,jsonViewProps:n})=>{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(Yl,Object.assign({value:l},n,{ref:i}))}),t(I,{children:[o(al,{copyText:l}),o(M,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})},Kl=({title:e,text:r,json:l})=>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}),l&&o(Yl,{value:l,height:300})]}),Ul=({control:e,name:r,label:l,required:n,restrictedValues:i,requiredErrorText:a="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:p}}=V({control:e,name:r,rules:{required:!!n&&(Array.isArray(i)&&i.length?s||"Please, select a value":a||zr)}}),m=T({control:e,name:r});return Array.isArray(i)&&i.length?t(H,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[o(fr,{htmlFor:"type-select",children:l}),o(gr,{labelId:"type-select",label:l,value:m||"",onChange:d,ref:u,children:i.map((e=>o(c,{value:e,children:e},e)))})]}):o(Jr,{hideErrorMessage:!0,required:n,control:e,name:r,label:l})},Xl=({name:e})=>{const{control:r,setValue:l,register:n}=R(),a=T({control:r,name:e}),d=v((r=>s(void 0,void 0,void 0,(function*(){const n=r.target.files[0];(new FileReader).readAsDataURL(n);const t=yield(e=>new Promise(((r,l)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{l(e)}})))(n);l(e,t)}))),[e,l]);return t(i,{children:[t(z,{mb:2,display:"flex",flex:"row",children:[o($,{children:"Does file uploaded:"}),o(A,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"},n(`${e}`,{required:!0}))),o("input",{type:"file",hidden:!0,onChange:d})]})]})},Ql=()=>o(z,{component:"span",sx:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),en=({data:e})=>t(lr,{nonLinear:!0,orientation:"vertical",connector:o(ir,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>t(nr,{expanded:!0,children:[o(tr,{sx:{display:"flex",alignItems:"flex-start"},slots:{stepIcon:Ql},slotProps:{stepIcon:{icon:"",completed:!1,active:!0}},children:e.label}),o(or,{sx:{marginLeft:4},children:Array.isArray(e.content)?o(en,{data:e.content}):e.content})]},r))),o(nr,{})]}),rn=(e,r)=>{const l=[...e];return l.splice(r,1),l},ln=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function nn(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const tn=(e,r,l,n="asc")=>{const t=e[l],o=r[l];return t<o?"asc"===n?-1:1:t>o?"asc"===n?1:-1:0},on=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"}},an=e=>{try{return JSON.parse(e)}catch(e){return null}},sn=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=sn(r[e])})),r}catch(r){return e}},dn=({children:e})=>{const[r,l]=b(!1),n=v((e=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return o(le,{title:e,arrow:!0,disableHoverListener:!r,children:o("div",{ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})},cn=ze(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}}))),un=({text:e,status:r="default"})=>o(cn,{className:xr("root",{[r]:!0}),children:e}),pn=({value:e,copyButton:r=!1,textField:l=!1})=>{const{open:n,onOpen:i,onClose:a}=Gr(),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(al,{copyText:on(e)}),o(le,{title:"Open",placement:"top",children:o(S,{size:"small",onClick:s,children:o(A,{children:o("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),l?o(z,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):o(Yl,{value:e}),o(Zl,{open:n,value:on(e),onClose:a,jsonViewProps:{height:450}})]})},mn={100:"#E3EBFC",200:"#CCD9F9",300:"#ACC2F5",400:"#8EABF1",500:"#7196ED",600:"#527FE9",700:"#376BE5",800:"#1744AE",900:"#00267F"},hn={100:"#DDF5F2",200:"#BAEAE5",300:"#92E2D8",400:"#76D3C8",500:"#53BAAD",600:"#2CAB9B",700:"#148C7D",800:"#08675B",900:"#014239"},gn={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"},fn={100:"#E5FEF1",200:"#CAFCE3",300:"#AAF2CE",400:"#8AE6B8",500:"#6CD9A3",600:"#53CF91",700:"#3BC480",800:"#138049",900:"#014221"},bn={100:"#FCEADF",200:"#FDDFCE",300:"#F9C8AC",400:"#F7B189",500:"#F69E6B",600:"#F4884A",700:"#F4772E",800:"#C96226",900:"#9A4716"},vn={100:"#FFE9E6",200:"#F8D2CD",300:"#F1ADA5",400:"#EB8E83",500:"#E46D5E",600:"#DD4F3E",700:"#D6331F",800:"#AA2111",900:"#831002"},Cn={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"},yn={100:"#FFFBDE",200:"#FFF7C4",300:"#FFF1A3",400:"#FFEF85",500:"#FFEB69",600:"#FFE249",700:"#FFCE1F",800:"#FFB60F",900:"#EF9A00"},xn={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:mn[700],secondary:mn[300],tertiary:mn[100]},green:{primary:fn[700],secondary:fn[300],tertiary:fn[100]},orange:{primary:bn[700],secondary:bn[300],tertiary:bn[100]},red:{primary:vn[700],secondary:vn[300],tertiary:vn[100]},yellow:{primary:yn[700],secondary:yn[300],tertiary:yn[100]}},brand:{high:hn[700],mid:hn[200],low:hn[100]},default:{hard:Cn[1e3],high:gn[200],inverse:gn[1e3],low:gn[20],mid:gn[100]},system:{critical:vn[800],disabled:gn[500],success:fn[800],warning:bn[800]}},button:{primary:{default:hn[700],disabled:gn[50],focused:hn[900],hover:hn[800]},secondary:{default:Cn[1e3],disabled:gn[100],focused:gn[400],hover:Cn[900]},warning:{default:bn[700],disabled:bn[200],focused:bn[900],hover:bn[800]}},stroke:{primary:{brand:hn[700],default:gn[200],focused:hn[700],hover:gn[300],inverse:Cn[100],hard:gn[1e3]},secondary:{brand:hn[500],default:gn[100],focused:hn[700],hover:gn[200],inverse:Cn[50]},tertiary:{brand:hn[300],default:gn[50],focused:hn[700],hover:gn[100],inverse:Cn[20]},system:{critical:vn[800],success:fn[800],warning:bn[800]}},surface:{primary:Cn[1e3],secondary:Cn[900]},textIcon:{accent:{blue:{primary:mn[700],secondary:mn[500],tertiary:mn[300]},green:{primary:fn[800],secondary:fn[500],tertiary:fn[300]}},brand:{primary:hn[700],secondary:hn[500],tertiary:hn[300]},disabled:{default:gn[200],onColor:gn[50]},primary:{default:gn[1e3],inverse:Cn[1e3],onDark:Cn[1e3],onLight:gn[1e3]},secondary:{default:gn[500],inverse:Cn[400],onColor:gn[200]},tertiary:{default:gn[300],inverse:Cn[200],onColor:gn[100]},system:{critical:vn[700],link:mn[800],success:fn[700],warning:bn[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 En=r(xn);const On={components:{MuiButtonBase:{defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:En.palette.button.warning.hover},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:En.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:En.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:En.spacing(3),minWidth:En.spacing(25),background:En.palette.background.default,paddingRight:En.spacing(3)},input:{minWidth:En.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:Zr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:En.spacing(25)}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:En.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto",whiteSpace:"normal","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:En.spacing(3),minWidth:En.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:En.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:o(Zr,{})},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:En.palette.secondary.dark,padding:En.spacing(2,3),borderRadius:8,textAlign:"center"}}}},wn={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:En.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:En.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:En.spacing(4)}},head:{padding:En.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:En.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:En.spacing(3),width:"100%",color:En.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{borderTopLeftRadius:En.spacing(3),borderTopRightRadius:En.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},"container--top":{'& [role="row"]':{backgroundColor:En.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:En.spacing(1.25,3),display:"flex",alignItems:"center",borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}},Vn={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:En.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:En.palette.secondary.main}}}}}},Tn={components:{MuiTypography:{styleOverrides:{h1:{[En.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[En.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[En.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}},Ln=(()=>{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 l(r(En,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},On.components),wn.components),Vn.components),Tn.components),{MuiToolbar:{styleOverrides:{root:{[En.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:En.spacing(2.5),padding:En.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:En.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:En.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:En.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:En.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:En.palette.secondary.main}}}}})}))})(),Rn=({value:e,canCopy:r,copyValue:l,shortId:n,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(A,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(dn,{children:c.map(((r,l)=>o(z,{children:me(new Date(e),r)},l)))}):t(dn,{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(dn,{children:o(un,{text:e,status:u||"default"})});case"json_text":return o(pn,{value:e,textField:!0});case"json_code":return o(pn,{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(le,{arrow:!0,title:d||e.map(((e,r)=>o(z,{fontSize:14,style:{paddingTop:Ln.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(dn,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?t(z,{display:"flex",alignItems:"center",width:"100%",children:[n?o(dn,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):i?o(z,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):o(dn,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&o(al,{copyText:l?"string"==typeof l?l:JSON.stringify(l):e})]}):""}},kn=e=>!e&&0!==e&&!1!==e,Fn=(e,r,l)=>{if(null==r)return null;if(pl(r))return r;let n=r;switch(Pn(e)){case Mr.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case Mr.INTEGER:case Mr.BIG_INTEGER:case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.LONG:case Mr.DOUBLE:case Mr.SHORT:n=Number(r);break;case Mr.DATE:case Mr.DATE_TIME:case Mr.TIME:if(r)try{const e=l.formatText.replace(/[Z,z,x]+/g,"XX");n=me(ge(r,e,new Date),e)}catch(e){console.error(e)}break;case Mr.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case Mr.OBJECT:n=An(e,r)}return n},An=(e,r)=>{var l;let n={};if(r){const t=Pn(e);return t===Mr.OBJECT?Array.isArray(e.properties)?null===(l=e.properties)||void 0===l||l.forEach((function(e){const{key:l}=e,t=r[l];Array.isArray(t)?n[l]=t.map((r=>Fn(e,r,{formatText:e.format,properties:e.properties}))):n[l]=Fn(e,t,{formatText:e.format,properties:e.properties})})):n=ar(r)?r:{}:n=t===Mr.ARRAY&&Array.isArray(r)?r.map((r=>e.memberNodes?Fn(e.memberNodes,r):r)):Fn(e,r),n}return null},Sn=(e,r)=>{return l(e);function l(e){const{name:n,isRequired:t,sortOrder:o,isEnabled:i,uiSettings:a,validationNode:s}=e,d=Pn(e),c=Object.assign({name:n,nodeType:d,isRequired:null!==t&&t,sortOrder:o,isEnabled:null!==i&&i,validationNode:s,uiSettings:a},((e,r)=>{const l={};let n,t="";return r?e.nodeType===Mr.ARRAY?(t="values",n=e.value):(t="value",n=e.value):e.nodeType===Mr.ARRAY?(t="defaultValues",n=e.defaultValue):(t="defaultValue",n=e.defaultValue),Array.isArray(n)?l[t]=n.map((r=>Fn(e,r,{formatText:e.format,properties:e.properties}))):l[t]=Fn(e,n,{formatText:e.format,properties:e.properties}),l})(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===Mr.BIG_DECIMAL&&(c.precisionScale=e.precisionScale,c.roundingMode=e.roundingMode),d!==Mr.DATE&&d!==Mr.TIME&&d!==Mr.DATE_TIME||(c.format=e.format),d===Mr.STRING&&(c.restrictedValues=e.restrictedValues),d===Mr.ENTITY_REFERENCE){const{definitionCode:r,definitionVersion:l,labelPropertyCode:n,valuePropertyCode:t}=e;c.definitionCode=r,c.definitionVersion=l,c.labelPropertyCode=n,c.valuePropertyCode=t}return d===Mr.ARRAY&&(c.memberNodes=e.memberNodes?l(e.memberNodes):null),d===Mr.OBJECT&&(c.properties=function(e){if(!Array.isArray(e)||!e.length)return null;const r={};return e.forEach((e=>{r[e.key]=l(e)})),r}(e.properties)),c}};function Nn(e,r){var l;return e&&e.nodeType===Mr.OBJECT&&e.properties&&(e.properties=(l=e.properties)?Array.isArray(l)?l:Object.keys(l).map((e=>{let n=Object.assign(Object.assign({key:e},l[e]),r||{});const t=Pn(n);return t===Mr.OBJECT&&(n=Nn(n,r)),t===Mr.ARRAY&&n.memberNodes&&(n.memberNodes=Nn(n.memberNodes,r),"defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>tn(e,r,"sortOrder"))):[]),e&&e.nodeType===Mr.ARRAY&&e.memberNodes&&(e.memberNodes=Nn(e.memberNodes,r)),e}const Mn=(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},Dn=e=>(Array.isArray(e.properties)?e:Nn(e)).properties.reduce(((r,l)=>{const n=JSON.parse(JSON.stringify(r));return e.nodeType===Mr.OBJECT?n[e.key]=Dn(e):n[e.key]=e.nodeType,n}),{}),In=({nodeType:e,useExpression:r,required:l})=>{let n=[{value:"widget",label:"Fill array",sortOrder:1}];return l||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Mr.OBJECT||e===Mr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==Mr.ANY&&e!==Mr.OBJECT&&e!==Mr.ARRAY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>tn(e,r,"sortOrder"))),n},Pn=e=>{var r;return e?"string"==typeof e.nodeType?e.nodeType:null===(r=e.nodeType)||void 0===r?void 0:r.value:Mr.ANY},qn=({nodeType:e,useExpression:r,required:l})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(l||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Mr.OBJECT||e===Mr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e){case Mr.STRING:n[0].label="Text input";break;case Mr.INTEGER:case Mr.BIG_INTEGER:case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.LONG:case Mr.DOUBLE:case Mr.SHORT:n[0].label="Number input";break;case Mr.BOOLEAN:n[0].label="Switch";break;case Mr.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case Mr.ARRAY:n[0].label="Array editor";break;case Mr.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.ANY:n[0].label="JSON"}return n=n.sort(((e,r)=>tn(e,r,"sortOrder"))),n},Bn=({value:e,node:r,label:l,isDirty:n,required:t=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const a=h((()=>l?`${l} (value)`:`${r.name} (value)`),[l,r]),s=h((()=>l?`${l} (widget)`:`${r.name} (widget)`),[l,r]),d=h((()=>Pn(r)),[r]),[c,u]=b(null),p=h((()=>i?In({nodeType:d,required:t,useExpression:o}):qn({nodeType:d,required:t,useExpression:o})),[o,t,d,i]),m=h((()=>{switch(d){case Mr.STRING:case Mr.DATE:case Mr.TIME:case Mr.DATE_TIME:case Mr.ENTITY_REFERENCE:case Mr.ANY:case Mr.FILE:case Mr.FILE_REFERENCE:return"";case Mr.OBJECT:return{};case Mr.ARRAY:return[];case Mr.BOOLEAN:return!1;case Mr.INTEGER:case Mr.BIG_DECIMAL:case Mr.BIG_INTEGER:case Mr.DOUBLE:case Mr.LONG:case Mr.FLOAT:case Mr.SHORT:return 0;default:return null}}),[d]),f=h((()=>d===Mr.ANY||d===Mr.ARRAY),[d]),C=v((()=>{pl(e,f)?u("expression"):d===Mr.ARRAY||null==e||pl(e,f)||"widget"===c||"string"===c||"json_valid"===c||u("widget")}),[e,c,f,d]);return g((()=>{c?n||C():!kn(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&pl(e,f)?u("expression"):u("widget"):u("null")}),[e,c,p,o,n,C,f,t,r]),{nodeType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:p,setFillOption:u,defaultProperyValue:m,checkFillOption:C}},zn=ze(fr)((()=>({inputLabel:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"}}))),$n=({control:e,node:r,name:l,useExpression:n,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:l,control:e,rules:{validate:e=>!a||null!==e||(p||zr)}}),y=f({}),{nodeType:x,valueLabel:E,fillOptionLabel:O,fillOption:w,fillOptions:T,setFillOption:L,defaultProperyValue:R}=Bn({value:m,node:r,isDirty:C,label:i,required:a,useExpression:n}),k=v((e=>{const n=e.target.value;y.current=Object.assign(Object.assign({},y.current),{[w]:m}),L(n);const t=y.current[n];if("null"===n)h(null);else if("widget"===n)if(x===Mr.OBJECT&&m&&"string"!=typeof m&&"dem_builder"===w&&"node"in m){const e=Sn(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||R);else if("expression"===n||"string"===n)h(l,null!=t?t:"");else if("dem_builder"===n){const e={code:"",name:"",version:0,node:null};if(m)try{const e=JSON.parse(m);e.properties=Nn(e.properties||{}),h(null!=t?t:e)}catch(r){h(null!=t?t:e)}else h(null!=t?t:e,{shouldDirty:!0})}}),[l,m,L,w,x,h,R,r]);return g((()=>{C||yr(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!yr(m)||h(l,r.defaultValue||r.value)}),[C,r,h,m,l]),g((()=>{var e;(void 0===m||r.isRequired&&null===m&&!r.defaultValue&&!r.value)&&h(null!==(e=y.current[w])&&void 0!==e?e:R),void 0!==m||r.isRequired||null!==r.defaultValue&&null!==r.value||h(null)}),[m,h,l,R,r,w]),t(Te,{size:12,children:[s&&o(z,{mb:2,children:o($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),T?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:O}),o(gr,{labelId:"type-select",label:O,value:w||"",onChange:k,children:T.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(x===Mr.OBJECT||x===Mr.ANY?o(dl,{name:l,control:e,label:E,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:x===Mr.ANY?"text":"json"}):o(Jr,{control:e,name:l,label:E,hideErrorMessage:!0})),"string"===w&&o(Jr,{control:e,name:l,label:E,hideErrorMessage:!0}),"widget"===w&&o(Kn,{control:e,node:r,name:l,useExpression:n,label:E,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),b&&o(J,{error:!0,children:b.message})]})},jn=({control:e,name:r,node:l,useExpression:n,required:i,label:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{fields:c,append:u,remove:p}=k({control:e,name:r});return t(Te,{container:!0,spacing:2,direction:"column",size:12,children:[Array.isArray(c)&&c.length?c.map(((c,u)=>o(Te,{size:12,children:t(z,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[o($n,{control:e,required:i,node:l,useExpression:n,name:`${r}.${u}`,label:`${a||l.name} (${u+1})`,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(z,{mt:"8px",ml:"4px",children:o(S,{id:"close-button",size:"small",onClick:()=>p(u),children:o(A,{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(Te,{children:o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>u(null),children:"Add value"})})]})},Hn={nodeType:Mr.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},_n=({node:e,name:r,useExpression:l,required:n,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:T}=R(),{field:{ref:L,onChange:k},fieldState:{error:F,isDirty:A}}=V({control:E,name:r,defaultValue:null!==(m=e.defaultValue)&&void 0!==m?m:[],rules:{validate:e=>!(n&&!e)||(p||zr)}}),S=T(r),N=f({}),{valueLabel:M,fillOptionLabel:D,fillOption:I,fillOptions:P,setFillOption:q,checkFillOption:B}=Bn({node:e,value:S,isDirty:A,label:a,required:n,useExpression:l,multipleOptions:!0});return g((()=>{!S&&e.isRequired&&k([]),ar(S)&&!e.isRequired&&k(null)}),[S,e,k]),g((()=>{S&&!y&&(x(!0),B())}),[B,y,S]),t(i,{children:[s&&o(z,{mb:2,children:o($,{variant:"h6",children:s})}),P?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:D}),o(gr,{labelId:"type-select",label:D,value:I||"",onChange:e=>{x(!0),N.current=Object.assign(Object.assign({},N.current),{[I]:S});const l=e.target.value,n=N.current[l];"null"===l?w(r,null):w(r,null!=n?n:[],{shouldDirty:!0}),q(l),O(r)},children:P.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===I||"json_valid"===I)&&o(dl,{name:r,control:E,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===I&&o(jn,{control:E,node:null!==(h=e.memberNodes)&&void 0!==h?h:Hn,name:r,useExpression:l,required:n,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})]})},Jn=({node:e,dataFieldName:r,locales:l,useExpression:n=!1,title:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=v(((e,r)=>Pn(e)===Mr.ARRAY?o(_n,{node:e,name:r,useExpression:n,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s}):o(Un,{node:e,name:r,locales:l,useExpression:n,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s})),[n,s,a]),c=v(((e,r)=>{if(e){const l=Pn(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:`${e.key?e.key+" | ":""}${l}`})]}),content:d(e,r)}}return null}),[d]);return o(hr,{dateAdapter:mr,children:t(Te,{container:!0,direction:"column",spacing:2,children:[i&&o(Te,{size:12,children:o("div",{style:{fontWeight:"600"},children:i})}),o(en,{data:[c(Nn(e),r)]})]})})},Wn=o(vr,{fontSize:"small"}),Gn=o(Cr,{fontSize:"small",color:"secondary"}),Yn=({localesCollection:e,onChange:r,onLocaleRemove:l,receivedObject:n})=>{const[i,s]=b(null==e?void 0:e.filter((e=>e.isRequired)));g((()=>{const l=null==e?void 0:e.filter((e=>e.isRequired)),t=null==e?void 0:e.filter((e=>null==n?void 0:n.hasOwnProperty(e.code))),o=[...new Set([...l,...t])];s(o),null==r||r(o)}),[e]);const c=v(((r,l,{selected:n})=>t(br,Object.assign({},r,{onClick:e=>{l.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:Wn,checkedIcon:Gn,sx:{marginRight:1,padding:1},checked:n||l.isRequired||"all"===l.code&&(null==i?void 0:i.length)===(null==e?void 0:e.length),disabled:l.isRequired}),o(z,{component:"span",textTransform:"capitalize",children:l.name}),l.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,l)=>{const n=r({index:l}),{onDelete:i}=n,d=a(n,["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(Zn,{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:(n,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 l=null==e?void 0:e.filter((e=>e.isRequired));s(l),null==r||r(l)}else{const l=null==e?void 0:e.filter((e=>"all"!==e.code));s(l),null==r||r(l)}else{const e=i.filter((e=>!t.some((r=>r.code===e.code))));s(t),null==r||r(t),e.length>0&&(null==l||l(e))}},renderOption:c,getOptionDisabled:u,renderTags:p,renderInput:e=>o(d,Object.assign({},e,{label:"Languages",placeholder:"Select"}))})},Zn=e=>o(A,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"})})),Kn=({node:e,name:r,locales:l,label:n,useExpression:i,control:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{var c,u;const{setValue:p,getValues:m}=R();switch("string"==typeof e.nodeType?e.nodeType:null===(c=e.nodeType)||void 0===c?void 0:c.value){case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.DOUBLE:return o(gl,{required:!0,decimal:!0,hideErrorMessage:!0,control:a,name:r,label:n,valueAsNumber:!0});case Mr.INTEGER:case Mr.SHORT:case Mr.BIG_INTEGER:case Mr.LONG:return o(gl,{required:!0,hideErrorMessage:!0,control:a,name:r,label:n,valueAsNumber:!0});case Mr.BOOLEAN:return o(fl,{control:a,name:r,defaultValue:!1});case Mr.DATE:return o(Cl,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.TIME:return o(El,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.DATE_TIME:return o(xl,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.STRING:return o(Ul,{control:a,name:r,label:n,restrictedValues:e.restrictedValues});case Mr.ENTITY_REFERENCE:return s?o(s,{name:r,node:e}):o(Ul,{name:r,label:n,control:a});case Mr.FILE:return o(Xl,{name:r});case Mr.FILE_REFERENCE:return d?o(d,{name:r}):o(Ul,{name:r,label:n,control:a});case Mr.ANY:return o(dl,{control:a,name:r,hideErrorMessage:!0,label:n,parseValue:!0});case Mr.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==l?void 0:l.filter((e=>e.isRequired))).properties),f=r=>{const l=c(e,r);g(l.properties)};return t("div",{style:{borderLeft:"1px solid #bdbdbd",paddingLeft:20},children:[null==h?void 0:h.map((e=>o(Jr,{hideErrorMessage:!0,required:e.isRequired,control:a,name:`${r}.${e.key}`,label:e.name,sx:{mb:3,textTransform:"capitalize"}}))),(null==l?void 0:l.length)?o(Yn,{localesCollection:l,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 Mr.OBJECT:return e.properties?o("div",{children:e.properties.map((e=>o(Jn,{node:e,dataFieldName:`${r}.${e.key}`,useExpression:i,entityReferenceValueComponent:s,fileReferenceValueComponent:d,locales:l})))}):o(dl,{control:a,name:r,hideErrorMessage:!0,label:n,parseValue:!0,mode:"json"});default:return o("div",{children:"No widget"})}},Un=({node:e,name:r,locales:l,useExpression:n,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{control:m,clearErrors:h,setValue:b}=R(),{field:{value:C},fieldState:{error:y,isDirty:x}}=V({name:r,control:m,rules:{validate:e=>!a||null!==e||(p||zr)}}),E=f({}),{nodeType:O,valueLabel:w,fillOptionLabel:T,fillOption:L,fillOptions:k,setFillOption:F,defaultProperyValue:A}=Bn({value:C,node:e,isDirty:x,label:i,required:a,useExpression:n}),S=v((l=>{const n=l.target.value;E.current=Object.assign(Object.assign({},E.current),{[L]:C}),F(n);const t=E.current[n];if("null"===n)b(r,null,{shouldDirty:!0});else if("widget"===n)if((O===Mr.OBJECT||O===Mr.LOCALIZED_STRING)&&C&&"string"!=typeof C&&"dem_builder"===L&&"node"in C){const e=Sn(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||A);else if("expression"===n||"string"===n)b(r,null!=t?t:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,node:null};if(C)try{const e=JSON.parse(C);e.properties=Nn(e.properties||{}),b(r,null!=t?t:e,{shouldDirty:!0})}catch(l){b(r,null!=t?t:e,{shouldDirty:!0})}else b(r,null!=t?t:e,{shouldDirty:!0})}h()}),[r,h,C,F,L,O,b,A,e]);return g((()=>{x||yr(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!yr(C)||b(r,e.defaultValue||e.value)}),[x,e,b,C,r]),g((()=>{var l;(void 0===C||e.isRequired&&null===C&&!e.defaultValue&&!e.value)&&b(r,null!==(l=E.current[L])&&void 0!==l?l:A),void 0!==C||e.isRequired||null!==e.defaultValue&&null!==e.value||b(r,null)}),[C,b,r,A,e,L]),t(Te,{size:12,children:[s&&o(z,{mb:2,children:o($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),k?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:T}),o(gr,{labelId:"type-select",label:T,value:L||"",onChange:S,children:k.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===L&&(O===Mr.OBJECT||O===Mr.ANY?o(dl,{name:r,control:m,label:w,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"expression"===L?"text":"json"}):o(dl,{control:m,name:r,hideErrorMessage:!0,label:i,parseValue:!0,height:"40px"})),"string"===L&&o(Jr,{control:m,name:r,label:w,hideErrorMessage:!0}),"widget"===L&&o(Kn,{control:m,locales:l,node:e,name:r,useExpression:n,label:w,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),y&&o(J,{error:!0,children:y.message})]})},Xn={nodeType:Mr.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},Qn=({control:e,node:r,name:l,useExpression:n,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:T,isDirty:L}}=V({control:e,name:l,defaultValue:null!==(h=r.defaultValue)&&void 0!==h?h:[],rules:{validate:e=>!(a&&!e)||(m||zr)}}),R=f({}),{valueLabel:k,fillOptionLabel:F,fillOption:A,fillOptions:S,setFillOption:N,checkFillOption:M}=Bn({node:r,value:O,isDirty:L,label:s,required:a,useExpression:n,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($,{variant:"h6",children:d})}),S?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:F}),o(gr,{labelId:"type-select",label:F,value:A||"",onChange:e=>{E(!0),R.current=Object.assign(Object.assign({},R.current),{[A]:O});const r=e.target.value,l=R.current[r];w("null"===r?null:null!=l?l:[]),N(r)},children:S.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===A||"json_valid"===A)&&o(dl,{name:l,control:e,label:k,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===A&&o(jn,{control:e,node:null!==(v=r.memberNodes)&&void 0!==v?v:Xn,name:l,useExpression:n,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}),T&&o(J,{error:!0,children:T.message})]})},et={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"},rt=({value:e,type:r})=>r!==Mr.OBJECT&&r!==Mr.ANY||!e?o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):o(Yl,{value:e}),lt=(e,r,l)=>{switch(r){case"nodeType":return o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:l});case"isRequired":case"isEnabled":case"isViewableInList":return e?o(A,{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(Ve,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return o(rt,{value:e,type:l});case"values":case"defaultValues":return e?Array.isArray(e)&&l!==Mr.OBJECT&&l!==Mr.ANY?t("div",{children:["[",null==e?void 0:e.map(((e,r)=>o("div",{children:o(rt,{value:e,type:l})},r))),"]"]}):o(Yl,{value:e}):null;case"uiSettings":case"validationNode":return e?o(Yl,{value:e}):null;case"memberNodes":return e?o(it,{node:e,defaultExpanded:!1}):null;default:return o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}},nt=({node:e})=>{const r=h((()=>(e&&(Pn(e)===Mr.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(et).map((e=>e in r?t(We,{children:[o(He,{width:"30%",children:o($,{children:et[e]})}),o(He,{children:lt(r[e],e,Pn(r))})]},e):null))})})},tt=({properties:e,parentNames:r=[]})=>{const l=h((()=>{if(!e)return!1;let r=!1;return e.every((e=>e.nodeType!==Mr.OBJECT||(r=!0,!1))),r}),[e]);return t(z,{mt:4,children:[o($,{variant:"h6",children:"Properties"}),t(lr,{orientation:"vertical",style:{paddingLeft:"4px"},children:[Array.isArray(e)?e.map((e=>t(nr,{expanded:!0,children:[o(tr,{slotProps:{stepIcon:{icon:"",completed:!1,active:!0}}}),o(or,{children:o(it,{node:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))):null,l&&o(nr,{})]})]})};var ot=m(tt);const it=({node:e,parentNames:r=[],defaultExpanded:l=!0})=>{const[n,i]=b(!0);return g((()=>{i(l)}),[l]),e?t(sr,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff",maxHeight:"none",width:"100%"},expanded:n,onChange:()=>i((e=>!e)),children:[o(dr,{expandIcon:o(A,{children:o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:o($,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),o(cr,{children:t(z,{width:"100%",children:[o(nt,{node:e}),Pn(e)===Mr.OBJECT&&o(ot,{properties:Nn(e).properties,parentNames:[...r,e.name]})]})})]}):null},at=Object.values(Dr).sort(((e,r)=>e.localeCompare(r))),st=({nodeFieldName:e,control:r})=>t(i,{children:[o(Te,{children:o(gl,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),o(Te,{children:o(Kr,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Dr.HALF_UP,options:at})})]}),dt=({setValue:e,nodeFieldName:r,control:l,defaultValue:n=""})=>(g((()=>{n&&e(`${r}.format`,n)}),[n,e,r]),o(Te,{children:o(Jr,{required:!0,control:l,defaultValue:n,name:`${r}.format`,label:"Format"})})),ct={key:"",nodeType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ut=({setValue:e,control:r,parentNodeFieldName:l,entityDefinition:n=!1,globalParameter:a=!1,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const c=T({control:r,name:`${l}.memberNodes`});return t(i,{children:[o($,{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(St,{setValue:e,control:r,nodeFieldName:`${l}.memberNodes`,entityDefinition:n,globalParameter:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(M,{sx:{marginTop:4},variant:"contained",size:"small",color:"primary",onClick:()=>e(`${l}.memberNodes`,null),children:"Delete"})]}):o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>e(`${l}.memberNodes`,ct),sx:{margin:"8px 0"},children:"Add node"})]})},pt=({entityDefinition:e,globalParameter:r,customPropertyFields:l,index:n,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(n===a&&!h.key);return o(Te,{size:12,ref:e=>g.current[n]=e,children:t(sr,{expanded:v,onChange:()=>C(!v),elevation:3,children:[o(dr,{expandIcon:o(pr,{}),children:o($,{color:m&&m[n]?"secondary":"initial",style:{wordBreak:"break-word"},children:h.name||`Property ${n+1}`})}),o(cr,{children:v&&o(St,{isObjectProperty:!0,control:d,setValue:c,nodeFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:l,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),!f&&o(ur,{children:o(M,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(n),children:"Remove"})})]})})},mt={propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ht=y((({properties:e,hideAddButton:r,focusOnIndex:l,required:n,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:T,watch:L}=F({mode:"all",defaultValues:{properties:e}}),{fields:R,append:A,remove:S}=k({control:y,name:"properties"}),{fieldState:{error:N}}=V({control:y,name:"properties",defaultValue:null,rules:{validate:e=>!n||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=f([]),I=v((()=>{A(mt),C("properties")}),[A,C]),P=v((e=>{c&&c(e),S(e)}),[c,S]);return g((()=>{"number"==typeof l&&D.current[l]&&D.current[l].scrollIntoView({behavior:"smooth",block:"start"})}),[l,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:T})),[O,I,P,T]),t(i,{children:[N&&N.message&&o(Te,{size:12,children:o($,{color:"secondary",children:N.message})}),Array.isArray(R)&&R.map(((e,r,l)=>o(pt,{item:e,index:r,arrLength:l.length-1,control:y,watch:L,setValue:E,customPropertyFields:d,entityDefinition:a,globalParameter:s,error:N,rootNode:m,handleRemoveParameter:P,fileReferenceValueComponent:p,entityReferenceValueComponent:u,extRefs:D},e.id))),!r&&t(Te,{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})]})]})})),gt=({properties:e=[]})=>{const r=h((()=>Array.isArray(e)?e.map((e=>{const r=Pn(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===Mr.OBJECT&&Array.isArray(e.properties)?o(gt,{properties:e.properties}):(null==e?void 0:e.memberNodes)&&o(gt,{properties:e.memberNodes.properties})}})):[]),[e]);return o(en,{data:r})},ft={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},bt=({control:e,parentNodeFieldName:r,entityDefinition:l=!1,globalParameter:n=!1,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const d=f(null),{field:{onChange:c}}=V({control:e,name:`${r}.properties`,defaultValue:null}),u=T({control:e,name:`${r}.properties`,defaultValue:null}),p=T({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,l)=>e!==l)))}),[u,c]),g=Gr(),[C,y]=b(0),x=v((()=>{if((null==u?void 0:u.length)>0){m(ft);const e=u.length;y(e)}else m(ft);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(Te,{container:!0,spacing:2,direction:"column",children:[o(Te,{children:o($,{variant:"h6",children:"Properties"})}),o(Te,{children:o(gt,{properties:u})}),o(Te,{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(Te,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[t(Te,{size:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[o(lr,{nonLinear:!0,activeStep:C,orientation:"vertical",style:{paddingLeft:"4px"},children:Array.isArray(u)&&(null==u?void 0:u.map(((e,r)=>t(nr,{onClick:()=>(e=>y(e))(r),style:{cursor:"pointer"},children:[o(tr,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),o(or,{})]},r))))}),o(M,{variant:"contained",size:"small",color:"primary",onClick:x,sx:{marginTop:2},children:"Add property"})]}),o(Te,{size:9,style:{height:"100%",overflowY:"auto"},children:o(Te,{container:!0,direction:"column",spacing:2,children:o(ht,{ref:d,properties:u,hideAddButton:!0,parentRemove:h,focusOnIndex:C,entityDefinition:l,globalParameter:n,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})})]})}),o(I,{children:o(M,{variant:"contained",color:"primary",onClick:E,children:"Ok"})})]})]})},vt=({propertyFieldName:e,control:r})=>t(i,{children:[o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]}),Ct=({setValue:e,control:r,nodeType:l,nodeFieldName:n,entityDefinition:a=!1,globalParameter:s=!1,fileReferenceValueComponent:d,entityReferenceValueComponent:c})=>{switch(l){case Mr.STRING:return t(i,{children:[o($,{variant:"h6",mb:1,children:"Restricted Values"}),o(Ol,{name:`${n}.restrictedValues`,control:r})]});case Mr.BIG_DECIMAL:return o(st,{nodeFieldName:n,control:r});case Mr.DATE:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:jr});case Mr.TIME:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:Hr});case Mr.DATE_TIME:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:_r});case Mr.ENTITY_REFERENCE:return o(vt,{control:r,propertyFieldName:n});case Mr.OBJECT:return o(bt,{control:r,parentNodeFieldName:n,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});case Mr.ARRAY:return o(ut,{setValue:e,control:r,parentNodeFieldName:n,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});default:return null}},yt=({control:e,nodeFieldName:r,name:l,label:n="",required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const s=T({control:e,name:`${r}.nodeType`}),d=T({control:e,name:`${r}.format`}),c=T({control:e,name:`${r}.restrictedValues`}),u=T({control:e,name:`${r}.properties`}),p=T({control:e,name:`${r}.isRequired`}),m=h((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:n,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,n,p,u,t]);return o(hr,{dateAdapter:mr,children:"ARRAY"===m.nodeType?o(Qn,{control:e,name:l,node:m,title:n,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a}):o($n,{control:e,name:l,node:m,title:n,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})},xt=({name:e,control:r,setValue:l})=>{const n=h((()=>({type:""})),[]),{fields:i,append:a,remove:s}=k({control:r,name:e});return t(z,{mt:2,children:[o(M,{variant:"outlined",size:"small",onClick:()=>a(n),children:"Add node"}),i.map((({id:n},t)=>o(kt,{setValue:l,control:r,removeHandle:()=>s(t),name:`${e}.${t}`},n)))]})},Et=E(""),Ot=({name:e,control:r})=>t(i,{children:[o($,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Jr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),wt=({name:e,control:r})=>t(i,{children:[o($,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Jr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),t(z,{mt:2,children:[o(Ur,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),o(Ur,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),Vt=["STRING_REGEX","JSON_SCHEMA"],Tt=new Set([Mr.INTEGER,Mr.FLOAT,Mr.DOUBLE,Mr.BIG_DECIMAL,Mr.BIG_INTEGER,Mr.LONG]),Lt=({name:e,control:r,setValue:l})=>{const n=O(Et),a=T({control:r,name:`${e}.type`}),s=h((()=>{if("STRING_REGEX"===a)return o(Jr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case n===Mr.STRING:return o(Ot,{name:`${e}.node`,control:r});case Tt.has(n):return o(wt,{name:`${e}.node`,control:r});case n===Mr.OBJECT:case n===Mr.ARRAY:return o(dl,{label:"Properties",control:r,name:`${e}.node.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,a,r,e]);return g((()=>{Tt.has(n)&&"JSON_SCHEMA"===a&&(l(`${e}.node.exclusiveMinimum`,!1),l(`${e}.node.exclusiveMaximum`,!1))}),[n,a,l,e]),o(en,{data:[{label:"Validator",content:t(i,{children:[o(z,{children:o(Kr,{control:r,name:`${e}.type`,label:"Type",options:Vt,onChange:r=>{l(e,{type:r.target.value})}})}),o(z,{mt:2,children:s})]})}]})},Rt=["AND","OR","NOT","NODE"],kt=({name:e,removeHandle:r,control:l,setValue:n})=>{const a=O(Et),s=f(a),d=T({control:l,name:`${e}.type`}),c=h((()=>({AND:o(xt,{name:`${e}.nodes`,control:l,setValue:n}),OR:o(xt,{name:`${e}.nodes`,control:l,setValue:n}),NODE:o(Lt,{name:`${e}.validator`,control:l,setValue:n}),NOT:o(kt,{name:`${e}.node`,control:l,setValue:n})})),[e,l,n]),u=v((r=>{n(e,{type:r.target.value})}),[]);return g((()=>{d&&s.current!==a&&(s.current=a,n(e,{type:""}))}),[n,a,s.current,d,e]),o(en,{data:[{label:"Node Type",content:t(i,{children:[t(z,{display:"flex",alignItems:"flex-start",children:[o(Kr,{required:!0,onChange:u,control:l,name:`${e}.type`,label:"Type",options:Rt}),r&&o(z,{ml:2,mt:6,children:o(S,{onClick:r,children:o(rr,{})})})]}),o(z,{children:c[d]})]})}]})},Ft=({name:e,control:r,setValue:l,enable:n})=>{const[a,s]=b(!1),d=v((r=>{s(r.target.checked),r.target.checked||l(e,null)}),[l,e]);return g((()=>{n&&!a&&s(!0)}),[n,a]),t(i,{children:[t(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o($,{component:"h6",color:"initial",style:{wordBreak:"break-word",fontSize:18},children:"Validator"}),o(_,{label:"Enable",control:o(W,{color:"primary",checked:n,onChange:d})})]}),a&&o(kt,{name:e,control:r,setValue:l})]})},At=Object.values(Mr).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),St=m((({setValue:e,control:r,nodeFieldName:l,entityDefinition:n=!1,globalParameter:a=!1,customPropertyFields:s=[],fileReferenceValueComponent:d,isObjectProperty:c,isObjectNode:u})=>{var p,m;const f=T({control:r,name:`${l}.nodeType`}),b=T({control:r,name:`${l}.isRequired`}),C=T({control:r,name:`${l}.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(`${l}.nodeType`,At.find((e=>e.value===f))):u&&e(`${l}.nodeType`,At.find((e=>e.value===Mr.OBJECT)))}),[f,e,l,u]);const w=h((()=>{let e=At;return a&&(e=At.filter((e=>e.value!==Mr.ANY))),e}),[a]),V=!a||(null!==(p=null==f?void 0:f.value)&&void 0!==p?p:f)!==Mr.OBJECT;return t(Te,{container:!0,direction:"column",spacing:2,children:[c&&o(Te,{children:o(Jr,{required:!0,control:r,name:`${l}.key`,label:"Key",validate:x})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${l}.name`,label:"Name"})}),o(Te,{children:o(tl,{required:!0,control:r,name:`${l}.nodeType`,label:"Type",options:w,disabled:u,onChange:(r,n)=>{const t=`${l}.nodeType`;e(`${l}.${a?"value":"defaultValue"}`,null),e(t,n)}})}),o(Te,{children:o(gl,{required:!0,control:r,name:`${l}.sortOrder`,label:"Sort Order"})}),o(Te,{children:o(dl,{control:r,name:`${l}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),t(Te,{children:[o(Ur,{control:r,name:`${l}.isEnabled`,label:"Enabled"}),o(Ur,{control:r,name:`${l}.isRequired`,label:"Required"}),n&&o(Ur,{control:r,name:`${l}.isViewableInList`,label:"Is viewable in list"}),y.length?o(i,{children:y.map(((e,n)=>o(Ur,{control:r,name:`${l}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),f&&t(i,{children:[o(Te,{children:o(Et.Provider,{value:null!==(m=f.value)&&void 0!==m?m:f,children:o(Ft,{control:r,setValue:e,enable:C,name:`${l}.validationNode`})})}),o(Te,{children:o(Ct,{setValue:e,control:r,nodeType:"string"==typeof f?f:f.value,nodeFieldName:l,globalParameter:a,entityDefinition:n,fileReferenceValueComponent:d})}),V&&o(Te,{children:o(yt,{control:r,nodeFieldName:l,name:`${l}.${a?"value":"defaultValue"}`,label:O,required:!!a&&b,fileReferenceValueComponent:d})})]})]})})),Nt=y((({node:e,entityDefinition:r=!1,globalParameter:l=!1,customPropertyFields:n=[],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($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(St,{control:c,setValue:u,nodeFieldName:"node",isObjectNode:s,entityDefinition:r,globalParameter:l,customPropertyFields:n,entityReferenceValueComponent:i,fileReferenceValueComponent:a})]})})),Mt=({control:e,parentFieldName:r,required:l,entityDefinition:n=!1,globalParameter:i=!1,customPropertyFields:a=[],entityReferenceValueComponent:s,fileReferenceValueComponent:d,isObjectNode:c})=>{const u=h((()=>r?`${r}.node`:"node"),[r]),{setValue:p,watch:m}=R(),{fieldState:{error:g}}=V({control:e,name:u,rules:{validate:e=>!l||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}});return t(z,{mt:2,children:[g&&g.message&&o(Te,{size:12,children:o($,{color:"secondary",children:g.message})}),o($,{component:"h6",color:"initial",mb:3,sx:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(St,{control:e,setValue:p,isObjectNode:c,nodeFieldName:u,entityDefinition:n,globalParameter:i,customPropertyFields:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})]})},Dt=y((({control:e,definitionFieldName:r,isObjectNode:l,title:n,hideCodeField:i,hideVersionField:a,hideNameField:s,required:d=!1,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=R(),g=h(r?`${r}.node`:"node");return t(Te,{container:!0,direction:"column",spacing:2,children:[n&&o(Te,{size:12,children:o(z,{my:2,children:o($,{variant:"h6",children:n})})}),!s&&o(Te,{size:12,children:o(Jr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!i&&o(Te,{size:12,children:o(Jr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!a&&o(Te,{size:12,children:o(gl,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),o(Te,{size:12,children:p?o(Nt,{node:g,ref:p,isObjectNode:l,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):o(Mt,{control:e,required:d,isObjectNode:l,parentFieldName:r,entityReferenceValueComponent:c,fileReferenceValueComponent:u})})]})})),It=({node:e,data:r})=>{const{name:l}=e,n=v(((e,r)=>{const l=e,n=document.createElement("a");document.body.appendChild(n),n.href=l,n.target="_self",n.download=r,n.click()}),[]);return o(M,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,l),children:"Download File"})},Pt=({node:e,data:r})=>{var l;const n=e=>o(z,{sx:{borderRadius:"4px",padding:"4px",wordBreak:"auto-phrase"},children:yr(e)?"null":ar(e)?JSON.stringify(e,null,2):e.toString()});switch(Pn(e)){case Mr.ARRAY:return Array.isArray(r)?o("div",{children:null==r?void 0:r.map(((r,l)=>o(Pt,{node:e.memberNodes,data:ar(r)?r:r+","},l)))}):n(r);case Mr.OBJECT:return Array.isArray(e.properties)&&(null===(l=e.properties)||void 0===l?void 0:l.length)?o(Bt,{node:e,data:r}):"object"==typeof r?o(Yl,{value:r}):n(r);case Mr.ANY:return"object"==typeof r?o(Yl,{value:r}):n(r);case Mr.FILE_REFERENCE:return null===r?n(r):o(M,{component:oe,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case Mr.FILE:return yr(r)?n(r):"string"==typeof r?o(It,{data:r,node:e}):n(r);default:return n(r)}},qt=({node:e,data:r,hasBackground:l=!1})=>o(z,{sx:{backgroundColor:l?"#f1f1f1":"none"},children:o(Pt,{node:e,data:r})}),Bt=({node:e,data:r})=>{const l=v(((e,r)=>{var n;if(e&&r){console.log(e,r);const i=e.key?r[e.key]:r,a=Pn(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===Mr.OBJECT&&Array.isArray(e.properties)&&(null===(n=e.properties)||void 0===n?void 0:n.length)?e.properties.map((e=>l(e,i))):o(qt,{node:e,data:i})}}return null}),[]);return o(Te,{container:!0,direction:"column",spacing:2,children:o(en,{data:[l(e,r)]})})},zt=({properties:e,parentKey:r="",activePath:l="",prefix:n="",onClick:i})=>o(lr,{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(nr,{expanded:!0,onClick:()=>{return e=s,void i(n?`${n}.${e}`:e);var e},children:[o(tr,{slotProps:{stepIcon:{icon:"",completed:!1,active:l===s}},children:t(z,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),o(or,{children:o("div",{children:d===Mr.OBJECT&&o(zt,{onClick:i,activePath:l,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))}),$t=({open:e=!1,onClose:r,onPaste:l,properties:n})=>{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==n?void 0:n.length)?n.map(((e,r)=>t("div",{children:[o($,{variant:"h6",children:e.title}),o(zt,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:i})]},r))):o($,{children:"Please, add properties"}),i&&t($,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",i,")"]})]}),t(I,{children:[o(M,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${i})`),Er.success("Copied!")},children:"Copy"}),o(M,{variant:"contained",color:"primary",onClick:()=>{l(`$(${i})`),Er.success("Pasted!")},children:"Paste"}),o(M,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},jt=E({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Ht=()=>O(jt),_t=({children:e})=>{const[r,l]=b("true"===localStorage.getItem("sidebar_collapsed")),n=v((()=>{l(!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(jt.Provider,{value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:t},children:e})},Jt=ze("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Wt=ze(wr)((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}}}))),Gt=ze(kr)((({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"}}}))),Yt=ze(Vr)((e=>({padding:e.theme.spacing(3),margin:0}))),Zt=ze(br)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),Kt=ze(Lr)((({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"}}}}))),Ut=ze(Tr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Xt=ze(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}}))),Qt=ze(Rr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),eo=ze(Vr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),ro=ze(Fr)((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)"}}}))),lo=({route:e,isActive:r,isSubmenu:l})=>{const{collapsed:n}=Ht(),[a,s]=p.useState(null),d=Boolean(a),c=e=>{s(e.currentTarget)},u=()=>{s(null)},m=v((({children:r})=>n&&!l?o(le,{title:e.name,placement:"right",children:r}):r),[n,e,l]);return e.link?o(Zt,{disablePadding:!0,component:oe,replace:!0,to:{pathname:e.link,search:e.query},children:o(m,{children:t(Kt,{className:xr({active:r,main:e.main,collapsed:n}),children:[e.icon&&o(Ut,{className:xr({collapsed:n}),children:e.icon}),o(Qt,{primary:e.name,className:xr({collapsed:n,main:e.main}),sx:n&&!l?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}})]})})}):e.children&&n?t(i,{children:[o(Xt,{className:"collapsed",children:o(le,{title:e.name,placement:"right",children:o(Kt,{className:xr({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:c,children:e.name.substring(0,1)})})}),o(Ke,{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(io,{route:e,isSubmenu:!0},r)))})]}):o(Xt,{children:e.name})};var no="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 to=({route:e,isActive:r,isListOpen:l,handleClick:n,isSubmenu:i})=>o(Xt,{children:o(Yt,{sx:{padding:0,margin:0},children:o(Zt,{disablePadding:!0,onClick:n,children:t(Kt,{className:xr({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[o(Qt,{primary:e.name,className:xr({main:e.main}),sx:i?{}:{display:"none"}}),e.name,o(z,{component:"img",src:no,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?0:"-90deg"})`}})]})})})});function oo({route:e,isActive:r,isListOpen:l,handleClick:n,isSubmenu:i}){const{collapsed:a}=Ht();return(null==e?void 0:e.link)?o(Zt,{disablePadding:!0,onClick:n,children:t(Kt,{className:xr({active:r,main:e.main,collapsed:a}),children:[e.icon&&o(Ut,{children:e.icon}),o(Qt,{primary:e.name,className:xr({collapsed:a,main:e.main}),sx:a&&!i?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}}),o(z,{component:"img",src:no,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?o(to,{route:e,handleClick:n,isListOpen:l}):o(Xt,{children:e.name})}const io=({route:e,isSubmenu:r})=>{var l,n,a;const s=te(),{collapsed:d,toggleRootElementLink:c}=Ht(),[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===(l=e.children)||void 0===l?void 0:l.length)&&(!d||d&&r)?t(i,{children:[o(oo,{route:e,isActive:C,handleClick:y,isListOpen:m,isSubmenu:r}),o(Ar,{in:!m,timeout:"auto",children:o(eo,{children:e.children.map((e=>o(io,{route:e,isSubmenu:r},e.name)))})})]}):(null===(n=e.children)||void 0===n?void 0:n.length)&&(!d||d&&r)?t(i,{children:[o(oo,{route:e,isActive:C,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),o(Ar,{in:u||!e.link,timeout:"auto",children:o(eo,{children:null===(a=e.children)||void 0===a?void 0:a.map(((e,l)=>o(io,{route:e,isSubmenu:r},e.name)))})})]}):o(lo,{route:e,isActive:C,isSubmenu:r})};const ao=({title:e,routes:r,id:l,logo:n,collapsedLogo:i,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=Ht();return t(Jt,{children:[o(ro,{className:xr("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(Wt,{variant:"permanent",anchor:"left",className:xr({collapsed:d}),id:l,children:[(!!e||!!n)&&o(Gt,{className:xr({collapsed:d}),"data-title":e.substring(0,1),children:t(z,{display:"flex",flexDirection:"column",children:[!!e&&o(z,{component:"span",children:e}),!!n&&o(z,{component:"img",src:d?i:n,alt:"Lending Hub KZ"})]})}),t(z,{height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[o(Yt,{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(io,{route:e},e.name)))}),a&&o(z,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})},so=({routes:e,theme:r=Ln,title:l="",id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>t(n,{theme:r,children:[o(Or,{}),o(_t,{children:o(ao,{title:l,routes:e,id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),co=({src:e,alt:r})=>o(z,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:o("img",{src:e,alt:r})}),uo=({children:e,toolbar:r,contentSx:l,sx:n})=>t(z,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n),children:[o(kr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),o(z,{sx:Object.assign(Object.assign({},l),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:o(w,{fallback:o(Ir,{}),children:null!=e?e:o(ae,{})})})]}),po=ze(oe)((()=>({textDecoration:"none",color:"inherit"}))),mo=({crumbs:e})=>o(Sr,{separator:o(Nr,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?o(po,{to:e.link,className:"breadcrumb",children:e.title},r):o($,{className:"breadcrumb",children:e.title},r)))});export{Pr as AlertDialog,_n as ArrayNodeFormBuilder,Qn as ArrayNodeFormBuilderControl,sl as BackButton,mo as Breadcrumbs,uo as ContentLayout,Ol as ControlArrayInput,tl as ControlAutocomplete,Ur as ControlCheckbox,dl as ControlCodeEditor,Cl as ControlDate,xl as ControlDateTime,Yr as ControlDebouncedInput,Jr as ControlInput,gl as ControlNumberInput,wl as ControlPeriodInput,Vl as ControlPhoneInput,il as ControlQueryAutocomplete,Xr as ControlRadio,Kr as ControlSelect,fl as ControlSwitch,El as ControlTime,al as CopyButton,Dt as CreateDefinition,Nt as CreateNode,Mt as CreateNodeWithContext,jr as DATE_DEFAULT_FORMAT,_r as DATE_TIME_DEFAULT_FORMAT,$r as DEFAULT_DATE_VALIDATION_ERROR_TEXT,hl as DEFAULT_ERROR_TEXT,zr as DEFAULT_REQUIRED_ERROR_TEXT,Jn as DefinitionFiller,Bt as DefinitionView,Kl as InfoItem,Zl as JsonModalView,$t as JsonPathPicker,Yl as JsonView,Ir as Loader,co as MenuIcon,Un as NodeFormBuilderContext,$n as NodeFormBuilderControl,Mr as NodeType,ht as ObjectNodeProperties,tt as ObjectNodeView,dn as OverflowTip,Zr as PopupIconComponent,Dr as RoundingMode,Gl as RouteTabs,so as Sidebar,_l as SimpleTable,un as Status,en as StepperView,Hr as TIME_DEFAULT_FORMAT,Wl as TabPanel,Il as Table,Pl as TableAction,Jl as TableActionCell,it as ViewNode,mn as blue,hn as brand,nn as capitalize,gn as dark,sn as deepParseJson,qr as defaultDefinitionArrayValue,Br as defaultDefinitionObjectValue,cl as digitsOnly,ul as floatsOnly,An as formatDefinitionNodeData,Rn as formatTableRowValue,Mn as getDemNodeDateFormat,on as getJsonStringValue,In as getMultipleNodeFillOptions,Pn as getNodeType,Dn as getObjectStarterValue,qn as getSingleNodeFillOptions,fn as green,pl as isExpression,kn as isValueEmpty,Sn as nodePropertiesArrayToObject,Nn as nodePropertiesObjectToArray,ml as numberFormat,bn as orange,vn as red,rn as removeArrayItem,an as safeParseJson,tn as sortArrayOfObjects,Ln as theme,Wr as useDebounce,Gr as useToggle,ln as validateJson,Cn as white,yn as yellow};
|
1
|
+
import{useTheme as e,createTheme as r,responsiveFontSizes as l,ThemeProvider as n}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 T,Controller as L,useFormContext as R,useFieldArray as k,useForm as F}from"react-hook-form";import A from"@mui/material/SvgIcon";import S 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 $ from"@mui/material/Typography";import j 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 le from"@mui/material/Tooltip";import{useNavigate as ne,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/material/Switch";import{DatePicker as pe}from"@mui/x-date-pickers/DatePicker";import{format as me,isValid as he,parse as ge,isMatch as fe,startOfTomorrow as be,endOfYesterday as ve,isToday as Ce,isAfter as ye,isBefore as xe}from"date-fns";import{DateTimePicker as Ee}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as Oe}from"@mui/x-date-pickers/TimePicker";import{renderTimeViewClock as we}from"@mui/x-date-pickers/timeViewRenderers";import Ve from"@mui/material/Chip";import Te from"@mui/material/Grid2";import{toString as Le,parse as Re}from"duration-fns";import ke from"react-input-mask";import Fe from"@mui/material/Pagination";import Ae from"@mui/material/TablePagination";import{useGridApiContext as Se,useGridSelector as Ne,gridPageSelector as Me,gridPageCountSelector as De,gridRowCountSelector as Ie,gridPageSizeSelector as Pe,DataGrid as qe,GridActionsCellItem as Be}from"@mui/x-data-grid";import{styled as ze}from"@mui/system";import $e from"@mui/material/Table";import je from"@mui/material/TableBody";import He from"@mui/material/TableCell";import _e from"@mui/material/TableContainer";import Je from"@mui/material/TableHead";import We from"@mui/material/TableRow";import Ge from"@mui/material/TableFooter";import Ye from"@mui/material/Backdrop";import Ze from"@mui/material/TableSortLabel";import Ke from"@mui/material/Menu";import Ue from"@mui/icons-material/MoreHoriz";import Xe from"@mui/material/Paper";import Qe from"@mui/material/Tab";import er from"@mui/material/Tabs";import rr from"@mui/icons-material/DeleteOutline";import lr from"@mui/material/Stepper";import nr from"@mui/material/Step";import tr from"@mui/material/StepLabel";import or from"@mui/material/StepContent";import ir from"@mui/material/StepConnector";import ar from"lodash/isPlainObject";import sr from"@mui/material/Accordion";import dr from"@mui/material/AccordionSummary";import cr from"@mui/material/AccordionDetails";import ur from"@mui/material/AccordionActions";import{ExpandMore as pr}from"@mui/icons-material";import{AdapterDateFns as mr}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as hr}from"@mui/x-date-pickers/LocalizationProvider";import gr from"@mui/material/Select";import fr from"@mui/material/InputLabel";import br from"@mui/material/ListItem";import vr from"@mui/icons-material/CheckBoxOutlineBlank";import Cr from"@mui/icons-material/CheckBox";import yr from"lodash/isNil";import xr from"classnames";import{toast as Er}from"react-toastify";import Or from"@mui/material/CssBaseline";import wr from"@mui/material/Drawer";import Vr from"@mui/material/List";import Tr from"@mui/material/ListItemIcon";import Lr from"@mui/material/ListItemButton";import Rr from"@mui/material/ListItemText";import kr from"@mui/material/Toolbar";import Fr from"@mui/material/ButtonBase";import Ar from"@mui/material/Collapse";import Sr from"@mui/material/Breadcrumbs";import Nr from"@mui/icons-material/NavigateNext";var Mr,Dr;!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"}(Mr||(Mr={})),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"}(Dr||(Dr={}));const Ir=m((function({transparent:e=.3,position:r="absolute",bgcolor:l="#fff"}){const n=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(j,{sx:{zIndex:1,position:"relative"}}),o(z,{sx:{opacity:n},position:"absolute",top:0,left:0,width:"100%",height:"100%",bgcolor:l})]})})),Pr=({open:e,title:r,description:l,closeButtonTitle:n="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(Ir,{}),t(B,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[o($,{variant:"inherit",children:r}),!g&&o(S,{sx:{padding:0,height:"28px",width:"28px"},onClick:i,children:o(A,{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:[l&&o(q,{id:"alert-dialog-description",children:l}),o(z,{maxWidth:"100%",overflow:"hidden",children:u})]}),t(I,{children:[!g&&o(M,{onClick:i,variant:"outlined",children:n}),a&&c?o(M,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))}),qr={code:"",name:"",version:0,properties:[]},Br={code:"",name:"",version:0,properties:{}},zr="Please, fill this field",$r="Incorrect date format",jr="yyyy-MM-dd",Hr="HH:mm:ss",_r="yyyy-MM-dd'T'HH:mm:ss.SSSZ",Jr=e=>{var r,l,{control:n,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:n,defaultValue:m,rules:{required:!!p&&(v||zr),validate:s}}),x=y.field,{ref:E,onChange:O,value:w}=x,T=a(x,["ref","onChange","value"]),{fieldState:{error:L}}=y;return o(d,Object.assign({},T,{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:!!L,helperText:!f&&(null==L?void 0:L.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!==(l=null===(r=null==C?void 0:C.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==l?l:{}),{value:null!=w?w:""})},onChange:b||O},C))};function Wr(e,r){const l=f();g((()=>()=>{l.current&&clearTimeout(l.current)}),[]);return(...n)=>{clearTimeout(l.current),l.current=setTimeout((()=>{e(...n)}),r)}}const Gr=()=>{const[e,r]=b(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Yr=e=>{var r,l,{control:n,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:L},fieldState:{error:R}}=V({name:c,control:n,defaultValue:m,rules:{required:!!p&&(x||zr),validate:s}}),k=T({control:n,name:c}),[F,A]=b("");g((()=>{!F&&k&&A(k)}),[F,k]);const S=Wr((e=>{L(e)}),200),N=v((e=>{A(e.target.value),S(e.target.value)}),[S]);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:!!R,helperText:!C&&(null==R?void 0:R.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!==(l=null===(r=null==O?void 0:O.slotProps)||void 0===r?void 0:r.htmlInput)&&void 0!==l?l:{}),{value:null!=F?F:""})}},O))},Zr=()=>o(A,{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"})}),Kr=e=>{var r,l,n,{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 T=V({name:p,control:s,defaultValue:g,rules:{required:!!h&&(O||zr),validate:u}}),L=T.field,{ref:R,onChange:k,value:F}=L,M=a(L,["ref","onChange","value"]),{fieldState:{error:D}}=T,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):k(null)}),[k,C]);return o(d,Object.assign({},M,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:R,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||k,slotProps:{input:Object.assign({endAdornment:!h&&F?o(N,{position:"end",sx:{mr:0},children:o(S,{onClick:q,size:"small",children:o(A,{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!==(n=null===(l=null==w?void 0:w.slotProps)||void 0===l?void 0:l.htmlInput)&&void 0!==n?n:{}),{value:null!=F?F:""})}},w,{children:E.map(((e,r)=>o(c,{value:I(e),children:P(e)},r)))}))},Ur=e=>{var{control:r,validate:l,name:n="",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:n,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:n,ref:b,disabled:c,color:"secondary"},m)),label:i}),!u&&(null==x?void 0:x.message)&&o(J,{variant:"standard",children:x.message})]})},Xr=({name:e,label:r,values:l=[],control:n,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:n,defaultValue:s,rules:{required:!!i&&(b||zr),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]),T=v((e=>"string"==typeof e?e:u?e[u]:e.label),[u]),L=v((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),R=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||R,children:l.map(((e,r)=>o(_,{value:w(e),control:o(G,Object.assign({},f,{checked:L(w(e))})),label:T(e)},r)))})),!c&&(null==O?void 0:O.message)&&o(J,{variant:"standard",children:O.message})]})},Qr=({valueKey:e,labelKey:r})=>{const l=v(((r,l)=>{if(r&&l){if("string"==typeof r)return r===l;if(e)return U(r,e)===U(l,e)||U(r,e)===l;if(r.value)return r.value===l.value||r.value===l}return!1}),[e]),n=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}),n(r))),[n]);return{isOptionEqualToValue:l,getOptionLabel:n,renderOption:t}},el=u.createContext({}),rl=u.forwardRef(((e,r)=>{const l=u.useContext(el);return o("div",Object.assign({ref:r},e,l))}));function ll(e){const{data:r,index:l,style:n}=e,t=r[l],i=Object.assign(Object.assign({},n),{top:n.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($,Object.assign({component:"li"},d,{noWrap:!0,style:i,children:t}),s)}const nl=u.forwardRef((function(r,l){const{children:n}=r,t=a(r,["children"]),i=[];n.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:l,children:o(el.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:rl,innerElementType:"ul",itemSize:e=>m(i[e]),overscanCount:5,itemCount:c,children:ll})})})})),tl=e=>{var{control:r,validate:l,name:n="",label:s="",required:c=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:m=!1,onChange:h,labelKey:f,valueKey:v,options:C=[],multiple:y,textFieldProps:x={},disableCloseOnSelect:E,useStringValue:O,requiredErrorText:w="",startAdornment:T,endAdornment:L,useVirtualList:R}=e,k=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:n,control:r,defaultValue:u||(y?[]:null),rules:{required:!!c&&(w||zr),validate:l}}),A=F.field,{ref:S,onChange:N,value:M}=A,D=a(A,["ref","onChange","value"]),{fieldState:{error:I}}=F,[P,q]=b(),{getOptionLabel:B,isOptionEqualToValue:z,renderOption:$}=Qr({valueKey:v,labelKey:f});return g((()=>{"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:R,getOptionLabel:B,isOptionEqualToValue:z,disableCloseOnSelect:E||y,filterSelectedOptions:y,onChange:h||((e,r)=>{N(O&&v?U(r,v):r),q(r)}),renderOption:$,slotProps:{listbox:{component:R?nl:null}},renderInput:e=>o(d,Object.assign({},e,{variant:"outlined",name:n,label:c?t(i,{children:[s," ",o("span",{children:"*"})]}):s,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==k?void 0:k.placeholder,error:!!I,inputRef:S,helperText:!m&&(null==I?void 0:I.message),slotProps:{input:Object.assign(Object.assign({},e.InputProps),{startAdornment:T||e.InputProps.startAdornment,endAdornment:L||e.InputProps.endAdornment}),formHelperText:{variant:"standard"},inputLabel:{shrink:!!(null==k?void 0:k.placeholder)}}},x))},k))};const ol=()=>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 il(e){var{name:r,label:l,control:n,required:s=!1,searchBy:c,labelKey:u,multiple:m=!1,mongoQueryJson:f,disabled:C,valueKey:y,sortBy:x="",hideErrorMessage:E,disableCloseOnSelect:O,textFieldProps:w,onChange:T,queryFunction:L,validate:R,itemQueryFunction:k,requiredErrorText:F="",startAdornment:A,endAdornment:S,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:n,name:r,defaultValue:m?[]:null,rules:{required:!!s&&(F||zr),validate:R}}),P=I.field,{ref:q,onChange:B,value:z}=P,$=a(P,["ref","onChange","value"]),{fieldState:{error:H,isDirty:_}}=I,{getOptionLabel:J,isOptionEqualToValue:W,renderOption:G}=Qr({valueKey:y,labelKey:u}),[Y,Z]=b([]),[X,Q]=b(!1),[ee,le]=b(""),[ne,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,ne],queryFn:({pageParam:e})=>L(Object.assign({page:`${e}`,size:"20",sort:x},ne?{[c]:ne}:{})),getNextPageParam:(e,r,l)=>e.totalPages&&e.totalPages!==l+1?l+1:null}),ue=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>ue(e,r)));{const l={};for(const n in e)l[n]=ue(e[n],r);return l}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},pe=Wr((e=>{if(f){const r=ue(f,e);te(JSON.stringify(r))}else te(e)}),500),me=v(((e,r)=>{Z([]),le(r),pe(r)}),[pe]),he=v(((e,r,...l)=>{B(r),T&&T(e,r,...l)}),[B,T]);g((()=>{(null==ie?void 0:ie.pages)&&Z(ne?ie.pages[0].collection:ie.pages.reduce(((e,r)=>(e.push(...r.collection),e)),[]))}),[ie,ne]),g((()=>{if(!_&&z&&k){let e=z;"object"==typeof z&&y in z&&(e=U(z,y)),k(e).then((e=>{B(e),le(U(e,u))})).catch(console.error)}}),[z,_,y,u,k,B]);const ge=v((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&de&&!se&&ce()}),[de,se,ce]);return o(K,Object.assign({},$,{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(ol,{}),slotProps:{listbox:{component:M?nl:null,onScroll:ge}},renderInput:e=>o(d,Object.assign({},e,{label:s?t(i,{children:[l," ",o("span",{children:"*"})]}):l,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:S||t(p.Fragment,{children:[ae?o(N,{position:"end",children:o(j,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:A||e.InputProps.startAdornment})}},w))},D))}const al=({copyText:e,helpText:r="Copy"})=>{const[l,n]=b(r);return l?o(le,{title:l,placement:"top",children:o(S,{onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)},children:o(A,{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},sl=({text:e,buttonProps:r={}})=>{const l=ne(),{state:n}=te(),t=h((()=>null==n?void 0:n.from),[n]),i=v((()=>{l(t||-1)}),[l,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(S,{onClick:i,children:o(A,{children:o("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},dl=y(((e,r)=>{var{control:l,name:n,mode:s="json",label:d,width:c="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:g=!1,hideErrorMessage:f=!1,fontSize:b=16,validate:C=!0,parseValue:y,requiredErrorText:x="",useCleanValue:E}=e,O=a(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const w=V({control:l,name:n,rules:{required:!!m&&(x||zr),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=w.field,{onChange:L,value:R,ref:k}=T,F=a(T,["onChange","value","ref"]),{fieldState:{error:A}}=w,S=h((()=>({json:[de.json()],javascript:[de.javascript()],python:[de.python()]})),[]);console.log("mode",s);const N=h((()=>"text"===s&&"string"!=typeof R?(console.log("first case",R),JSON.stringify(R,null,2)):"json"===s&&"string"!=typeof R?(console.log("second case",R),null===R?"":E?JSON.stringify(R,null,2).replace(/\\"/g,""):JSON.stringify(R,null,2)):"string"==typeof R&&"text"!==s?(console.log("third case",R),E?R.replace(/\\"/g,""):R):(console.log("default case",R),R)),[R,E,s]),M=v((e=>{if(y)try{const r=JSON.parse(e);L(r)}catch(r){L(e)}else L(e)}),[L,y]);return t(z,{display:"flex",flexDirection:"column",width:"100%",children:[o(z,{children:d&&o($,{variant:"subtitle1",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({},F,{ref:r||k,basicSetup:{autocompletion:!0,history:!0},theme:ce,width:c,height:u,style:{fontSize:b,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:N,onChange:M,extensions:"text"===s?[]:S[s]},O)),A&&!f&&o(J,{variant:"standard",error:!0,children:A.message})]})]})})),cl=new RegExp("^[-+]?[0-9]+$"),ul=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),pl=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const l of e)if(pl(l,r))return!0;if("object"==typeof e)for(const l in e)if(pl(e[l],r))return!0}return!1},ml=new Intl.NumberFormat("ru-RU",{style:"decimal"}),hl={required:zr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},gl=e=>{var r,l,{control:n,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||hl),[x]),w=V({name:c,control:n,defaultValue:m,rules:{required:!!p&&O.required,validate:e=>s?"function"!=typeof s||s(e):0===+e||(null===e?!p||O.required:v&&!ul.test(e)||/^-*0+$/.test(e)?O.notValidNumber:!(!v&&!cl.test(e))||O.notValidInteger)}}),T=w.field,{ref:L,onChange:R,value:k}=T,F=a(T,["ref","onChange","value"]),{fieldState:{error:A}}=w;return o(d,Object.assign({},F,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:L,name:c,label:p?t(i,{children:[u," ",o("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!A,helperText:!f&&(null==A?void 0:A.message),disabled:g,value:y?null!==(r=null==k?void 0:k.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=k?k:"",onChange:e=>{let r=e.target.value.replace(/\s/g,"");const l=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(l)||v&&"."===l||"-"===l||"+"===l||r)if(b)b(e);else if(C)if(r)if("0"===r)R(0);else if(v){const e=r.replace(",",".").split(".")[1],l=parseFloat(r.replace(",","."));R(!ul.test(r.replace(",","."))||/^0+$/.test(e)||/^-*0+$/.test(r)||Number.isNaN(l)?r:l)}else R(Number.isNaN(+r.replace(",","."))?r:+r.replace(",","."));else R(null);else R(r);else R(r)},slotProps:{formHelperText:{variant:"standard"},htmlInput:null===(l=null==E?void 0:E.slotProps)||void 0===l?void 0:l.htmlInput}},E))},fl=e=>{var{control:r,name:l,label:n,defaultValue:t}=e,i=a(e,["control","name","label","defaultValue"]);const s=V({control:r,name:l,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:n,name:l,control:o(ue,Object.assign({},p,{color:"primary",size:"small",inputRef:d,onChange:e=>{const{checked:r}=e.target;c(r)},checked:m},i))})};var bl="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 vl=()=>o("img",{src:bl,alt:""}),Cl=e=>{var{control:r,name:l,required:n,label:s,placeholder:d,defaultValue:c,format:u=jr,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(jr),T=V({control:r,name:l,defaultValue:c,rules:{required:!!n&&(m||zr),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:$r;if(C&&e){const r=ge(e,O,new Date),l=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,l)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,l)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,l))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,l))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),L=T.field,{value:R,onChange:k}=L,F=a(L,["value","onChange"]),{fieldState:{error:A}}=T,S=v((e=>{k(he(e)&&O?me(e,O):"")}),[k,O]),N=h((()=>{if(R instanceof Date)return"Invalid Date"==`${R}`?null:R;if("string"==typeof R&&R.length&&O){const e=ge(R,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[R,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:n,children:s}),o(pe,Object.assign({},F,O?{format:O}:{},{value:N,onChange:S,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:!!A,placeholder:d,name:l,helperText:!p&&(null==A?void 0:A.message),slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:vl}},E))]})},yl=()=>o("img",{src:bl,alt:""}),xl=e=>{var{control:r,name:l,required:n,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(),T=V({control:r,name:l,defaultValue:c,rules:{required:!!n&&(m||zr),validate:f||(e=>{if("Invalid Date"==`${e}`)return"Invalid Date";if(""!==e&&O&&e&&!fe(e,O))return null!=y?y:$r;if(C&&e){const r=ge(e,O,new Date),l=new Date;switch(C){case"current":return!!Ce(r)||"Только сегодняшний день";case"gt":return!Ce(r)&&!xe(r,l)||"Только будущие даты";case"lt":return!Ce(r)&&!ye(r,l)||"Только прошлые даты";case"gte":return!(!Ce(r)&&xe(r,l))||"Только текущая или будущие даты";case"lte":return!(!Ce(r)&&ye(r,l))||"Только текущая или прошлые даты";default:return!0}}return!0})}}),L=T.field,{value:R,onChange:k}=L,F=a(L,["value","onChange"]),{fieldState:{error:A}}=T,S=v((e=>{k(he(e)&&O?me(e,O):"")}),[k,O]),N=h((()=>{if(R instanceof Date)return"Invalid Date"==`${R}`?null:R;if("string"==typeof R&&R.length&&O){const e=ge(R,O,new Date);return"Invalid Date"==`${e}`?null:e}return null}),[R,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(Ee,Object.assign({},F,{ampm:!1,label:n?t(i,{children:[s," ",o("span",{children:"*"})]}):s,value:N},O?{format:O}:{},{onChange:S,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:!!A,placeholder:d,name:l,helperText:!p&&(null==A?void 0:A.message),sx:{".MuiInputLabel-root span":{color:"#D6331F"}},slotProps:{formHelperText:{variant:"standard"}}},null==x?void 0:x.textField)}),slots:{openPickerIcon:yl}},E))},El=e=>{var{control:r,name:l,required:n,label:s,format:d=Hr,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:l,defaultValue:m,rules:{required:!!n&&(u||zr),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,[T,L]=b(null);return g((()=>{if(E&&d)try{let e=ge(E,d,new Date);he(e)||(e=ge(E,"HH:mm:ss.SSS",new Date)),L(e)}catch(e){L(E)}}),[E,d]),o(Oe,Object.assign({},O,{inputRef:x,label:n?t(i,{children:[s," ",o("span",{children:"*"})]}):s,ampm:!1,value:T,format:d,onChange:e=>{L(e),y(he(e)?me(e,d):void 0)},viewRenderers:{hours:we,minutes:we},slotProps:Object.assign(Object.assign({},h),{textField:Object.assign({fullWidth:!0,size:"small",variant:"outlined",error:!!w,placeholder:p,name:l,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))},Ol=e=>{var r,l,n,{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&&zr}}),T=w.field,{onChange:L,value:R}=T,k=a(T,["onChange","value"]),{formState:{errors:F}}=w,N=h((()=>g||L),[g,L]),M=v((e=>{const{value:r}=e.target;x(r)}),[]),D=v((()=>{O(null),!y||Array.isArray(R)&&R.includes(y)?Array.isArray(R)&&R.includes(y)&&O("This value already exists"):(N([...null!=R?R:[],y]),x(""))}),[y,N,R]),I=v((e=>{N(R.filter((r=>r!==e)))}),[R,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==R?void 0:R.map(((e,r)=>o(Ve,{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:R},k)),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===(l=F[s])||void 0===l?void 0:l.message,slotProps:{htmlInput:null===(n=C.slotProps)||void 0===n?void 0:n.htmlInput,formHelperText:{variant:"standard"},input:{endAdornment:o(S,{size:"small",onClick:D,children:o(A,{children:o("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}},name:s,onKeyDown:P},C)),E&&o(J,{error:!0,children:E})]})},wl=({name:e="period",control:r,label:l="Period",required:n,isSecondsVisible:a=!1})=>{var s;const[c,u]=b(),p=T({control:r,name:e}),{field:{onChange:m},formState:{errors:f}}=V({name:e,control:r,rules:{required:!!n&&"Please, fill one of the fields"}}),C=v((e=>{const{name:r,value:l}=e.target,n=Object.assign({},null!=c?c:{});l?(n[r]=+l,m(Le(n))):(delete n[r],m(Object.keys(n).length?Le(n):"")),u(n)}),[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(Re(p))}),[c,p]),t(i,{children:[o($,{variant:"subtitle1",children:n?t(i,{children:[l," ",o(z,{component:"span",color:"#D6331F",children:"*"})]}):l}),y&&o(J,{error:!0,children:y}),t(Te,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.years)||"",name:"years",label:"Years"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.months)||"",name:"months",label:"Months"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.days)||"",name:"days",label:"Days"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours"}))}),o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes"}))}),a&&o(Te,{size:1,children:o(d,Object.assign({},x,{value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds"}))})]})]})};const Vl=e=>{var{control:r,name:l,label:n,required:s,mask:c="+7 (799) 999 99 99",requiredErrorText:u="",inputMaskProps:p,disabled:m,validate:h,invalidErrorText:g}=e,f=a(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","validate","invalidErrorText"]);return o(L,{control:r,name:l,rules:{required:!!s&&(u||zr),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}})=>o(ke,Object.assign({disabled:m,mask:c,value:e.value,onChange:e.onChange,onBlur:e.onBlur},p,{children:o(d,Object.assign({name:l,fullWidth:!0,size:"small",label:s&&n?t(i,{children:[n," ",o("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",slotProps:{formHelperText:{variant:"standard"},input:{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:""})})}}},f,{error:!!r,helperText:null==r?void 0:r.message}))}))})};var Tl="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 Ll=()=>o("img",{src:Tl,alt:""}),Rl=()=>{const e=Se(),r=Ne(e,Me),l=Ne(e,De),n=Ne(e,Ie),i=Ne(e,Pe),a=r=>e.current.setPage(r);return t(z,{px:2,display:"flex",alignItems:"center",children:[o(Ae,{component:"div",page:r,count:n,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:l})=>`${e}–${r} из ${-1!==l?l:`более ${r}`}`,ActionsComponent:void 0,slotProps:{select:{IconComponent:Ll}}}),o(Fe,{count:l,page:r+1,onChange:(e,r)=>a(r-1)})]})};var kl="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",Fl="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",Al="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 Sl=()=>o("img",{src:kl,alt:"sort"}),Nl=()=>o("img",{src:Fl,alt:"asc"}),Ml=()=>o("img",{src:Al,alt:"desc"}),Dl=ze(qe)((({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}}}))),Il=e=>{var{columns:r,rows:l,rowCount:n,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[l,n]=ie(),t=+l.get("page")||0,o=+l.get("size")||10,i=v((({page:e,pageSize:r})=>{l.set("page",e),l.set("size",r),n(l,{replace:!0})}),[n,l]);return g((()=>{"server"===e&&r&&(l.has("page")||l.set("page","0"),l.has("size")||l.set("size","10"),n(l,{replace:!0}))}),[e,r,l,n]),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(),l=f(""),n=e.getAll("sort").map((e=>e.split(","))),t=h((()=>n.length?n.map((e=>({field:e[0],sort:e[1]}))):[]),[n]),o=v((l=>{e.delete("sort"),l.length&&l.forEach((r=>e.set("sort",`${r.field},${r.sort}`))),r(e,{replace:!0})}),[e,r]),i=v((e=>e.map((e=>{const r=n.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))),[n]),a=v((({field:e})=>{l.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(Dl,Object.assign({hideFooterPagination:!c,hideFooter:!c,loading:t,rows:l,sortingMode:s,paginationMode:s,paginationModel:"server"===s?y:m,rowCount:n||-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:le,pagination:Rl,columnUnsortedIcon:Sl,columnSortedAscendingIcon:Nl,columnSortedDescendingIcon:Ml},sx:{"--DataGrid-overlayHeight":"300px"}},p))})},Pl=({icon:e,label:r,showInMenu:l,onClick:n,location:t})=>{var i;return t?o(S,{component:oe,to:t.pathname,state:null!==(i=t.state)&&void 0!==i?i:null,size:"small",children:o(le,{title:r,arrow:!0,children:p.cloneElement(e,{fontSize:"small"})})}):o(Be,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:o(le,{title:r,arrow:!0,children:e}),onClick:n,label:r,showInMenu:l})},ql=ze(Ze)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),Bl=()=>o("img",{src:Tl,alt:""}),zl=()=>o("img",{src:kl,alt:""}),$l=()=>o("img",{src:Fl,alt:""}),jl=()=>o("img",{src:Al,alt:""});function Hl({columns:e=[],rows:r=[],rowCount:l,children:n,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,l]=ie(),n=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=>{l((r=>(r.set("page",`${e}`),r)))}),[l]),i=v((e=>{l((r=>(r.set("size",`${e}`),r)))}),[l]);return g((()=>{e&&(r.has("page")||l((e=>(e.set("page","0"),e))),r.has("size")||l((e=>(e.set("size","10"),e))))}),[r,l,e]),{page:n,size:t,onPageChange:o,onSizeChange:i}})(i),{onSortChanged:y,getColumnSorting:x}=(()=>{const[e,r]=ie(),l=h((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=v((e=>{r((r=>{r.delete("sort");let n=!1;return l.forEach((([l,t])=>{l===e?(n=!0,"asc"===t&&r.append("sort",`${l},desc`)):r.append("sort",`${l},${t}`)})),n||r.append("sort",`${e},asc`),r}))}),[l,r]),t=v((e=>{const r=l.find((([r,l])=>r===e));return!!r&&r[1]}),[l]);return{sortParams:l,onSortChanged:n,getColumnSorting:t}})();return o(z,{sx:{overflow:"auto"},children:t(_e,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[o(Ye,{open:a,sx:{position:"absolute",top:0,left:0},children:o(Ir,{})}),t($e,{ref:p,children:[o(Je,{children:o(We,{children:e.map(((e,r)=>{const l=!!e.sortKey&&x(e.sortKey);return o(He,{align:e.align?e.align:"left",sortDirection:l,sx:{width:e.width?`${e.width}%`:"unset"},children:o(ql,{active:!!l,hideSortIcon:!e.sortKey,direction:l||"asc",IconComponent:"asc"===l?$l:"desc"===l?jl:zl,onClick:()=>e.sortKey?y(e.sortKey):{},children:e.label})},r)}))})}),o(je,{children:r.length?r.map(((r,l)=>o(We,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,n)=>o(He,{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,l):r[e.id]})})},n)))},l))):o(We,{sx:{verticalAlign:c},children:o(He,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),i||n?o(Ge,{children:t(We,{children:[n&&o(He,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:n}),i&&r.length?o(Ae,{rowsPerPageOptions:[5,10,25],count:l,rowsPerPage:+f,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:l})=>`${e}–${r} из ${-1!==l?l:`более ${r}`}`:void 0,slotProps:{select:{IconComponent:Bl}},onPageChange:(e,r)=>b(r),onRowsPerPageChange:e=>C(+e.target.value)}):null]})}):null]})]})})}const _l=y(Hl),Jl=({actionsList:e})=>{const[r,l]=b(null),n=Boolean(r),i=()=>{l(null)};return t("div",{children:[o(S,{"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),l(e.currentTarget)},children:o(Ue,{})}),o(Ke,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,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)))})]})},Wl=e=>{const{children:r,value:l,index:n}=e,t=a(e,["children","value","index"]);return o("div",Object.assign({role:"tabpanel",hidden:l!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},t,{children:l===n?r:null}))},Gl=e=>{var r;const{tabs:l}=e,n=ne(),i=te(),a=h((()=>new URLSearchParams(i.search)),[i.search]),s=a.get("tab");return t(z,{children:[o(Xe,{children:o(er,{value:s||(null===(r=l[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),n({pathname:i.pathname,search:a.toString()},{replace:!0})},children:l.map((e=>o(Qe,{value:e.name,label:e.label},e.name)))})}),o(z,{mt:2,children:l.map((e=>{var r;return o(Wl,{value:s||(null===(r=l[0])||void 0===r?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},Yl=y((({value:e,height:r=200,fontSize:l=16},n)=>{const[i,a]=b(!0),s=v((e=>{const r=l=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-l.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===l.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",children:[i&&o(Ir,{bgcolor:"#fff"}),o(se,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[de.json()],style:{fontSize:l,width:"100%"}})]})})),Zl=({open:e,onClose:r,value:l,jsonViewProps:n})=>{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(Yl,Object.assign({value:l},n,{ref:i}))}),t(I,{children:[o(al,{copyText:l}),o(M,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})},Kl=({title:e,text:r,json:l})=>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}),l&&o(Yl,{value:l,height:300})]}),Ul=({control:e,name:r,label:l,required:n,restrictedValues:i,requiredErrorText:a="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:p}}=V({control:e,name:r,rules:{required:!!n&&(Array.isArray(i)&&i.length?s||"Please, select a value":a||zr)}}),m=T({control:e,name:r});return Array.isArray(i)&&i.length?t(H,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[o(fr,{htmlFor:"type-select",children:l}),o(gr,{labelId:"type-select",label:l,value:m||"",onChange:d,ref:u,children:i.map((e=>o(c,{value:e,children:e},e)))})]}):o(Jr,{hideErrorMessage:!0,required:n,control:e,name:r,label:l})},Xl=({name:e})=>{const{control:r,setValue:l,register:n}=R(),a=T({control:r,name:e}),d=v((r=>s(void 0,void 0,void 0,(function*(){const n=r.target.files[0];(new FileReader).readAsDataURL(n);const t=yield(e=>new Promise(((r,l)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{l(e)}})))(n);l(e,t)}))),[e,l]);return t(i,{children:[t(z,{mb:2,display:"flex",flex:"row",children:[o($,{children:"Does file uploaded:"}),o(A,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"},n(`${e}`,{required:!0}))),o("input",{type:"file",hidden:!0,onChange:d})]})]})},Ql=()=>o(z,{component:"span",sx:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),en=({data:e})=>t(lr,{nonLinear:!0,orientation:"vertical",connector:o(ir,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>t(nr,{expanded:!0,children:[o(tr,{sx:{display:"flex",alignItems:"flex-start"},slots:{stepIcon:Ql},slotProps:{stepIcon:{icon:"",completed:!1,active:!0}},children:e.label}),o(or,{sx:{marginLeft:4},children:Array.isArray(e.content)?o(en,{data:e.content}):e.content})]},r))),o(nr,{})]}),rn=(e,r)=>{const l=[...e];return l.splice(r,1),l},ln=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function nn(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const tn=(e,r,l,n="asc")=>{const t=e[l],o=r[l];return t<o?"asc"===n?-1:1:t>o?"asc"===n?1:-1:0},on=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"}},an=e=>{try{return JSON.parse(e)}catch(e){return null}},sn=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=sn(r[e])})),r}catch(r){return e}},dn=({children:e})=>{const[r,l]=b(!1),n=v((e=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return o(le,{title:e,arrow:!0,disableHoverListener:!r,children:o("div",{ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})},cn=ze(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}}))),un=({text:e,status:r="default"})=>o(cn,{className:xr("root",{[r]:!0}),children:e}),pn=({value:e,copyButton:r=!1,textField:l=!1})=>{const{open:n,onOpen:i,onClose:a}=Gr(),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(al,{copyText:on(e)}),o(le,{title:"Open",placement:"top",children:o(S,{size:"small",onClick:s,children:o(A,{children:o("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),l?o(z,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):o(Yl,{value:e}),o(Zl,{open:n,value:on(e),onClose:a,jsonViewProps:{height:450}})]})},mn={100:"#E3EBFC",200:"#CCD9F9",300:"#ACC2F5",400:"#8EABF1",500:"#7196ED",600:"#527FE9",700:"#376BE5",800:"#1744AE",900:"#00267F"},hn={100:"#DDF5F2",200:"#BAEAE5",300:"#92E2D8",400:"#76D3C8",500:"#53BAAD",600:"#2CAB9B",700:"#148C7D",800:"#08675B",900:"#014239"},gn={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"},fn={100:"#E5FEF1",200:"#CAFCE3",300:"#AAF2CE",400:"#8AE6B8",500:"#6CD9A3",600:"#53CF91",700:"#3BC480",800:"#138049",900:"#014221"},bn={100:"#FCEADF",200:"#FDDFCE",300:"#F9C8AC",400:"#F7B189",500:"#F69E6B",600:"#F4884A",700:"#F4772E",800:"#C96226",900:"#9A4716"},vn={100:"#FFE9E6",200:"#F8D2CD",300:"#F1ADA5",400:"#EB8E83",500:"#E46D5E",600:"#DD4F3E",700:"#D6331F",800:"#AA2111",900:"#831002"},Cn={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"},yn={100:"#FFFBDE",200:"#FFF7C4",300:"#FFF1A3",400:"#FFEF85",500:"#FFEB69",600:"#FFE249",700:"#FFCE1F",800:"#FFB60F",900:"#EF9A00"},xn={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:mn[700],secondary:mn[300],tertiary:mn[100]},green:{primary:fn[700],secondary:fn[300],tertiary:fn[100]},orange:{primary:bn[700],secondary:bn[300],tertiary:bn[100]},red:{primary:vn[700],secondary:vn[300],tertiary:vn[100]},yellow:{primary:yn[700],secondary:yn[300],tertiary:yn[100]}},brand:{high:hn[700],mid:hn[200],low:hn[100]},default:{hard:Cn[1e3],high:gn[200],inverse:gn[1e3],low:gn[20],mid:gn[100]},system:{critical:vn[800],disabled:gn[500],success:fn[800],warning:bn[800]}},button:{primary:{default:hn[700],disabled:gn[50],focused:hn[900],hover:hn[800]},secondary:{default:Cn[1e3],disabled:gn[100],focused:gn[400],hover:Cn[900]},warning:{default:bn[700],disabled:bn[200],focused:bn[900],hover:bn[800]}},stroke:{primary:{brand:hn[700],default:gn[200],focused:hn[700],hover:gn[300],inverse:Cn[100],hard:gn[1e3]},secondary:{brand:hn[500],default:gn[100],focused:hn[700],hover:gn[200],inverse:Cn[50]},tertiary:{brand:hn[300],default:gn[50],focused:hn[700],hover:gn[100],inverse:Cn[20]},system:{critical:vn[800],success:fn[800],warning:bn[800]}},surface:{primary:Cn[1e3],secondary:Cn[900]},textIcon:{accent:{blue:{primary:mn[700],secondary:mn[500],tertiary:mn[300]},green:{primary:fn[800],secondary:fn[500],tertiary:fn[300]}},brand:{primary:hn[700],secondary:hn[500],tertiary:hn[300]},disabled:{default:gn[200],onColor:gn[50]},primary:{default:gn[1e3],inverse:Cn[1e3],onDark:Cn[1e3],onLight:gn[1e3]},secondary:{default:gn[500],inverse:Cn[400],onColor:gn[200]},tertiary:{default:gn[300],inverse:Cn[200],onColor:gn[100]},system:{critical:vn[700],link:mn[800],success:fn[700],warning:bn[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 En=r(xn);const On={components:{MuiButtonBase:{defaultProps:{disableElevation:!0,disableRipple:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:En.palette.button.warning.hover},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:En.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:En.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:En.spacing(3),minWidth:En.spacing(25),background:En.palette.background.default,paddingRight:En.spacing(3)},input:{minWidth:En.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:Zr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:En.spacing(25)}}},MuiInputLabel:{defaultProps:{shrink:!0},styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:En.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto",whiteSpace:"normal","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:En.spacing(3),minWidth:En.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:En.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:o(Zr,{})},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:En.palette.secondary.dark,padding:En.spacing(2,3),borderRadius:8,textAlign:"center"}}}},wn={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:En.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:En.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:En.spacing(4)}},head:{padding:En.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:En.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:En.spacing(3),width:"100%",color:En.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{borderTopLeftRadius:En.spacing(3),borderTopRightRadius:En.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},"container--top":{'& [role="row"]':{backgroundColor:En.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:En.spacing(1.25,3),display:"flex",alignItems:"center",borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}},Vn={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:En.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:En.palette.secondary.main}}}}}},Tn={components:{MuiTypography:{styleOverrides:{h1:{[En.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[En.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[En.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}},Ln=(()=>{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 l(r(En,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},On.components),wn.components),Vn.components),Tn.components),{MuiToolbar:{styleOverrides:{root:{[En.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:En.spacing(2.5),padding:En.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:En.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:En.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:En.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:En.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:En.palette.secondary.main}}}}})}))})(),Rn=({value:e,canCopy:r,copyValue:l,shortId:n,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(A,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(dn,{children:c.map(((r,l)=>o(z,{children:me(new Date(e),r)},l)))}):t(dn,{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(dn,{children:o(un,{text:e,status:u||"default"})});case"json_text":return o(pn,{value:e,textField:!0});case"json_code":return o(pn,{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(le,{arrow:!0,title:d||e.map(((e,r)=>o(z,{fontSize:14,style:{paddingTop:Ln.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(dn,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?t(z,{display:"flex",alignItems:"center",width:"100%",children:[n?o(dn,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):i?o(z,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):o(dn,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&o(al,{copyText:l?"string"==typeof l?l:JSON.stringify(l):e})]}):""}},kn=e=>!e&&0!==e&&!1!==e,Fn=(e,r,l)=>{if(null==r)return null;if(pl(r))return r;let n=r;switch(Pn(e)){case Mr.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case Mr.INTEGER:case Mr.BIG_INTEGER:case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.LONG:case Mr.DOUBLE:case Mr.SHORT:n=Number(r);break;case Mr.DATE:case Mr.DATE_TIME:case Mr.TIME:if(r)try{const e=l.formatText.replace(/[Z,z,x]+/g,"XX");n=me(ge(r,e,new Date),e)}catch(e){console.error(e)}break;case Mr.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case Mr.OBJECT:n=An(e,r)}return n},An=(e,r)=>{var l;let n={};if(r){const t=Pn(e);return t===Mr.OBJECT?Array.isArray(e.properties)?null===(l=e.properties)||void 0===l||l.forEach((function(e){const{key:l}=e,t=r[l];Array.isArray(t)?n[l]=t.map((r=>Fn(e,r,{formatText:e.format,properties:e.properties}))):n[l]=Fn(e,t,{formatText:e.format,properties:e.properties})})):n=ar(r)?r:{}:n=t===Mr.ARRAY&&Array.isArray(r)?r.map((r=>e.memberNodes?Fn(e.memberNodes,r):r)):Fn(e,r),n}return null},Sn=(e,r)=>{return l(e);function l(e){const{name:n,isRequired:t,sortOrder:o,isEnabled:i,uiSettings:a,validationNode:s}=e,d=Pn(e),c=Object.assign({name:n,nodeType:d,isRequired:null!==t&&t,sortOrder:o,isEnabled:null!==i&&i,validationNode:s,uiSettings:a},((e,r)=>{const l={};let n,t="";return r?e.nodeType===Mr.ARRAY?(t="values",n=e.value):(t="value",n=e.value):e.nodeType===Mr.ARRAY?(t="defaultValues",n=e.defaultValue):(t="defaultValue",n=e.defaultValue),Array.isArray(n)?l[t]=n.map((r=>Fn(e,r,{formatText:e.format,properties:e.properties}))):l[t]=Fn(e,n,{formatText:e.format,properties:e.properties}),l})(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===Mr.BIG_DECIMAL&&(c.precisionScale=e.precisionScale,c.roundingMode=e.roundingMode),d!==Mr.DATE&&d!==Mr.TIME&&d!==Mr.DATE_TIME||(c.format=e.format),d===Mr.STRING&&(c.restrictedValues=e.restrictedValues),d===Mr.ENTITY_REFERENCE){const{definitionCode:r,definitionVersion:l,labelPropertyCode:n,valuePropertyCode:t}=e;c.definitionCode=r,c.definitionVersion=l,c.labelPropertyCode=n,c.valuePropertyCode=t}return d===Mr.ARRAY&&(c.memberNodes=e.memberNodes?l(e.memberNodes):null),d===Mr.OBJECT&&(c.properties=function(e){if(!Array.isArray(e)||!e.length)return null;const r={};return e.forEach((e=>{r[e.key]=l(e)})),r}(e.properties)),c}};function Nn(e,r){var l;return e&&e.nodeType===Mr.OBJECT&&e.properties&&(e.properties=(l=e.properties)?Array.isArray(l)?l:Object.keys(l).map((e=>{let n=Object.assign(Object.assign({key:e},l[e]),r||{});const t=Pn(n);return t===Mr.OBJECT&&(n=Nn(n,r)),t===Mr.ARRAY&&n.memberNodes&&(n.memberNodes=Nn(n.memberNodes,r),"defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>tn(e,r,"sortOrder"))):[]),e&&e.nodeType===Mr.ARRAY&&e.memberNodes&&(e.memberNodes=Nn(e.memberNodes,r)),e}const Mn=(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},Dn=e=>(Array.isArray(e.properties)?e:Nn(e)).properties.reduce(((r,l)=>{const n=JSON.parse(JSON.stringify(r));return e.nodeType===Mr.OBJECT?n[e.key]=Dn(e):n[e.key]=e.nodeType,n}),{}),In=({nodeType:e,useExpression:r,required:l})=>{let n=[{value:"widget",label:"Fill array",sortOrder:1}];return l||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Mr.OBJECT||e===Mr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==Mr.ANY&&e!==Mr.OBJECT&&e!==Mr.ARRAY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>tn(e,r,"sortOrder"))),n},Pn=e=>{var r;return e?"string"==typeof e.nodeType?e.nodeType:null===(r=e.nodeType)||void 0===r?void 0:r.value:Mr.ANY},qn=({nodeType:e,useExpression:r,required:l})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(l||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Mr.OBJECT||e===Mr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e){case Mr.STRING:n[0].label="Text input";break;case Mr.INTEGER:case Mr.BIG_INTEGER:case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.LONG:case Mr.DOUBLE:case Mr.SHORT:n[0].label="Number input";break;case Mr.BOOLEAN:n[0].label="Switch";break;case Mr.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case Mr.ARRAY:n[0].label="Array editor";break;case Mr.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Mr.ANY:n[0].label="JSON"}return n=n.sort(((e,r)=>tn(e,r,"sortOrder"))),n},Bn=({value:e,node:r,label:l,isDirty:n,required:t=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const a=h((()=>l?`${l} (value)`:`${r.name} (value)`),[l,r]),s=h((()=>l?`${l} (widget)`:`${r.name} (widget)`),[l,r]),d=h((()=>Pn(r)),[r]),[c,u]=b(null),p=h((()=>i?In({nodeType:d,required:t,useExpression:o}):qn({nodeType:d,required:t,useExpression:o})),[o,t,d,i]),m=h((()=>{switch(d){case Mr.STRING:case Mr.DATE:case Mr.TIME:case Mr.DATE_TIME:case Mr.ENTITY_REFERENCE:case Mr.ANY:case Mr.FILE:case Mr.FILE_REFERENCE:return"";case Mr.OBJECT:return{};case Mr.ARRAY:return[];case Mr.BOOLEAN:return!1;case Mr.INTEGER:case Mr.BIG_DECIMAL:case Mr.BIG_INTEGER:case Mr.DOUBLE:case Mr.LONG:case Mr.FLOAT:case Mr.SHORT:return 0;default:return null}}),[d]),f=h((()=>d===Mr.ANY||d===Mr.ARRAY),[d]),C=v((()=>{pl(e,f)?u("expression"):d===Mr.ARRAY||null==e||pl(e,f)||"widget"===c||"string"===c||"json_valid"===c||u("widget")}),[e,c,f,d]);return g((()=>{c?n||C():!kn(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&pl(e,f)?u("expression"):u("widget"):u("null")}),[e,c,p,o,n,C,f,t,r]),{nodeType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:p,setFillOption:u,defaultProperyValue:m,checkFillOption:C}},zn=ze(fr)((()=>({inputLabel:{overflow:"hidden",textOverflow:"ellipsis",width:"100%"}}))),$n=({control:e,node:r,name:l,useExpression:n,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:l,control:e,rules:{validate:e=>!a||null!==e||(p||zr)}}),y=f({}),{nodeType:x,valueLabel:E,fillOptionLabel:O,fillOption:w,fillOptions:T,setFillOption:L,defaultProperyValue:R}=Bn({value:m,node:r,isDirty:C,label:i,required:a,useExpression:n}),k=v((e=>{const n=e.target.value;y.current=Object.assign(Object.assign({},y.current),{[w]:m}),L(n);const t=y.current[n];if("null"===n)h(null);else if("widget"===n)if(x===Mr.OBJECT&&m&&"string"!=typeof m&&"dem_builder"===w&&"node"in m){const e=Sn(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||R);else if("expression"===n||"string"===n)h(l,null!=t?t:"");else if("dem_builder"===n){const e={code:"",name:"",version:0,node:null};if(m)try{const e=JSON.parse(m);e.properties=Nn(e.properties||{}),h(null!=t?t:e)}catch(r){h(null!=t?t:e)}else h(null!=t?t:e,{shouldDirty:!0})}}),[l,m,L,w,x,h,R,r]);return g((()=>{C||yr(r.defaultValue||r.value)||""===r.defaultValue&&""===r.value||!yr(m)||h(l,r.defaultValue||r.value)}),[C,r,h,m,l]),g((()=>{var e;(void 0===m||r.isRequired&&null===m&&!r.defaultValue&&!r.value)&&h(null!==(e=y.current[w])&&void 0!==e?e:R),void 0!==m||r.isRequired||null!==r.defaultValue&&null!==r.value||h(null)}),[m,h,l,R,r,w]),t(Te,{size:12,children:[s&&o(z,{mb:2,children:o($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),T?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:O}),o(gr,{labelId:"type-select",label:O,value:w||"",onChange:k,children:T.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(x===Mr.OBJECT||x===Mr.ANY?o(dl,{name:l,control:e,label:E,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:x===Mr.ANY?"text":"json"}):o(Jr,{control:e,name:l,label:E,hideErrorMessage:!0})),"string"===w&&o(Jr,{control:e,name:l,label:E,hideErrorMessage:!0}),"widget"===w&&o(Kn,{control:e,node:r,name:l,useExpression:n,label:E,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),b&&o(J,{error:!0,children:b.message})]})},jn=({control:e,name:r,node:l,useExpression:n,required:i,label:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{fields:c,append:u,remove:p}=k({control:e,name:r});return t(Te,{container:!0,spacing:2,direction:"column",size:12,children:[Array.isArray(c)&&c.length?c.map(((c,u)=>o(Te,{size:12,children:t(z,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[o($n,{control:e,required:i,node:l,useExpression:n,name:`${r}.${u}`,label:`${a||l.name} (${u+1})`,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(z,{mt:"8px",ml:"4px",children:o(S,{id:"close-button",size:"small",onClick:()=>p(u),children:o(A,{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(Te,{children:o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>u(null),children:"Add value"})})]})},Hn={nodeType:Mr.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},_n=({node:e,name:r,useExpression:l,required:n,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:T}=R(),{field:{ref:L,onChange:k},fieldState:{error:F,isDirty:A}}=V({control:E,name:r,defaultValue:null!==(m=e.defaultValue)&&void 0!==m?m:[],rules:{validate:e=>!(n&&!e)||(p||zr)}}),S=T(r),N=f({}),{valueLabel:M,fillOptionLabel:D,fillOption:I,fillOptions:P,setFillOption:q,checkFillOption:B}=Bn({node:e,value:S,isDirty:A,label:a,required:n,useExpression:l,multipleOptions:!0});return g((()=>{!S&&e.isRequired&&k([]),ar(S)&&!e.isRequired&&k(null)}),[S,e,k]),g((()=>{S&&!y&&(x(!0),B())}),[B,y,S]),t(i,{children:[s&&o(z,{mb:2,children:o($,{variant:"h6",children:s})}),P?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:D}),o(gr,{labelId:"type-select",label:D,value:I||"",onChange:e=>{x(!0),N.current=Object.assign(Object.assign({},N.current),{[I]:S});const l=e.target.value,n=N.current[l];"null"===l?w(r,null):w(r,null!=n?n:[],{shouldDirty:!0}),q(l),O(r)},children:P.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===I||"json_valid"===I)&&o(dl,{name:r,control:E,label:M,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===I&&o(jn,{control:E,node:null!==(h=e.memberNodes)&&void 0!==h?h:Hn,name:r,useExpression:l,required:n,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})]})},Jn=({node:e,dataFieldName:r,locales:l,useExpression:n=!1,title:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=v(((e,r)=>Pn(e)===Mr.ARRAY?o(_n,{node:e,name:r,useExpression:n,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s}):o(Un,{node:e,name:r,locales:l,useExpression:n,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s})),[n,s,a]),c=v(((e,r)=>{if(e){const l=Pn(e);return{label:t(z,{display:"flex",flexDirection:"column",children:[t("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:`${e.key?e.key+" | ":""}${l}`})]}),content:d(e,r)}}return null}),[d]);return o(hr,{dateAdapter:mr,children:t(Te,{container:!0,direction:"column",spacing:2,children:[i&&o(Te,{size:12,children:o("div",{style:{fontWeight:"600"},children:i})}),o(en,{data:[c(Nn(e),r)]})]})})},Wn=o(vr,{fontSize:"small"}),Gn=o(Cr,{fontSize:"small",color:"secondary"}),Yn=({localesCollection:e,onChange:r,onLocaleRemove:l,receivedObject:n})=>{const[i,s]=b(null==e?void 0:e.filter((e=>e.isRequired)));g((()=>{const l=null==e?void 0:e.filter((e=>e.isRequired)),t=null==e?void 0:e.filter((e=>null==n?void 0:n.hasOwnProperty(e.code))),o=[...new Set([...l,...t])];s(o),null==r||r(o)}),[e]);const c=v(((r,l,{selected:n})=>t(br,Object.assign({},r,{onClick:e=>{l.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:Wn,checkedIcon:Gn,sx:{marginRight:1,padding:1},checked:n||l.isRequired||"all"===l.code&&(null==i?void 0:i.length)===(null==e?void 0:e.length),disabled:l.isRequired}),o(z,{component:"span",textTransform:"capitalize",children:l.name}),l.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,l)=>{const n=r({index:l}),{onDelete:i}=n,d=a(n,["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(Zn,{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:(n,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 l=null==e?void 0:e.filter((e=>e.isRequired));s(l),null==r||r(l)}else{const l=null==e?void 0:e.filter((e=>"all"!==e.code));s(l),null==r||r(l)}else{const e=i.filter((e=>!t.some((r=>r.code===e.code))));s(t),null==r||r(t),e.length>0&&(null==l||l(e))}},renderOption:c,getOptionDisabled:u,renderTags:p,renderInput:e=>o(d,Object.assign({},e,{label:"Languages",placeholder:"Select"}))})},Zn=e=>o(A,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"})})),Kn=({node:e,name:r,locales:l,label:n,useExpression:i,control:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{var c,u;const{setValue:p,getValues:m}=R();switch("string"==typeof e.nodeType?e.nodeType:null===(c=e.nodeType)||void 0===c?void 0:c.value){case Mr.BIG_DECIMAL:case Mr.FLOAT:case Mr.DOUBLE:return o(gl,{required:!0,decimal:!0,hideErrorMessage:!0,control:a,name:r,label:n,valueAsNumber:!0});case Mr.INTEGER:case Mr.SHORT:case Mr.BIG_INTEGER:case Mr.LONG:return o(gl,{required:!0,hideErrorMessage:!0,control:a,name:r,label:n,valueAsNumber:!0});case Mr.BOOLEAN:return o(fl,{control:a,name:r,defaultValue:!1});case Mr.DATE:return o(Cl,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.TIME:return o(El,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.DATE_TIME:return o(xl,{hideErrorMessage:!0,control:a,name:r,label:n,format:e.format});case Mr.STRING:return o(Ul,{control:a,name:r,label:n,restrictedValues:e.restrictedValues});case Mr.ENTITY_REFERENCE:return s?o(s,{name:r,node:e}):o(Ul,{name:r,label:n,control:a});case Mr.FILE:return o(Xl,{name:r});case Mr.FILE_REFERENCE:return d?o(d,{name:r}):o(Ul,{name:r,label:n,control:a});case Mr.ANY:return o(dl,{control:a,name:r,hideErrorMessage:!0,label:n,parseValue:!0});case Mr.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==l?void 0:l.filter((e=>e.isRequired))).properties),f=r=>{const l=c(e,r);g(l.properties)};return t("div",{style:{borderLeft:"1px solid #bdbdbd",paddingLeft:20},children:[null==h?void 0:h.map((e=>o(Jr,{hideErrorMessage:!0,required:e.isRequired,control:a,name:`${r}.${e.key}`,label:e.name,sx:{mb:3,textTransform:"capitalize"}}))),(null==l?void 0:l.length)?o(Yn,{localesCollection:l,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 Mr.OBJECT:return e.properties?o("div",{children:e.properties.map((e=>o(Jn,{node:e,dataFieldName:`${r}.${e.key}`,useExpression:i,entityReferenceValueComponent:s,fileReferenceValueComponent:d,locales:l})))}):o(dl,{control:a,name:r,hideErrorMessage:!0,label:n,parseValue:!0,mode:"json"});default:return o("div",{children:"No widget"})}},Un=({node:e,name:r,locales:l,useExpression:n,label:i,required:a,title:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:p=""})=>{const{control:m,clearErrors:h,setValue:b}=R(),{field:{value:C},fieldState:{error:y,isDirty:x}}=V({name:r,control:m,rules:{validate:e=>!a||null!==e||(p||zr)}}),E=f({}),{nodeType:O,valueLabel:w,fillOptionLabel:T,fillOption:L,fillOptions:k,setFillOption:F,defaultProperyValue:A}=Bn({value:C,node:e,isDirty:x,label:i,required:a,useExpression:n}),S=v((l=>{const n=l.target.value;E.current=Object.assign(Object.assign({},E.current),{[L]:C}),F(n);const t=E.current[n];if("null"===n)b(r,null,{shouldDirty:!0});else if("widget"===n)if((O===Mr.OBJECT||O===Mr.LOCALIZED_STRING)&&C&&"string"!=typeof C&&"dem_builder"===L&&"node"in C){const e=Sn(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||A);else if("expression"===n||"string"===n)b(r,null!=t?t:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,node:null};if(C)try{const e=JSON.parse(C);e.properties=Nn(e.properties||{}),b(r,null!=t?t:e,{shouldDirty:!0})}catch(l){b(r,null!=t?t:e,{shouldDirty:!0})}else b(r,null!=t?t:e,{shouldDirty:!0})}h()}),[r,h,C,F,L,O,b,A,e]);return g((()=>{x||yr(e.defaultValue||e.value)||""===e.defaultValue&&""===e.value||!yr(C)||b(r,e.defaultValue||e.value)}),[x,e,b,C,r]),g((()=>{var l;(void 0===C||e.isRequired&&null===C&&!e.defaultValue&&!e.value)&&b(r,null!==(l=E.current[L])&&void 0!==l?l:A),void 0!==C||e.isRequired||null!==e.defaultValue&&null!==e.value||b(r,null)}),[C,b,r,A,e,L]),t(Te,{size:12,children:[s&&o(z,{mb:2,children:o($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:s})}),k?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:T}),o(gr,{labelId:"type-select",label:T,value:L||"",onChange:S,children:k.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===L&&(O===Mr.OBJECT||O===Mr.ANY?o(dl,{name:r,control:m,label:w,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"expression"===L?"text":"json"}):o(dl,{control:m,name:r,hideErrorMessage:!0,label:i,height:"40px"})),"string"===L&&o(Jr,{control:m,name:r,label:w,hideErrorMessage:!0}),"widget"===L&&o(Kn,{control:m,locales:l,node:e,name:r,useExpression:n,label:w,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),y&&o(J,{error:!0,children:y.message})]})},Xn={nodeType:Mr.ANY,name:"",isRequired:!0,defaultValue:null,defaultValues:null,sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null},Qn=({control:e,node:r,name:l,useExpression:n,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:T,isDirty:L}}=V({control:e,name:l,defaultValue:null!==(h=r.defaultValue)&&void 0!==h?h:[],rules:{validate:e=>!(a&&!e)||(m||zr)}}),R=f({}),{valueLabel:k,fillOptionLabel:F,fillOption:A,fillOptions:S,setFillOption:N,checkFillOption:M}=Bn({node:r,value:O,isDirty:L,label:s,required:a,useExpression:n,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($,{variant:"h6",children:d})}),S?o(z,{mb:2,children:t(H,{fullWidth:!0,size:"small",variant:"outlined",children:[o(zn,{htmlFor:"type-select",children:F}),o(gr,{labelId:"type-select",label:F,value:A||"",onChange:e=>{E(!0),R.current=Object.assign(Object.assign({},R.current),{[A]:O});const r=e.target.value,l=R.current[r];w("null"===r?null:null!=l?l:[]),N(r)},children:S.map((e=>o(c,{value:e.value,children:e.label},e.value)))})]})}):null,("expression"===A||"json_valid"===A)&&o(dl,{name:l,control:e,label:k,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:"json"}),"widget"===A&&o(jn,{control:e,node:null!==(v=r.memberNodes)&&void 0!==v?v:Xn,name:l,useExpression:n,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}),T&&o(J,{error:!0,children:T.message})]})},et={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"},rt=({value:e,type:r})=>r!==Mr.OBJECT&&r!==Mr.ANY||!e?o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):o(Yl,{value:e}),lt=(e,r,l)=>{switch(r){case"nodeType":return o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:l});case"isRequired":case"isEnabled":case"isViewableInList":return e?o(A,{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(Ve,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return o(rt,{value:e,type:l});case"values":case"defaultValues":return e?Array.isArray(e)&&l!==Mr.OBJECT&&l!==Mr.ANY?t("div",{children:["[",null==e?void 0:e.map(((e,r)=>o("div",{children:o(rt,{value:e,type:l})},r))),"]"]}):o(Yl,{value:e}):null;case"uiSettings":case"validationNode":return e?o(Yl,{value:e}):null;case"memberNodes":return e?o(it,{node:e,defaultExpanded:!1}):null;default:return o($,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}},nt=({node:e})=>{const r=h((()=>(e&&(Pn(e)===Mr.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(et).map((e=>e in r?t(We,{children:[o(He,{width:"30%",children:o($,{children:et[e]})}),o(He,{children:lt(r[e],e,Pn(r))})]},e):null))})})},tt=({properties:e,parentNames:r=[]})=>{const l=h((()=>{if(!e)return!1;let r=!1;return e.every((e=>e.nodeType!==Mr.OBJECT||(r=!0,!1))),r}),[e]);return t(z,{mt:4,children:[o($,{variant:"h6",children:"Properties"}),t(lr,{orientation:"vertical",style:{paddingLeft:"4px"},children:[Array.isArray(e)?e.map((e=>t(nr,{expanded:!0,children:[o(tr,{slotProps:{stepIcon:{icon:"",completed:!1,active:!0}}}),o(or,{children:o(it,{node:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))):null,l&&o(nr,{})]})]})};var ot=m(tt);const it=({node:e,parentNames:r=[],defaultExpanded:l=!0})=>{const[n,i]=b(!0);return g((()=>{i(l)}),[l]),e?t(sr,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff",maxHeight:"none",width:"100%"},expanded:n,onChange:()=>i((e=>!e)),children:[o(dr,{expandIcon:o(A,{children:o("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:o($,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),o(cr,{children:t(z,{width:"100%",children:[o(nt,{node:e}),Pn(e)===Mr.OBJECT&&o(ot,{properties:Nn(e).properties,parentNames:[...r,e.name]})]})})]}):null},at=Object.values(Dr).sort(((e,r)=>e.localeCompare(r))),st=({nodeFieldName:e,control:r})=>t(i,{children:[o(Te,{children:o(gl,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),o(Te,{children:o(Kr,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Dr.HALF_UP,options:at})})]}),dt=({setValue:e,nodeFieldName:r,control:l,defaultValue:n=""})=>(g((()=>{n&&e(`${r}.format`,n)}),[n,e,r]),o(Te,{children:o(Jr,{required:!0,control:l,defaultValue:n,name:`${r}.format`,label:"Format"})})),ct={key:"",nodeType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ut=({setValue:e,control:r,parentNodeFieldName:l,entityDefinition:n=!1,globalParameter:a=!1,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const c=T({control:r,name:`${l}.memberNodes`});return t(i,{children:[o($,{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(St,{setValue:e,control:r,nodeFieldName:`${l}.memberNodes`,entityDefinition:n,globalParameter:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),o(M,{sx:{marginTop:4},variant:"contained",size:"small",color:"primary",onClick:()=>e(`${l}.memberNodes`,null),children:"Delete"})]}):o(M,{variant:"contained",size:"small",color:"primary",onClick:()=>e(`${l}.memberNodes`,ct),sx:{margin:"8px 0"},children:"Add node"})]})},pt=({entityDefinition:e,globalParameter:r,customPropertyFields:l,index:n,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(n===a&&!h.key);return o(Te,{size:12,ref:e=>g.current[n]=e,children:t(sr,{expanded:v,onChange:()=>C(!v),elevation:3,children:[o(dr,{expandIcon:o(pr,{}),children:o($,{color:m&&m[n]?"secondary":"initial",style:{wordBreak:"break-word"},children:h.name||`Property ${n+1}`})}),o(cr,{children:v&&o(St,{isObjectProperty:!0,control:d,setValue:c,nodeFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:l,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),!f&&o(ur,{children:o(M,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(n),children:"Remove"})})]})})},mt={propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ht=y((({properties:e,hideAddButton:r,focusOnIndex:l,required:n,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:T,watch:L}=F({mode:"all",defaultValues:{properties:e}}),{fields:R,append:A,remove:S}=k({control:y,name:"properties"}),{fieldState:{error:N}}=V({control:y,name:"properties",defaultValue:null,rules:{validate:e=>!n||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),D=f([]),I=v((()=>{A(mt),C("properties")}),[A,C]),P=v((e=>{c&&c(e),S(e)}),[c,S]);return g((()=>{"number"==typeof l&&D.current[l]&&D.current[l].scrollIntoView({behavior:"smooth",block:"start"})}),[l,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:T})),[O,I,P,T]),t(i,{children:[N&&N.message&&o(Te,{size:12,children:o($,{color:"secondary",children:N.message})}),Array.isArray(R)&&R.map(((e,r,l)=>o(pt,{item:e,index:r,arrLength:l.length-1,control:y,watch:L,setValue:E,customPropertyFields:d,entityDefinition:a,globalParameter:s,error:N,rootNode:m,handleRemoveParameter:P,fileReferenceValueComponent:p,entityReferenceValueComponent:u,extRefs:D},e.id))),!r&&t(Te,{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})]})]})})),gt=({properties:e=[]})=>{const r=h((()=>Array.isArray(e)?e.map((e=>{const r=Pn(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===Mr.OBJECT&&Array.isArray(e.properties)?o(gt,{properties:e.properties}):(null==e?void 0:e.memberNodes)&&o(gt,{properties:e.memberNodes.properties})}})):[]),[e]);return o(en,{data:r})},ft={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},bt=({control:e,parentNodeFieldName:r,entityDefinition:l=!1,globalParameter:n=!1,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const d=f(null),{field:{onChange:c}}=V({control:e,name:`${r}.properties`,defaultValue:null}),u=T({control:e,name:`${r}.properties`,defaultValue:null}),p=T({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,l)=>e!==l)))}),[u,c]),g=Gr(),[C,y]=b(0),x=v((()=>{if((null==u?void 0:u.length)>0){m(ft);const e=u.length;y(e)}else m(ft);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(Te,{container:!0,spacing:2,direction:"column",children:[o(Te,{children:o($,{variant:"h6",children:"Properties"})}),o(Te,{children:o(gt,{properties:u})}),o(Te,{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(Te,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[t(Te,{size:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[o(lr,{nonLinear:!0,activeStep:C,orientation:"vertical",style:{paddingLeft:"4px"},children:Array.isArray(u)&&(null==u?void 0:u.map(((e,r)=>t(nr,{onClick:()=>(e=>y(e))(r),style:{cursor:"pointer"},children:[o(tr,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),o(or,{})]},r))))}),o(M,{variant:"contained",size:"small",color:"primary",onClick:x,sx:{marginTop:2},children:"Add property"})]}),o(Te,{size:9,style:{height:"100%",overflowY:"auto"},children:o(Te,{container:!0,direction:"column",spacing:2,children:o(ht,{ref:d,properties:u,hideAddButton:!0,parentRemove:h,focusOnIndex:C,entityDefinition:l,globalParameter:n,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})})]})}),o(I,{children:o(M,{variant:"contained",color:"primary",onClick:E,children:"Ok"})})]})]})},vt=({propertyFieldName:e,control:r})=>t(i,{children:[o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]}),Ct=({setValue:e,control:r,nodeType:l,nodeFieldName:n,entityDefinition:a=!1,globalParameter:s=!1,fileReferenceValueComponent:d,entityReferenceValueComponent:c})=>{switch(l){case Mr.STRING:return t(i,{children:[o($,{variant:"h6",mb:1,children:"Restricted Values"}),o(Ol,{name:`${n}.restrictedValues`,control:r})]});case Mr.BIG_DECIMAL:return o(st,{nodeFieldName:n,control:r});case Mr.DATE:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:jr});case Mr.TIME:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:Hr});case Mr.DATE_TIME:return o(dt,{setValue:e,control:r,nodeFieldName:n,defaultValue:_r});case Mr.ENTITY_REFERENCE:return o(vt,{control:r,propertyFieldName:n});case Mr.OBJECT:return o(bt,{control:r,parentNodeFieldName:n,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});case Mr.ARRAY:return o(ut,{setValue:e,control:r,parentNodeFieldName:n,globalParameter:s,entityDefinition:a,fileReferenceValueComponent:d,entityReferenceValueComponent:c});default:return null}},yt=({control:e,nodeFieldName:r,name:l,label:n="",required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})=>{const s=T({control:e,name:`${r}.nodeType`}),d=T({control:e,name:`${r}.format`}),c=T({control:e,name:`${r}.restrictedValues`}),u=T({control:e,name:`${r}.properties`}),p=T({control:e,name:`${r}.isRequired`}),m=h((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:n,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,n,p,u,t]);return o(hr,{dateAdapter:mr,children:"ARRAY"===m.nodeType?o(Qn,{control:e,name:l,node:m,title:n,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a}):o($n,{control:e,name:l,node:m,title:n,required:t,entityReferenceValueComponent:i,fileReferenceValueComponent:a})})},xt=({name:e,control:r,setValue:l})=>{const n=h((()=>({type:""})),[]),{fields:i,append:a,remove:s}=k({control:r,name:e});return t(z,{mt:2,children:[o(M,{variant:"outlined",size:"small",onClick:()=>a(n),children:"Add node"}),i.map((({id:n},t)=>o(kt,{setValue:l,control:r,removeHandle:()=>s(t),name:`${e}.${t}`},n)))]})},Et=E(""),Ot=({name:e,control:r})=>t(i,{children:[o($,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Jr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),wt=({name:e,control:r})=>t(i,{children:[o($,{variant:"body2",gutterBottom:!0,children:"Node"}),o(z,{children:o(Jr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),o(z,{mt:2,children:o(Jr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),t(z,{mt:2,children:[o(Ur,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),o(Ur,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),Vt=["STRING_REGEX","JSON_SCHEMA"],Tt=new Set([Mr.INTEGER,Mr.FLOAT,Mr.DOUBLE,Mr.BIG_DECIMAL,Mr.BIG_INTEGER,Mr.LONG]),Lt=({name:e,control:r,setValue:l})=>{const n=O(Et),a=T({control:r,name:`${e}.type`}),s=h((()=>{if("STRING_REGEX"===a)return o(Jr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case n===Mr.STRING:return o(Ot,{name:`${e}.node`,control:r});case Tt.has(n):return o(wt,{name:`${e}.node`,control:r});case n===Mr.OBJECT:case n===Mr.ARRAY:return o(dl,{label:"Properties",control:r,name:`${e}.node.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,a,r,e]);return g((()=>{Tt.has(n)&&"JSON_SCHEMA"===a&&(l(`${e}.node.exclusiveMinimum`,!1),l(`${e}.node.exclusiveMaximum`,!1))}),[n,a,l,e]),o(en,{data:[{label:"Validator",content:t(i,{children:[o(z,{children:o(Kr,{control:r,name:`${e}.type`,label:"Type",options:Vt,onChange:r=>{l(e,{type:r.target.value})}})}),o(z,{mt:2,children:s})]})}]})},Rt=["AND","OR","NOT","NODE"],kt=({name:e,removeHandle:r,control:l,setValue:n})=>{const a=O(Et),s=f(a),d=T({control:l,name:`${e}.type`}),c=h((()=>({AND:o(xt,{name:`${e}.nodes`,control:l,setValue:n}),OR:o(xt,{name:`${e}.nodes`,control:l,setValue:n}),NODE:o(Lt,{name:`${e}.validator`,control:l,setValue:n}),NOT:o(kt,{name:`${e}.node`,control:l,setValue:n})})),[e,l,n]),u=v((r=>{n(e,{type:r.target.value})}),[]);return g((()=>{d&&s.current!==a&&(s.current=a,n(e,{type:""}))}),[n,a,s.current,d,e]),o(en,{data:[{label:"Node Type",content:t(i,{children:[t(z,{display:"flex",alignItems:"flex-start",children:[o(Kr,{required:!0,onChange:u,control:l,name:`${e}.type`,label:"Type",options:Rt}),r&&o(z,{ml:2,mt:6,children:o(S,{onClick:r,children:o(rr,{})})})]}),o(z,{children:c[d]})]})}]})},Ft=({name:e,control:r,setValue:l,enable:n})=>{const[a,s]=b(!1),d=v((r=>{s(r.target.checked),r.target.checked||l(e,null)}),[l,e]);return g((()=>{n&&!a&&s(!0)}),[n,a]),t(i,{children:[t(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o($,{component:"h6",color:"initial",style:{wordBreak:"break-word",fontSize:18},children:"Validator"}),o(_,{label:"Enable",control:o(W,{color:"primary",checked:n,onChange:d})})]}),a&&o(kt,{name:e,control:r,setValue:l})]})},At=Object.values(Mr).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),St=m((({setValue:e,control:r,nodeFieldName:l,entityDefinition:n=!1,globalParameter:a=!1,customPropertyFields:s=[],fileReferenceValueComponent:d,isObjectProperty:c,isObjectNode:u})=>{var p,m;const f=T({control:r,name:`${l}.nodeType`}),b=T({control:r,name:`${l}.isRequired`}),C=T({control:r,name:`${l}.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(`${l}.nodeType`,At.find((e=>e.value===f))):u&&e(`${l}.nodeType`,At.find((e=>e.value===Mr.OBJECT)))}),[f,e,l,u]);const w=h((()=>{let e=At;return a&&(e=At.filter((e=>e.value!==Mr.ANY))),e}),[a]),V=!a||(null!==(p=null==f?void 0:f.value)&&void 0!==p?p:f)!==Mr.OBJECT;return t(Te,{container:!0,direction:"column",spacing:2,children:[c&&o(Te,{children:o(Jr,{required:!0,control:r,name:`${l}.key`,label:"Key",validate:x})}),o(Te,{children:o(Jr,{required:!0,control:r,name:`${l}.name`,label:"Name"})}),o(Te,{children:o(tl,{required:!0,control:r,name:`${l}.nodeType`,label:"Type",options:w,disabled:u,onChange:(r,n)=>{const t=`${l}.nodeType`;e(`${l}.${a?"value":"defaultValue"}`,null),e(t,n)}})}),o(Te,{children:o(gl,{required:!0,control:r,name:`${l}.sortOrder`,label:"Sort Order"})}),o(Te,{children:o(dl,{control:r,name:`${l}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),t(Te,{children:[o(Ur,{control:r,name:`${l}.isEnabled`,label:"Enabled"}),o(Ur,{control:r,name:`${l}.isRequired`,label:"Required"}),n&&o(Ur,{control:r,name:`${l}.isViewableInList`,label:"Is viewable in list"}),y.length?o(i,{children:y.map(((e,n)=>o(Ur,{control:r,name:`${l}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),f&&t(i,{children:[o(Te,{children:o(Et.Provider,{value:null!==(m=f.value)&&void 0!==m?m:f,children:o(Ft,{control:r,setValue:e,enable:C,name:`${l}.validationNode`})})}),o(Te,{children:o(Ct,{setValue:e,control:r,nodeType:"string"==typeof f?f:f.value,nodeFieldName:l,globalParameter:a,entityDefinition:n,fileReferenceValueComponent:d})}),V&&o(Te,{children:o(yt,{control:r,nodeFieldName:l,name:`${l}.${a?"value":"defaultValue"}`,label:O,required:!!a&&b,fileReferenceValueComponent:d})})]})]})})),Nt=y((({node:e,entityDefinition:r=!1,globalParameter:l=!1,customPropertyFields:n=[],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($,{component:"h6",color:"initial",mb:3,style:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(St,{control:c,setValue:u,nodeFieldName:"node",isObjectNode:s,entityDefinition:r,globalParameter:l,customPropertyFields:n,entityReferenceValueComponent:i,fileReferenceValueComponent:a})]})})),Mt=({control:e,parentFieldName:r,required:l,entityDefinition:n=!1,globalParameter:i=!1,customPropertyFields:a=[],entityReferenceValueComponent:s,fileReferenceValueComponent:d,isObjectNode:c})=>{const u=h((()=>r?`${r}.node`:"node"),[r]),{setValue:p,watch:m}=R(),{fieldState:{error:g}}=V({control:e,name:u,rules:{validate:e=>!l||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}});return t(z,{mt:2,children:[g&&g.message&&o(Te,{size:12,children:o($,{color:"secondary",children:g.message})}),o($,{component:"h6",color:"initial",mb:3,sx:{wordBreak:"break-word",fontSize:18},children:"Node Configuration"}),o(St,{control:e,setValue:p,isObjectNode:c,nodeFieldName:u,entityDefinition:n,globalParameter:i,customPropertyFields:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})]})},Dt=y((({control:e,definitionFieldName:r,isObjectNode:l,title:n,hideCodeField:i,hideVersionField:a,hideNameField:s,required:d=!1,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=R(),g=h(r?`${r}.node`:"node");return t(Te,{container:!0,direction:"column",spacing:2,children:[n&&o(Te,{size:12,children:o(z,{my:2,children:o($,{variant:"h6",children:n})})}),!s&&o(Te,{size:12,children:o(Jr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!i&&o(Te,{size:12,children:o(Jr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!a&&o(Te,{size:12,children:o(gl,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),o(Te,{size:12,children:p?o(Nt,{node:g,ref:p,isObjectNode:l,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):o(Mt,{control:e,required:d,isObjectNode:l,parentFieldName:r,entityReferenceValueComponent:c,fileReferenceValueComponent:u})})]})})),It=({node:e,data:r})=>{const{name:l}=e,n=v(((e,r)=>{const l=e,n=document.createElement("a");document.body.appendChild(n),n.href=l,n.target="_self",n.download=r,n.click()}),[]);return o(M,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,l),children:"Download File"})},Pt=({node:e,data:r})=>{var l;const n=e=>o(z,{sx:{borderRadius:"4px",padding:"4px",wordBreak:"auto-phrase"},children:yr(e)?"null":ar(e)?JSON.stringify(e,null,2):e.toString()});switch(Pn(e)){case Mr.ARRAY:return Array.isArray(r)?o("div",{children:null==r?void 0:r.map(((r,l)=>o(Pt,{node:e.memberNodes,data:ar(r)?r:r+","},l)))}):n(r);case Mr.OBJECT:return Array.isArray(e.properties)&&(null===(l=e.properties)||void 0===l?void 0:l.length)?o(Bt,{node:e,data:r}):"object"==typeof r?o(Yl,{value:r}):n(r);case Mr.ANY:return"object"==typeof r?o(Yl,{value:r}):n(r);case Mr.FILE_REFERENCE:return null===r?n(r):o(M,{component:oe,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case Mr.FILE:return yr(r)?n(r):"string"==typeof r?o(It,{data:r,node:e}):n(r);default:return n(r)}},qt=({node:e,data:r,hasBackground:l=!1})=>o(z,{sx:{backgroundColor:l?"#f1f1f1":"none"},children:o(Pt,{node:e,data:r})}),Bt=({node:e,data:r})=>{const l=v(((e,r)=>{var n;if(e&&r){console.log(e,r);const i=e.key?r[e.key]:r,a=Pn(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===Mr.OBJECT&&Array.isArray(e.properties)&&(null===(n=e.properties)||void 0===n?void 0:n.length)?e.properties.map((e=>l(e,i))):o(qt,{node:e,data:i})}}return null}),[]);return o(Te,{container:!0,direction:"column",spacing:2,children:o(en,{data:[l(e,r)]})})},zt=({properties:e,parentKey:r="",activePath:l="",prefix:n="",onClick:i})=>o(lr,{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(nr,{expanded:!0,onClick:()=>{return e=s,void i(n?`${n}.${e}`:e);var e},children:[o(tr,{slotProps:{stepIcon:{icon:"",completed:!1,active:l===s}},children:t(z,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),o(or,{children:o("div",{children:d===Mr.OBJECT&&o(zt,{onClick:i,activePath:l,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))}),$t=({open:e=!1,onClose:r,onPaste:l,properties:n})=>{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==n?void 0:n.length)?n.map(((e,r)=>t("div",{children:[o($,{variant:"h6",children:e.title}),o(zt,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:i})]},r))):o($,{children:"Please, add properties"}),i&&t($,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",i,")"]})]}),t(I,{children:[o(M,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${i})`),Er.success("Copied!")},children:"Copy"}),o(M,{variant:"contained",color:"primary",onClick:()=>{l(`$(${i})`),Er.success("Pasted!")},children:"Paste"}),o(M,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},jt=E({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Ht=()=>O(jt),_t=({children:e})=>{const[r,l]=b("true"===localStorage.getItem("sidebar_collapsed")),n=v((()=>{l(!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(jt.Provider,{value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:t},children:e})},Jt=ze("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Wt=ze(wr)((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}}}))),Gt=ze(kr)((({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"}}}))),Yt=ze(Vr)((e=>({padding:e.theme.spacing(3),margin:0}))),Zt=ze(br)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),Kt=ze(Lr)((({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"}}}}))),Ut=ze(Tr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Xt=ze(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}}))),Qt=ze(Rr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),eo=ze(Vr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),ro=ze(Fr)((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)"}}}))),lo=({route:e,isActive:r,isSubmenu:l})=>{const{collapsed:n}=Ht(),[a,s]=p.useState(null),d=Boolean(a),c=e=>{s(e.currentTarget)},u=()=>{s(null)},m=v((({children:r})=>n&&!l?o(le,{title:e.name,placement:"right",children:r}):r),[n,e,l]);return e.link?o(Zt,{disablePadding:!0,component:oe,replace:!0,to:{pathname:e.link,search:e.query},children:o(m,{children:t(Kt,{className:xr({active:r,main:e.main,collapsed:n}),children:[e.icon&&o(Ut,{className:xr({collapsed:n}),children:e.icon}),o(Qt,{primary:e.name,className:xr({collapsed:n,main:e.main}),sx:n&&!l?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}})]})})}):e.children&&n?t(i,{children:[o(Xt,{className:"collapsed",children:o(le,{title:e.name,placement:"right",children:o(Kt,{className:xr({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:c,children:e.name.substring(0,1)})})}),o(Ke,{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(io,{route:e,isSubmenu:!0},r)))})]}):o(Xt,{children:e.name})};var no="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 to=({route:e,isActive:r,isListOpen:l,handleClick:n,isSubmenu:i})=>o(Xt,{children:o(Yt,{sx:{padding:0,margin:0},children:o(Zt,{disablePadding:!0,onClick:n,children:t(Kt,{className:xr({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[o(Qt,{primary:e.name,className:xr({main:e.main}),sx:i?{}:{display:"none"}}),e.name,o(z,{component:"img",src:no,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?0:"-90deg"})`}})]})})})});function oo({route:e,isActive:r,isListOpen:l,handleClick:n,isSubmenu:i}){const{collapsed:a}=Ht();return(null==e?void 0:e.link)?o(Zt,{disablePadding:!0,onClick:n,children:t(Kt,{className:xr({active:r,main:e.main,collapsed:a}),children:[e.icon&&o(Ut,{children:e.icon}),o(Qt,{primary:e.name,className:xr({collapsed:a,main:e.main}),sx:a&&!i?{display:"none"}:{},slotProps:{primary:{variant:"body2"}}}),o(z,{component:"img",src:no,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?o(to,{route:e,handleClick:n,isListOpen:l}):o(Xt,{children:e.name})}const io=({route:e,isSubmenu:r})=>{var l,n,a;const s=te(),{collapsed:d,toggleRootElementLink:c}=Ht(),[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===(l=e.children)||void 0===l?void 0:l.length)&&(!d||d&&r)?t(i,{children:[o(oo,{route:e,isActive:C,handleClick:y,isListOpen:m,isSubmenu:r}),o(Ar,{in:!m,timeout:"auto",children:o(eo,{children:e.children.map((e=>o(io,{route:e,isSubmenu:r},e.name)))})})]}):(null===(n=e.children)||void 0===n?void 0:n.length)&&(!d||d&&r)?t(i,{children:[o(oo,{route:e,isActive:C,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),o(Ar,{in:u||!e.link,timeout:"auto",children:o(eo,{children:null===(a=e.children)||void 0===a?void 0:a.map(((e,l)=>o(io,{route:e,isSubmenu:r},e.name)))})})]}):o(lo,{route:e,isActive:C,isSubmenu:r})};const ao=({title:e,routes:r,id:l,logo:n,collapsedLogo:i,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=Ht();return t(Jt,{children:[o(ro,{className:xr("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(Wt,{variant:"permanent",anchor:"left",className:xr({collapsed:d}),id:l,children:[(!!e||!!n)&&o(Gt,{className:xr({collapsed:d}),"data-title":e.substring(0,1),children:t(z,{display:"flex",flexDirection:"column",children:[!!e&&o(z,{component:"span",children:e}),!!n&&o(z,{component:"img",src:d?i:n,alt:"Lending Hub KZ"})]})}),t(z,{height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[o(Yt,{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(io,{route:e},e.name)))}),a&&o(z,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})},so=({routes:e,theme:r=Ln,title:l="",id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>t(n,{theme:r,children:[o(Or,{}),o(_t,{children:o(ao,{title:l,routes:e,id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),co=({src:e,alt:r})=>o(z,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:o("img",{src:e,alt:r})}),uo=({children:e,toolbar:r,contentSx:l,sx:n})=>t(z,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n),children:[o(kr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),o(z,{sx:Object.assign(Object.assign({},l),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:o(w,{fallback:o(Ir,{}),children:null!=e?e:o(ae,{})})})]}),po=ze(oe)((()=>({textDecoration:"none",color:"inherit"}))),mo=({crumbs:e})=>o(Sr,{separator:o(Nr,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?o(po,{to:e.link,className:"breadcrumb",children:e.title},r):o($,{className:"breadcrumb",children:e.title},r)))});export{Pr as AlertDialog,_n as ArrayNodeFormBuilder,Qn as ArrayNodeFormBuilderControl,sl as BackButton,mo as Breadcrumbs,uo as ContentLayout,Ol as ControlArrayInput,tl as ControlAutocomplete,Ur as ControlCheckbox,dl as ControlCodeEditor,Cl as ControlDate,xl as ControlDateTime,Yr as ControlDebouncedInput,Jr as ControlInput,gl as ControlNumberInput,wl as ControlPeriodInput,Vl as ControlPhoneInput,il as ControlQueryAutocomplete,Xr as ControlRadio,Kr as ControlSelect,fl as ControlSwitch,El as ControlTime,al as CopyButton,Dt as CreateDefinition,Nt as CreateNode,Mt as CreateNodeWithContext,jr as DATE_DEFAULT_FORMAT,_r as DATE_TIME_DEFAULT_FORMAT,$r as DEFAULT_DATE_VALIDATION_ERROR_TEXT,hl as DEFAULT_ERROR_TEXT,zr as DEFAULT_REQUIRED_ERROR_TEXT,Jn as DefinitionFiller,Bt as DefinitionView,Kl as InfoItem,Zl as JsonModalView,$t as JsonPathPicker,Yl as JsonView,Ir as Loader,co as MenuIcon,Un as NodeFormBuilderContext,$n as NodeFormBuilderControl,Mr as NodeType,ht as ObjectNodeProperties,tt as ObjectNodeView,dn as OverflowTip,Zr as PopupIconComponent,Dr as RoundingMode,Gl as RouteTabs,so as Sidebar,_l as SimpleTable,un as Status,en as StepperView,Hr as TIME_DEFAULT_FORMAT,Wl as TabPanel,Il as Table,Pl as TableAction,Jl as TableActionCell,it as ViewNode,mn as blue,hn as brand,nn as capitalize,gn as dark,sn as deepParseJson,qr as defaultDefinitionArrayValue,Br as defaultDefinitionObjectValue,cl as digitsOnly,ul as floatsOnly,An as formatDefinitionNodeData,Rn as formatTableRowValue,Mn as getDemNodeDateFormat,on as getJsonStringValue,In as getMultipleNodeFillOptions,Pn as getNodeType,Dn as getObjectStarterValue,qn as getSingleNodeFillOptions,fn as green,pl as isExpression,kn as isValueEmpty,Sn as nodePropertiesArrayToObject,Nn as nodePropertiesObjectToArray,ml as numberFormat,bn as orange,vn as red,rn as removeArrayItem,an as safeParseJson,tn as sortArrayOfObjects,Ln as theme,Wr as useDebounce,Gr as useToggle,ln as validateJson,Cn as white,yn as yellow};
|