@artibet/react-mui-components 3.10.0 → 3.11.0

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.
@@ -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 x,Grid2 as g,Link as b,Paper as h,List as E}from"@mui/material";import{router as y}from"@inertiajs/react";import{EditNoteRounded as S,ErrorOutline as W,Edit as w,ToggleOff as C,ToggleOn as z,DeleteOutline as q,Upload as T}from"@mui/icons-material";import{Controller as L,useForm as R}from"react-hook-form";import{yupResolver as k}from"@hookform/resolvers/yup";import*as I from"yup";import"react-color";import{format as F,parseISO as P,toDate as V}from"date-fns";import{el as j}from"date-fns/locale";import"axios";import{NumericFormat as D}from"react-number-format";import{AdapterDateFns as O}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as B}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as K,renderDigitalClockTimeView as M,DatePicker as N,TimePicker as H}from"@mui/x-date-pickers";import A from"date-fns/locale/el";import U from"@mui/icons-material/WarningAmberRounded";import _ from"@mui/icons-material/ErrorOutlineRounded";import Y from"@mui/icons-material/CheckCircleOutlineRounded";function $(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 G(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 Z(){return Z=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},Z.apply(null,arguments)}function J(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 Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){G(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function X(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 ee(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 $(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)?$(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 te=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],re=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,x=r.readonly,g=void 0!==x&&x,b=r.readonlyBackgroundColor,h=void 0===b?"#dddddd":b,E=r.bold,y=void 0!==E&&E,S=X(r,te),W=n.control,w=n.formState.errors;return e.createElement(L,{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,Z({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?h:""}}}},S))}})},ne=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],oe=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,x=r.showErrors,g=void 0===x||x,b=r.readonly,h=void 0!==b&&b,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,w=X(r,ne),C=n.control,z=n.formState.errors;return e.createElement(L,{name:i,control:C,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,Z({required:u,label:a,value:m,onChange:s,onBlur:d,error:g&&Boolean(null===(n=z[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:g&&(null===(o=z[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},w))}})},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","onChange","readonly","readonlyBackgroundColor","bold"],le=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,x=void 0===p?"label":p,g=n.maxLength,b=void 0===g?255:g,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,w=void 0===W||W,C=n.size,z=void 0===C?"medium":C,q=n.onChange,T=void 0===q?null:q,R=n.readonly,k=void 0!==R&&R,I=n.readonlyBackgroundColor,F=void 0===I?"#dddddd":I,P=n.bold,V=void 0!==P&&P,j=X(n,ie),D=ee(e.useState(null),2),O=D[0],B=D[1],K=o.watch(i);e.useEffect((function(){B(m.find((function(e){return e[v]===K}))||null)}),[K]);var M=o.control,N=o.formState.errors;return e.createElement(L,{name:i,control:M,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,k?e.createElement(t,Z({size:z,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:b,readOnly:k,sx:{fontWeight:V?"bold":"",backgroundColor:k?F:""}}},value:O?O.label:""},j)):e.createElement(r,{value:O,required:s,onChange:function(e,t){var r=t?t[v]:null;a(r),T&&T(r)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[x]},size:z,slotProps:{input:{maxLength:b,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,Z({label:l,required:s,disabled:d,autoFocus:E,size:z,error:w&&Boolean(null===(n=N[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=N[i])||void 0===o?void 0:o.message)},r,j))}})}})},ae=function(e){return null==e||""===e},se=function(e){return null!=e&&""!==e},ce=function(e){return ae(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!ae(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return e?F(P(e,{locale:j}),"dd".concat(t,"MM").concat(t,"yyyy")):""},me=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],fe=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,x=o.labelKey,g=void 0===x?"label":x,b=o.maxLength,h=void 0===b?255:b,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,w=o.showErrors,C=void 0===w||w,z=X(o,me),q=ee(e.useState([]),2),T=q[0],R=q[1],k=i.watch(l);e.useEffect((function(){R(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,k)})))}),[k]);var I=i.control,F=i.formState.errors;return e.createElement(L,{name:l,control:I,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:T,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,Z({variant:"outlined",label:t[g],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,Z({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:C&&Boolean(null===(n=F[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=F[l])||void 0===o?void 0:o.message)},r,z))}})}})},ve=["form","name","label","rows","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],pe=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,x=r.readonly,g=void 0!==x&&x,b=r.readonlyBackgroundColor,h=void 0===b?"#dddddd":b,E=r.bold,y=void 0!==E&&E,S=X(r,ve),W=n.control,w=n.formState.errors;return e.createElement(L,{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,Z({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,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:{readOnly:g,sx:{fontWeight:y?"bold":"",backgroundColor:g?h:""}}}},S))}})},xe=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ge=function(r){var n=r.form,o=r.name,i=r.label,l=r.decimals,a=void 0===l?2:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d;r.autofocus;var m=r.showErrors,f=void 0===m||m,v=r.readonly,p=void 0!==v&&v,x=r.readonlyBackgroundColor,g=void 0===x?"#dddddd":x,b=r.bold,h=void 0!==b&&b,E=X(r,xe),y=n.control,S=n.formState.errors,W=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(L,{name:o,control:y,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field;s.onChange,s.onBlur;var d=s.value;return e.createElement(D,Z({customInput:t,variant:"outlined",label:i,required:c,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:a,fixedDecimalScale:!0,allowNegative:!1,onValueChange:W,error:f&&Boolean(null===(n=S[o])||void 0===n?void 0:n.message),helperText:f&&(null===(l=S[o])||void 0===l?void 0:l.message),fullWidth:!0,slotProps:{input:{readOnly:p,sx:{fontWeight:h?"bold":"",backgroundColor:p?g:""}}}},E))}})},be=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],he=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,x=void 0===p?1:p,g=t.minutesStep,b=void 0===g?15:g,h=t.secondsStep,E=void 0===h?30:h,y=X(t,be),S=r.control,W=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(L,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(K,{label:o,value:a.value?V(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:M}:null,timeSteps:{hours:x,minutes:b,seconds:E},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:Q(Q({},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})}})}}))},Ee=["form","name","label","required","disabled","autofocus","showErrors"],ye=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=X(t,Ee),m=r.control,f=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(L,{name:n,control:m,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(N,{label:o,value:a.value?V(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:Q(Q({},u),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Se=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],We=function(r){var n=r.form,o=r.name,i=r.label,l=r.allowNegative,a=void 0!==l&&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,x=X(r,Se),g=n.control,b=n.formState.errors,h=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(L,{name:o,control:g,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field;s.onChange,s.onBlur;var d=s.value;return e.createElement(D,Z({customInput:t,variant:"outlined",label:i,required:c,disabled:u,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:a,onValueChange:h,error:p&&Boolean(null===(n=b[o])||void 0===n?void 0:n.message),helperText:p&&(null===(l=b[o])||void 0===l?void 0:l.message),fullWidth:!0,autoFocus:f},x))}})},we=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],Ce=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,l=void 0!==i&&i,a=t.hoursStep,s=void 0===a?1:a,c=t.minutesStep,d=void 0===c?15:c,u=t.secondsStep,m=void 0===u?30:u,f=t.singleTimeColumn,v=void 0===f||f,p=t.required,x=void 0!==p&&p,g=t.disabled,b=void 0!==g&&g;t.autofocus;var h=t.showErrors,E=void 0===h||h,y=X(t,we),S=r.control,W=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(L,{name:n,control:S,rules:{required:x,disabled:b},render:function(t){var r,i,a=t.field;return e.createElement(H,{label:o,value:a.value?V(a.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:l,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:M}:null,timeSteps:{hours:s,minutes:d,seconds:m},slotProps:{textField:Q(Q({},y),{},{required:x,error:E&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:E&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ze=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.maxLength,P=void 0===F?255:F,V=t.message,j=void 0===V?null:V,D=t.isLoading,O=void 0!==D&&D,B={text:x||""},K=I.object({text:W?I.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(C):I.string().max(P)}),M=R({defaultValues:B,resolver:k(K)});e.useEffect((function(){r&&(M.reset(B),M.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),j&&"string"==typeof j?e.createElement(c,{variant:"caption",color:"text.secondary"},j):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}},j&&"string"!=typeof j&&e.createElement(s,{sx:{mb:2}},j),e.createElement(re,{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(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},O?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},qe=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,Te=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.invalidMessage,q=void 0===z?"Μη έγκυρη μορφή email":z,T=t.okLabel,L=void 0===T?"ΚΑΤΑΧΩΡΗΣΗ":T,F=t.cancelLabel,P=void 0===F?"ΑΚΥΡΩΣΗ":F,V=t.maxLength,j=void 0===V?255:V,D=t.message,O=void 0===D?null:D,B=t.isLoading,K=void 0!==B&&B,M={email:x||""},N=I.object({email:W?I.string().matches(qe,q).required(C):I.string().matches(qe,q)}),H=R({defaultValues:M,resolver:k(N)});e.useEffect((function(){r&&(H.reset(M),H.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),O&&"string"==typeof O?e.createElement(c,{variant:"caption",color:"text.secondary"},O):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return g(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},O&&"string"!=typeof O&&e.createElement(s,{sx:{mb:2}},O),e.createElement(oe,{form:H,label:p,required:W,autofocus:!0,maxLength:j,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},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)"}}},K?e.createElement(v,{size:20,sx:{color:"inherit"}}):L))))};!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 Le=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.options,E=void 0===h?[]:h,y=t.valueKey,W=void 0===y?"id":y,w=t.labelKey,C=void 0===w?"label":w,z=t.required,q=void 0===z||z,T=t.size,L=void 0===T?"sm":T,F=t.requiredMessage,P=void 0===F?"Υποχρεωτικό πεδίο":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={field:x||null},A=I.object({field:q?I.string().required(P):I.string().nullable()}),U=R({defaultValues:H,resolver:k(A)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:L,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(le,{form:U,name:"field",label:p,options:E,valueKey:W,labelKey:C,required:q,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},Re=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=void 0===x?[]:x,b=t.onSubmit,h=t.onCancel,E=t.options,y=void 0===E?[]:E,W=t.valueKey,w=void 0===W?"id":W,C=t.labelKey,z=void 0===C?"label":C,q=t.required,T=void 0===q||q,L=t.size,F=void 0===L?"sm":L,P=t.requiredMessage,V=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,j=t.okLabel,D=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,O=t.cancelLabel,B=void 0===O?"ΑΚΥΡΩΣΗ":O,K=t.message,M=void 0===K?null:K,N=t.isLoading,H=void 0!==N&&N,A={field:g||[]},U=I.object({field:T?I.array().min(1,V):I.array()}),_=R({defaultValues:A,resolver:k(U)});e.useEffect((function(){r&&(_.reset(A),_.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:F,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(S,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 b(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(fe,{form:_,name:"field",label:p,options:y,valueKey:w,labelKey:z,required:T,autofocus:!0,sx:{marginTop: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}},B),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)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):D))))},ke=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,x=t.confirmText,g=void 0===x?"ΕΠΙΒΕΒΑΙΩΣΗ":x,b=t.cancelText,h=void 0===b?"ΑΚΥΡΩΣΗ":b,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(U,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(_,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(Y,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},disableRestoreFocus:!0,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(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.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"}},h),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)))},Ie=function(t){var r=t.open,n=t.title,p=t.label,x=t.message,g=void 0===x?null:x,b=t.value,h=t.onSubmit,E=t.onCancel,y=t.size,W=void 0===y?"sm":y,w=t.rows,C=void 0===w?5:w,z=t.required,q=void 0!==z&&z,T=t.requiredMessage,L=void 0===T?"Υποχρεωτικό πεδίο":T,F=t.okLabel,P=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,V=t.cancelLabel,j=void 0===V?"ΑΚΥΡΩΣΗ":V,D=t.isLoading,O=void 0!==D&&D,B={notes:b||""},K=I.object({notes:q?I.string().required(L):I.string()}),M=R({defaultValues:B,resolver:k(K)});e.useEffect((function(){r&&(M.reset(B),M.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:W,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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),g&&"string"==typeof g?e.createElement(c,{variant:"caption",color:"text.secondary"},g):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return h(e.notes)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},g&&"string"!=typeof g&&e.createElement(s,{sx:{mb:2}},g),e.createElement(pe,{form:M,name:"notes",label:p,required:q,rows:C,autofocus:!0,sx:{marginTop:1}})),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}},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)"}}},O?e.createElement(v,{size:20,sx:{color:"inherit"}}):P))))},Fe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.minValue,C=void 0===w?null:w,z=t.maxValue,q=void 0===z?null:z,T=t.requiredMessage,L=void 0===T?"Υποχρεωτικό πεδίο":T,F=t.okLabel,P=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,V=t.cancelLabel,j=void 0===V?"ΑΚΥΡΩΣΗ":V,D=t.message,O=void 0===D?null:D,B=t.isLoading,K=void 0!==B&&B,M={poso:se(x)?x:null},N=I.object({poso:I.number().when([],{is:function(e){return W},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==C},then:function(e){return e.min(C,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ce(C)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==q},then:function(e){return e.max(q,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ce(q)))},otherwise:function(e){return e}})}),H=R({defaultValues:M,resolver:k(N)});e.useEffect((function(){r&&(H.reset(M),H.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),O&&"string"==typeof O?e.createElement(c,{variant:"caption",color:"text.secondary"},O):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return g(e.poso)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(ge,{form:H,name:"poso",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},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)"}}},K?e.createElement(v,{size:20,sx:{color:"inherit"}}):P))))},Pe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),B=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(B.reset(D),B.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(he,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},Ve=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),B=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(B.reset(D),B.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(ye,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},je=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.allowNegative,E=void 0!==h&&h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.size,q=void 0===z?"sm":z,T=t.minValue,L=void 0===T?null:T,F=t.maxValue,P=void 0===F?null:F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={num:se(x)?x:null},A=I.object({num:I.number().when([],{is:function(e){return W},then:function(e){return e.required(C)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(L))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==P},then:function(e){return e.max(P,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(P))},otherwise:function(e){return e}})}),U=R({defaultValues:H,resolver:k(A)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:q,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return g(e.num)})),noValidate:!0},e.createElement(u,null,e.createElement(We,{form:U,name:"num",label:p,required:W,autofocus:!0,allowNegative:E,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},De=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.decimals,b=void 0===g?2:g,h=t.minValue,E=void 0===h?null:h,y=t.maxValue,W=void 0===y?null:y,w=t.onSubmit,C=t.onCancel,z=t.size,q=void 0===z?"sm":z,T=t.required,L=void 0===T||T,F=t.requiredMessage,P=void 0===F?"Υποχρεωτικό πεδίο":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={field:se(x)?x:null},A=I.object({field:I.number().when([],{is:function(e){return L},then:function(e){return e.required(P)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==E},then:function(e){return e.min(E,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(de(E,b)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==W},then:function(e){return e.max(W,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(de(W,b)))},otherwise:function(e){return e}})}),U=R({defaultValues:H,resolver:k(A)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:q,open:r,onClose:function(e,t){"escapeKeyDown"===t&&C()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return w(e.field)})),noValidate:!0},e.createElement(u,null,e.createElement(ge,{form:U,name:"field",label:p,decimals:b,required:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},Oe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ώρας")}),B=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(B.reset(D),B.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(Ce,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},Be=function(t){var r=t.open,n=t.title,p=t.registrationNumber,x=t.registrationDate,g=t.registrationNumberLabel,b=void 0===g?"Αριθμός Πρωτοκόλλου":g,h=t.registrationDateLabel,E=void 0===h?"Ημερομηνία Πρωτοκόλλου":h,y=t.onSubmit,W=t.onCancel,w=t.size,C=void 0===w?"sm":w,z=t.required,q=void 0!==z&&z,T=t.registrationNumberRequiredMessage,L=void 0===T?"Συμπληρώστε τον αριθμό πρωτοκόλλου":T,F=t.registrationDateRequiredMessage,P=void 0===F?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.registrationNumberMaxLength,K=void 0===B?255:B,M=t.message,N=void 0===M?null:M,H=t.isLoading,A=void 0!==H&&H,U=e.useMemo((function(){return{registration_number:p||"",registration_date:x||null}}),[p,x]),_=I.object({registration_number:q?I.string().max(K,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(K," χαρακτήρες")).required(L):I.string().max(K,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(K," χαρακτήρες")),registration_date:q?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(P):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=R({defaultValues:U,resolver:k(_)});e.useEffect((function(){r&&(Y.reset(U),Y.clearErrors())}),[r,U]);return e.createElement(o,{fullWidth:!0,maxWidth:C,open:r,onClose:function(e,t){"escapeKeyDown"===t&&W()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),N&&"string"==typeof N?e.createElement(c,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return y(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(s,{sx:{mb:2}},N),e.createElement(a,{direction:"column",spacing:2.5},e.createElement(re,{form:Y,name:"registration_number",label:b,required:q,autofocus:!0,maxLength:K,sx:{mt:1}}),e.createElement(ye,{form:Y,name:"registration_date",label:E,required:q,sx:{mt:1}}))),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),W()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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)"}}},A?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))},Ke=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(ze,{open:V,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Me=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(Te,{open:V,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Ne=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,b=t.required,h=void 0===b||b,E=t.placeholder,S=void 0===E?"":E,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,T=void 0===q?null:q,L=t.message,R=void 0===L?null:L,k=t.hasDivider,I=void 0===k||k,V=ee(e.useState(!1),2),D=V[0],O=V[1],B=!i&&h,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},h&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?F(P(r,{locale:j}),"dd/MM/yyyy, HH:mm"):"":S)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(Pe,{open:D,title:z,label:o,value:i,required:h,onSubmit:function(e){N(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:M}))},He=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.message,L=void 0===T?null:T,R=t.hasDivider,k=void 0===R||R,I=ee(e.useState(!1),2),F=I[0],P=I[1],V=!o&&b,j=ee(e.useState(!1),2),D=j[0],O=j[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o?ue(o):E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),P(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),k&&e.createElement(d,{component:"li"}),e.createElement(Ve,{open:F,title:C,label:r,value:o,required:b,onSubmit:function(e){O(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){O(!1),P(!1)}})},onCancel:function(){return P(!1)},message:L,isLoading:D}))},Ae=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500,sx:{whiteSpace:"pre-line"}},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(Ie,{open:V,title:C,label:r,value:o,required:b,rows:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Ue=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,b=void 0===p?"label":p,h=t.fieldName,E=void 0===h?null:h,S=t.editable,C=void 0!==S&&S,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,R=t.modalTitle,k=void 0===R?"Επεξεργασία":R,I=t.updateUrl,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=null==o&&q,N=ee(e.useState(!1),2),H=N[0],A=N[1],U=u.find((function(e){return e[v]===o})),_=U?U[b]:"";return e.createElement(e.Fragment,null,e.createElement(x,{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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},_||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Le,{open:B,title:k,label:r,value:o,options:u,valueKey:v,labelKey:b,required:q,onSubmit:function(e){A(!0),y.put(F,{field:E,value:e.field},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},_e=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,b=void 0===p?"Απενεργοποίηση":p,h=t.activationMessage,E=void 0===h?"":h,S=t.deactivationMessage,W=void 0===S?"":S,w=t.updateUrl,q=void 0===w?null:w,T=t.hasDivider,L=void 0===T||T,R=ee(e.useState(!1),2),k=R[0],I=R[1],F=ee(e.useState(!1),2),P=F[0],V=F[1];return e.createElement(e.Fragment,null,e.createElement(x,{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(C,{fontSize:"small"}):e.createElement(z,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),I(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?b:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(ke,{open:k,title:n?b:v,message:n?W:E,onConfirm:function(){V(!0),y.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){V(!1),I(!1)}})},onCancel:function(){return I(!1)},isLoading:P}))},Ye=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,b=void 0===p?"label":p,h=t.fieldName,E=void 0===h?null:h,S=t.editable,C=void 0!==S&&S,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,R=t.modalTitle,k=void 0===R?"Επεξεργασία":R,I=t.updateUrl,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=q&&(!Array.isArray(o)||!o.length),N=ee(e.useState(!1),2),H=N[0],A=N[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[b]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(x,{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||Array.isArray(o)&&o.length?l||e.createElement(c,{variant:"body1",fontWeight:500},U||L):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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}}))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},Array.isArray(o)&&o.length?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Re,{open:B,title:k,label:r,value:o,options:u,valueKey:v,labelKey:b,required:q,onSubmit:function(e){A(!0),y.put(F,{field:E,value:e.field.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},$e=function(t){var r=t.label,o=t.exists,i=void 0!==o&&o,l=t.fileName,s=void 0===l?null:l,u=t.placeholder,m=void 0===u?"File":u,v=t.render,p=void 0===v?null:v,h=t.editable,E=void 0!==h&&h,S=t.required,w=void 0===S||S,C=t.downloadUrl,z=void 0===C?null:C,L=t.createUrl,R=void 0===L?null:L,k=t.updateUrl,I=void 0===k?null:k,F=t.deleteUrl,P=void 0===F?null:F,V=t.hasDivider,j=void 0===V||V,D=!i&&w,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=ee(e.useState(!1),2),N=M[0],H=M[1],A=e.useRef(null);return e.createElement(e.Fragment,null,e.createElement(x,{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}},w&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):p||e.createElement(b,{href:z,download:s,underline:"hover"},e.createElement(c,{variant:"body1",fontWeight:500},s||m))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},E&&e.createElement(a,{direction:"row",spacing:1},i&&P&&e.createElement(f,{size:"small",variant:"outlined",color:"error",onClick:function(e){e.currentTarget.blur(),H(!0)},disabled:B,sx:{minWidth:"auto",px:1.5,borderRadius:2}},e.createElement(q,{fontSize:"small"})),e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(T,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),A.current.click()},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Αντικατάσταση":"Επιλογή"))))),j&&e.createElement(d,{component:"li"}),e.createElement("input",{type:"file",ref:A,onChange:function(e){var t=e.target.files[0];t&&(K(!0),y.post(i?I:R,{file:t},{forceFormData:!0,preserveScroll:!0,onFinish:function(){K(!1),e.target.value=""}}))},style:{display:"none"}}),e.createElement(ke,{open:N,title:"Επιβεβαίωση Διαγραφής",message:"Να διαγραφεί το επιλεγμένο αρχείο;",onConfirm:function(){K(!0),y.delete(P,{preserveScroll:!0,onFinish:function(){K(!1),H(!1)}})},onCancel:function(){return H(!1)}}))},Ge=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.minValue,L=void 0===T?null:T,R=t.maxValue,k=void 0===R?null:R,I=t.message,F=void 0===I?null:I,P=t.hasDivider,V=void 0===P||P,j=ee(e.useState(!1),2),D=j[0],O=j[1],B=null==o||""===o,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&B?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},B?E:ce(o))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},B?"Συμπλήρωση":"Επεξεργασία")))),V&&e.createElement(d,{component:"li"}),e.createElement(Fe,{open:D,title:C,label:r,value:o,required:b,minValue:L,maxValue:k,onSubmit:function(e){N(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:M}))},Ze=function(t){var r=t.title,n=t.children,o=t.sx,i=void 0===o?{}:o,l=t.titleBgColor,a=void 0===l?"rgba(25, 118, 210, 0.08)":l,d=t.titleColor,u=void 0===d?"primary.main":d,m=t.titleFontWeight,f=void 0===m?"bold":m;return e.createElement(h,{variant:"outlined",sx:Q({mb:3,overflow:"hidden"},i)},r&&e.createElement(s,{sx:{px:2,py:1.5,bgcolor:a}},e.createElement(c,{variant:"subtitle2",color:u,fontWeight:f},r)),e.createElement(E,{disablePadding:!0},n))},Je=function(t){var r=t.label,o=void 0===r?"Πρωτόκολλο":r,i=t.registrationNumber,l=t.registrationDate,s=t.registrationNumberLabel,u=void 0===s?"Αριθμός Πρωτοκόλλου":s,m=t.registrationDateLabel,v=void 0===m?"Ημερομηνία Πρωτοκόλλου":m,p=t.render,b=void 0===p?null:p,h=t.editable,E=void 0!==h&&h,S=t.required,C=void 0===S||S,z=t.placeholder,q=void 0===z?"----------":z,T=t.modalTitle,L=void 0===T?"Επεξεργασία Πρωτοκόλλου":T,R=t.updateUrl,k=void 0===R?null:R,I=t.registrationNumberMaxLength,F=void 0===I?255:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=(!i||!l)&&C,N=ee(e.useState(!1),2),H=N[0],A=N[1],U=i&&l?"".concat(i,"/").concat(ue(l,"-")):q;return e.createElement(e.Fragment,null,e.createElement(x,{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}},!C||i&&l?b||e.createElement(c,{variant:"body1",fontWeight:500},U):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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}}))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},E&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i||l?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Be,{open:B,title:L,registrationNumberLabel:u,registrationDateLabel:v,registrationNumber:i,registrationDate:l,required:C,registrationNumberMaxLength:F,registrationNumberRequiredMessage:"Συμπληρώστε τον αριθμό πρωτοκόλλου",registrationDateRequiredMessage:"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου",onSubmit:function(e){A(!0),y.put(k,e,{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},Qe=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,b=t.required,h=void 0===b||b,E=t.placeholder,S=void 0===E?"":E,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,T=void 0===q?null:q,L=t.message,R=void 0===L?null:L,k=t.hasDivider,I=void 0===k||k,V=ee(e.useState(!1),2),D=V[0],O=V[1],B=!i&&h,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},h&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?F(P(r,{locale:j}),"HH:mm"):"":S)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(Oe,{open:D,title:z,label:o,value:i,required:h,onSubmit:function(e){N(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:M}))},Xe=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.minValue,L=void 0===T?null:T,R=t.maxValue,k=void 0===R?null:R,I=t.message,F=void 0===I?null:I,P=t.hasDivider,V=void 0===P||P,j=ee(e.useState(!1),2),D=j[0],O=j[1],B=(null==o||""===o)&&b,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&B?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},B?E:o)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},B?"Συμπλήρωση":"Επεξεργασία")))),V&&e.createElement(d,{component:"li"}),e.createElement(je,{open:D,title:C,label:r,value:o,required:b,minValue:L,maxValue:k,onSubmit:function(e){N(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:M}))},et=function(t){var r=t.label,o=t.value,i=t.decimals,l=void 0===i?2:i,s=t.render,u=void 0===s?null:s,m=t.fieldName,v=void 0===m?null:m,p=t.editable,b=void 0!==p&&p,h=t.required,E=void 0===h||h,S=t.placeholder,C=void 0===S?"":S,z=t.modalTitle,q=void 0===z?"Επεξεργασία":z,T=t.updateUrl,L=void 0===T?null:T,R=t.minValue,k=void 0===R?null:R,I=t.maxValue,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=(null==o||""===o)&&E,N=ee(e.useState(!1),2),H=N[0],A=N[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},E&&M?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):u||e.createElement(c,{variant:"body1",fontWeight:500},M?C:de(o,l))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},b&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},M?"Συμπλήρωση":"Επεξεργασία")))),D&&e.createElement(d,{component:"li"}),e.createElement(De,{open:B,title:q,label:r,value:o,decimals:l,required:E,minValue:k,maxValue:F,onSubmit:function(e){A(!0),y.put(L,{field:v,value:e},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))};export{Ye as AutocompleteMultiProperty,Ue as AutocompleteProperty,Ge as CurrencyProperty,He as DateProperty,Ne as DateTimeProperty,et as DecimalProperty,Me as EmailProperty,$e as FileProperty,Xe as IntegerProperty,Ze as PropertyGroup,Je as RegistrationProperty,Ke as StringProperty,Ae as TextProperty,Qe as TimeProperty,_e 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 x,Grid2 as g,Link as b,Paper as h,List as E}from"@mui/material";import{router as y}from"@inertiajs/react";import{EditNoteRounded as S,ErrorOutline as W,Edit as w,ToggleOff as C,ToggleOn as z,DeleteOutline as q,Upload as T}from"@mui/icons-material";import{Controller as L,useForm as R}from"react-hook-form";import{yupResolver as k}from"@hookform/resolvers/yup";import*as I from"yup";import"react-color";import{format as F,parseISO as P,toDate as V}from"date-fns";import{el as j}from"date-fns/locale";import"axios";import{NumericFormat as D}from"react-number-format";import{AdapterDateFns as O}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as B}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as K,renderDigitalClockTimeView as M,DatePicker as N,TimePicker as H}from"@mui/x-date-pickers";import A from"date-fns/locale/el";import U from"@mui/icons-material/WarningAmberRounded";import _ from"@mui/icons-material/ErrorOutlineRounded";import Y from"@mui/icons-material/CheckCircleOutlineRounded";function $(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 G(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 Z(){return Z=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},Z.apply(null,arguments)}function J(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 Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach(function(t){G(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function X(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 ee(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 $(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)?$(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 te=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],re=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,x=r.readonly,g=void 0!==x&&x,b=r.readonlyBackgroundColor,h=void 0===b?"#dddddd":b,E=r.bold,y=void 0!==E&&E,S=X(r,te),W=n.control,w=n.formState.errors;return e.createElement(L,{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,Z({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?h:""}}}},S))}})},ne=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],oe=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,x=r.showErrors,g=void 0===x||x,b=r.readonly,h=void 0!==b&&b,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,w=X(r,ne),C=n.control,z=n.formState.errors;return e.createElement(L,{name:i,control:C,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,Z({required:u,label:a,value:m,onChange:s,onBlur:d,error:g&&Boolean(null===(n=z[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:g&&(null===(o=z[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},w))}})},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","onChange","readonly","readonlyBackgroundColor","bold"],le=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,x=void 0===p?"label":p,g=n.maxLength,b=void 0===g?255:g,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,w=void 0===W||W,C=n.size,z=void 0===C?"medium":C,q=n.onChange,T=void 0===q?null:q,R=n.readonly,k=void 0!==R&&R,I=n.readonlyBackgroundColor,F=void 0===I?"#dddddd":I,P=n.bold,V=void 0!==P&&P,j=X(n,ie),D=ee(e.useState(null),2),O=D[0],B=D[1],K=o.watch(i);e.useEffect(function(){B(m.find(function(e){return e[v]===K})||null)},[K]);var M=o.control,N=o.formState.errors;return e.createElement(L,{name:i,control:M,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,k?e.createElement(t,Z({size:z,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:b,readOnly:k,sx:{fontWeight:V?"bold":"",backgroundColor:k?F:""}}},value:O?O.label:""},j)):e.createElement(r,{value:O,required:s,onChange:function(e,t){var r=t?t[v]:null;a(r),T&&T(r)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[x]},size:z,slotProps:{input:{maxLength:b,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,Z({label:l,required:s,disabled:d,autoFocus:E,size:z,error:w&&Boolean(null===(n=N[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=N[i])||void 0===o?void 0:o.message)},r,j))}})}})},ae=function(e){return null==e||""===e},se=function(e){return null!=e&&""!==e},ce=function(e){return ae(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},de=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!ae(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return e?F(P(e,{locale:j}),"dd".concat(t,"MM").concat(t,"yyyy")):""},me=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],fe=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,x=o.labelKey,g=void 0===x?"label":x,b=o.maxLength,h=void 0===b?255:b,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,w=o.showErrors,C=void 0===w||w,z=X(o,me),q=ee(e.useState([]),2),T=q[0],R=q[1],k=i.watch(l);e.useEffect(function(){R(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,k)}))},[k]);var I=i.control,F=i.formState.errors;return e.createElement(L,{name:l,control:I,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:T,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,Z({variant:"outlined",label:t[g],size:"small"},r({index:o})))})},renderInput:function(r){var n,o;return e.createElement(t,Z({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:C&&Boolean(null===(n=F[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=F[l])||void 0===o?void 0:o.message)},r,z))}})}})},ve=["form","name","label","rows","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],pe=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,x=r.readonly,g=void 0!==x&&x,b=r.readonlyBackgroundColor,h=void 0===b?"#dddddd":b,E=r.bold,y=void 0!==E&&E,S=X(r,ve),W=n.control,w=n.formState.errors;return e.createElement(L,{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,Z({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,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:{readOnly:g,sx:{fontWeight:y?"bold":"",backgroundColor:g?h:""}}}},S))}})},xe=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ge=function(r){var n=r.form,o=r.name,i=r.label,l=r.decimals,a=void 0===l?2:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d;r.autofocus;var m=r.showErrors,f=void 0===m||m,v=r.readonly,p=void 0!==v&&v,x=r.readonlyBackgroundColor,g=void 0===x?"#dddddd":x,b=r.bold,h=void 0!==b&&b,E=X(r,xe),y=n.control,S=n.formState.errors,W=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(L,{name:o,control:y,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field;s.onChange,s.onBlur;var d=s.value;return e.createElement(D,Z({customInput:t,variant:"outlined",label:i,required:c,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:a,fixedDecimalScale:!0,allowNegative:!1,onValueChange:W,error:f&&Boolean(null===(n=S[o])||void 0===n?void 0:n.message),helperText:f&&(null===(l=S[o])||void 0===l?void 0:l.message),fullWidth:!0,slotProps:{input:{readOnly:p,sx:{fontWeight:h?"bold":"",backgroundColor:p?g:""}}}},E))}})},be=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],he=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,x=void 0===p?1:p,g=t.minutesStep,b=void 0===g?15:g,h=t.secondsStep,E=void 0===h?30:h,y=X(t,be),S=r.control,W=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(L,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(K,{label:o,value:a.value?V(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:M}:null,timeSteps:{hours:x,minutes:b,seconds:E},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:Q(Q({},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})}})}}))},Ee=["form","name","label","required","disabled","autofocus","showErrors"],ye=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=X(t,Ee),m=r.control,f=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(L,{name:n,control:m,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(N,{label:o,value:a.value?V(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:Q(Q({},u),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Se=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],We=function(r){var n=r.form,o=r.name,i=r.label,l=r.allowNegative,a=void 0!==l&&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,x=X(r,Se),g=n.control,b=n.formState.errors,h=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(L,{name:o,control:g,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field;s.onChange,s.onBlur;var d=s.value;return e.createElement(D,Z({customInput:t,variant:"outlined",label:i,required:c,disabled:u,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:a,onValueChange:h,error:p&&Boolean(null===(n=b[o])||void 0===n?void 0:n.message),helperText:p&&(null===(l=b[o])||void 0===l?void 0:l.message),fullWidth:!0,autoFocus:f},x))}})},we=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],Ce=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,l=void 0!==i&&i,a=t.hoursStep,s=void 0===a?1:a,c=t.minutesStep,d=void 0===c?15:c,u=t.secondsStep,m=void 0===u?30:u,f=t.singleTimeColumn,v=void 0===f||f,p=t.required,x=void 0!==p&&p,g=t.disabled,b=void 0!==g&&g;t.autofocus;var h=t.showErrors,E=void 0===h||h,y=X(t,we),S=r.control,W=r.formState.errors;return e.createElement(B,{dateAdapter:O,adapterLocale:A,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(L,{name:n,control:S,rules:{required:x,disabled:b},render:function(t){var r,i,a=t.field;return e.createElement(H,{label:o,value:a.value?V(a.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:l,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:M}:null,timeSteps:{hours:s,minutes:d,seconds:m},slotProps:{textField:Q(Q({},y),{},{required:x,error:E&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:E&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ze=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.maxLength,P=void 0===F?255:F,V=t.message,j=void 0===V?null:V,D=t.isLoading,O=void 0!==D&&D,B={text:x||""},K=I.object({text:W?I.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(C):I.string().max(P)}),M=R({defaultValues:B,resolver:k(K)});e.useEffect(function(){r&&(M.reset(B),M.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),j&&"string"==typeof j?e.createElement(c,{variant:"caption",color:"text.secondary"},j):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}},j&&"string"!=typeof j&&e.createElement(s,{sx:{mb:2}},j),e.createElement(re,{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(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},O?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},qe=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,Te=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.invalidMessage,q=void 0===z?"Μη έγκυρη μορφή email":z,T=t.okLabel,L=void 0===T?"ΚΑΤΑΧΩΡΗΣΗ":T,F=t.cancelLabel,P=void 0===F?"ΑΚΥΡΩΣΗ":F,V=t.maxLength,j=void 0===V?255:V,D=t.message,O=void 0===D?null:D,B=t.isLoading,K=void 0!==B&&B,M={email:x||""},N=I.object({email:W?I.string().matches(qe,q).required(C):I.string().matches(qe,q)}),H=R({defaultValues:M,resolver:k(N)});e.useEffect(function(){r&&(H.reset(M),H.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),O&&"string"==typeof O?e.createElement(c,{variant:"caption",color:"text.secondary"},O):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit(function(e){return g(e.email)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},O&&"string"!=typeof O&&e.createElement(s,{sx:{mb:2}},O),e.createElement(oe,{form:H,label:p,required:W,autofocus:!0,maxLength:j,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},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)"}}},K?e.createElement(v,{size:20,sx:{color:"inherit"}}):L))))};!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 Le=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.options,E=void 0===h?[]:h,y=t.valueKey,W=void 0===y?"id":y,w=t.labelKey,C=void 0===w?"label":w,z=t.required,q=void 0===z||z,T=t.size,L=void 0===T?"sm":T,F=t.requiredMessage,P=void 0===F?"Υποχρεωτικό πεδίο":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={field:x||null},A=I.object({field:q?I.string().required(P):I.string().nullable()}),U=R({defaultValues:H,resolver:k(A)});e.useEffect(function(){r&&(U.reset(H),U.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:L,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit(function(e){return g(e)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(s,{sx:{mb:2}},K),e.createElement(le,{form:U,name:"field",label:p,options:E,valueKey:W,labelKey:C,required:q,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},Re=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=void 0===x?[]:x,b=t.onSubmit,h=t.onCancel,E=t.options,y=void 0===E?[]:E,W=t.valueKey,w=void 0===W?"id":W,C=t.labelKey,z=void 0===C?"label":C,q=t.required,T=void 0===q||q,L=t.size,F=void 0===L?"sm":L,P=t.requiredMessage,V=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,j=t.okLabel,D=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,O=t.cancelLabel,B=void 0===O?"ΑΚΥΡΩΣΗ":O,K=t.message,M=void 0===K?null:K,N=t.isLoading,H=void 0!==N&&N,A={field:g||[]},U=I.object({field:T?I.array().min(1,V):I.array()}),_=R({defaultValues:A,resolver:k(U)});e.useEffect(function(){r&&(_.reset(A),_.clearErrors())},[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:F,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(S,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 b(e)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(fe,{form:_,name:"field",label:p,options:y,valueKey:w,labelKey:z,required:T,autofocus:!0,sx:{marginTop: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}},B),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)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):D))))},ke=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,x=t.confirmText,g=void 0===x?"ΕΠΙΒΕΒΑΙΩΣΗ":x,b=t.cancelText,h=void 0===b?"ΑΚΥΡΩΣΗ":b,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(U,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(_,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(Y,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},disableRestoreFocus:!0,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(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.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"}},h),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)))},Ie=function(t){var r=t.open,n=t.title,p=t.label,x=t.message,g=void 0===x?null:x,b=t.value,h=t.onSubmit,E=t.onCancel,y=t.size,W=void 0===y?"sm":y,w=t.rows,C=void 0===w?5:w,z=t.required,q=void 0!==z&&z,T=t.requiredMessage,L=void 0===T?"Υποχρεωτικό πεδίο":T,F=t.okLabel,P=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,V=t.cancelLabel,j=void 0===V?"ΑΚΥΡΩΣΗ":V,D=t.isLoading,O=void 0!==D&&D,B={notes:b||""},K=I.object({notes:q?I.string().required(L):I.string()}),M=R({defaultValues:B,resolver:k(K)});e.useEffect(function(){r&&(M.reset(B),M.clearErrors())},[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:W,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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),g&&"string"==typeof g?e.createElement(c,{variant:"caption",color:"text.secondary"},g):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit(function(e){return h(e.notes)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},g&&"string"!=typeof g&&e.createElement(s,{sx:{mb:2}},g),e.createElement(pe,{form:M,name:"notes",label:p,required:q,rows:C,autofocus:!0,sx:{marginTop:1}})),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}},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)"}}},O?e.createElement(v,{size:20,sx:{color:"inherit"}}):P))))},Fe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.minValue,C=void 0===w?null:w,z=t.maxValue,q=void 0===z?null:z,T=t.requiredMessage,L=void 0===T?"Υποχρεωτικό πεδίο":T,F=t.okLabel,P=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,V=t.cancelLabel,j=void 0===V?"ΑΚΥΡΩΣΗ":V,D=t.message,O=void 0===D?null:D,B=t.isLoading,K=void 0!==B&&B,M={poso:se(x)?x:null},N=I.object({poso:I.number().when([],{is:function(e){return W},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==C},then:function(e){return e.min(C,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ce(C)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==q},then:function(e){return e.max(q,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ce(q)))},otherwise:function(e){return e}})}),H=R({defaultValues:M,resolver:k(N)});e.useEffect(function(){r&&(H.reset(M),H.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),O&&"string"==typeof O?e.createElement(c,{variant:"caption",color:"text.secondary"},O):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit(function(e){return g(e.poso)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(ge,{form:H,name:"poso",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},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)"}}},K?e.createElement(v,{size:20,sx:{color:"inherit"}}):P))))},Pe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),B=R({defaultValues:D,resolver:k(O)});e.useEffect(function(){r&&(B.reset(D),B.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit(function(e){return g(e.datetime)}),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(he,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},Ve=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),B=R({defaultValues:D,resolver:k(O)});e.useEffect(function(){r&&(B.reset(D),B.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit(function(e){return g(e.datetime)}),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(ye,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},je=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.allowNegative,E=void 0!==h&&h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.size,q=void 0===z?"sm":z,T=t.minValue,L=void 0===T?null:T,F=t.maxValue,P=void 0===F?null:F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={num:se(x)?x:null},A=I.object({num:I.number().when([],{is:function(e){return W},then:function(e){return e.required(C)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(L))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==P},then:function(e){return e.max(P,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(P))},otherwise:function(e){return e}})}),U=R({defaultValues:H,resolver:k(A)});e.useEffect(function(){r&&(U.reset(H),U.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:q,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit(function(e){return g(e.num)}),noValidate:!0},e.createElement(u,null,e.createElement(We,{form:U,name:"num",label:p,required:W,autofocus:!0,allowNegative:E,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},De=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.decimals,b=void 0===g?2:g,h=t.minValue,E=void 0===h?null:h,y=t.maxValue,W=void 0===y?null:y,w=t.onSubmit,C=t.onCancel,z=t.size,q=void 0===z?"sm":z,T=t.required,L=void 0===T||T,F=t.requiredMessage,P=void 0===F?"Υποχρεωτικό πεδίο":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.message,K=void 0===B?null:B,M=t.isLoading,N=void 0!==M&&M,H={field:se(x)?x:null},A=I.object({field:I.number().when([],{is:function(e){return L},then:function(e){return e.required(P)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==E},then:function(e){return e.min(E,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(de(E,b)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==W},then:function(e){return e.max(W,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(de(W,b)))},otherwise:function(e){return e}})}),U=R({defaultValues:H,resolver:k(A)});e.useEffect(function(){r&&(U.reset(H),U.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:q,open:r,onClose:function(e,t){"escapeKeyDown"===t&&C()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),K&&"string"==typeof K?e.createElement(c,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit(function(e){return w(e.field)}),noValidate:!0},e.createElement(u,null,e.createElement(ge,{form:U,name:"field",label:p,decimals:b,required:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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"}}):j))))},Oe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,g=t.onSubmit,b=t.onCancel,h=t.size,E=void 0===h?"sm":h,y=t.required,W=void 0===y||y,w=t.requiredMessage,C=void 0===w?"Υποχρεωτικό πεδίο":w,z=t.okLabel,q=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,T=t.cancelLabel,L=void 0===T?"ΑΚΥΡΩΣΗ":T,F=t.message,P=void 0===F?null:F,V=t.isLoading,j=void 0!==V&&V,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ώρας")}),B=R({defaultValues:D,resolver:k(O)});e.useEffect(function(){r&&(B.reset(D),B.clearErrors())},[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:E,open:r,onClose:function(e,t){"escapeKeyDown"===t&&b()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),P&&"string"==typeof P?e.createElement(c,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:B.handleSubmit(function(e){return g(e.datetime)}),noValidate:!0},e.createElement(u,null,P&&"string"!=typeof P&&e.createElement(s,{sx:{mb:2}},P),e.createElement(Ce,{form:B,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),b()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},L),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)"}}},j?e.createElement(v,{size:20,sx:{color:"inherit"}}):q))))},Be=function(t){var r=t.open,n=t.title,p=t.registrationNumber,x=t.registrationDate,g=t.registrationNumberLabel,b=void 0===g?"Αριθμός Πρωτοκόλλου":g,h=t.registrationDateLabel,E=void 0===h?"Ημερομηνία Πρωτοκόλλου":h,y=t.onSubmit,W=t.onCancel,w=t.size,C=void 0===w?"sm":w,z=t.required,q=void 0!==z&&z,T=t.registrationNumberRequiredMessage,L=void 0===T?"Συμπληρώστε τον αριθμό πρωτοκόλλου":T,F=t.registrationDateRequiredMessage,P=void 0===F?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":F,V=t.okLabel,j=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,B=t.registrationNumberMaxLength,K=void 0===B?255:B,M=t.message,N=void 0===M?null:M,H=t.isLoading,A=void 0!==H&&H,U=e.useMemo(function(){return{registration_number:p||"",registration_date:x||null}},[p,x]),_=I.object({registration_number:q?I.string().max(K,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(K," χαρακτήρες")).required(L):I.string().max(K,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(K," χαρακτήρες")),registration_date:q?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(P):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=R({defaultValues:U,resolver:k(_)});e.useEffect(function(){r&&(Y.reset(U),Y.clearErrors())},[r,U]);return e.createElement(o,{fullWidth:!0,maxWidth:C,open:r,onClose:function(e,t){"escapeKeyDown"===t&&W()},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(S,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),N&&"string"==typeof N?e.createElement(c,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit(function(e){return y(e)}),noValidate:!0},e.createElement(u,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(s,{sx:{mb:2}},N),e.createElement(a,{direction:"column",spacing:2.5},e.createElement(re,{form:Y,name:"registration_number",label:b,required:q,autofocus:!0,maxLength:K,sx:{mt:1}}),e.createElement(ye,{form:Y,name:"registration_date",label:E,required:q,sx:{mt:1}}))),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),W()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),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)"}}},A?e.createElement(v,{size:20,sx:{color:"inherit"}}):j))))},Ke=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(ze,{open:V,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Me=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(Te,{open:V,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Ne=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,b=t.required,h=void 0===b||b,E=t.placeholder,S=void 0===E?"":E,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,T=void 0===q?null:q,L=t.message,R=void 0===L?null:L,k=t.hasDivider,I=void 0===k||k,V=ee(e.useState(!1),2),D=V[0],O=V[1],B=!i&&h,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},h&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?F(P(r,{locale:j}),"dd/MM/yyyy, HH:mm"):"":S)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(Pe,{open:D,title:z,label:o,value:i,required:h,onSubmit:function(e){N(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:M}))},He=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.message,L=void 0===T?null:T,R=t.hasDivider,k=void 0===R||R,I=ee(e.useState(!1),2),F=I[0],P=I[1],V=!o&&b,j=ee(e.useState(!1),2),D=j[0],O=j[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o?ue(o):E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),P(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),k&&e.createElement(d,{component:"li"}),e.createElement(Ve,{open:F,title:C,label:r,value:o,required:b,onSubmit:function(e){O(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){O(!1),P(!1)}})},onCancel:function(){return P(!1)},message:L,isLoading:D}))},Ae=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,R=t.message,k=void 0===R?null:R,I=t.hasDivider,F=void 0===I||I,P=ee(e.useState(!1),2),V=P[0],j=P[1],D=!o&&b,O=ee(e.useState(!1),2),B=O[0],K=O[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500,sx:{whiteSpace:"pre-line"}},o||E)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),j(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),F&&e.createElement(d,{component:"li"}),e.createElement(Ie,{open:V,title:C,label:r,value:o,required:b,rows:L,onSubmit:function(e){K(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){K(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:B}))},Ue=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,b=void 0===p?"label":p,h=t.fieldName,E=void 0===h?null:h,S=t.editable,C=void 0!==S&&S,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,R=t.modalTitle,k=void 0===R?"Επεξεργασία":R,I=t.updateUrl,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=null==o&&q,N=ee(e.useState(!1),2),H=N[0],A=N[1],U=u.find(function(e){return e[v]===o}),_=U?U[b]:"";return e.createElement(e.Fragment,null,e.createElement(x,{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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},_||L)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Le,{open:B,title:k,label:r,value:o,options:u,valueKey:v,labelKey:b,required:q,onSubmit:function(e){A(!0),y.put(F,{field:E,value:e.field},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},_e=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,b=void 0===p?"Απενεργοποίηση":p,h=t.activationMessage,E=void 0===h?"":h,S=t.deactivationMessage,W=void 0===S?"":S,w=t.updateUrl,q=void 0===w?null:w,T=t.hasDivider,L=void 0===T||T,R=ee(e.useState(!1),2),k=R[0],I=R[1],F=ee(e.useState(!1),2),P=F[0],V=F[1];return e.createElement(e.Fragment,null,e.createElement(x,{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(C,{fontSize:"small"}):e.createElement(z,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),I(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?b:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(ke,{open:k,title:n?b:v,message:n?W:E,onConfirm:function(){V(!0),y.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){V(!1),I(!1)}})},onCancel:function(){return I(!1)},isLoading:P}))},Ye=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,b=void 0===p?"label":p,h=t.fieldName,E=void 0===h?null:h,S=t.editable,C=void 0!==S&&S,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,R=t.modalTitle,k=void 0===R?"Επεξεργασία":R,I=t.updateUrl,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=q&&(!Array.isArray(o)||!o.length),N=ee(e.useState(!1),2),H=N[0],A=N[1],U=u.filter(function(e){return o.some(function(t){return t[v]===e[v]})}).map(function(e){return e[b]}).join(", ");return e.createElement(e.Fragment,null,e.createElement(x,{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||Array.isArray(o)&&o.length?l||e.createElement(c,{variant:"body1",fontWeight:500},U||L):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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}}))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},Array.isArray(o)&&o.length?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Re,{open:B,title:k,label:r,value:o,options:u,valueKey:v,labelKey:b,required:q,onSubmit:function(e){A(!0),y.put(F,{field:E,value:e.field.map(function(e){return e[v]})},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},$e=function(t){var r=t.label,o=t.exists,i=void 0!==o&&o,l=t.fileName,s=void 0===l?null:l,u=t.placeholder,m=void 0===u?"File":u,v=t.render,p=void 0===v?null:v,h=t.editable,E=void 0!==h&&h,S=t.required,w=void 0===S||S,C=t.downloadUrl,z=void 0===C?null:C,L=t.createUrl,R=void 0===L?null:L,k=t.updateUrl,I=void 0===k?null:k,F=t.deleteUrl,P=void 0===F?null:F,V=t.hasDivider,j=void 0===V||V,D=!i&&w,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=ee(e.useState(!1),2),N=M[0],H=M[1],A=e.useRef(null);return e.createElement(e.Fragment,null,e.createElement(x,{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}},w&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):p||e.createElement(b,{href:z,download:s,underline:"hover"},e.createElement(c,{variant:"body1",fontWeight:500},s||m))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},E&&e.createElement(a,{direction:"row",spacing:1},i&&P&&e.createElement(f,{size:"small",variant:"outlined",color:"error",onClick:function(e){e.currentTarget.blur(),H(!0)},disabled:B,sx:{minWidth:"auto",px:1.5,borderRadius:2}},e.createElement(q,{fontSize:"small"})),e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(T,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),A.current.click()},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Αντικατάσταση":"Επιλογή"))))),j&&e.createElement(d,{component:"li"}),e.createElement("input",{type:"file",ref:A,onChange:function(e){var t=e.target.files[0];t&&(K(!0),y.post(i?I:R,{file:t},{forceFormData:!0,preserveScroll:!0,onFinish:function(){K(!1),e.target.value=""}}))},style:{display:"none"}}),e.createElement(ke,{open:N,title:"Επιβεβαίωση Διαγραφής",message:"Να διαγραφεί το επιλεγμένο αρχείο;",onConfirm:function(){K(!0),y.delete(P,{preserveScroll:!0,onFinish:function(){K(!1),H(!1)}})},onCancel:function(){return H(!1)}}))},Ge=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.minValue,L=void 0===T?null:T,R=t.maxValue,k=void 0===R?null:R,I=t.message,F=void 0===I?null:I,P=t.hasDivider,V=void 0===P||P,j=ee(e.useState(!1),2),D=j[0],O=j[1],B=null==o||""===o,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&B?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},B?E:ce(o))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},B?"Συμπλήρωση":"Επεξεργασία")))),V&&e.createElement(d,{component:"li"}),e.createElement(Fe,{open:D,title:C,label:r,value:o,required:b,minValue:L,maxValue:k,onSubmit:function(e){N(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:M}))},Ze=function(t){var r=t.title,n=t.children,o=t.sx,i=void 0===o?{}:o,l=t.titleBgColor,a=void 0===l?"rgba(25, 118, 210, 0.08)":l,d=t.titleColor,u=void 0===d?"primary.main":d,m=t.titleFontWeight,f=void 0===m?"bold":m;return e.createElement(h,{variant:"outlined",sx:Q({mb:3,overflow:"hidden"},i)},r&&e.createElement(s,{sx:{px:2,py:1.5,bgcolor:a}},e.createElement(c,{variant:"subtitle2",color:u,fontWeight:f},r)),e.createElement(E,{disablePadding:!0},n))},Je=function(t){var r=t.label,o=void 0===r?"Πρωτόκολλο":r,i=t.registrationNumber,l=t.registrationDate,s=t.registrationNumberLabel,u=void 0===s?"Αριθμός Πρωτοκόλλου":s,m=t.registrationDateLabel,v=void 0===m?"Ημερομηνία Πρωτοκόλλου":m,p=t.render,b=void 0===p?null:p,h=t.editable,E=void 0!==h&&h,S=t.required,C=void 0===S||S,z=t.placeholder,q=void 0===z?"----------":z,T=t.modalTitle,L=void 0===T?"Επεξεργασία Πρωτοκόλλου":T,R=t.updateUrl,k=void 0===R?null:R,I=t.registrationNumberMaxLength,F=void 0===I?255:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=(!i||!l)&&C,N=ee(e.useState(!1),2),H=N[0],A=N[1],U=i&&l?"".concat(i,"/").concat(ue(l,"-")):q;return e.createElement(e.Fragment,null,e.createElement(x,{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}},!C||i&&l?b||e.createElement(c,{variant:"body1",fontWeight:500},U):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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}}))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},E&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i||l?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Be,{open:B,title:L,registrationNumberLabel:u,registrationDateLabel:v,registrationNumber:i,registrationDate:l,required:C,registrationNumberMaxLength:F,registrationNumberRequiredMessage:"Συμπληρώστε τον αριθμό πρωτοκόλλου",registrationDateRequiredMessage:"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου",onSubmit:function(e){A(!0),y.put(k,e,{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))},Qe=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,b=t.required,h=void 0===b||b,E=t.placeholder,S=void 0===E?"":E,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,T=void 0===q?null:q,L=t.message,R=void 0===L?null:L,k=t.hasDivider,I=void 0===k||k,V=ee(e.useState(!1),2),D=V[0],O=V[1],B=!i&&h,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},h&&!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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?F(P(r,{locale:j}),"HH:mm"):"":S)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(Oe,{open:D,title:z,label:o,value:i,required:h,onSubmit:function(e){N(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:M}))},Xe=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,b=void 0===p||p,h=t.placeholder,E=void 0===h?"":h,S=t.modalTitle,C=void 0===S?"Επεξεργασία":S,z=t.updateUrl,q=void 0===z?null:z,T=t.minValue,L=void 0===T?null:T,R=t.maxValue,k=void 0===R?null:R,I=t.message,F=void 0===I?null:I,P=t.hasDivider,V=void 0===P||P,j=ee(e.useState(!1),2),D=j[0],O=j[1],B=(null==o||""===o)&&b,K=ee(e.useState(!1),2),M=K[0],N=K[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},b&&B?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},B?E:o)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},B?"Συμπλήρωση":"Επεξεργασία")))),V&&e.createElement(d,{component:"li"}),e.createElement(je,{open:D,title:C,label:r,value:o,required:b,minValue:L,maxValue:k,onSubmit:function(e){N(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){N(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:M}))},et=function(t){var r=t.label,o=t.value,i=t.decimals,l=void 0===i?2:i,s=t.render,u=void 0===s?null:s,m=t.fieldName,v=void 0===m?null:m,p=t.editable,b=void 0!==p&&p,h=t.required,E=void 0===h||h,S=t.placeholder,C=void 0===S?"":S,z=t.modalTitle,q=void 0===z?"Επεξεργασία":z,T=t.updateUrl,L=void 0===T?null:T,R=t.minValue,k=void 0===R?null:R,I=t.maxValue,F=void 0===I?null:I,P=t.message,V=void 0===P?null:P,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),B=O[0],K=O[1],M=(null==o||""===o)&&E,N=ee(e.useState(!1),2),H=N[0],A=N[1];return e.createElement(e.Fragment,null,e.createElement(x,{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}},E&&M?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(W,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):u||e.createElement(c,{variant:"body1",fontWeight:500},M?C:de(o,l))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},b&&e.createElement(f,{size:"small",variant:M?"contained":"outlined",color:M?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},M?"Συμπλήρωση":"Επεξεργασία")))),D&&e.createElement(d,{component:"li"}),e.createElement(De,{open:B,title:q,label:r,value:o,decimals:l,required:E,minValue:k,maxValue:F,onSubmit:function(e){A(!0),y.put(L,{field:v,value:e},{preserveScroll:!0,onFinish:function(){A(!1),K(!1)}})},onCancel:function(){return K(!1)},message:V,isLoading:H}))};export{Ye as AutocompleteMultiProperty,Ue as AutocompleteProperty,Ge as CurrencyProperty,He as DateProperty,Ne as DateTimeProperty,et as DecimalProperty,Me as EmailProperty,$e as FileProperty,Xe as IntegerProperty,Ze as PropertyGroup,Je as RegistrationProperty,Ke as StringProperty,Ae as TextProperty,Qe as TimeProperty,_e as ToggleProperty};
package/tables/index.js CHANGED
@@ -1 +1 @@
1
- import{TextField as e,InputAdornment as t,IconButton as n,Typography as r,Tooltip as o,Button as l,Box as i,Select as a,MenuItem as c,Autocomplete as u,TableRow as s,TableCell as d,Collapse as f,TableFooter as m,TableContainer as p,Table as g,TableHead as v,TableBody as b,TablePagination as y}from"@mui/material";import h from"react";import{MdClear as C,MdOutlineAdd as E}from"react-icons/md";import"date-fns";import"date-fns/locale";import w from"nprogress";import"@inertiajs/react";import{TiArrowSortedDown as x,TiArrowSortedUp as S,TiArrowUnsorted as F}from"react-icons/ti";import k from"react-input-mask";import O from"axios";import{KeyboardArrowUp as P,KeyboardArrowDown as I}from"@mui/icons-material";function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;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:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t);else for(;!(c=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return a}}(e,t)||B(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.")}()}function D(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){if(e){if("string"==typeof e)return A(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}var N=function(r){var o=r.initialValue,l=r.onChange,i=r.placeholder,a=void 0===i?"":i,c=r.activeColor,u=void 0===c?"#D4F7F4":c,s=r.inactiveColor,d=void 0===s?"white":s,f=r.clearIcon,m=void 0===f||f,p=K(h.useState(o),2),g=p[0],v=p[1];h.useEffect((function(){v(o)}),[o]);return h.createElement(e,{sx:{backgroundColor:g?u:d},placeholder:a,value:g||"",fullWidth:!0,onChange:function(e){v(e.target.value),l(e.target.value)},size:"small",InputProps:{endAdornment:m&&h.createElement(t,{position:"end",disablePointerEvents:!g},h.createElement(n,{onClick:function(){return l("")}},g?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))}})},V=h.createContext(),L=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];n&&clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o)}),t)}},M=function(){var e=h.useContext(V),t=e.state,n=e.props,r=e.api,o=h.useCallback(L((function(e){r.handleGlobalFilterChange(e)}),300),[r]);return n.enableGlobalFilter?h.createElement(N,{initialValue:t.globalFilter,onChange:o,placeholder:n.globalFilterPlaceholder}):null};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("#nprogress {\r\n pointer-events: none;\r\n}\r\n\r\n#nprogress .bar {\r\n background: #29d;\r\n position: fixed;\r\n z-index: 99999;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 4px;\r\n}\r\n\r\n/* Fancy blur effect */\r\n#nprogress .peg {\r\n display: block;\r\n position: absolute;\r\n right: 0px;\r\n width: 100px;\r\n height: 100%;\r\n box-shadow: 0 0 10px #29d, 0 0 5px #29d;\r\n opacity: 1.0;\r\n -webkit-transform: rotate(3deg) translate(0px, -4px);\r\n -ms-transform: rotate(3deg) translate(0px, -4px);\r\n transform: rotate(3deg) translate(0px, -4px);\r\n}\r\n\r\n/* Remove these to get rid of the spinner */\r\n#nprogress .spinner {\r\n display: block;\r\n position: fixed;\r\n z-index: 1031;\r\n top: 15px;\r\n right: 15px;\r\n}\r\n\r\n#nprogress .spinner-icon {\r\n width: 18px;\r\n height: 18px;\r\n box-sizing: border-box;\r\n border: solid 2px transparent;\r\n border-top-color: #29d;\r\n border-left-color: #29d;\r\n border-radius: 50%;\r\n -webkit-animation: nprogress-spinner 400ms linear infinite;\r\n animation: nprogress-spinner 400ms linear infinite;\r\n}\r\n\r\n.nprogress-custom-parent {\r\n overflow: hidden;\r\n position: relative;\r\n}\r\n\r\n.nprogress-custom-parent #nprogress .spinner,\r\n.nprogress-custom-parent #nprogress .bar {\r\n position: absolute;\r\n}\r\n\r\n@-webkit-keyframes nprogress-spinner {\r\n 0% {\r\n -webkit-transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n -webkit-transform: rotate(360deg);\r\n }\r\n}\r\n\r\n@keyframes nprogress-spinner {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}");var J=function(){var e=h.useContext(V).props;return h.createElement(r,{variant:"h5",sx:e.titleStyle},e.title)},W=function(){var e=h.useContext(V).props;if(!e.enableCreateRow)return null;return h.createElement(o,{title:e.createButtonTooltip,arrow:!0,placement:"top"},h.createElement(l,{variant:e.createButtonVariant,onClick:function(t){t.currentTarget.blur(),e.onCreateRow(t)}},h.createElement(E,{size:24})))},_=function(){var e=h.useContext(V).props;return e.globalActions?h.createElement(h.Fragment,null,e.globalActions.map((function(e,t){return h.createElement(i,{key:t},e)}))):null},G=function(e){var t,n=e.column;h.useContext(V).props;var r=h.useContext(V).api;return h.createElement(h.Fragment,null,h.createElement(i,{sx:{dispaly:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start"}},h.createElement(i,{sx:{display:"flex",flexDirection:"row",gap:.5,aligntItems:"center",cursor:n.enableSorting?"pointer":"default",justifyContent:"right"===n.align?"end":"center"===n.align?"center":"start"},onClick:n.enableSorting?function(e){return r.toggleSorting(e,n)}:null},h.createElement(i,null,n.label),h.createElement(i,null,n.enableSorting?null!==(t={asc:h.createElement(S,{size:20}),desc:h.createElement(x,{size:20})}[r.getSortingStatus(n)])&&void 0!==t?t:h.createElement(F,{size:20,color:"#cccccc"}):null))))},U=function(r){var o=r.initialValue,l=r.mask,i=void 0===l?"999999":l,a=r.onChange,c=r.placeholder,u=void 0===c?"":c,s=r.activeColor,d=void 0===s?"#D4F7F4":s,f=r.inactiveColor,m=void 0===f?"white":f,p=r.clearIcon,g=void 0===p||p,v=K(h.useState(o),2),b=v[0],y=v[1];h.useEffect((function(){y(o)}),[o]);return h.createElement(k,{mask:i,value:b,onChange:function(e){y((function(t){return t===e.target.value?t:(a(e.target.value),e.target.value)}))},maskChar:""},(function(){return h.createElement(e,{sx:{backgroundColor:b?d:m},placeholder:u,fullWidth:!0,size:"small",InputProps:{endAdornment:g&&h.createElement(t,{position:"end",disablePointerEvents:!b},h.createElement(n,{onClick:function(){return a("")}},b?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))}})}))},q=function(e){var r=e.value,o=e.options,l=e.onChange,i=e.valueKey,u=void 0===i?"id":i,s=e.labelKey,d=void 0===s?"label":s,f=e.placeholder,m=void 0===f?"":f,p=e.activeColor,g=void 0===p?"#D4F7F4":p,v=e.inactiveColor,b=void 0===v?"white":v,y=e.clearIcon,E=void 0===y||y,w=K(h.useState(-1),2),x=w[0],S=w[1];h.useEffect((function(){S(null===r||""===r?-1:r)}),[r]);return h.createElement(a,{sx:{backgroundColor:-1!==x?g:b,color:-1==x?"#cccccc":""},value:x,fullWidth:!0,onChange:function(e){var t=e.target.value;l(-1!==t?t:"")},size:"small",endAdornment:E&&h.createElement(t,{position:"end",disablePointerEvents:null===r},h.createElement(n,{onClick:function(){return l("")}},-1!==x?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))},h.createElement(c,{value:-1},m),o.map((function(e){return h.createElement(c,{key:e[u],value:e[u]},e[d])})))},Q=["value","options","valueKey","labelKey","onChange","placeholder","activeColor","inactiveColor"],H=function(t){var n=t.value,r=t.options,o=void 0===r?[]:r,l=t.valueKey,i=void 0===l?"id":l;t.labelKey;var a=t.onChange,c=t.placeholder,s=void 0===c?"":c,d=t.activeColor,f=void 0===d?"#D4F7F4":d,m=t.inactiveColor,p=void 0===m?"white":m,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Q),v=K(h.useState(null),2),b=v[0],y=v[1];return h.useEffect((function(){y(o.find((function(e){return e[i]===n}))||null)}),[n]),h.createElement(u,{value:b,onChange:function(e,t){return a(t?t[i]:null)},options:o,isOptionEqualToValue:function(e,t){return e[i]===t[i]},noOptionsText:"Δεν υπάρχουν επιλογές",size:"small",renderInput:function(t){return h.createElement(e,R({variant:"outlined",fullWidth:!0,placeholder:s,sx:{backgroundColor:null!==b?f:p,color:-1==b?"#cccccc":""},size:"small"},t,g))}})},$=function(e){var t=e.column,n=h.useContext(V),r=n.api,o=n.props,l=r.getColumnFilter(t),i=h.useCallback(L((function(e,t){r.handleColumnFilterChange(e,t)}),300),[r]);return"text"===t.filterType?h.createElement(N,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,initialValue:l,onChange:function(e){return i(t,e)},placeholder:t.filterPlaceholder}):"integer"===t.filterType?h.createElement(U,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,initialValue:l,mask:t.filterMask,onChange:function(e){return i(t,e)},placeholder:t.filterPlaceholder}):"autocomplete"===t.filterType?h.createElement(H,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,value:l,valueKey:t.filterValueKey,labelKey:t.filterLabelKey,onChange:function(e){return r.handleColumnFilterChange(t,e)},placeholder:t.filterPlaceholder,options:t.filterOptions}):"select"===t.filterType?h.createElement(q,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,value:l,onChange:function(e){return r.handleColumnFilterChange(t,e)},placeholder:t.filterPlaceholder,options:t.filterOptions}):null},X=function(){var e=h.useContext(V),t=e.props,n=e.state;return h.createElement(h.Fragment,null,h.createElement(s,null,n.columns.map((function(e){return h.createElement(d,{key:e.id,width:e.width,sx:{minWidth:e.minWidth}},h.createElement(G,{column:e}))})),t.rowActions.length>0&&h.createElement(d,null)),t.enableColumnFilters&&h.createElement(s,null,n.columns.map((function(e){return h.createElement(d,{key:e.id},e.enableFilter?h.createElement($,{column:e}):null)})),t.rowActions.length>0&&h.createElement(d,null)))},Y=function(e){var t=e.row,n=h.useContext(V).props;return n.rowActions?h.createElement(d,null,h.createElement(i,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"}},n.rowActions.map((function(e,n){return h.createElement(i,{key:n},e(t))})))):null},Z=function(e){var t=e.row,n=h.useContext(V),r=n.props,o=n.state,l=K(h.useState({}),2),a=l[0],c=l[1],u=K(h.useState({}),2),m=u[0],p=u[1],g=!!o.expandedRows[t.id];return h.useEffect((function(){c(g?r.expandedRowStyle?r.expandedRowStyle(t):{}:r.rowStyle?r.rowStyle(t):{}),r.cellStyle&&p(r.cellStyle(t))}),[t,g,r.rowStyle,r.cellStyle]),h.createElement(h.Fragment,null,h.createElement(s,{hover:r.rowsClickable,sx:T({cursor:r.rowsClickable?"pointer":"default"},a),onClick:function(){return r.onRowClick&&r.onRowClick(t)}},o.columns.map((function(e){return h.createElement(d,{key:e.id,sx:T(T({},m),{},{textAlign:e.align})},e.render?e.render(t):t[e.id])})),r.rowActions.length>0&&h.createElement(Y,{row:t})),r.expandableRows&&h.createElement(s,null,h.createElement(d,{style:{paddingBottom:0,paddingTop:0,borderBottom:g?void 0:"none"},colSpan:o.columns.length+(r.rowActions.length>0?1:0)},h.createElement(f,{in:g,timeout:"auto",unmountOnExit:!0},h.createElement(i,{sx:{margin:1}},r.expandedRow&&r.expandedRow(t))))))},ee={id:"",label:"",enableSorting:!0,enableFilter:!0,filterType:"text",filterValueKey:"id",filterLabelKey:"label",filterMark:"999999",filterPlaceholder:"Αναζήτηση",filterOptions:[],onFilterChange:null,style:null,width:"",minWidth:"",align:"left",render:null},te=function(){var e,t,n=h.useContext(V).state;return null!==(e=n.data)&&void 0!==e&&e.footer&&0!=Object.keys(null===(t=n.data)||void 0===t?void 0:t.footer).length?h.createElement(m,null,h.createElement(s,null,null==n?void 0:n.columns.map((function(e){var t;return h.createElement(d,{key:e.id,align:"right",sx:{fontWeight:"bold",fontSize:14}},null===(t=n.data)||void 0===t?void 0:t.footer[e.id])})))):null},ne={data:[],page:0,page_size:10,total:0},re=h.forwardRef((function(e,t){var r=e.title,o=e.titleStyle,l=void 0===o?{}:o,a=e.rowStyle,c=void 0===a?null:a,u=e.cellStyle,s=void 0===u?null:u,d=e.tableSize,f=void 0===d?"medium":d,m=e.columns,C=e.dataUrl,E=e.rowKey,x=void 0===E?"id":E,S=e.hasQueryParams,F=void 0!==S&&S,k=e.enableGlobalFilter,A=void 0!==k&&k,R=e.enableColumnFilters,z=void 0!==R&&R,B=e.globalFilterPlaceholder,N=void 0===B?"Καθολική Αναζήτηση":B,L=e.enableCreateRow,G=void 0!==L&&L,U=e.createButtonVariant,q=void 0===U?"contained":U,Q=e.createButtonTooltip,H=void 0===Q?"Νέα Εγγραφή":Q,$=e.onCreateRow,Y=void 0===$?null:$,re=e.rowsClickable,oe=void 0!==re&&re,le=e.onRowClick,ie=void 0===le?null:le,ae=e.globalActions,ce=void 0===ae?[]:ae,ue=e.rowActions,se=void 0===ue?[]:ue,de=e.keepState,fe=void 0===de||de,me=e.stateKey,pe=void 0===me?null:me,ge=e.filterActiveColor,ve=void 0===ge?"#D4F7F4":ge,be=e.filterInactiveColor,ye=void 0===be?"white":be,he=e.defaultSorting,Ce=void 0===he?[]:he,Ee=e.initialPageSize,we=void 0===Ee?10:Ee,xe=e.rowsPerPageLabel,Se=void 0===xe?"Εγγραφές ανά σελίδα":xe,Fe=e.fromLabel,ke=void 0===Fe?"από":Fe,Oe=e.toLabel,Pe=void 0===Oe?"έως":Oe,Ie=e.expandableRows,Ae=void 0!==Ie&&Ie,je=e.expandedRow,Re=void 0===je?null:je,ze=e.expandedRowStyle,Te=void 0===ze?null:ze,Ke=h.useMemo((function(){return!(!fe||!pe)&&"".concat(pe,".pageIndex")}),[]),De=h.useMemo((function(){return!(!fe||!pe)&&"".concat(pe,".pageSize")}),[]),Be=h.useMemo((function(){return!(!fe||!pe)&&"".concat(pe,".sorting")}),[]),Ne=h.useMemo((function(){return!(!fe||!pe)&&"".concat(pe,".globalFilter")}),[]),Ve=h.useMemo((function(){return!(!fe||!pe)&&"".concat(pe,".columnFilters")}),[]),Le=h.useMemo((function(){var e=m.map((function(e){return T(T({},ee),e)}));return Ae?[T(T({},ee),{},{id:"internal_expander",label:"",align:"center",width:"50px",enableSorting:!1,enableFilter:!1,render:function(e){return h.createElement(n,{size:"small",onClick:function(t){t.stopPropagation(),at((function(t){return T(T({},t),{},j({},e.id,!t[e.id]))}))}},it[e.id]?h.createElement(P,null):h.createElement(I,null))}})].concat(D(e)):e}),[m,Re,Ae,ee]),Me=K(h.useState(ne),2),Je=Me[0],We=Me[1],_e=K(h.useState(Be&&JSON.parse(sessionStorage.getItem(Be))||Ce),2),Ge=_e[0],Ue=_e[1],qe=K(h.useState(Ne&&sessionStorage.getItem(Ne)||""),2),Qe=qe[0],He=qe[1],$e=K(h.useState(Ve&&JSON.parse(sessionStorage.getItem(Ve))||[]),2),Xe=$e[0],Ye=$e[1],Ze=K(h.useState(Ke&&parseInt(sessionStorage.getItem(Ke))||0),2),et=Ze[0],tt=Ze[1],nt=K(h.useState(De&&parseInt(sessionStorage.getItem(De))||we),2),rt=nt[0],ot=nt[1],lt=K(h.useState({}),2),it=lt[0],at=lt[1],ct=function(){var e=K(h.useState(!1),2),t=e[0],n=e[1];return{loader:t,startLoader:function(){n(!0),w.start()},stopLoader:function(){n(!1),w.done()}}}(),ut=ct.startLoader,st=ct.stopLoader,dt=function(e,t,n,r,o){ut();var l=F?"&":"?";O.get("".concat(C).concat(l,"page=").concat(e+1,"&pageSize=").concat(t,"&sorting=").concat(JSON.stringify(n),"&globalFilter=").concat(r,"&columnFilters=").concat(JSON.stringify(o))).then((function(e){We(e.data),st()})).catch((function(e){console.log(e.message),st()}))};h.useImperativeHandle(t,(function(){return{updateRow:function(e){We((function(t){var n=t.data.map((function(t){return t.id===e.id?e:t}));return T(T({},t),{},{data:n})}))},refresh:function(){return dt(et,rt,Ge,Qe,Xe)},globalFilter:function(){return Qe},columnFilters:function(){return Xe},sorting:function(){return Ge},queryParams:function(){return"sorting=".concat(JSON.stringify(Ge),"&globalFilter=").concat(Qe,"&columnFilters=").concat(JSON.stringify(Xe))}}}));var ft={props:{title:r,titleStyle:l,rowStyle:c,cellStyle:s,tableSize:f,columns:m,dataUrl:C,hasQueryParams:F,enableGlobalFilter:A,enableColumnFilters:z,globalFilterPlaceholder:N,enableCreateRow:G,createButtonVariant:q,createButtonTooltip:H,onCreateRow:Y,rowsClickable:oe,onRowClick:ie,globalActions:ce,rowActions:se,keepState:fe,stateKey:pe,filterActiveColor:ve,filterInactiveColor:ye,defaultSorting:Ce,expandableRows:Ae,expandedRow:Re,expandedRowStyle:Te},state:{data:Je,columns:Le,setData:We,sorting:Ge,setSorting:Ue,globalFilter:Qe,setGlobalFilter:He,columnFilters:Xe,setColumnFilters:Ye,pageIndex:et,setPageIndex:tt,pageSize:rt,setPageSize:ot,expandedRows:it},api:{toggleSorting:function(e,t){Ue((function(n){var r=n.find((function(e){return e.id===t.id})),o=[];r?o=!r.desc?e.altKey?[].concat(D(n.filter((function(e){return e.id!==t.id}))),[{id:t.id,desc:!0}]):[{id:t.id,desc:!0}]:e.altKey?D(n.filter((function(e){return e.id!==t.id}))):[]:o=e.altKey?[].concat(D(n),[{id:t.id,desc:!1}]):[{id:t.id,desc:!1}];return tt(0),dt(0,rt,o,Qe,Xe),o}))},getSortingStatus:function(e){var t=Ge.find((function(t){return t.id===e.id}));return t?t.desc?"desc":"asc":null},handleGlobalFilterChange:function(e){He(e),tt(0),dt(0,rt,Ge,e,Xe)},getColumnFilter:function(e){var t=Xe.find((function(t){return t.id===e.id}));return t?t.value:""},handleColumnFilterChange:function(e,t){Ye((function(n){var r=[];return r=n.find((function(t){return t.id===e.id}))?t?[].concat(D(n.filter((function(t){return t.id!==e.id}))),[{id:e.id,value:t}]):D(n.filter((function(t){return t.id!==e.id}))):[].concat(D(n),[{id:e.id,value:t}]),"function"==typeof e.onFilterChange&&e.onFilterChange(t),tt(0),dt(0,rt,Ge,Qe,r),r}))}}};return h.useEffect((function(){dt(et,rt,Ge,Qe,Xe)}),[]),h.useEffect((function(){Ke&&sessionStorage.setItem(Ke,et)}),[et]),h.useEffect((function(){De&&sessionStorage.setItem(De,rt)}),[rt]),h.useEffect((function(){Be&&sessionStorage.setItem(Be,JSON.stringify(Ge))}),[Ge]),h.useEffect((function(){Ne&&sessionStorage.setItem(Ne,Qe)}),[Qe]),h.useEffect((function(){Ve&&sessionStorage.setItem(Ve,JSON.stringify(Xe))}),[Xe]),h.createElement(h.Fragment,null,h.createElement(V.Provider,{value:ft},h.createElement(i,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:{xs:"top",md:"space-between"},alignItems:{xs:"left",md:"center"},marginBottom:1}},h.createElement(J,null),h.createElement(i,{sx:{display:"flex",gap:2,justifyContent:"end",alignItems:"center",marginTop:{xs:2,md:0}}},h.createElement(M,null),h.createElement(W,null),h.createElement(_,null))),h.createElement(p,null,h.createElement(g,{size:f},h.createElement(v,null,h.createElement(X,null)),h.createElement(b,null,Je.data.map((function(e,t){return h.createElement(Z,{key:"__index__"===x?t:e[x],row:e})}))),h.createElement(te,{footer:null==Je?void 0:Je.footer})))),h.createElement(y,{sx:{marginTop:1,overflow:"hidden"},component:"div",showFirstButton:!0,showLastButton:!0,count:parseInt(Je.total),page:0!=Je.page?Je.page-1:0,rowsPerPage:Je.page_size,onPageChange:function(e,t){return tt(n=t),void dt(n,rt,Ge,Qe,Xe);var n},onRowsPerPageChange:function(e){return t=e.target.value,ot(t),tt(0),void dt(0,t,Ge,Qe,Xe);var t},labelDisplayedRows:function(e){return"".concat(e.from," ").concat(Pe," ").concat(e.to," ").concat(ke," ").concat(e.count)},labelRowsPerPage:Se}))}));export{re as ServerSideTable};
1
+ import{TextField as e,InputAdornment as t,IconButton as n,Typography as r,Tooltip as o,Button as l,Box as i,Select as a,MenuItem as c,Autocomplete as u,TableRow as s,TableCell as d,Collapse as f,TableFooter as m,TableContainer as p,Table as g,TableHead as v,TableBody as b,TablePagination as y}from"@mui/material";import h from"react";import{MdClear as C,MdOutlineAdd as E}from"react-icons/md";import"date-fns";import"date-fns/locale";import w from"nprogress";import"@inertiajs/react";import{TiArrowSortedDown as x,TiArrowSortedUp as S,TiArrowUnsorted as F}from"react-icons/ti";import k from"react-input-mask";import O from"axios";import{KeyboardArrowUp as P,KeyboardArrowDown as I}from"@mui/icons-material";function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;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:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){j(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function K(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,l,i,a=[],c=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t);else for(;!(c=(r=l.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return a}}(e,t)||B(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.")}()}function D(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){if(e){if("string"==typeof e)return A(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}var N=function(r){var o=r.initialValue,l=r.onChange,i=r.placeholder,a=void 0===i?"":i,c=r.activeColor,u=void 0===c?"#D4F7F4":c,s=r.inactiveColor,d=void 0===s?"white":s,f=r.clearIcon,m=void 0===f||f,p=K(h.useState(o),2),g=p[0],v=p[1];h.useEffect(function(){v(o)},[o]);return h.createElement(e,{sx:{backgroundColor:g?u:d},placeholder:a,value:g||"",fullWidth:!0,onChange:function(e){v(e.target.value),l(e.target.value)},size:"small",InputProps:{endAdornment:m&&h.createElement(t,{position:"end",disablePointerEvents:!g},h.createElement(n,{onClick:function(){return l("")}},g?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))}})},V=h.createContext(),L=function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];n&&clearTimeout(n),n=setTimeout(function(){e.apply(void 0,o)},t)}},M=function(){var e=h.useContext(V),t=e.state,n=e.props,r=e.api,o=h.useCallback(L(function(e){r.handleGlobalFilterChange(e)},300),[r]);return n.enableGlobalFilter?h.createElement(N,{initialValue:t.globalFilter,onChange:o,placeholder:n.globalFilterPlaceholder}):null};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("#nprogress {\r\n pointer-events: none;\r\n}\r\n\r\n#nprogress .bar {\r\n background: #29d;\r\n position: fixed;\r\n z-index: 99999;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 4px;\r\n}\r\n\r\n/* Fancy blur effect */\r\n#nprogress .peg {\r\n display: block;\r\n position: absolute;\r\n right: 0px;\r\n width: 100px;\r\n height: 100%;\r\n box-shadow: 0 0 10px #29d, 0 0 5px #29d;\r\n opacity: 1.0;\r\n -webkit-transform: rotate(3deg) translate(0px, -4px);\r\n -ms-transform: rotate(3deg) translate(0px, -4px);\r\n transform: rotate(3deg) translate(0px, -4px);\r\n}\r\n\r\n/* Remove these to get rid of the spinner */\r\n#nprogress .spinner {\r\n display: block;\r\n position: fixed;\r\n z-index: 1031;\r\n top: 15px;\r\n right: 15px;\r\n}\r\n\r\n#nprogress .spinner-icon {\r\n width: 18px;\r\n height: 18px;\r\n box-sizing: border-box;\r\n border: solid 2px transparent;\r\n border-top-color: #29d;\r\n border-left-color: #29d;\r\n border-radius: 50%;\r\n -webkit-animation: nprogress-spinner 400ms linear infinite;\r\n animation: nprogress-spinner 400ms linear infinite;\r\n}\r\n\r\n.nprogress-custom-parent {\r\n overflow: hidden;\r\n position: relative;\r\n}\r\n\r\n.nprogress-custom-parent #nprogress .spinner,\r\n.nprogress-custom-parent #nprogress .bar {\r\n position: absolute;\r\n}\r\n\r\n@-webkit-keyframes nprogress-spinner {\r\n 0% {\r\n -webkit-transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n -webkit-transform: rotate(360deg);\r\n }\r\n}\r\n\r\n@keyframes nprogress-spinner {\r\n 0% {\r\n transform: rotate(0deg);\r\n }\r\n\r\n 100% {\r\n transform: rotate(360deg);\r\n }\r\n}");var J=function(){var e=h.useContext(V).props;return h.createElement(r,{variant:"h5",sx:e.titleStyle},e.title)},W=function(){var e=h.useContext(V).props;if(!e.enableCreateRow)return null;return h.createElement(o,{title:e.createButtonTooltip,arrow:!0,placement:"top"},h.createElement(l,{variant:e.createButtonVariant,onClick:function(t){t.currentTarget.blur(),e.onCreateRow(t)}},h.createElement(E,{size:24})))},_=function(){var e=h.useContext(V).props;return e.globalActions?h.createElement(h.Fragment,null,e.globalActions.map(function(e,t){return h.createElement(i,{key:t},e)})):null},G=function(e){var t,n=e.column;h.useContext(V).props;var r=h.useContext(V).api;return h.createElement(h.Fragment,null,h.createElement(i,{sx:{dispaly:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start"}},h.createElement(i,{sx:{display:"flex",flexDirection:"row",gap:.5,aligntItems:"center",cursor:n.enableSorting?"pointer":"default",justifyContent:"right"===n.align?"end":"center"===n.align?"center":"start"},onClick:n.enableSorting?function(e){return r.toggleSorting(e,n)}:null},h.createElement(i,null,n.label),h.createElement(i,null,n.enableSorting?null!==(t={asc:h.createElement(S,{size:20}),desc:h.createElement(x,{size:20})}[r.getSortingStatus(n)])&&void 0!==t?t:h.createElement(F,{size:20,color:"#cccccc"}):null))))},U=function(r){var o=r.initialValue,l=r.mask,i=void 0===l?"999999":l,a=r.onChange,c=r.placeholder,u=void 0===c?"":c,s=r.activeColor,d=void 0===s?"#D4F7F4":s,f=r.inactiveColor,m=void 0===f?"white":f,p=r.clearIcon,g=void 0===p||p,v=K(h.useState(o),2),b=v[0],y=v[1];h.useEffect(function(){y(o)},[o]);return h.createElement(k,{mask:i,value:b,onChange:function(e){y(function(t){return t===e.target.value?t:(a(e.target.value),e.target.value)})},maskChar:""},function(){return h.createElement(e,{sx:{backgroundColor:b?d:m},placeholder:u,fullWidth:!0,size:"small",InputProps:{endAdornment:g&&h.createElement(t,{position:"end",disablePointerEvents:!b},h.createElement(n,{onClick:function(){return a("")}},b?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))}})})},q=function(e){var r=e.value,o=e.options,l=e.onChange,i=e.valueKey,u=void 0===i?"id":i,s=e.labelKey,d=void 0===s?"label":s,f=e.placeholder,m=void 0===f?"":f,p=e.activeColor,g=void 0===p?"#D4F7F4":p,v=e.inactiveColor,b=void 0===v?"white":v,y=e.clearIcon,E=void 0===y||y,w=K(h.useState(-1),2),x=w[0],S=w[1];h.useEffect(function(){S(null===r||""===r?-1:r)},[r]);return h.createElement(a,{sx:{backgroundColor:-1!==x?g:b,color:-1==x?"#cccccc":""},value:x,fullWidth:!0,onChange:function(e){var t=e.target.value;l(-1!==t?t:"")},size:"small",endAdornment:E&&h.createElement(t,{position:"end",disablePointerEvents:null===r},h.createElement(n,{onClick:function(){return l("")}},-1!==x?h.createElement(C,null):h.createElement(C,{color:"#cccccc"})))},h.createElement(c,{value:-1},m),o.map(function(e){return h.createElement(c,{key:e[u],value:e[u]},e[d])}))},Q=["value","options","valueKey","labelKey","onChange","placeholder","activeColor","inactiveColor"],H=function(t){var n=t.value,r=t.options,o=void 0===r?[]:r,l=t.valueKey,i=void 0===l?"id":l;t.labelKey;var a=t.onChange,c=t.placeholder,s=void 0===c?"":c,d=t.activeColor,f=void 0===d?"#D4F7F4":d,m=t.inactiveColor,p=void 0===m?"white":m,g=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,Q),v=K(h.useState(null),2),b=v[0],y=v[1];return h.useEffect(function(){y(o.find(function(e){return e[i]===n})||null)},[n]),h.createElement(u,{value:b,onChange:function(e,t){return a(t?t[i]:null)},options:o,isOptionEqualToValue:function(e,t){return e[i]===t[i]},noOptionsText:"Δεν υπάρχουν επιλογές",size:"small",renderInput:function(t){return h.createElement(e,R({variant:"outlined",fullWidth:!0,placeholder:s,sx:{backgroundColor:null!==b?f:p,color:-1==b?"#cccccc":""},size:"small"},t,g))}})},$=function(e){var t=e.column,n=h.useContext(V),r=n.api,o=n.props,l=r.getColumnFilter(t),i=h.useCallback(L(function(e,t){r.handleColumnFilterChange(e,t)},300),[r]);return"text"===t.filterType?h.createElement(N,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,initialValue:l,onChange:function(e){return i(t,e)},placeholder:t.filterPlaceholder}):"integer"===t.filterType?h.createElement(U,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,initialValue:l,mask:t.filterMask,onChange:function(e){return i(t,e)},placeholder:t.filterPlaceholder}):"autocomplete"===t.filterType?h.createElement(H,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,value:l,valueKey:t.filterValueKey,labelKey:t.filterLabelKey,onChange:function(e){return r.handleColumnFilterChange(t,e)},placeholder:t.filterPlaceholder,options:t.filterOptions}):"select"===t.filterType?h.createElement(q,{activeColor:o.filterActiveColor,inactiveColor:o.filterInactiveColor,value:l,onChange:function(e){return r.handleColumnFilterChange(t,e)},placeholder:t.filterPlaceholder,options:t.filterOptions}):null},X=function(){var e=h.useContext(V),t=e.props,n=e.state;return h.createElement(h.Fragment,null,h.createElement(s,null,n.columns.map(function(e){return h.createElement(d,{key:e.id,width:e.width,sx:{minWidth:e.minWidth}},h.createElement(G,{column:e}))}),t.rowActions.length>0&&h.createElement(d,null)),t.enableColumnFilters&&h.createElement(s,null,n.columns.map(function(e){return h.createElement(d,{key:e.id},e.enableFilter?h.createElement($,{column:e}):null)}),t.rowActions.length>0&&h.createElement(d,null)))},Y=function(e){var t=e.row,n=h.useContext(V).props;return n.rowActions?h.createElement(d,null,h.createElement(i,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"}},n.rowActions.map(function(e,n){return h.createElement(i,{key:n},e(t))}))):null},Z=function(e){var t=e.row,n=h.useContext(V),r=n.props,o=n.state,l=K(h.useState({}),2),a=l[0],c=l[1],u=K(h.useState({}),2),m=u[0],p=u[1],g=!!o.expandedRows[t.id];return h.useEffect(function(){c(g?r.expandedRowStyle?r.expandedRowStyle(t):{}:r.rowStyle?r.rowStyle(t):{}),r.cellStyle&&p(r.cellStyle(t))},[t,g,r.rowStyle,r.cellStyle]),h.createElement(h.Fragment,null,h.createElement(s,{hover:r.rowsClickable,sx:T({cursor:r.rowsClickable?"pointer":"default"},a),onClick:function(){return r.onRowClick&&r.onRowClick(t)}},o.columns.map(function(e){return h.createElement(d,{key:e.id,sx:T(T({},m),{},{textAlign:e.align})},e.render?e.render(t):t[e.id])}),r.rowActions.length>0&&h.createElement(Y,{row:t})),r.expandableRows&&h.createElement(s,null,h.createElement(d,{style:{paddingBottom:0,paddingTop:0,borderBottom:g?void 0:"none"},colSpan:o.columns.length+(r.rowActions.length>0?1:0)},h.createElement(f,{in:g,timeout:"auto",unmountOnExit:!0},h.createElement(i,{sx:{margin:1}},r.expandedRow&&r.expandedRow(t))))))},ee={id:"",label:"",enableSorting:!0,enableFilter:!0,filterType:"text",filterValueKey:"id",filterLabelKey:"label",filterMark:"999999",filterPlaceholder:"Αναζήτηση",filterOptions:[],onFilterChange:null,style:null,width:"",minWidth:"",align:"left",render:null},te=function(){var e,t,n=h.useContext(V).state;return null!==(e=n.data)&&void 0!==e&&e.footer&&0!=Object.keys(null===(t=n.data)||void 0===t?void 0:t.footer).length?h.createElement(m,null,h.createElement(s,null,null==n?void 0:n.columns.map(function(e){var t;return h.createElement(d,{key:e.id,align:"right",sx:{fontWeight:"bold",fontSize:14}},null===(t=n.data)||void 0===t?void 0:t.footer[e.id])}))):null},ne={data:[],page:0,page_size:10,total:0},re=h.forwardRef(function(e,t){var r=e.title,o=e.titleStyle,l=void 0===o?{}:o,a=e.rowStyle,c=void 0===a?null:a,u=e.cellStyle,s=void 0===u?null:u,d=e.tableSize,f=void 0===d?"medium":d,m=e.columns,C=e.dataUrl,E=e.rowKey,x=void 0===E?"id":E,S=e.hasQueryParams,F=void 0!==S&&S,k=e.enableGlobalFilter,A=void 0!==k&&k,R=e.enableColumnFilters,z=void 0!==R&&R,B=e.globalFilterPlaceholder,N=void 0===B?"Καθολική Αναζήτηση":B,L=e.enableCreateRow,G=void 0!==L&&L,U=e.createButtonVariant,q=void 0===U?"contained":U,Q=e.createButtonTooltip,H=void 0===Q?"Νέα Εγγραφή":Q,$=e.onCreateRow,Y=void 0===$?null:$,re=e.rowsClickable,oe=void 0!==re&&re,le=e.onRowClick,ie=void 0===le?null:le,ae=e.globalActions,ce=void 0===ae?[]:ae,ue=e.rowActions,se=void 0===ue?[]:ue,de=e.keepState,fe=void 0===de||de,me=e.stateKey,pe=void 0===me?null:me,ge=e.filterActiveColor,ve=void 0===ge?"#D4F7F4":ge,be=e.filterInactiveColor,ye=void 0===be?"white":be,he=e.defaultSorting,Ce=void 0===he?[]:he,Ee=e.initialPageSize,we=void 0===Ee?10:Ee,xe=e.rowsPerPageLabel,Se=void 0===xe?"Εγγραφές ανά σελίδα":xe,Fe=e.fromLabel,ke=void 0===Fe?"από":Fe,Oe=e.toLabel,Pe=void 0===Oe?"έως":Oe,Ie=e.expandableRows,Ae=void 0!==Ie&&Ie,je=e.expandedRow,Re=void 0===je?null:je,ze=e.expandedRowStyle,Te=void 0===ze?null:ze,Ke=h.useMemo(function(){return!(!fe||!pe)&&"".concat(pe,".pageIndex")},[]),De=h.useMemo(function(){return!(!fe||!pe)&&"".concat(pe,".pageSize")},[]),Be=h.useMemo(function(){return!(!fe||!pe)&&"".concat(pe,".sorting")},[]),Ne=h.useMemo(function(){return!(!fe||!pe)&&"".concat(pe,".globalFilter")},[]),Ve=h.useMemo(function(){return!(!fe||!pe)&&"".concat(pe,".columnFilters")},[]),Le=h.useMemo(function(){var e=m.map(function(e){return T(T({},ee),e)});return Ae?[T(T({},ee),{},{id:"internal_expander",label:"",align:"center",width:"50px",enableSorting:!1,enableFilter:!1,render:function(e){return h.createElement(n,{size:"small",onClick:function(t){t.stopPropagation(),at(function(t){return T(T({},t),{},j({},e.id,!t[e.id]))})}},it[e.id]?h.createElement(P,null):h.createElement(I,null))}})].concat(D(e)):e},[m,Re,Ae,ee]),Me=K(h.useState(ne),2),Je=Me[0],We=Me[1],_e=K(h.useState(Be&&JSON.parse(sessionStorage.getItem(Be))||Ce),2),Ge=_e[0],Ue=_e[1],qe=K(h.useState(Ne&&sessionStorage.getItem(Ne)||""),2),Qe=qe[0],He=qe[1],$e=K(h.useState(Ve&&JSON.parse(sessionStorage.getItem(Ve))||[]),2),Xe=$e[0],Ye=$e[1],Ze=K(h.useState(Ke&&parseInt(sessionStorage.getItem(Ke))||0),2),et=Ze[0],tt=Ze[1],nt=K(h.useState(De&&parseInt(sessionStorage.getItem(De))||we),2),rt=nt[0],ot=nt[1],lt=K(h.useState({}),2),it=lt[0],at=lt[1],ct=function(){var e=K(h.useState(!1),2),t=e[0],n=e[1];return{loader:t,startLoader:function(){n(!0),w.start()},stopLoader:function(){n(!1),w.done()}}}(),ut=ct.startLoader,st=ct.stopLoader,dt=function(e,t,n,r,o){ut();var l=F?"&":"?";O.get("".concat(C).concat(l,"page=").concat(e+1,"&pageSize=").concat(t,"&sorting=").concat(JSON.stringify(n),"&globalFilter=").concat(r,"&columnFilters=").concat(JSON.stringify(o))).then(function(e){We(e.data),st()}).catch(function(e){console.log(e.message),st()})};h.useImperativeHandle(t,function(){return{updateRow:function(e){We(function(t){var n=t.data.map(function(t){return t.id===e.id?e:t});return T(T({},t),{},{data:n})})},refresh:function(){return dt(et,rt,Ge,Qe,Xe)},globalFilter:function(){return Qe},columnFilters:function(){return Xe},sorting:function(){return Ge},queryParams:function(){return"sorting=".concat(JSON.stringify(Ge),"&globalFilter=").concat(Qe,"&columnFilters=").concat(JSON.stringify(Xe))}}});var ft={props:{title:r,titleStyle:l,rowStyle:c,cellStyle:s,tableSize:f,columns:m,dataUrl:C,hasQueryParams:F,enableGlobalFilter:A,enableColumnFilters:z,globalFilterPlaceholder:N,enableCreateRow:G,createButtonVariant:q,createButtonTooltip:H,onCreateRow:Y,rowsClickable:oe,onRowClick:ie,globalActions:ce,rowActions:se,keepState:fe,stateKey:pe,filterActiveColor:ve,filterInactiveColor:ye,defaultSorting:Ce,expandableRows:Ae,expandedRow:Re,expandedRowStyle:Te},state:{data:Je,columns:Le,setData:We,sorting:Ge,setSorting:Ue,globalFilter:Qe,setGlobalFilter:He,columnFilters:Xe,setColumnFilters:Ye,pageIndex:et,setPageIndex:tt,pageSize:rt,setPageSize:ot,expandedRows:it},api:{toggleSorting:function(e,t){Ue(function(n){var r=n.find(function(e){return e.id===t.id}),o=[];r?o=!r.desc?e.altKey?[].concat(D(n.filter(function(e){return e.id!==t.id})),[{id:t.id,desc:!0}]):[{id:t.id,desc:!0}]:e.altKey?D(n.filter(function(e){return e.id!==t.id})):[]:o=e.altKey?[].concat(D(n),[{id:t.id,desc:!1}]):[{id:t.id,desc:!1}];return tt(0),dt(0,rt,o,Qe,Xe),o})},getSortingStatus:function(e){var t=Ge.find(function(t){return t.id===e.id});return t?t.desc?"desc":"asc":null},handleGlobalFilterChange:function(e){He(e),tt(0),dt(0,rt,Ge,e,Xe)},getColumnFilter:function(e){var t=Xe.find(function(t){return t.id===e.id});return t?t.value:""},handleColumnFilterChange:function(e,t){Ye(function(n){var r=[];return r=n.find(function(t){return t.id===e.id})?t?[].concat(D(n.filter(function(t){return t.id!==e.id})),[{id:e.id,value:t}]):D(n.filter(function(t){return t.id!==e.id})):[].concat(D(n),[{id:e.id,value:t}]),"function"==typeof e.onFilterChange&&e.onFilterChange(t),tt(0),dt(0,rt,Ge,Qe,r),r})}}};return h.useEffect(function(){dt(et,rt,Ge,Qe,Xe)},[]),h.useEffect(function(){Ke&&sessionStorage.setItem(Ke,et)},[et]),h.useEffect(function(){De&&sessionStorage.setItem(De,rt)},[rt]),h.useEffect(function(){Be&&sessionStorage.setItem(Be,JSON.stringify(Ge))},[Ge]),h.useEffect(function(){Ne&&sessionStorage.setItem(Ne,Qe)},[Qe]),h.useEffect(function(){Ve&&sessionStorage.setItem(Ve,JSON.stringify(Xe))},[Xe]),h.createElement(h.Fragment,null,h.createElement(V.Provider,{value:ft},h.createElement(i,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:{xs:"top",md:"space-between"},alignItems:{xs:"left",md:"center"},marginBottom:1}},h.createElement(J,null),h.createElement(i,{sx:{display:"flex",gap:2,justifyContent:"end",alignItems:"center",marginTop:{xs:2,md:0}}},h.createElement(M,null),h.createElement(W,null),h.createElement(_,null))),h.createElement(p,null,h.createElement(g,{size:f},h.createElement(v,null,h.createElement(X,null)),h.createElement(b,null,Je.data.map(function(e,t){return h.createElement(Z,{key:"__index__"===x?t:e[x],row:e})})),h.createElement(te,{footer:null==Je?void 0:Je.footer})))),h.createElement(y,{sx:{marginTop:1,overflow:"hidden"},component:"div",showFirstButton:!0,showLastButton:!0,count:parseInt(Je.total),page:0!=Je.page?Je.page-1:0,rowsPerPage:Je.page_size,onPageChange:function(e,t){return tt(n=t),void dt(n,rt,Ge,Qe,Xe);var n},onRowsPerPageChange:function(e){return t=e.target.value,ot(t),tt(0),void dt(0,t,Ge,Qe,Xe);var t},labelDisplayedRows:function(e){return"".concat(e.from," ").concat(Pe," ").concat(e.to," ").concat(ke," ").concat(e.count)},labelRowsPerPage:Se}))});export{re as ServerSideTable};
package/utils/index.js CHANGED
@@ -1 +1 @@
1
- import{parseISO as n,format as t,getMonth as r,formatISO as e}from"date-fns";import{el as o}from"date-fns/locale";var u=function(n){return null==n||""===n},i=function(n){return null!=n&&""!==n},c=function(n){return n?parseInt(n).toLocaleString():0},l=function(n){return u(n)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(n)},a=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!u(n))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(n)},f=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,y=function(n){return 0===n?"ΟΧΙ":1===n?"ΝΑΙ":null},m=function(t){if(!t)return null;var r=n(t);return"Invalid Date"==r?null:r},d=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return r?t(n(r,{locale:o}),"dd".concat(e,"MM").concat(e,"yyyy")):""},v=function(r){return r?t(n(r,{locale:o}),"HH:mm"):""},M=function(r){return r?t(n(r,{locale:o}),"dd/MM/yyyy, HH:mm"):""},s=function(n){return t(n,"dd/MM/yyyy")},g=function(n){return t(n,"yyyy-MM-dd",{locale:o})},p=function(n){return n?t(n,"yyyy-MM-dd HH:mm",{locale:o}):null},H=function(n){var e=r(n);return t(n,"eeee, d ".concat(genikiOfMonth[e]," yyyy"),{locale:o})},h=function(n){return n?e(n):""},F=function(n,t){var r;return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];r&&clearTimeout(r),r=setTimeout((function(){n.apply(void 0,o)}),t)}},I=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===n[r]})))};export{f as emailRegEx,l as formatCurrency,d as formatDate,M as formatDateTime,a as formatFloat,s as formatFnsDate,g as formatFnsDbDate,p as formatFnsDbDatetime,H as formatFnsFullDate,c as formatInteger,v as formatTime,u as isEmpty,F as myDebounce,i as notEmpty,I as objectInArray,m as parseDate,h as toISOString,y as yesno};
1
+ import{format as n,parseISO as t,getMonth as r,formatISO as e}from"date-fns";import{el as o}from"date-fns/locale";var u=function(n){return null==n||""===n},i=function(n){return null!=n&&""!==n},c=function(n){return n?parseInt(n).toLocaleString():0},l=function(n){return u(n)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(n)},a=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!u(n))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(n)},f=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,y=function(n){return 0===n?"ΟΧΙ":1===n?"ΝΑΙ":null},m=function(n){if(!n)return null;var r=t(n);return"Invalid Date"==r?null:r},d=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return r?n(t(r,{locale:o}),"dd".concat(e,"MM").concat(e,"yyyy")):""},v=function(r){return r?n(t(r,{locale:o}),"HH:mm"):""},M=function(r){return r?n(t(r,{locale:o}),"dd/MM/yyyy, HH:mm"):""},s=function(t){return n(t,"dd/MM/yyyy")},g=function(t){return n(t,"yyyy-MM-dd",{locale:o})},p=function(t){return t?n(t,"yyyy-MM-dd HH:mm",{locale:o}):null},H=function(t){var e=r(t);return n(t,"eeee, d ".concat(genikiOfMonth[e]," yyyy"),{locale:o})},h=function(n){return n?e(n):""},F=function(n,t){var r;return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];r&&clearTimeout(r),r=setTimeout(function(){n.apply(void 0,o)},t)}},I=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find(function(t){return t[r]===n[r]}))};export{f as emailRegEx,l as formatCurrency,d as formatDate,M as formatDateTime,a as formatFloat,s as formatFnsDate,g as formatFnsDbDate,p as formatFnsDbDatetime,H as formatFnsFullDate,c as formatInteger,v as formatTime,u as isEmpty,F as myDebounce,i as notEmpty,I as objectInArray,m as parseDate,h as toISOString,y as yesno};