@artibet/react-mui-components 3.7.24 → 3.7.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.7.24",
3
+ "version": "3.7.25",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as l,Stack as a,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as b,Grid2 as g}from"@mui/material";import{router as h}from"@inertiajs/react";import{EditNoteRounded as x,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as C,useForm as w}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as O}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as j}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as I}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as P,renderDigitalClockTimeView as R}from"@mui/x-date-pickers";import F from"date-fns/locale/el";import K from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import D from"@mui/icons-material/CheckCircleOutlineRounded";function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Y=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=r.readonly,g=void 0!==b&&b,h=r.readonlyBackgroundColor,x=void 0===h?"#dddddd":h,E=r.bold,y=void 0!==E&&E,S=U(r,Z),W=n.control,w=n.formState.errors;return e.createElement(C,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=w[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=w[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:g,sx:{fontWeight:y?"bold":"",backgroundColor:g?x:""}}}},S))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],J=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,b=r.showErrors,g=void 0===b||b,h=r.readonly,x=void 0!==h&&h,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,w=U(r,G),z=n.control,q=n.formState.errors;return e.createElement(C,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,l=r.field,s=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,A({required:u,label:a,value:m,onChange:s,onBlur:d,error:g&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:g&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:W?"bold":"",backgroundColor:x?y:""}}}},w))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],X=function(n){var o=n.form,i=n.name,l=n.label,a=n.required,s=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,b=void 0===p?"label":p,g=n.maxLength,h=void 0===g?255:g,x=n.autofocus,E=void 0!==x&&x,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,w=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,O=void 0===k?"#dddddd":k,j=n.bold,I=void 0!==j&&j,P=U(n,Q),R=$(e.useState(null),2),F=R[0],K=R[1],B=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,V=o.formState.errors;return e.createElement(C,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:h,readOnly:L,sx:{fontWeight:I?"bold":"",backgroundColor:L?O:""}}},value:F?F.label:""}):e.createElement(r,{value:F,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[b]},size:q,slotProps:{input:{maxLength:h,sx:{fontWeight:I?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,A({label:l,required:s,disabled:d,autoFocus:E,size:q,error:w&&Boolean(null===(n=V[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=V[i])||void 0===o?void 0:o.message)},r,P))}})}})},_=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ee=function(o){var i=o.form,l=o.name,a=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,b=o.labelKey,g=void 0===b?"label":b,h=o.maxLength,x=void 0===h?255:h,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,w=o.showErrors,z=void 0===w||w,q=U(o,_),T=$(e.useState([]),2),L=T[0],k=T[1],O=i.watch(l);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,O)})))}),[O]);var j=i.control,I=i.formState.errors;return e.createElement(C,{name:l,control:j,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,A({variant:"outlined",label:t[g],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,A({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:x},error:z&&Boolean(null===(n=I[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=I[l])||void 0===o?void 0:o.message)},r,q))}})}})},te=["form","name","label","rows","required","disabled","autofocus","showErrors"],re=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=U(r,te),g=n.control,h=n.formState.errors;return e.createElement(C,{name:o,control:g,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=h[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=h[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f},b))}})},ne=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],oe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,b=void 0===p?1:p,g=t.minutesStep,h=void 0===g?15:g,x=t.secondsStep,E=void 0===x?30:x,y=U(t,ne),S=r.control,W=r.formState.errors;return e.createElement(I,{dateAdapter:j,adapterLocale:F,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(C,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(P,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:R}:null,timeSteps:{hours:b,minutes:h,seconds:E},slotProps:{textField:H(H({},y),{},{required:l,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ie=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=t.onSubmit,h=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,C=t.requiredMessage,T=void 0===C?"Υποχρεωτικό πεδίο":C,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,O=t.cancelLabel,j=void 0===O?"ΑΚΥΡΩΣΗ":O,I=t.maxLength,P=void 0===I?255:I,R=t.message,F=void 0===R?null:R,K=t.isLoading,B=void 0!==K&&K,D={text:b||""},V=q.object({text:W?q.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(T):q.string().max(P)}),M=w({defaultValues:D,resolver:z(V)});e.useEffect((function(){r&&(M.reset(D),M.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&h()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),F&&"string"==typeof F?e.createElement(c,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return g(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(Y,{form:M,name:"text",label:p,required:W,autofocus:!0,maxLength:P,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),h()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},le=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ae=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=t.onSubmit,h=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,C=t.requiredMessage,T=void 0===C?"Υποχρεωτικό πεδίο":C,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,O=t.okLabel,j=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,I=t.cancelLabel,P=void 0===I?"ΑΚΥΡΩΣΗ":I,R=t.maxLength,F=void 0===R?255:R,K=t.message,B=void 0===K?null:K,D=t.isLoading,V=void 0!==D&&D,M={email:b||""},A=q.object({email:W?q.string().matches(le,k).required(T):q.string().matches(le,k)}),N=w({defaultValues:M,resolver:z(A)});e.useEffect((function(){r&&(N.reset(M),N.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&h()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:N.handleSubmit((function(e){return g(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(J,{form:N,label:p,required:W,autofocus:!0,maxLength:F,sx:{marginTop:2}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),h()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},V?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var se=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.options,v=void 0===d?[]:d,p=t.valueKey,b=void 0===p?"id":p,g=t.labelKey,h=void 0===g?"label":g,x=t.required,E=void 0===x||x,y=t.size,S=void 0===y?"sm":y,W=t.requiredMessage,C=void 0===W?"Υποχρεωτικό πεδίο":W,T=t.okLabel,L=void 0===T?"ΚΑΤΑΧΩΡΗΣΗ":T,k=t.cancelLabel,O=void 0===k?"ΑΚΥΡΩΣΗ":k;t.isLoading;var j={field:a||null},I=q.object({field:E?q.string().required(C):q.string().nullable()}),P=w({defaultValues:j,resolver:z(I)});return e.useEffect((function(){r&&(P.clearErrors(),P.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:S,open:r,onClose:function(){}},e.createElement(l,null,n),e.createElement(u,null,e.createElement(X,{form:P,name:"field",label:i,options:v,valueKey:b,labelKey:h,required:E,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:P.handleSubmit(s)},L),e.createElement(f,{color:"error",onClick:function(){return c()}},O)))},ce=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=void 0===b?[]:b,h=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,C=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,O=void 0===k||k,j=t.size,I=void 0===j?"sm":j,P=t.requiredMessage,R=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,V=t.message,M=void 0===V?null:V,A=t.isLoading,N=void 0!==A&&A,H={field:g||[]},U=q.object({field:O?q.array().min(1,R):q.array()}),$=w({defaultValues:H,resolver:z(U)});e.useEffect((function(){r&&($.reset(H),$.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:I,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),M&&"string"==typeof M?e.createElement(c,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return h(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ee,{form:$,name:"field",label:p,options:S,valueKey:C,labelKey:L,required:O,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},de=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,b=t.confirmText,g=void 0===b?"ΕΠΙΒΕΒΑΙΩΣΗ":b,h=t.cancelText,x=void 0===h?"ΑΚΥΡΩΣΗ":h,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,C={warning:{color:"warning.main",icon:e.createElement(K,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(D,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(C.color,"20"),color:C.color,borderRadius:"50%",mb:2}},C.icon),e.createElement(l,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},a)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},x),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):g)))},ue=function(t){var r=t.open,n=t.title,i=t.label,a=t.message,s=void 0===a?null:a,d=t.value,v=t.onSubmit,p=t.onCancel,b=t.size,g=void 0===b?"sm":b,h=t.rows,x=void 0===h?5:h,E=t.required,y=void 0!==E&&E,S=t.requiredMessage,W=void 0===S?"Υποχρεωτικό πεδίο":S,C=t.okLabel,T=void 0===C?"ΚΑΤΑΧΩΡΗΣΗ":C,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L;t.isLoading;var O={notes:d||""},j=q.object({notes:y?q.string().required(W):q.string()}),I=w({defaultValues:O,resolver:z(j)});return e.useEffect((function(){r&&(I.clearErrors(),I.setValue("notes",d||"",{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,d]),e.createElement(o,{fullWidth:!0,maxWidth:g,open:r,onClose:function(){},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,s&&e.createElement(c,null,s),e.createElement(re,{form:I,name:"notes",label:i,required:y,rows:x,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:I.handleSubmit((function(e){return v(e.notes)}))},T),e.createElement(f,{color:"error",onClick:function(){return p()}},k)))},me=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.size,v=void 0===d?"sm":d,p=t.required,b=void 0===p||p,g=t.requiredMessage,h=void 0===g?"Υποχρεωτικό πεδίο":g,x=t.okLabel,E=void 0===x?"ΚΑΤΑΧΩΡΗΣΗ":x,y=t.cancelLabel,S=void 0===y?"ΑΚΥΡΩΣΗ":y;t.isLoading;var W={datetime:a},C=q.object({datetime:b?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(h):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),T=w({defaultValues:W,resolver:z(C)});return e.useEffect((function(){r&&(T.clearErrors(),T.setValue("datetime",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:v,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),T.handleSubmit((function(e){return s(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,e.createElement(oe,{form:T,name:"datetime",label:i,required:b,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:T.handleSubmit((function(e){return s(e.datetime)}))},E),e.createElement(f,{color:"error",onClick:function(){return c()}},S)))},fe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ie,{open:R,title:w,label:r,value:o,required:x,maxLength:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},ve=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ae,{open:R,title:w,label:r,value:o,required:x,maxLength:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},pe=function(t){var r,o=t.label,i=t.value,l=t.render,s=void 0===l?null:l,u=t.fieldName,m=void 0===u?null:u,v=t.editable,p=void 0!==v&&v,x=t.required,S=void 0===x||x,W=t.placeholder,C=void 0===W?"":W,w=t.modalTitle,z=void 0===w?"Επεξεργασία":w,q=t.updateUrl,k=void 0===q?null:q,j=t.message,I=void 0===j?null:j,P=t.hasDivider,R=void 0===P||P,F=$(e.useState(!1),2),K=F[0],B=F[1],D=!i&&S,V=$(e.useState(!1),2),M=V[0],A=V[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},o)),e.createElement(g,{size:{xs:12,sm:6}},S&&!i?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?T(L(r,{locale:O}),"dd/MM/yyyy, HH:mm"):"":C)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),B(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(me,{open:K,title:z,label:o,value:i,required:S,onSubmit:function(e){A(!0),h.put(k,{field:m,value:e},{preserveScroll:!0,onFinish:function(){A(!1),B(!1)}})},onCancel:function(){return B(!1)},message:I,isLoading:M}))},be=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:R,title:w,label:r,value:o,required:x,rows:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},ge=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,x=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,C=t.editable,w=void 0!==C&&C,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,I=void 0===j?null:j,P=t.message,R=void 0===P?null:P,F=t.hasDivider,K=void 0===F||F,B=$(e.useState(!1),2),D=B[0],V=B[1],M=null==o&&q,A=u.find((function(e){return e.id===o})),N=A?A.label:"",H=$(e.useState(!1),2),U=H[0],Z=H[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},N||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},w&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),V(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(se,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:x,required:q,onSubmit:function(e){Z(!0),h.put(I,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){Z(!1),V(!1)}})},onCancel:function(){return V(!1)},message:R,isLoading:U}))},he=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,l=t.fieldName,a=void 0===l?null:l,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,x=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,C=t.deactivationMessage,w=void 0===C?"":C,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=$(e.useState(!1),2),O=k[0],j=k[1],I=$(e.useState(!1),2),P=I[0],R=I[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?x:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(de,{open:O,title:n?x:v,message:n?w:y,onConfirm:function(){R(!0),h.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){R(!1),j(!1)}})},onCancel:function(){return j(!1)},isLoading:P}))},xe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,x=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,C=t.editable,w=void 0!==C&&C,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,I=void 0===j?null:j,P=t.message,R=void 0===P?null:P,F=t.hasDivider,K=void 0===F||F,B=$(e.useState(!1),2),D=B[0],V=B[1],M=null==o&&q,A=$(e.useState(!1),2),N=A[0],H=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[x]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},w&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(){return V(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(ce,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:x,required:q,onSubmit:function(e){H(!0),h.put(I,{field:W,value:e.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){H(!1),V(!1)}})},onCancel:function(){return V(!1)},message:R,isLoading:N}))};export{xe as AutocompleteMultiProperty,ge as AutocompleteProperty,pe as DateTimeProperty,ve as EmailProperty,fe as StringProperty,be as TextProperty,he as ToggleProperty};
1
+ import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as l,Stack as a,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as b,Grid2 as g}from"@mui/material";import{router as h}from"@inertiajs/react";import{EditNoteRounded as x,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as C,useForm as w}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as O}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as j}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as I}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as P,renderDigitalClockTimeView as R}from"@mui/x-date-pickers";import F from"date-fns/locale/el";import K from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import D from"@mui/icons-material/CheckCircleOutlineRounded";function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function U(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Y=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=r.readonly,g=void 0!==b&&b,h=r.readonlyBackgroundColor,x=void 0===h?"#dddddd":h,E=r.bold,y=void 0!==E&&E,S=U(r,Z),W=n.control,w=n.formState.errors;return e.createElement(C,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=w[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=w[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:g,sx:{fontWeight:y?"bold":"",backgroundColor:g?x:""}}}},S))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],J=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,b=r.showErrors,g=void 0===b||b,h=r.readonly,x=void 0!==h&&h,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,w=U(r,G),z=n.control,q=n.formState.errors;return e.createElement(C,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,l=r.field,s=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,A({required:u,label:a,value:m,onChange:s,onBlur:d,error:g&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:g&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:W?"bold":"",backgroundColor:x?y:""}}}},w))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],X=function(n){var o=n.form,i=n.name,l=n.label,a=n.required,s=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,b=void 0===p?"label":p,g=n.maxLength,h=void 0===g?255:g,x=n.autofocus,E=void 0!==x&&x,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,w=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,O=void 0===k?"#dddddd":k,j=n.bold,I=void 0!==j&&j,P=U(n,Q),R=$(e.useState(null),2),F=R[0],K=R[1],B=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,V=o.formState.errors;return e.createElement(C,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:h,readOnly:L,sx:{fontWeight:I?"bold":"",backgroundColor:L?O:""}}},value:F?F.label:""}):e.createElement(r,{value:F,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[b]},size:q,slotProps:{input:{maxLength:h,sx:{fontWeight:I?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,A({label:l,required:s,disabled:d,autoFocus:E,size:q,error:w&&Boolean(null===(n=V[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=V[i])||void 0===o?void 0:o.message)},r,P))}})}})},_=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ee=function(o){var i=o.form,l=o.name,a=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,b=o.labelKey,g=void 0===b?"label":b,h=o.maxLength,x=void 0===h?255:h,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,w=o.showErrors,z=void 0===w||w,q=U(o,_),T=$(e.useState([]),2),L=T[0],k=T[1],O=i.watch(l);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,O)})))}),[O]);var j=i.control,I=i.formState.errors;return e.createElement(C,{name:l,control:j,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,A({variant:"outlined",label:t[g],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,A({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:x},error:z&&Boolean(null===(n=I[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=I[l])||void 0===o?void 0:o.message)},r,q))}})}})},te=["form","name","label","rows","required","disabled","autofocus","showErrors"],re=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=U(r,te),g=n.control,h=n.formState.errors;return e.createElement(C,{name:o,control:g,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,A({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=h[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=h[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f},b))}})},ne=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],oe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,b=void 0===p?1:p,g=t.minutesStep,h=void 0===g?15:g,x=t.secondsStep,E=void 0===x?30:x,y=U(t,ne),S=r.control,W=r.formState.errors;return e.createElement(I,{dateAdapter:j,adapterLocale:F,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(C,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(P,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:R}:null,timeSteps:{hours:b,minutes:h,seconds:E},slotProps:{textField:H(H({},y),{},{required:l,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ie=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=t.onSubmit,h=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,C=t.requiredMessage,T=void 0===C?"Υποχρεωτικό πεδίο":C,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,O=t.cancelLabel,j=void 0===O?"ΑΚΥΡΩΣΗ":O,I=t.maxLength,P=void 0===I?255:I,R=t.message,F=void 0===R?null:R,K=t.isLoading,B=void 0!==K&&K,D={text:b||""},V=q.object({text:W?q.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(T):q.string().max(P)}),M=w({defaultValues:D,resolver:z(V)});e.useEffect((function(){r&&(M.reset(D),M.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&h()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),F&&"string"==typeof F?e.createElement(c,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return g(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(Y,{form:M,name:"text",label:p,required:W,autofocus:!0,maxLength:P,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),h()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},j),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},le=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ae=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=t.onSubmit,h=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,C=t.requiredMessage,T=void 0===C?"Υποχρεωτικό πεδίο":C,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,O=t.okLabel,j=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,I=t.cancelLabel,P=void 0===I?"ΑΚΥΡΩΣΗ":I,R=t.maxLength,F=void 0===R?255:R,K=t.message,B=void 0===K?null:K,D=t.isLoading,V=void 0!==D&&D,M={email:b||""},A=q.object({email:W?q.string().matches(le,k).required(T):q.string().matches(le,k)}),N=w({defaultValues:M,resolver:z(A)});e.useEffect((function(){r&&(N.reset(M),N.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&h()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:N.handleSubmit((function(e){return g(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(J,{form:N,label:p,required:W,autofocus:!0,maxLength:F,sx:{marginTop:2}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),h()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},V?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var se=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.options,v=void 0===d?[]:d,p=t.valueKey,b=void 0===p?"id":p,g=t.labelKey,h=void 0===g?"label":g,x=t.required,E=void 0===x||x,y=t.size,S=void 0===y?"sm":y,W=t.requiredMessage,C=void 0===W?"Υποχρεωτικό πεδίο":W,T=t.okLabel,L=void 0===T?"ΚΑΤΑΧΩΡΗΣΗ":T,k=t.cancelLabel,O=void 0===k?"ΑΚΥΡΩΣΗ":k;t.isLoading;var j={field:a||null},I=q.object({field:E?q.string().required(C):q.string().nullable()}),P=w({defaultValues:j,resolver:z(I)});return e.useEffect((function(){r&&(P.clearErrors(),P.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:S,open:r,onClose:function(){}},e.createElement(l,null,n),e.createElement(u,null,e.createElement(X,{form:P,name:"field",label:i,options:v,valueKey:b,labelKey:h,required:E,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:P.handleSubmit(s)},L),e.createElement(f,{color:"error",onClick:function(){return c()}},O)))},ce=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,g=void 0===b?[]:b,h=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,C=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,O=void 0===k||k,j=t.size,I=void 0===j?"sm":j,P=t.requiredMessage,R=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,V=t.message,M=void 0===V?null:V,A=t.isLoading,N=void 0!==A&&A,H={field:g||[]},U=q.object({field:O?q.array().min(1,R):q.array()}),$=w({defaultValues:H,resolver:z(U)});e.useEffect((function(){r&&($.reset(H),$.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:I,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(x,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),M&&"string"==typeof M?e.createElement(c,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return h(e.field)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ee,{form:$,name:"field",label:p,options:S,valueKey:C,labelKey:L,required:O,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},de=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,b=t.confirmText,g=void 0===b?"ΕΠΙΒΕΒΑΙΩΣΗ":b,h=t.cancelText,x=void 0===h?"ΑΚΥΡΩΣΗ":h,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,C={warning:{color:"warning.main",icon:e.createElement(K,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(D,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(C.color,"20"),color:C.color,borderRadius:"50%",mb:2}},C.icon),e.createElement(l,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},a)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},x),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):g)))},ue=function(t){var r=t.open,n=t.title,i=t.label,a=t.message,s=void 0===a?null:a,d=t.value,v=t.onSubmit,p=t.onCancel,b=t.size,g=void 0===b?"sm":b,h=t.rows,x=void 0===h?5:h,E=t.required,y=void 0!==E&&E,S=t.requiredMessage,W=void 0===S?"Υποχρεωτικό πεδίο":S,C=t.okLabel,T=void 0===C?"ΚΑΤΑΧΩΡΗΣΗ":C,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L;t.isLoading;var O={notes:d||""},j=q.object({notes:y?q.string().required(W):q.string()}),I=w({defaultValues:O,resolver:z(j)});return e.useEffect((function(){r&&(I.clearErrors(),I.setValue("notes",d||"",{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,d]),e.createElement(o,{fullWidth:!0,maxWidth:g,open:r,onClose:function(){},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,s&&e.createElement(c,null,s),e.createElement(re,{form:I,name:"notes",label:i,required:y,rows:x,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:I.handleSubmit((function(e){return v(e.notes)}))},T),e.createElement(f,{color:"error",onClick:function(){return p()}},k)))},me=function(t){var r=t.open,n=t.title,i=t.label,a=t.value,s=t.onSubmit,c=t.onCancel,d=t.size,v=void 0===d?"sm":d,p=t.required,b=void 0===p||p,g=t.requiredMessage,h=void 0===g?"Υποχρεωτικό πεδίο":g,x=t.okLabel,E=void 0===x?"ΚΑΤΑΧΩΡΗΣΗ":x,y=t.cancelLabel,S=void 0===y?"ΑΚΥΡΩΣΗ":y;t.isLoading;var W={datetime:a},C=q.object({datetime:b?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(h):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),T=w({defaultValues:W,resolver:z(C)});return e.useEffect((function(){r&&(T.clearErrors(),T.setValue("datetime",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,a]),e.createElement(o,{fullWidth:!0,maxWidth:v,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),T.handleSubmit((function(e){return s(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(l,null,n),e.createElement(u,null,e.createElement(oe,{form:T,name:"datetime",label:i,required:b,autofocus:!0,sx:{marginTop:2}})),e.createElement(m,null,e.createElement(f,{color:"success",onClick:T.handleSubmit((function(e){return s(e.datetime)}))},E),e.createElement(f,{color:"error",onClick:function(){return c()}},S)))},fe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ie,{open:R,title:w,label:r,value:o,required:x,maxLength:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},ve=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ae,{open:R,title:w,label:r,value:o,required:x,maxLength:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},pe=function(t){var r,o=t.label,i=t.value,l=t.render,s=void 0===l?null:l,u=t.fieldName,m=void 0===u?null:u,v=t.editable,p=void 0!==v&&v,x=t.required,S=void 0===x||x,W=t.placeholder,C=void 0===W?"":W,w=t.modalTitle,z=void 0===w?"Επεξεργασία":w,q=t.updateUrl,k=void 0===q?null:q,j=t.message,I=void 0===j?null:j,P=t.hasDivider,R=void 0===P||P,F=$(e.useState(!1),2),K=F[0],B=F[1],D=!i&&S,V=$(e.useState(!1),2),M=V[0],A=V[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},o)),e.createElement(g,{size:{xs:12,sm:6}},S&&!i?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?T(L(r,{locale:O}),"dd/MM/yyyy, HH:mm"):"":C)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),B(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(me,{open:K,title:z,label:o,value:i,required:S,onSubmit:function(e){A(!0),h.put(k,{field:m,value:e},{preserveScroll:!0,onFinish:function(){A(!1),B(!1)}})},onCancel:function(){return B(!1)},message:I,isLoading:M}))},be=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,x=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,C=t.modalTitle,w=void 0===C?"Επεξεργασία":C,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=$(e.useState(!1),2),R=P[0],F=P[1],K=!o&&x,B=$(e.useState(!1),2),D=B[0],V=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},x&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:R,title:w,label:r,value:o,required:x,rows:L,onSubmit:function(e){V(!0),h.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),F(!1)}})},onCancel:function(){return F(!1)},message:O,isLoading:D}))},ge=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,x=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,C=t.editable,w=void 0!==C&&C,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,I=void 0===j?null:j,P=t.message,R=void 0===P?null:P,F=t.hasDivider,K=void 0===F||F,B=$(e.useState(!1),2),D=B[0],V=B[1],M=null==o&&q,A=u.find((function(e){return e.id===o})),N=A?A.label:"",H=$(e.useState(!1),2),U=H[0],Z=H[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},N||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},w&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),V(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(se,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:x,required:q,onSubmit:function(e){Z(!0),h.put(I,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){Z(!1),V(!1)}})},onCancel:function(){return V(!1)},message:R,isLoading:U}))},he=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,l=t.fieldName,a=void 0===l?null:l,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,x=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,C=t.deactivationMessage,w=void 0===C?"":C,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=$(e.useState(!1),2),O=k[0],j=k[1],I=$(e.useState(!1),2),P=I[0],R=I[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?x:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(de,{open:O,title:n?x:v,message:n?w:y,onConfirm:function(){R(!0),h.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){R(!1),j(!1)}})},onCancel:function(){return j(!1)},isLoading:P}))},xe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,x=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,C=t.editable,w=void 0!==C&&C,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,O=void 0===k?"Επεξεργασία":k,j=t.updateUrl,I=void 0===j?null:j,P=t.message,R=void 0===P?null:P,F=t.hasDivider,K=void 0===F||F,B=$(e.useState(!1),2),D=B[0],V=B[1],M=null==o&&q,A=$(e.useState(!1),2),N=A[0],H=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[x]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(g,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(g,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(g,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},w&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),V(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(ce,{open:D,title:O,label:r,value:o,options:u,valueKey:v,labelKey:x,required:q,onSubmit:function(e){H(!0),h.put(I,{field:W,value:e.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){H(!1),V(!1)}})},onCancel:function(){return V(!1)},message:R,isLoading:N}))};export{xe as AutocompleteMultiProperty,ge as AutocompleteProperty,pe as DateTimeProperty,ve as EmailProperty,fe as StringProperty,be as TextProperty,he as ToggleProperty};