@artibet/react-mui-components 3.9.0 → 3.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as l,Popover as i,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import w from"axios";import{NumericFormat as x}from"react-number-format";import{AdapterDateFns as C}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as O}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as L,TimePicker as T}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as k}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,l){try{var i=e[a](l),u=i.value}catch(e){return void t(e)}i.done?r(u):Promise.resolve(u).then(n,o)}function V(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function l(e){j(a,n,o,l,i,"next",e)}function i(e){j(a,n,o,l,i,"throw",e)}l(void 0)}))}}function W(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){W(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,l=Object.create(a.prototype),i=new k(n||[]);return o(l,"_invoke",{value:S(e,t,i)}),l}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,l,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(B([])));x&&x!==t&&n.call(x,l)&&(E=x);var C=y.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,l,i){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,l,i)}),(function(e){t("throw",e,l,i)})):r.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return t("throw",e,l,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,l){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw l;return{value:e,done:!0}}for(n.method=a,n.arg=l;;){var i=n.delegate;if(i){var u=L(i,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function L(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,L(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var l=a.arg;return l?l.done?(t[r.resultName]=l.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[l];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(C,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},O(q.prototype),d(q.prototype,i,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var l=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},O(C),d(C,u,"Generator"),d(C,l,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return i.type="throw",i.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],i=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(l)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,l,i=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(d)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||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 K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,l=void 0===a?255:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,w=r.bold,x=void 0!==w&&w,C=I(r,K),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:p,sx:{fontWeight:x?"bold":"",backgroundColor:p?E:""}}}},C))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,l=void 0===a?"Κωδικός Πρόσβασης":a,i=r.required,u=void 0===i||i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:l,value:s,onChange:i,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,l=void 0===a?"E-mail":a,i=r.maxLength,u=void 0===i?255:i,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,w=r.readonlyBackgroundColor,x=void 0===w?"#dddddd":w,C=r.bold,O=void 0!==C&&C,q=I(r,G),S=t.control,L=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:l,value:s,onChange:i,onBlur:d,error:p&&Boolean(null===(t=L[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=L[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:O?"bold":"",backgroundColor:E?x:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,l=e.label,i=e.disabled,u=void 0!==i&&i,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var i=e.field;i.onChange,i.onBlur;var u=i.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":l}}),label:l}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,l=e.backgroundColor,i=void 0===l?"#888888":l,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:i,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,w=e.paddingX,x=void 0===w?"10px":w,C=e.required,O=void 0!==C&&C,q=e.disabled,S=void 0!==q&&q,L=I(e,$),T=N(g.useState(null),2),P=T[0],k=T[1],B=Boolean(P),j=B?"color-picker":void 0,V=r.control;return g.createElement(b,{name:n,control:V,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},L),g.createElement(o,null,"".concat(d," ").concat(O?"*":"")),g.createElement(l,{sx:{display:"flex"}},g.createElement(l,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return k(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:x,width:s,label:n}))),g.createElement(i,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return k(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(l,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,d=void 0!==i&&i,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,w=void 0!==E&&E,x=r.noOptionsText,C=void 0===x?"Δεν υπάρχουν επιλογές":x,O=r.showErrors,q=void 0===O||O,S=r.size,L=void 0===S?"medium":S,T=r.readonly,P=void 0!==T&&T,k=r.readonlyBackgroundColor,B=void 0===k?"#dddddd":k,j=r.bold,V=void 0!==j&&j,W=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:l,disabled:d},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,P?g.createElement(e,{size:L,label:o,fullWidth:!0,required:l,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:V?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:l,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:y,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:d,autoFocus:w,size:L,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,W))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,c=void 0!==i&&i,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,w=r.autofocus,x=void 0!==w&&w,C=r.noOptionsText,O=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,S=void 0===q||q,L=I(r,ee),T=N(g.useState([]),2),P=T[0],k=T[1],B=t.watch(n);g.useEffect((function(){k(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,V=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:l,disabled:c},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:l,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:O,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:c,autoFocus:x,inputProps:{maxLength:E},error:S&&Boolean(null===(t=V[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=V[n])||void 0===a?void 0:a.message)},r,L))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,l=r.optionsUrl,i=r.renderOption,d=void 0===i?null:i,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,x=void 0!==E&&E,C=r.maxLength,O=void 0===C?255:C,q=r.autofocus,S=void 0!==q&&q,L=r.loadingText,T=void 0===L?"Ανάκτηση...":L,P=r.noOptionsText,k=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,W=r.size,z=void 0===W?"medium":W,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],le=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=V(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return le(!0),r.next=3,w.get("".concat(l,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var ie=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=V(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,w.get("".concat(l,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=V(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return le(!0),e.next=6,w.get("".concat(l,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),le(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=g.useMemo((function(){return e=function(e,r,t){var a;"input"===t&&(a=r,de(n.getValues(o),a))},r=300,function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,o)}),r)};var e,r,t}),[]);return g.createElement(b,{name:o,control:ie,rules:{required:y,disabled:x},render:function(r){var t=r.field,n=t.onChange,l=t.onBlur;return t.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:O,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:ce,onChange:function(e,r){Z(r),n(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:k,loadingText:T,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:x,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:O},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,l=void 0===a?5:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,oe),p=t.control,y=t.formState.errors;return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:s,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f},h))}})},le=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ie=function(r){var t=r.form,n=r.name,o=r.label,a=r.decimals,l=void 0===a?2:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d;r.autofocus;var s=r.showErrors,f=void 0===s||s,v=r.readonly,m=void 0!==v&&v,h=r.readonlyBackgroundColor,p=void 0===h?"#dddddd":h,y=r.bold,E=void 0!==y&&y,w=I(r,le),C=t.control,O=t.formState.errors,q=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:C,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:l,fixedDecimalScale:!0,allowNegative:!1,onValueChange:q,error:f&&Boolean(null===(t=O[n])||void 0===t?void 0:t.message),helperText:f&&(null===(a=O[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:m,sx:{fontWeight:E?"bold":"",backgroundColor:m?p:""}}}},w))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,w=e.secondsStep,x=void 0===w?30:w,L=I(e,ue),T=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:T,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(q,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:x},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},L),{},{required:a,error:d&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(L,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,l=void 0!==a&&a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,w=t.formState.errors,x=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var a,i,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:x,required:l,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(i=w[n])||void 0===i?void 0:i.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(k,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,l=e.hoursStep,i=void 0===l?1:l,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var w=e.showErrors,x=void 0===w||w,q=I(e,pe),L=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:L,rules:{required:h,disabled:y},render:function(e){var r,o,l=e.field;return g.createElement(T,{label:n,value:l.value?E(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:i,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:x&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:x&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,l=e.disabled,i=void 0!==l&&l,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:i},render:function(e){var l=e.field;l.onChange,l.onBlur;var i=l.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:i,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],we=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,l=void 0!==a&&a,i=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:l},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:l}),label:o},i))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,we as MyCheckboxField,J as MyColorPickerField,ie as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
1
+ import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as l,Popover as i,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import x from"axios";import{NumericFormat as w}from"react-number-format";import{AdapterDateFns as C}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as O}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as k,TimePicker as L}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as T}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,l){try{var i=e[a](l),u=i.value}catch(e){return void t(e)}i.done?r(u):Promise.resolve(u).then(n,o)}function W(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function l(e){j(a,n,o,l,i,"next",e)}function i(e){j(a,n,o,l,i,"throw",e)}l(void 0)}))}}function V(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){V(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,l=Object.create(a.prototype),i=new T(n||[]);return o(l,"_invoke",{value:S(e,t,i)}),l}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,l,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(B([])));w&&w!==t&&n.call(w,l)&&(E=w);var C=y.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,l,i){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,l,i)}),(function(e){t("throw",e,l,i)})):r.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return t("throw",e,l,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,l){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw l;return{value:e,done:!0}}for(n.method=a,n.arg=l;;){var i=n.delegate;if(i){var u=k(i,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function k(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,k(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var l=a.arg;return l?l.done?(t[r.resultName]=l.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function L(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[l];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(C,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},O(q.prototype),d(q.prototype,i,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var l=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},O(C),d(C,u,"Generator"),d(C,l,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,T.prototype={constructor:T,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return i.type="throw",i.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],i=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(l)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,l,i=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(d)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||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 K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,l=void 0===a?255:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,x=r.bold,w=void 0!==x&&x,C=I(r,K),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:p,sx:{fontWeight:w?"bold":"",backgroundColor:p?E:""}}}},C))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,l=void 0===a?"Κωδικός Πρόσβασης":a,i=r.required,u=void 0===i||i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:l,value:s,onChange:i,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,l=void 0===a?"E-mail":a,i=r.maxLength,u=void 0===i?255:i,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,x=r.readonlyBackgroundColor,w=void 0===x?"#dddddd":x,C=r.bold,O=void 0!==C&&C,q=I(r,G),S=t.control,k=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:l,value:s,onChange:i,onBlur:d,error:p&&Boolean(null===(t=k[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=k[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:O?"bold":"",backgroundColor:E?w:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,l=e.label,i=e.disabled,u=void 0!==i&&i,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var i=e.field;i.onChange,i.onBlur;var u=i.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":l}}),label:l}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,l=e.backgroundColor,i=void 0===l?"#888888":l,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:i,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,x=e.paddingX,w=void 0===x?"10px":x,C=e.required,O=void 0!==C&&C,q=e.disabled,S=void 0!==q&&q,k=I(e,$),L=N(g.useState(null),2),P=L[0],T=L[1],B=Boolean(P),j=B?"color-picker":void 0,W=r.control;return g.createElement(b,{name:n,control:W,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},k),g.createElement(o,null,"".concat(d," ").concat(O?"*":"")),g.createElement(l,{sx:{display:"flex"}},g.createElement(l,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return T(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:w,width:s,label:n}))),g.createElement(i,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return T(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(l,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,d=void 0!==i&&i,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,x=void 0!==E&&E,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,O=r.showErrors,q=void 0===O||O,S=r.size,k=void 0===S?"medium":S,L=r.readonly,P=void 0!==L&&L,T=r.readonlyBackgroundColor,B=void 0===T?"#dddddd":T,j=r.bold,W=void 0!==j&&j,V=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:l,disabled:d},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,P?g.createElement(e,{size:k,label:o,fullWidth:!0,required:l,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:W?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:l,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:k,slotProps:{input:{maxLength:y,sx:{fontWeight:W?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:d,autoFocus:x,size:k,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,V))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,c=void 0!==i&&i,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,x=r.autofocus,w=void 0!==x&&x,C=r.noOptionsText,O=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,S=void 0===q||q,k=I(r,ee),L=N(g.useState([]),2),P=L[0],T=L[1],B=t.watch(n);g.useEffect((function(){T(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,W=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:l,disabled:c},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:l,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:O,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:c,autoFocus:w,inputProps:{maxLength:E},error:S&&Boolean(null===(t=W[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=W[n])||void 0===a?void 0:a.message)},r,k))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,l=r.optionsUrl,i=r.renderOption,d=void 0===i?null:i,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,w=void 0!==E&&E,C=r.maxLength,O=void 0===C?255:C,q=r.autofocus,S=void 0!==q&&q,k=r.loadingText,L=void 0===k?"Ανάκτηση...":k,P=r.noOptionsText,T=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,V=r.size,z=void 0===V?"medium":V,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],le=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=W(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return le(!0),r.next=3,x.get("".concat(l,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var ie=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=W(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,x.get("".concat(l,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=W(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return le(!0),e.next=6,x.get("".concat(l,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),le(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=g.useMemo((function(){return e=function(e,r,t){var a;"input"===t&&(a=r,de(n.getValues(o),a))},r=300,function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,o)}),r)};var e,r,t}),[]);return g.createElement(b,{name:o,control:ie,rules:{required:y,disabled:w},render:function(r){var t=r.field,n=t.onChange,l=t.onBlur;return t.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:O,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:ce,onChange:function(e,r){Z(r),n(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:T,loadingText:L,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:w,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:O},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,l=void 0===a?5:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,x=r.bold,w=void 0!==x&&x,C=I(r,oe),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{readOnly:p,sx:{fontWeight:w?"bold":"",backgroundColor:p?E:""}}}},C))}})},le=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ie=function(r){var t=r.form,n=r.name,o=r.label,a=r.decimals,l=void 0===a?2:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d;r.autofocus;var s=r.showErrors,f=void 0===s||s,v=r.readonly,m=void 0!==v&&v,h=r.readonlyBackgroundColor,p=void 0===h?"#dddddd":h,y=r.bold,E=void 0!==y&&y,x=I(r,le),C=t.control,O=t.formState.errors,q=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:C,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(w,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:l,fixedDecimalScale:!0,allowNegative:!1,onValueChange:q,error:f&&Boolean(null===(t=O[n])||void 0===t?void 0:t.message),helperText:f&&(null===(a=O[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:m,sx:{fontWeight:E?"bold":"",backgroundColor:m?p:""}}}},x))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,x=e.secondsStep,w=void 0===x?30:x,k=I(e,ue),L=r.control,T=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:L,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(q,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:w},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},k),{},{required:a,error:d&&Boolean(null===(r=T[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=T[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(k,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,l=void 0!==a&&a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(w,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,x=t.formState.errors,w=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var a,i,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:w,required:l,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=x[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(i=x[n])||void 0===i?void 0:i.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(T,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,l=e.hoursStep,i=void 0===l?1:l,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var x=e.showErrors,w=void 0===x||x,q=I(e,pe),k=r.control,T=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:k,rules:{required:h,disabled:y},render:function(e){var r,o,l=e.field;return g.createElement(L,{label:n,value:l.value?E(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:i,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:w&&Boolean(null===(r=T[t])||void 0===r?void 0:r.message),helperText:w&&(null===(o=T[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,l=e.disabled,i=void 0!==l&&l,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:i},render:function(e){var l=e.field;l.onChange,l.onBlur;var i=l.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:i,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],xe=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,l=void 0!==a&&a,i=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:l},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:l}),label:o},i))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,xe as MyCheckboxField,J as MyColorPickerField,ie as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
package/modals/index.js CHANGED
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as a,Dialog as l,Zoom as u,DialogTitle as c,Stack as s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as x}from"react-hook-form";import{yupResolver as E}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as S}from"date-fns";import"date-fns/locale";import C from"axios";import{NumericFormat as W}from"react-number-format";import{AdapterDateFns as q}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as R,TimePicker as O}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as V,EditNoteRounded as z}from"@mui/icons-material";import j from"@mui/icons-material/WarningAmberRounded";import F from"@mui/icons-material/ErrorOutlineRounded";import K from"@mui/icons-material/CheckCircleOutlineRounded";function B(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 D(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){D(i,n,o,a,l,"next",e)}function l(e){D(i,n,o,a,l,"throw",e)}a(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=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},N.apply(null,arguments)}function H(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 _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(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 G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),l=new R(n||[]);return o(a,"_invoke",{value:q(e,r,l)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function x(){}var E={};c(E,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(O([])));w&&w!==r&&n.call(w,a)&&(E=w);var S=x.prototype=b.prototype=Object.create(E);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function W(e,t){function r(o,i,a,l){var u=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function q(t,r,n){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=L(l,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=x,o(S,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:g,configurable:!0}),g.displayName=c(x,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(W.prototype),c(W.prototype,l,(function(){return this})),t.AsyncIterator=W,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new W(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=O,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(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,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return B(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)?B(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 U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,x=r.readonlyBackgroundColor,E=void 0===x?"#dddddd":x,y=r.bold,w=void 0!==y&&y,S=A(r,U),C=n.control,W=n.formState.errors;return e.createElement(g,{name:o,control:C,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=W[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=W[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?E:""}}}},S))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,u=r.maxLength,c=void 0===u?255:u,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,h=r.showErrors,b=void 0===h||h,x=r.readonly,E=void 0!==x&&x,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,S=r.bold,C=void 0!==S&&S,W=A(r,$),q=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:q,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:v,slotProps:{input:{maxLength:c,readOnly:E,sx:{fontWeight:C?"bold":"",backgroundColor:E?w:""}}}},W))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,a=void 0===i?"white":i,l=t.backgroundColor,u=void 0===l?"#888888":l,c=t.paddingX,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,width:void 0===b?"auto":b,color:a,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,a=r.label,l=r.required,u=void 0!==l&&l,c=r.disabled,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,b=r.maxLength,x=void 0===b?255:b,E=r.autofocus,y=void 0!==E&&E,w=r.noOptionsText,S=void 0===w?"Δεν υπάρχουν επιλογές":w,C=r.showErrors,W=void 0===C||C,q=r.size,L=void 0===q?"medium":q,k=r.readonly,T=void 0!==k&&k,R=r.readonlyBackgroundColor,O=void 0===R?"#dddddd":R,P=r.bold,V=void 0!==P&&P,z=A(r,Q),j=Y(e.useState(null),2),F=j[0],K=j[1],B=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[p]===B}))||null)}),[B]);var D=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:D,rules:{required:u,disabled:s},render:function(r){var o=r.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:a,fullWidth:!0,required:u,slotProps:{input:{maxLength:x,readOnly:T,sx:{fontWeight:V?"bold":"",backgroundColor:T?O:""}}},value:F?F.label:""}):e.createElement(n,{value:F,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:S,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:x,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,autoFocus:y,size:L,error:W&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,z))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ae=function(r){var i=r.form,a=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,h=r.labelKey,b=void 0===h?"label":h,x=r.maxLength,E=void 0===x?255:x,y=r.autofocus,w=void 0!==y&&y,S=r.noOptionsText,C=void 0===S?"Δεν υπάρχουν επιλογές":S,W=r.showErrors,q=void 0===W||W,L=A(r,ie),k=Y(e.useState([]),2),T=k[0],R=k[1],O=i.watch(a);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,O)})))}),[O]);var P=i.control,V=i.formState.errors;return e.createElement(g,{name:a,control:P,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:c,disabled:d,autoFocus:w,inputProps:{maxLength:E},error:q&&Boolean(null===(n=V[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=V[a])||void 0===o?void 0:o.message)},r,L))}})}})},le=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,a=r.name,l=r.label,u=r.optionsUrl,c=r.renderOption,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,b=r.required,x=void 0!==b&&b,E=r.disabled,y=void 0!==E&&E,w=r.maxLength,S=void 0===w?255:w,W=r.autofocus,q=void 0!==W&&W,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,R=void 0===T?"Δεν υπάρχουν επιλογές":T,O=r.placeholder,P=void 0===O?"":O,V=r.size,z=void 0===V?"medium":V,j=r.onChange,F=void 0===j?null:j,K=r.showErrors,B=void 0===K||K,D=r.readonly,M=void 0!==D&&D,H=r.readonlyBackgroundColor,_=void 0===H?"#dddddd":H,U=r.bold,X=void 0!==U&&U,$=A(r,le),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,C.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(a,e),function(){t.apply(this,arguments)}()}}}));var ae=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(a)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,C.get("".concat(u,"?id=").concat(i.getValues(a)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,C.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),se=e.useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:x,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.value,M?e.createElement(t,{size:z,label:l,fullWidth:!0,required:x,slotProps:{input:{maxLength:S,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?_:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),F&&F(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},filterOptions:function(e){return e},noOptionsText:R,loadingText:k,loading:oe,required:x,size:z,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:x,disabled:y,autoFocus:q,placeholder:P,error:B&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:B&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:z,maxLength:S},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],se=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=A(r,ce),b=n.control,x=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=x[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f},h))}})},de=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,a=r.decimals,l=void 0===a?2:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s;r.autofocus;var m=r.showErrors,f=void 0===m||m,p=r.readonly,v=void 0!==p&&p,h=r.readonlyBackgroundColor,b=void 0===h?"#dddddd":h,x=r.bold,E=void 0!==x&&x,y=A(r,de),w=n.control,S=n.formState.errors,C=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:w,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(W,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:l,fixedDecimalScale:!0,allowNegative:!1,onValueChange:C,error:f&&Boolean(null===(n=S[o])||void 0===n?void 0:n.message),helperText:f&&(null===(a=S[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:v,sx:{fontWeight:E?"bold":"",backgroundColor:v?b:""}}}},y))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,x=void 0===b?15:b,E=t.secondsStep,y=void 0===E?30:E,w=A(t,fe),C=r.control,W=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,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(g,{name:n,control:C,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(k,{label:o,value:l.value?S(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:x,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:_(_({},w),{},{required:a,error:s&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=A(t,ve),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:m,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(R,{label:o,value:l.value?S(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:_(_({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,a=r.allowNegative,l=void 0!==a&&a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=A(r,be),b=n.control,x=n.formState.errors,E=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(W,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:v&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),helperText:v&&(null===(a=x[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},xe=["form","name","label","required","disabled","showErrors"],Ee=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=A(r,xe),v=Y(e.useState(),2),h=v[0],b=v[1],x=e.useRef(null),E=n.control,y=n.formState.errors,w=function(){x.current.value=null,x.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:E,rules:{required:c,disabled:d},render:function(r){var u,s,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:l,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(a,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(V,null))),readOnly:!0}},p))}}),e.createElement("input",{type:"file",ref:x,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,a=void 0!==i&&i,l=t.hoursStep,u=void 0===l?1:l,c=t.minutesStep,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,x=void 0!==b&&b;t.autofocus;var E=t.showErrors,y=void 0===E||E,w=A(t,ye),C=r.control,W=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:C,rules:{required:h,disabled:x},render:function(t){var r,i,l=t.field;return e.createElement(O,{label:o,value:l.value?S(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:_(_({},w),{},{required:h,error:y&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Se=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.maxLength,V=void 0===P?255:P,j=t.message,F=void 0===j?null:j,K=t.isLoading,B=void 0!==K&&K,D={text:a||""},I=y.object({text:W?y.string().max(V,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(V," χαρακτήρες")).required(L):y.string().max(V)}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(d,{sx:{mb:2}},F),e.createElement(X,{form:M,name:"text",label:i,required:W,autofocus:!0,maxLength:V,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Ce=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,We=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,j=t.maxLength,F=void 0===j?255:j,K=t.message,B=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={email:a||""},N=y.object({email:W?y.string().matches(Ce,T).required(L):y.string().matches(Ce,T)}),H=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(H.reset(M),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(d,{sx:{mb:2}},B),e.createElement(Z,{form:H,label:i,required:W,autofocus:!0,maxLength:F,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{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)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):O))))};!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 qe=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,a=void 0===i?"Επιλογή Χρώματος":i,u=t.color,d=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,x=t.paddingY,E=void 0===x?"10px":x,y=t.paddingX,S=void 0===y?"10px":y,C=t.okLabel,W=void 0===C?"ΚΑΤΑΧΩΡΗΣΗ":C,q=t.cancelLabel,L=void 0===q?"ΑΚΥΡΩΣΗ":q;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],R=k[1];e.useEffect((function(){r&&R(d)}),[r,d]);return e.createElement(l,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,a),e.createElement(f,null,e.createElement(s,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:S,paddingY:E,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return R(e.hex)}}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},W),e.createElement(v,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,S=void 0===w?[]:w,C=t.valueKey,W=void 0===C?"id":C,q=t.labelKey,L=void 0===q?"label":q,k=t.required,T=void 0===k||k,R=t.size,O=void 0===R?"sm":R,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,j=t.okLabel,F=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={field:a||null},_=y.object({field:T?y.string().required(V):y.string().nullable()}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},I&&"string"!=typeof I&&e.createElement(d,{sx:{mb:2}},I),e.createElement(ee,{form:A,name:"field",label:i,options:S,valueKey:W,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):F))))},ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=void 0===a?[]:a,g=t.onSubmit,w=t.onCancel,S=t.options,C=void 0===S?[]:S,W=t.valueKey,q=void 0===W?"id":W,L=t.labelKey,k=void 0===L?"label":L,T=t.required,R=void 0===T||T,O=t.size,P=void 0===O?"sm":O,V=t.requiredMessage,j=void 0===V?"Επιλέξτε τουλάχιστον μία τιμή":V,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,I=t.message,M=void 0===I?null:I,N=t.isLoading,H=void 0!==N&&N,_={field:b||[]},A=y.object({field:R?y.array().min(1,j):y.array()}),G=x({defaultValues:_,resolver:E(A)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ae,{form:G,name:"field",label:i,options:C,valueKey:q,labelKey:k,required:R,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):K))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,g=t.cancelText,x=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,w=t.type,S=void 0===w?"warning":w,C={warning:{color:"warning.main",icon:e.createElement(j,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(F,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(K,{sx:{fontSize:40}})}}[S]||{color:"primary.main",icon:null};return e.createElement(l,{open:r,onClose:function(e,t){"backdropClick"!==t&&a()},disableRestoreFocus:!0,slots:{transition:u},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(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(C.color,"20"),color:C.color,borderRadius:"50%",mb:2}},C.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},x),e.createElement(v,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===S?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Re=function(t){var n=t.open,o=t.title,i=t.label,a=t.message,b=void 0===a?null:a,g=t.value,w=t.onSubmit,S=t.onCancel,C=t.size,W=void 0===C?"sm":C,q=t.rows,L=void 0===q?5:q,k=t.required,T=void 0!==k&&k,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,j=t.cancelLabel,F=void 0===j?"ΑΚΥΡΩΣΗ":j,K=t.isLoading,B=void 0!==K&&K,D={notes:g||""},I=y.object({notes:T?y.string().required(O):y.string()}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,g]);return e.createElement(l,{fullWidth:!0,maxWidth:W,open:n,onClose:function(e,t){"escapeKeyDown"===t&&S()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),S()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):V))))},Oe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.minValue,L=void 0===q?null:q,k=t.maxValue,T=void 0===k?null:k,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,j=t.cancelLabel,F=void 0===j?"ΑΚΥΡΩΣΗ":j,K=t.message,B=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return W},then:function(e){return e.required(O)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),H=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(H.reset(M),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:H,name:"poso",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{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)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):V))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,F=void 0!==j&&j,K={datetime:a},B=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),D=x({defaultValues:K,resolver:E(B)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(pe,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{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)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,F=void 0!==j&&j,K={datetime:a},B=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),D=x({defaultValues:K,resolver:E(B)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(he,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{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)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},ze=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],je=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,u=t.onSubmit,s=t.onCancel,d=t.required,m=void 0===d||d,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,S=t.requiredMessage,C=void 0===S?"Υποχρεωτικό πεδίο":S,W=t.okLabel,q=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:a||null},R=y.object({field:m?y.boolean().required(C):y.boolean().nullable()}),O=x({defaultValues:T,resolver:E(R)});return e.useEffect((function(){n&&(O.clearErrors(),O.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,a]),e.createElement(l,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:O,name:"field",label:i,options:ze,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:O.handleSubmit((function(e){return u(e.field)}))},q),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Fe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.allowNegative,S=void 0!==w&&w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.size,T=void 0===k?"sm":k,R=t.minValue,O=void 0===R?null:R,P=t.maxValue,V=void 0===P?null:P,j=t.okLabel,F=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={num:re(a)?a:null},_=y.object({num:y.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!==O},then:function(e){return e.min(O,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(O))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==V},then:function(e){return e.max(V,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(V))},otherwise:function(e){return e}})}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:T,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.num)})),noValidate:!0},e.createElement(f,null,e.createElement(ge,{form:A,name:"num",label:i,required:W,autofocus:!0,allowNegative:S,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):F))))},Ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.decimals,g=void 0===b?2:b,w=t.minValue,S=void 0===w?null:w,C=t.maxValue,W=void 0===C?null:C,q=t.onSubmit,L=t.onCancel,k=t.size,T=void 0===k?"sm":k,R=t.required,O=void 0===R||R,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,j=t.okLabel,F=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={field:re(a)?a:null},_=y.object({field:y.number().when([],{is:function(e){return O},then:function(e){return e.required(V)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==S},then:function(e){return e.min(S,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(S,g)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==W},then:function(e){return e.max(W,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(W,g)))},otherwise:function(e){return e}})}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:T,open:n,onClose:function(e,t){"escapeKeyDown"===t&&L()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return q(e.field)})),noValidate:!0},e.createElement(f,null,e.createElement(me,{form:A,name:"field",label:i,decimals:g,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),L()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):F))))},Be=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,a=t.closeText,u=void 0===a?"ΟΚ":a;return e.createElement(l,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},De=function(t){var n=t.open,o=t.title,i=void 0===o?"Νέο Αρχείο":o,a=t.description,u=void 0===a||a,b=t.descriptionLabel,g=void 0===b?"Περιγραφή Αρχείου":b,w=t.descriptionRequiredMessage,S=void 0===w?"Παρακαλώ συμπληρώστε την περιγραφή του αρχείου":w,C=t.fileSelectLabel,W=void 0===C?"Επιλογή Αρχείου":C,q=t.maxFileName,L=void 0===q?255:q,k=t.onSubmit,T=t.onCancel,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,j=t.message,F=void 0===j?null:j,K=t.isLoading,B=void 0!==K&&K,D={descr:"",filename:null},I=y.object({descr:u?y.string().required(S).max(L,"Το πεδίο δεν πρέπει να υπερβαίνει τους ".concat(L," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n]);return e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:n,onClose:function(e,t){"escapeKeyDown"===t&&T()},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},i),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit(k),noValidate:!0},e.createElement(f,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(d,{sx:{mb:2}},F),e.createElement(s,{sx:{marginTop:2},gap:3},u&&e.createElement(X,{form:M,name:"descr",label:g,required:!0,autofocus:!0}),e.createElement(Ee,{form:M,name:"filename",label:W,required:!0}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),T()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):O))))},Ie=function(t){var n=t.open,o=t.title,i=t.label,a=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,S=t.valueKey,C=void 0===S?"id":S,W=t.labelKey,q=void 0===W?"label":W,L=t.required,k=void 0===L||L,T=t.size,R=void 0===T?"sm":T,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.minChars,j=void 0===V?1:V,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,I=t.message,M=void 0===I?null:I,N=t.isLoading,H=void 0!==N&&N,_={field:b||null},A=y.object({field:k?y.string().required(P):y.string().nullable()}),G=x({defaultValues:_,resolver:E(A)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:R,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:a,minChars:j,valueKey:C,labelKey:q,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):K))))},Me=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,F=void 0!==j&&j,K={datetime:a},B=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ώρας")}),D=x({defaultValues:K,resolver:E(B)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(we,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{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)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,S=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,C=t.onSubmit,W=t.onCancel,q=t.size,L=void 0===q?"sm":q,k=t.required,T=void 0!==k&&k,R=t.registrationNumberRequiredMessage,O=void 0===R?"Συμπληρώστε τον αριθμό πρωτοκόλλου":R,P=t.registrationDateRequiredMessage,V=void 0===P?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":P,j=t.okLabel,F=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.registrationNumberMaxLength,I=void 0===D?255:D,M=t.message,N=void 0===M?null:M,H=t.isLoading,_=void 0!==H&&H,A=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(O):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(V):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=x({defaultValues:A,resolver:E(G)});e.useEffect((function(){n&&(Y.reset(A),Y.clearErrors())}),[n,A]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&W()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return C(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:S,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),W()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):F))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Oe as CurrencyModalForm,Ve as DateModalForm,Pe as DatetimeModalForm,Ke as DecimalModalForm,We as EmailModalForm,Fe as IntegerModalForm,Be as MessageDialog,Re as NotesModalForm,qe as PickColorModalForm,Ne as RegistrationModalForm,De as SelectFileModalForm,Se as TextModalForm,Me as TimeModalForm,je as YesNoModalForm};
1
+ import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as a,Dialog as l,Zoom as u,DialogTitle as c,Stack as s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as x}from"react-hook-form";import{yupResolver as E}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as S}from"date-fns";import"date-fns/locale";import C from"axios";import{NumericFormat as W}from"react-number-format";import{AdapterDateFns as q}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as R,TimePicker as O}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as V,EditNoteRounded as z}from"@mui/icons-material";import j from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import F from"@mui/icons-material/CheckCircleOutlineRounded";function K(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 D(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){D(i,n,o,a,l,"next",e)}function l(e){D(i,n,o,a,l,"throw",e)}a(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=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},N.apply(null,arguments)}function H(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 _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function A(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 G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),l=new R(n||[]);return o(a,"_invoke",{value:q(e,r,l)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function x(){}var E={};c(E,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(O([])));w&&w!==r&&n.call(w,a)&&(E=w);var S=x.prototype=b.prototype=Object.create(E);function C(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function W(e,t){function r(o,i,a,l){var u=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function q(t,r,n){var o=m;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=L(l,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=x,o(S,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:g,configurable:!0}),g.displayName=c(x,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,c(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},C(W.prototype),c(W.prototype,l,(function(){return this})),t.AsyncIterator=W,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new W(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(S),c(S,u,"Generator"),c(S,a,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=O,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(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,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(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)?K(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 U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,x=r.readonlyBackgroundColor,E=void 0===x?"#dddddd":x,y=r.bold,w=void 0!==y&&y,S=A(r,U),C=n.control,W=n.formState.errors;return e.createElement(g,{name:o,control:C,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=W[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=W[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?E:""}}}},S))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,u=r.maxLength,c=void 0===u?255:u,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,h=r.showErrors,b=void 0===h||h,x=r.readonly,E=void 0!==x&&x,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,S=r.bold,C=void 0!==S&&S,W=A(r,$),q=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:q,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:v,slotProps:{input:{maxLength:c,readOnly:E,sx:{fontWeight:C?"bold":"",backgroundColor:E?w:""}}}},W))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,a=void 0===i?"white":i,l=t.backgroundColor,u=void 0===l?"#888888":l,c=t.paddingX,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,width:void 0===b?"auto":b,color:a,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,a=r.label,l=r.required,u=void 0!==l&&l,c=r.disabled,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,b=r.maxLength,x=void 0===b?255:b,E=r.autofocus,y=void 0!==E&&E,w=r.noOptionsText,S=void 0===w?"Δεν υπάρχουν επιλογές":w,C=r.showErrors,W=void 0===C||C,q=r.size,L=void 0===q?"medium":q,k=r.readonly,T=void 0!==k&&k,R=r.readonlyBackgroundColor,O=void 0===R?"#dddddd":R,P=r.bold,V=void 0!==P&&P,z=A(r,Q),j=Y(e.useState(null),2),B=j[0],F=j[1],K=o.watch(i);e.useEffect((function(){F(m.find((function(e){return e[p]===K}))||null)}),[K]);var D=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:D,rules:{required:u,disabled:s},render:function(r){var o=r.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:a,fullWidth:!0,required:u,slotProps:{input:{maxLength:x,readOnly:T,sx:{fontWeight:V?"bold":"",backgroundColor:T?O:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:S,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:x,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,autoFocus:y,size:L,error:W&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,z))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ae=function(r){var i=r.form,a=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,h=r.labelKey,b=void 0===h?"label":h,x=r.maxLength,E=void 0===x?255:x,y=r.autofocus,w=void 0!==y&&y,S=r.noOptionsText,C=void 0===S?"Δεν υπάρχουν επιλογές":S,W=r.showErrors,q=void 0===W||W,L=A(r,ie),k=Y(e.useState([]),2),T=k[0],R=k[1],O=i.watch(a);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,O)})))}),[O]);var P=i.control,V=i.formState.errors;return e.createElement(g,{name:a,control:P,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:c,disabled:d,autoFocus:w,inputProps:{maxLength:E},error:q&&Boolean(null===(n=V[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=V[a])||void 0===o?void 0:o.message)},r,L))}})}})},le=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,a=r.name,l=r.label,u=r.optionsUrl,c=r.renderOption,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,b=r.required,x=void 0!==b&&b,E=r.disabled,y=void 0!==E&&E,w=r.maxLength,S=void 0===w?255:w,W=r.autofocus,q=void 0!==W&&W,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,R=void 0===T?"Δεν υπάρχουν επιλογές":T,O=r.placeholder,P=void 0===O?"":O,V=r.size,z=void 0===V?"medium":V,j=r.onChange,B=void 0===j?null:j,F=r.showErrors,K=void 0===F||F,D=r.readonly,M=void 0!==D&&D,H=r.readonlyBackgroundColor,_=void 0===H?"#dddddd":H,U=r.bold,X=void 0!==U&&U,$=A(r,le),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,C.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(a,e),function(){t.apply(this,arguments)}()}}}));var ae=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(a)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,C.get("".concat(u,"?id=").concat(i.getValues(a)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,C.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),se=e.useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:x,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.value,M?e.createElement(t,{size:z,label:l,fullWidth:!0,required:x,slotProps:{input:{maxLength:S,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?_:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},filterOptions:function(e){return e},noOptionsText:R,loadingText:k,loading:oe,required:x,size:z,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:x,disabled:y,autoFocus:q,placeholder:P,error:K&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:K&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:z,maxLength:S},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],se=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,x=r.readonlyBackgroundColor,E=void 0===x?"#dddddd":x,y=r.bold,w=void 0!==y&&y,S=A(r,ce),C=n.control,W=n.formState.errors;return e.createElement(g,{name:o,control:C,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=W[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=W[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?E:""}}}},S))}})},de=["form","name","label","decimals","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,a=r.decimals,l=void 0===a?2:a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s;r.autofocus;var m=r.showErrors,f=void 0===m||m,p=r.readonly,v=void 0!==p&&p,h=r.readonlyBackgroundColor,b=void 0===h?"#dddddd":h,x=r.bold,E=void 0!==x&&x,y=A(r,de),w=n.control,S=n.formState.errors,C=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:w,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(W,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:l,fixedDecimalScale:!0,allowNegative:!1,onValueChange:C,error:f&&Boolean(null===(n=S[o])||void 0===n?void 0:n.message),helperText:f&&(null===(a=S[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:v,sx:{fontWeight:E?"bold":"",backgroundColor:v?b:""}}}},y))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,x=void 0===b?15:b,E=t.secondsStep,y=void 0===E?30:E,w=A(t,fe),C=r.control,W=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,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(g,{name:n,control:C,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(k,{label:o,value:l.value?S(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:x,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:_(_({},w),{},{required:a,error:s&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,s=void 0===c||c,d=A(t,ve),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:m,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(R,{label:o,value:l.value?S(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:_(_({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,a=r.allowNegative,l=void 0!==a&&a,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=A(r,be),b=n.control,x=n.formState.errors,E=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(W,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:v&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),helperText:v&&(null===(a=x[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},xe=["form","name","label","required","disabled","showErrors"],Ee=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=A(r,xe),v=Y(e.useState(),2),h=v[0],b=v[1],x=e.useRef(null),E=n.control,y=n.formState.errors,w=function(){x.current.value=null,x.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:E,rules:{required:c,disabled:d},render:function(r){var u,s,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:l,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(a,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(V,null))),readOnly:!0}},p))}}),e.createElement("input",{type:"file",ref:x,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,a=void 0!==i&&i,l=t.hoursStep,u=void 0===l?1:l,c=t.minutesStep,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,x=void 0!==b&&b;t.autofocus;var E=t.showErrors,y=void 0===E||E,w=A(t,ye),C=r.control,W=r.formState.errors;return e.createElement(L,{dateAdapter:q,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:C,rules:{required:h,disabled:x},render:function(t){var r,i,l=t.field;return e.createElement(O,{label:o,value:l.value?S(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:_(_({},w),{},{required:h,error:y&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Se=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.maxLength,V=void 0===P?255:P,j=t.message,B=void 0===j?null:j,F=t.isLoading,K=void 0!==F&&F,D={text:a||""},I=y.object({text:W?y.string().max(V,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(V," χαρακτήρες")).required(L):y.string().max(V)}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(d,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:W,autofocus:!0,maxLength:V,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):T))))},Ce=/^$|^(([^<>()\[\]\\.,;:\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,}))$/,We=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,j=t.maxLength,B=void 0===j?255:j,F=t.message,K=void 0===F?null:F,D=t.isLoading,I=void 0!==D&&D,M={email:a||""},N=y.object({email:W?y.string().matches(Ce,T).required(L):y.string().matches(Ce,T)}),H=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(H.reset(M),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(d,{sx:{mb:2}},K),e.createElement(Z,{form:H,label:i,required:W,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{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)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):O))))};!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 qe=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,a=void 0===i?"Επιλογή Χρώματος":i,u=t.color,d=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,x=t.paddingY,E=void 0===x?"10px":x,y=t.paddingX,S=void 0===y?"10px":y,C=t.okLabel,W=void 0===C?"ΚΑΤΑΧΩΡΗΣΗ":C,q=t.cancelLabel,L=void 0===q?"ΑΚΥΡΩΣΗ":q;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],R=k[1];e.useEffect((function(){r&&R(d)}),[r,d]);return e.createElement(l,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,a),e.createElement(f,null,e.createElement(s,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:S,paddingY:E,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return R(e.hex)}}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},W),e.createElement(v,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,S=void 0===w?[]:w,C=t.valueKey,W=void 0===C?"id":C,q=t.labelKey,L=void 0===q?"label":q,k=t.required,T=void 0===k||k,R=t.size,O=void 0===R?"sm":R,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,j=t.okLabel,B=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,F=t.cancelLabel,K=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={field:a||null},_=y.object({field:T?y.string().required(V):y.string().nullable()}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},I&&"string"!=typeof I&&e.createElement(d,{sx:{mb:2}},I),e.createElement(ee,{form:A,name:"field",label:i,options:S,valueKey:W,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):B))))},ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=void 0===a?[]:a,g=t.onSubmit,w=t.onCancel,S=t.options,C=void 0===S?[]:S,W=t.valueKey,q=void 0===W?"id":W,L=t.labelKey,k=void 0===L?"label":L,T=t.required,R=void 0===T||T,O=t.size,P=void 0===O?"sm":O,V=t.requiredMessage,j=void 0===V?"Επιλέξτε τουλάχιστον μία τιμή":V,B=t.okLabel,F=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,I=t.message,M=void 0===I?null:I,N=t.isLoading,H=void 0!==N&&N,_={field:b||[]},A=y.object({field:R?y.array().min(1,j):y.array()}),G=x({defaultValues:_,resolver:E(A)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ae,{form:G,name:"field",label:i,options:C,valueKey:q,labelKey:k,required:R,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):F))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,g=t.cancelText,x=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,w=t.type,S=void 0===w?"warning":w,C={warning:{color:"warning.main",icon:e.createElement(j,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(F,{sx:{fontSize:40}})}}[S]||{color:"primary.main",icon:null};return e.createElement(l,{open:r,onClose:function(e,t){"backdropClick"!==t&&a()},disableRestoreFocus:!0,slots:{transition:u},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(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(C.color,"20"),color:C.color,borderRadius:"50%",mb:2}},C.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},x),e.createElement(v,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===S?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Re=function(t){var n=t.open,o=t.title,i=t.label,a=t.message,b=void 0===a?null:a,g=t.value,w=t.onSubmit,S=t.onCancel,C=t.size,W=void 0===C?"sm":C,q=t.rows,L=void 0===q?5:q,k=t.required,T=void 0!==k&&k,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,j=t.cancelLabel,B=void 0===j?"ΑΚΥΡΩΣΗ":j,F=t.isLoading,K=void 0!==F&&F,D={notes:g||""},I=y.object({notes:T?y.string().required(O):y.string()}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,g]);return e.createElement(l,{fullWidth:!0,maxWidth:W,open:n,onClose:function(e,t){"escapeKeyDown"===t&&S()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),S()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):V))))},Oe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.minValue,L=void 0===q?null:q,k=t.maxValue,T=void 0===k?null:k,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,j=t.cancelLabel,B=void 0===j?"ΑΚΥΡΩΣΗ":j,F=t.message,K=void 0===F?null:F,D=t.isLoading,I=void 0!==D&&D,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return W},then:function(e){return e.required(O)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),H=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(H.reset(M),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:H,name:"poso",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):V))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,B=void 0!==j&&j,F={datetime:a},K=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),D=x({defaultValues:F,resolver:E(K)});e.useEffect((function(){n&&(D.reset(F),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(pe,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,B=void 0!==j&&j,F={datetime:a},K=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),D=x({defaultValues:F,resolver:E(K)});e.useEffect((function(){n&&(D.reset(F),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(he,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},ze=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],je=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,u=t.onSubmit,s=t.onCancel,d=t.required,m=void 0===d||d,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,S=t.requiredMessage,C=void 0===S?"Υποχρεωτικό πεδίο":S,W=t.okLabel,q=void 0===W?"ΚΑΤΑΧΩΡΗΣΗ":W,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:a||null},R=y.object({field:m?y.boolean().required(C):y.boolean().nullable()}),O=x({defaultValues:T,resolver:E(R)});return e.useEffect((function(){n&&(O.clearErrors(),O.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,a]),e.createElement(l,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:O,name:"field",label:i,options:ze,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:O.handleSubmit((function(e){return u(e.field)}))},q),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Be=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.allowNegative,S=void 0!==w&&w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.size,T=void 0===k?"sm":k,R=t.minValue,O=void 0===R?null:R,P=t.maxValue,V=void 0===P?null:P,j=t.okLabel,B=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,F=t.cancelLabel,K=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={num:re(a)?a:null},_=y.object({num:y.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!==O},then:function(e){return e.min(O,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(O))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==V},then:function(e){return e.max(V,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(V))},otherwise:function(e){return e}})}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:T,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.num)})),noValidate:!0},e.createElement(f,null,e.createElement(ge,{form:A,name:"num",label:i,required:W,autofocus:!0,allowNegative:S,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):B))))},Fe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.decimals,g=void 0===b?2:b,w=t.minValue,S=void 0===w?null:w,C=t.maxValue,W=void 0===C?null:C,q=t.onSubmit,L=t.onCancel,k=t.size,T=void 0===k?"sm":k,R=t.required,O=void 0===R||R,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,j=t.okLabel,B=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,F=t.cancelLabel,K=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,H={field:re(a)?a:null},_=y.object({field:y.number().when([],{is:function(e){return O},then:function(e){return e.required(V)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==S},then:function(e){return e.min(S,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(S,g)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==W},then:function(e){return e.max(W,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(W,g)))},otherwise:function(e){return e}})}),A=x({defaultValues:H,resolver:E(_)});e.useEffect((function(){n&&(A.reset(H),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:T,open:n,onClose:function(e,t){"escapeKeyDown"===t&&L()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return q(e.field)})),noValidate:!0},e.createElement(f,null,e.createElement(me,{form:A,name:"field",label:i,decimals:g,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),L()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):B))))},Ke=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,a=t.closeText,u=void 0===a?"ΟΚ":a;return e.createElement(l,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},De=function(t){var n=t.open,o=t.title,i=void 0===o?"Νέο Αρχείο":o,a=t.description,u=void 0===a||a,b=t.descriptionLabel,g=void 0===b?"Περιγραφή Αρχείου":b,w=t.descriptionRequiredMessage,S=void 0===w?"Παρακαλώ συμπληρώστε την περιγραφή του αρχείου":w,C=t.fileSelectLabel,W=void 0===C?"Επιλογή Αρχείου":C,q=t.maxFileName,L=void 0===q?255:q,k=t.onSubmit,T=t.onCancel,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,j=t.message,B=void 0===j?null:j,F=t.isLoading,K=void 0!==F&&F,D={descr:"",filename:null},I=y.object({descr:u?y.string().required(S).max(L,"Το πεδίο δεν πρέπει να υπερβαίνει τους ".concat(L," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),M=x({defaultValues:D,resolver:E(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n]);return e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:n,onClose:function(e,t){"escapeKeyDown"===t&&T()},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},i),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit(k),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(d,{sx:{mb:2}},B),e.createElement(s,{sx:{marginTop:2},gap:3},u&&e.createElement(X,{form:M,name:"descr",label:g,required:!0,autofocus:!0}),e.createElement(Ee,{form:M,name:"filename",label:W,required:!0}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),T()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):O))))},Ie=function(t){var n=t.open,o=t.title,i=t.label,a=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,S=t.valueKey,C=void 0===S?"id":S,W=t.labelKey,q=void 0===W?"label":W,L=t.required,k=void 0===L||L,T=t.size,R=void 0===T?"sm":T,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.minChars,j=void 0===V?1:V,B=t.okLabel,F=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,I=t.message,M=void 0===I?null:I,N=t.isLoading,H=void 0!==N&&N,_={field:b||null},A=y.object({field:k?y.string().required(P):y.string().nullable()}),G=x({defaultValues:_,resolver:E(A)});e.useEffect((function(){n&&(G.reset(_),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:R,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(d,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:a,minChars:j,valueKey:C,labelKey:q,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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(h,{size:20,sx:{color:"inherit"}}):F))))},Me=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,S=void 0===w?"sm":w,C=t.required,W=void 0===C||C,q=t.requiredMessage,L=void 0===q?"Υποχρεωτικό πεδίο":q,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,P=t.message,V=void 0===P?null:P,j=t.isLoading,B=void 0!==j&&j,F={datetime:a},K=y.object({datetime:W?y.date().typeError("Μη έγκυρη μορφή ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ώρας")}),D=x({defaultValues:F,resolver:E(K)});e.useEffect((function(){n&&(D.reset(F),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:S,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(we,{form:D,name:"datetime",label:i,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(v,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,S=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,C=t.onSubmit,W=t.onCancel,q=t.size,L=void 0===q?"sm":q,k=t.required,T=void 0!==k&&k,R=t.registrationNumberRequiredMessage,O=void 0===R?"Συμπληρώστε τον αριθμό πρωτοκόλλου":R,P=t.registrationDateRequiredMessage,V=void 0===P?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":P,j=t.okLabel,B=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,F=t.cancelLabel,K=void 0===F?"ΑΚΥΡΩΣΗ":F,D=t.registrationNumberMaxLength,I=void 0===D?255:D,M=t.message,N=void 0===M?null:M,H=t.isLoading,_=void 0!==H&&H,A=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(O):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(V):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=x({defaultValues:A,resolver:E(G)});e.useEffect((function(){n&&(Y.reset(A),Y.clearErrors())}),[n,A]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&W()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(z,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return C(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:S,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),W()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Oe as CurrencyModalForm,Ve as DateModalForm,Pe as DatetimeModalForm,Fe as DecimalModalForm,We as EmailModalForm,Be as IntegerModalForm,Ke as MessageDialog,Re as NotesModalForm,qe as PickColorModalForm,Ne as RegistrationModalForm,De as SelectFileModalForm,Se as TextModalForm,Me as TimeModalForm,je as YesNoModalForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as a,Stack as l,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 V,toDate as P}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 K}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as M,renderDigitalClockTimeView as N,DatePicker as B,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,a,l=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(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,a=r.maxLength,l=void 0===a?255:a,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,a,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===(a=w[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:l,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,a=r.label,l=void 0===a?"E-mail":a,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,a=r.field,s=a.onChange,d=a.onBlur,m=a.value;return e.createElement(t,Z({required:u,label:l,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","readonly","readonlyBackgroundColor","bold"],ae=function(n){var o=n.form,i=n.name,a=n.label,l=n.required,s=void 0!==l&&l,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.readonly,T=void 0!==q&&q,R=n.readonlyBackgroundColor,k=void 0===R?"#dddddd":R,I=n.bold,F=void 0!==I&&I,V=X(n,ie),P=ee(e.useState(null),2),j=P[0],D=P[1],O=o.watch(i);e.useEffect((function(){D(m.find((function(e){return e[v]===O}))||null)}),[O]);var K=o.control,M=o.formState.errors;return e.createElement(L,{name:i,control:K,rules:{required:s,disabled:d},render:function(n){var o=n.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:z,label:a,fullWidth:!0,required:s,slotProps:{input:{maxLength:b,readOnly:T,sx:{fontWeight:F?"bold":"",backgroundColor:T?k:""}}},value:j?j.label:""}):e.createElement(r,{value:j,required:s,onChange:function(e,t){return l(t?t[v]:null)},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:F?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,Z({label:a,required:s,disabled:d,autoFocus:E,size:z,error:w&&Boolean(null===(n=M[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=M[i])||void 0===o?void 0:o.message)},r,V))}})}})},le=function(e){return null==e||""===e},se=function(e){return null!=e&&""!==e},ce=function(e){return le(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(!le(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(V(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,a=o.name,l=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(a);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:a,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:l,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:C&&Boolean(null===(n=F[a])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=F[a])||void 0===o?void 0:o.message)},r,z))}})}})},ve=["form","name","label","rows","required","disabled","autofocus","showErrors"],pe=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,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,ve),g=n.control,b=n.formState.errors;return e.createElement(L,{name:o,control:g,rules:{required:c,disabled:u},render:function(r){var n,a,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:l,maxRows:l,onChange:d,onBlur:m,error:p&&Boolean(null===(n=b[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(a=b[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:u,autoFocus:f},x))}})},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,a=r.decimals,l=void 0===a?2:a,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,a,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:l,fixedDecimalScale:!0,allowNegative:!1,onValueChange:W,error:f&&Boolean(null===(n=S[o])||void 0===n?void 0:n.message),helperText:f&&(null===(a=S[o])||void 0===a?void 0:a.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,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l;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(K,{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:a,disabled:s},render:function(t){var r,i,l=t.field;return e.createElement(M,{label:o,value:l.value?P(l.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 l.onChange(e)},viewRenderers:v?{hours:N}:null,timeSteps:{hours:x,minutes:b,seconds:E},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:Q(Q({},y),{},{required:a,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,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l;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(K,{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:a,disabled:s},render:function(t){var r,i,l=t.field;return e.createElement(B,{label:o,value:l.value?P(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:Q(Q({},u),{},{required:a,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,a=r.allowNegative,l=void 0!==a&&a,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,a,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:l,onValueChange:h,error:p&&Boolean(null===(n=b[o])||void 0===n?void 0:n.message),helperText:p&&(null===(a=b[o])||void 0===a?void 0:a.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,a=void 0!==i&&i,l=t.hoursStep,s=void 0===l?1:l,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(K,{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,l=t.field;return e.createElement(H,{label:o,value:l.value?P(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:N}: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,V=void 0===F?255:F,P=t.message,j=void 0===P?null:P,D=t.isLoading,O=void 0!==D&&D,K={text:x||""},M=I.object({text:W?I.string().max(V,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(V," χαρακτήρες")).required(C):I.string().max(V)}),N=R({defaultValues:K,resolver:k(M)});e.useEffect((function(){r&&(N.reset(K),N.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(a,{sx:{pb:1.5}},e.createElement(l,{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:N.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:N,name:"text",label:p,required:W,autofocus:!0,maxLength:V,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,V=void 0===F?"ΑΚΥΡΩΣΗ":F,P=t.maxLength,j=void 0===P?255:P,D=t.message,O=void 0===D?null:D,K=t.isLoading,M=void 0!==K&&K,N={email:x||""},B=I.object({email:W?I.string().matches(qe,q).required(C):I.string().matches(qe,q)}),H=R({defaultValues:N,resolver:k(B)});e.useEffect((function(){r&&(H.reset(N),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(a,{sx:{pb:1.5}},e.createElement(l,{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}},V),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)"}}},M?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,V=void 0===F?"Υποχρεωτικό πεδίο":F,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,K=t.message,M=void 0===K?null:K,N=t.isLoading,B=void 0!==N&&N,H={field:x||null},A=I.object({field:q?I.string().required(V):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(a,{sx:{pb:1.5}},e.createElement(l,{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:U.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ae,{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)"}}},B?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,V=t.requiredMessage,P=void 0===V?"Επιλέξτε τουλάχιστον μία τιμή":V,j=t.okLabel,D=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,O=t.cancelLabel,K=void 0===O?"ΑΚΥΡΩΣΗ":O,M=t.message,N=void 0===M?null:M,B=t.isLoading,H=void 0!==B&&B,A={field:g||[]},U=I.object({field:T?I.array().min(1,P):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(a,{sx:{pb:1.5}},e.createElement(l,{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:_.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(s,{sx:{mb:2}},N),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}},K),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,l=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(a,{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}},l)),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,V=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,P=t.cancelLabel,j=void 0===P?"ΑΚΥΡΩΣΗ":P,D=t.isLoading,O=void 0!==D&&D,K={notes:b||""},M=I.object({notes:q?I.string().required(L):I.string()}),N=R({defaultValues:K,resolver:k(M)});e.useEffect((function(){r&&(N.reset(K),N.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(a,{sx:{pb:1.5}},e.createElement(l,{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:N.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:N,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"}}):V))))},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,V=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,P=t.cancelLabel,j=void 0===P?"ΑΚΥΡΩΣΗ":P,D=t.message,O=void 0===D?null:D,K=t.isLoading,M=void 0!==K&&K,N={poso:se(x)?x:null},B=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:N,resolver:k(B)});e.useEffect((function(){r&&(H.reset(N),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(a,{sx:{pb:1.5}},e.createElement(l,{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)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):V))))},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,V=void 0===F?null:F,P=t.isLoading,j=void 0!==P&&P,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),K=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(K.reset(D),K.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(a,{sx:{pb:1.5}},e.createElement(l,{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),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:K.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(he,{form:K,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))))},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,V=void 0===F?null:F,P=t.isLoading,j=void 0!==P&&P,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(C):I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),K=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(K.reset(D),K.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(a,{sx:{pb:1.5}},e.createElement(l,{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),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:K.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(ye,{form:K,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,V=void 0===F?null:F,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,K=t.message,M=void 0===K?null:K,N=t.isLoading,B=void 0!==N&&N,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!==V},then:function(e){return e.max(V,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(V))},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(a,{sx:{pb:1.5}},e.createElement(l,{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: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)"}}},B?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,V=void 0===F?"Υποχρεωτικό πεδίο":F,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,K=t.message,M=void 0===K?null:K,N=t.isLoading,B=void 0!==N&&N,H={field:se(x)?x:null},A=I.object({field:I.number().when([],{is:function(e){return L},then:function(e){return e.required(V)},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(a,{sx:{pb:1.5}},e.createElement(l,{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: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)"}}},B?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,V=void 0===F?null:F,P=t.isLoading,j=void 0!==P&&P,D={datetime:x},O=I.object({datetime:W?I.date().typeError("Μη έγκυρη μορφή ώρας").required(C):I.date().typeError("Μη έγκυρη μορφή ώρας")}),K=R({defaultValues:D,resolver:k(O)});e.useEffect((function(){r&&(K.reset(D),K.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(a,{sx:{pb:1.5}},e.createElement(l,{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),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:K.handleSubmit((function(e){return g(e.datetime)})),noValidate:!0},e.createElement(u,null,V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(Ce,{form:K,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))))},Ke=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,V=void 0===F?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":F,P=t.okLabel,j=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,D=t.cancelLabel,O=void 0===D?"ΑΚΥΡΩΣΗ":D,K=t.registrationNumberMaxLength,M=void 0===K?255:K,N=t.message,B=void 0===N?null:N,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(M,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(M," χαρακτήρες")).required(L):I.string().max(M,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(M," χαρακτήρες")),registration_date:q?I.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(V):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(a,{sx:{pb:1.5}},e.createElement(l,{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),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return y(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(l,{direction:"column",spacing:2.5},e.createElement(re,{form:Y,name:"registration_number",label:b,required:q,autofocus:!0,maxLength:M,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))))},Me=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=ee(e.useState(!1),2),P=V[0],j=V[1],D=!o&&b,O=ee(e.useState(!1),2),K=O[0],M=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(l,{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}})):a||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:P,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){M(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:K}))},Ne=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=ee(e.useState(!1),2),P=V[0],j=V[1],D=!o&&b,O=ee(e.useState(!1),2),K=O[0],M=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(l,{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}})):a||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:P,title:C,label:r,value:o,required:b,maxLength:L,onSubmit:function(e){M(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:K}))},Be=function(t){var r,o=t.label,i=t.value,a=t.render,s=void 0===a?null:a,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,P=ee(e.useState(!1),2),D=P[0],O=P[1],K=!i&&h,M=ee(e.useState(!1),2),N=M[0],B=M[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(l,{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(V(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:K?"contained":"outlined",color:K?"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(Ve,{open:D,title:z,label:o,value:i,required:h,onSubmit:function(e){B(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){B(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:N}))},He=function(t){var r=t.label,o=t.value,i=t.render,a=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],V=I[1],P=!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(l,{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}})):a||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:P?"contained":"outlined",color:P?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),V(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),k&&e.createElement(d,{component:"li"}),e.createElement(Pe,{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),V(!1)}})},onCancel:function(){return V(!1)},message:L,isLoading:D}))},Ae=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=ee(e.useState(!1),2),P=V[0],j=V[1],D=!o&&b,O=ee(e.useState(!1),2),K=O[0],M=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(l,{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}})):a||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:P,title:C,label:r,value:o,required:b,rows:L,onSubmit:function(e){M(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),j(!1)}})},onCancel:function(){return j(!1)},message:k,isLoading:K}))},Ue=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=t.message,P=void 0===V?null:V,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),K=O[0],M=O[1],N=null==o&&q,B=ee(e.useState(!1),2),H=B[0],A=B[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(l,{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}})):a||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:N?"contained":"outlined",color:N?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Le,{open:K,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),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))},_e=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,a=t.fieldName,l=void 0===a?null:a,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),V=F[0],P=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(){P(!0),y.put(q,{field:l,value:n?0:1},{preserveScroll:!0,onFinish:function(){P(!1),I(!1)}})},onCancel:function(){return I(!1)},isLoading:V}))},Ye=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=t.message,P=void 0===V?null:V,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),K=O[0],M=O[1],N=q&&(!Array.isArray(o)||!o.length),B=ee(e.useState(!1),2),H=B[0],A=B[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?a||e.createElement(c,{variant:"body1",fontWeight:500},U||L):e.createElement(l,{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:N?"contained":"outlined",color:N?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!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:K,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),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))},$e=function(t){var r=t.label,o=t.exists,i=void 0!==o&&o,a=t.fileName,s=void 0===a?null:a,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,V=void 0===F?null:F,P=t.hasDivider,j=void 0===P||P,D=!i&&w,O=ee(e.useState(!1),2),K=O[0],M=O[1],N=ee(e.useState(!1),2),B=N[0],H=N[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(l,{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(l,{direction:"row",spacing:1},i&&V&&e.createElement(f,{size:"small",variant:"outlined",color:"error",onClick:function(e){e.currentTarget.blur(),H(!0)},disabled:K,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&&(M(!0),y.post(i?I:R,{file:t},{forceFormData:!0,preserveScroll:!0,onFinish:function(){M(!1),e.target.value=""}}))},style:{display:"none"}}),e.createElement(ke,{open:B,title:"Επιβεβαίωση Διαγραφής",message:"Να διαγραφεί το επιλεγμένο αρχείο;",onConfirm:function(){M(!0),y.delete(V,{preserveScroll:!0,onFinish:function(){M(!1),H(!1)}})},onCancel:function(){return H(!1)}}))},Ge=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=t.hasDivider,P=void 0===V||V,j=ee(e.useState(!1),2),D=j[0],O=j[1],K=(null==o||""===o)&&b,M=ee(e.useState(!1),2),N=M[0],B=M[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&&!K?e.createElement(l,{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}})):a||e.createElement(c,{variant:"body1",fontWeight:500},K?E:ce(o))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},K?"Συμπλήρωση":"Επεξεργασία")))),P&&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){B(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){B(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:N}))},Ze=function(t){var r=t.title,n=t.children,o=t.sx,i=void 0===o?{}:o,a=t.titleBgColor,l=void 0===a?"rgba(25, 118, 210, 0.08)":a,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)},e.createElement(s,{sx:{px:2,py:1.5,bgcolor:l}},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,a=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,V=t.message,P=void 0===V?null:V,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),K=O[0],M=O[1],N=(!i||!a)&&C,B=ee(e.useState(!1),2),H=B[0],A=B[1],U=i&&a?"".concat(i,"/").concat(ue(a,"-")):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&&a?b||e.createElement(c,{variant:"body1",fontWeight:500},U):e.createElement(l,{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:N?"contained":"outlined",color:N?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i||a?"Επεξεργασία":"Συμπλήρωση")))),D&&e.createElement(d,{component:"li"}),e.createElement(Ke,{open:K,title:L,registrationNumberLabel:u,registrationDateLabel:v,registrationNumber:i,registrationDate:a,required:C,registrationNumberMaxLength:F,registrationNumberRequiredMessage:"Συμπληρώστε τον αριθμό πρωτοκόλλου",registrationDateRequiredMessage:"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου",onSubmit:function(e){A(!0),y.put(k,e,{preserveScroll:!0,onFinish:function(){A(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))},Qe=function(t){var r,o=t.label,i=t.value,a=t.render,s=void 0===a?null:a,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,P=ee(e.useState(!1),2),D=P[0],O=P[1],K=!i&&h,M=ee(e.useState(!1),2),N=M[0],B=M[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(l,{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(V(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:K?"contained":"outlined",color:K?"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){B(!0),y.put(T,{field:m,value:e},{preserveScroll:!0,onFinish:function(){B(!1),O(!1)}})},onCancel:function(){return O(!1)},message:R,isLoading:N}))},Xe=function(t){var r=t.label,o=t.value,i=t.render,a=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,V=t.hasDivider,P=void 0===V||V,j=ee(e.useState(!1),2),D=j[0],O=j[1],K=(null==o||""===o)&&b,M=ee(e.useState(!1),2),N=M[0],B=M[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&&K?e.createElement(l,{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}})):a||e.createElement(c,{variant:"body1",fontWeight:500},K?E:o)),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},K?"Συμπλήρωση":"Επεξεργασία")))),P&&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){B(!0),y.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){B(!1),O(!1)}})},onCancel:function(){return O(!1)},message:F,isLoading:N}))},et=function(t){var r=t.label,o=t.value,i=t.decimals,a=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,V=t.message,P=void 0===V?null:V,j=t.hasDivider,D=void 0===j||j,O=ee(e.useState(!1),2),K=O[0],M=O[1],N=(null==o||""===o)&&E,B=ee(e.useState(!1),2),H=B[0],A=B[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&&N?e.createElement(l,{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},N?C:de(o,a))),e.createElement(g,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},b&&e.createElement(f,{size:"small",variant:N?"contained":"outlined",color:N?"error":"primary",startIcon:e.createElement(w,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},N?"Συμπλήρωση":"Επεξεργασία")))),D&&e.createElement(d,{component:"li"}),e.createElement(De,{open:K,title:q,label:r,value:o,decimals:a,required:E,minValue:k,maxValue:F,onSubmit:function(e){A(!0),y.put(L,{field:v,value:e},{preserveScroll:!0,onFinish:function(){A(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))};export{Ye as AutocompleteMultiProperty,Ue as AutocompleteProperty,Ge as CurrencyProperty,He as DateProperty,Be as DateTimeProperty,et as DecimalProperty,Ne as EmailProperty,$e as FileProperty,Xe as IntegerProperty,Ze as PropertyGroup,Je as RegistrationProperty,Me 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","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.readonly,T=void 0!==q&&q,R=n.readonlyBackgroundColor,k=void 0===R?"#dddddd":R,I=n.bold,F=void 0!==I&&I,P=X(n,ie),V=ee(e.useState(null),2),j=V[0],D=V[1],O=o.watch(i);e.useEffect((function(){D(m.find((function(e){return e[v]===O}))||null)}),[O]);var B=o.control,K=o.formState.errors;return e.createElement(L,{name:i,control:B,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:z,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:b,readOnly:T,sx:{fontWeight:F?"bold":"",backgroundColor:T?k:""}}},value:j?j.label:""}):e.createElement(r,{value:j,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[x]},size:z,slotProps:{input:{maxLength:b,sx:{fontWeight:F?"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=K[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:w&&(null===(o=K[i])||void 0===o?void 0:o.message)},r,P))}})}})},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)&&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: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)},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};