@zydon/common 1.1.53 → 1.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/hook-form/Autocomplete/index.d.ts.map +1 -1
- package/dist/components/hook-form/Autocomplete/props.d.ts +4 -1
- package/dist/components/hook-form/Autocomplete/props.d.ts.map +1 -1
- package/dist/{features-faf2f167.js → features-1e2cb893.js} +1 -1
- package/dist/{index-ddaa4960.js → index-b5a4992a.js} +13 -10
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Autocomplete/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8B7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BaseField } from '../../../types/baseField';
|
|
2
2
|
import { BaseAutoComplete } from '../../../types/autoComplete';
|
|
3
|
-
|
|
3
|
+
import { Option } from '../../../types/option';
|
|
4
|
+
export type AutocompleteProps = BaseField<BaseAutoComplete> & {
|
|
5
|
+
onSelectOption?(value: NonNullable<string | Option> | (string | Option)[] | null | undefined): void;
|
|
6
|
+
};
|
|
4
7
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Autocomplete/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/Autocomplete/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,gBAAgB,CAAC,GAAG;IAC5D,cAAc,CAAC,CACb,KAAK,EACD,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAC5B,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACnB,IAAI,GACJ,SAAS,GACZ,IAAI,CAAC;CACT,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-
|
|
1
|
+
import { f as D, n as L, r as En, c as jn, i as K, a as jt, s as Xs, b as It, d as xt, e as In, g as Ot, h as it, p as ot, j as On, k as Zs, w as Nt, l as z, m as B, t as Vt, o as Js, q as rt, u as St, v as Qs, x as ti, y as ei, z as ni, A as Nn, B as ne, C as Un, D as Gn, E as yt, P as si, F as ii, L as oi, S as ri, G as Kt, H as zt, I as ke, J as se, K as ai, M as $n, N as li, O as ci, Q as Kn, R as zn, T as ui, U as hi, V as fi, W as di, X as pi, Y as mi, Z as gi, _ as yi, $ as vi, a0 as xi } from "./index-b5a4992a.js";
|
|
2
2
|
import Hn, { useContext as ie, useId as Pi, useEffect as Ti } from "react";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "@emotion/react";
|
|
@@ -5612,7 +5612,7 @@ const A6 = (t, e, n) => {
|
|
|
5612
5612
|
...r,
|
|
5613
5613
|
children: n
|
|
5614
5614
|
}
|
|
5615
|
-
), N6 = () => import("./features-
|
|
5615
|
+
), N6 = () => import("./features-1e2cb893.js").then((t) => t.default), w6 = ({ children: t }) => /* @__PURE__ */ O.jsx(p5, { strict: !0, features: N6, children: /* @__PURE__ */ O.jsxs(Dr.div, { style: { height: "100%" }, children: [
|
|
5616
5616
|
" ",
|
|
5617
5617
|
t,
|
|
5618
5618
|
" "
|
|
@@ -107073,23 +107073,26 @@ const G1e = (t = !1) => {
|
|
|
107073
107073
|
name: t,
|
|
107074
107074
|
helperText: e,
|
|
107075
107075
|
rules: n,
|
|
107076
|
-
|
|
107076
|
+
onSelectOption: r,
|
|
107077
|
+
...i
|
|
107077
107078
|
}) => {
|
|
107078
|
-
const { control:
|
|
107079
|
+
const { control: a } = ln();
|
|
107079
107080
|
return /* @__PURE__ */ O.jsx(
|
|
107080
107081
|
_n,
|
|
107081
107082
|
{
|
|
107082
107083
|
name: t,
|
|
107083
|
-
control:
|
|
107084
|
+
control: a,
|
|
107084
107085
|
rules: n,
|
|
107085
|
-
render: ({ field:
|
|
107086
|
+
render: ({ field: o, fieldState: { error: s } }) => /* @__PURE__ */ O.jsx(
|
|
107086
107087
|
xD,
|
|
107087
107088
|
{
|
|
107088
|
-
...
|
|
107089
|
-
...
|
|
107090
|
-
onChange: (
|
|
107091
|
-
|
|
107092
|
-
|
|
107089
|
+
...o,
|
|
107090
|
+
...i,
|
|
107091
|
+
onChange: (l) => {
|
|
107092
|
+
r && r(l), o.onChange(l);
|
|
107093
|
+
},
|
|
107094
|
+
error: !!s,
|
|
107095
|
+
helperText: (s == null ? void 0 : s.message) || e
|
|
107093
107096
|
}
|
|
107094
107097
|
)
|
|
107095
107098
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aD as m, a1 as p, aE as c, aF as v, aH as C, aI as k, a2 as S, a3 as F, a4 as P, a5 as A, a6 as I, a7 as g, aJ as T, aK as M, aL as E, a8 as h, aZ as D, a9 as B, aa as N, aM as f, ab as x, a$ as w, aN as y, ac as L, aO as R, b0 as U, ad as G, ae as H, af as O, ag as V, aP as W, ah as z, ai as q, aQ as K, bl as Q, aj as j, ak as J, al as Z, b2 as X, b3 as Y, b1 as _, aG as $, av as aa, aw as sa, ax as ea, ay as ra, am as oa, aR as ta, aS as ia, ao as na, an as ba, aT as la, ap as da, aU as ua, aq as ma, ar as pa, bm as ca, bn as va, as as Ca, aV as ka, b4 as Sa, at as Fa, a_ as Pa, au as Aa, aW as Ia, bo as ga, az as Ta, aA as Ma, aY as Ea, aB as ha, aC as Da, aX as Ba, bp as Na, bH as fa, bq as xa, bE as wa, bF as ya, bG as La, bO as Ra, bM as Ua, bL as Ga, bI as Ha, bJ as Oa, bs as Va, bt as Wa, bu as za, bv as qa, bw as Ka, bx as Qa, by as ja, bD as Ja, bC as Za, bz as Xa, br as Ya, bA as _a, bB as $a, bN as as, bK as ss, bi as es, bj as rs, bk as os, bb as ts, be as is, b6 as ns, b8 as bs, bd as ls, b5 as ds, bc as us, ba as ms, b9 as ps, bg as cs, bh as vs, bf as Cs, b7 as ks } from "./index-
|
|
1
|
+
import { aD as m, a1 as p, aE as c, aF as v, aH as C, aI as k, a2 as S, a3 as F, a4 as P, a5 as A, a6 as I, a7 as g, aJ as T, aK as M, aL as E, a8 as h, aZ as D, a9 as B, aa as N, aM as f, ab as x, a$ as w, aN as y, ac as L, aO as R, b0 as U, ad as G, ae as H, af as O, ag as V, aP as W, ah as z, ai as q, aQ as K, bl as Q, aj as j, ak as J, al as Z, b2 as X, b3 as Y, b1 as _, aG as $, av as aa, aw as sa, ax as ea, ay as ra, am as oa, aR as ta, aS as ia, ao as na, an as ba, aT as la, ap as da, aU as ua, aq as ma, ar as pa, bm as ca, bn as va, as as Ca, aV as ka, b4 as Sa, at as Fa, a_ as Pa, au as Aa, aW as Ia, bo as ga, az as Ta, aA as Ma, aY as Ea, aB as ha, aC as Da, aX as Ba, bp as Na, bH as fa, bq as xa, bE as wa, bF as ya, bG as La, bO as Ra, bM as Ua, bL as Ga, bI as Ha, bJ as Oa, bs as Va, bt as Wa, bu as za, bv as qa, bw as Ka, bx as Qa, by as ja, bD as Ja, bC as Za, bz as Xa, br as Ya, bA as _a, bB as $a, bN as as, bK as ss, bi as es, bj as rs, bk as os, bb as ts, be as is, b6 as ns, b8 as bs, bd as ls, b5 as ds, bc as us, ba as ms, b9 as ps, bg as cs, bh as vs, bf as Cs, b7 as ks } from "./index-b5a4992a.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "@emotion/react";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -316,4 +316,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=F,M=j),$===void 0&&(
|
|
|
316
316
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function OAe(t){if(Array.isArray(t))return eT(t)}function T5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function C5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?T5(Object(n),!0).forEach(function(r){O5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function O5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lu(t,e){return AAe(t)||RAe(t,e)||x5(t,e)||xAe()}function xAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
317
317
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x5(t,e){if(t){if(typeof t=="string")return eT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eT(t,e)}}function eT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function RAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function AAe(t){if(Array.isArray(t))return t}var NAe="file-invalid-type",wAe="file-too-large",IAe="file-too-small",DAe="too-many-files",MAe=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:NAe,message:"File type must be ".concat(n)}},R5=function(e){return{code:wAe,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},A5=function(e){return{code:IAe,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},kAe={code:DAe,message:"Too many files"};function N5(t,e){var n=t.type==="application/x-moz-file"||yAe(t,e);return[n,n?null:MAe(e)]}function w5(t,e,n){if(po(t.size))if(po(e)&&po(n)){if(t.size>n)return[!1,R5(n)];if(t.size<e)return[!1,A5(e)]}else{if(po(e)&&t.size<e)return[!1,A5(e)];if(po(n)&&t.size>n)return[!1,R5(n)]}return[!0,null]}function po(t){return t!=null}function PAe(t){var e=t.files,n=t.accept,r=t.minSize,i=t.maxSize,a=t.multiple,o=t.maxFiles,s=t.validator;return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(function(l){var c=N5(l,n),u=lu(c,1),d=u[0],f=w5(l,r,i),p=lu(f,1),h=p[0],m=s?s(l):null;return d&&h&&!m})}function ch(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function uh(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function I5(t){t.preventDefault()}function LAe(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function FAe(t){return t.indexOf("Edge/")!==-1}function BAe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return LAe(t)||FAe(t)}function ci(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];return e.some(function(s){return!ch(r)&&s&&s.apply(void 0,[r].concat(a)),ch(r)})}}function UAe(){return"showOpenFilePicker"in window}function GAe(t){if(po(t)){var e=Object.entries(t).filter(function(n){var r=lu(n,2),i=r[0],a=r[1],o=!0;return D5(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(a)||!a.every(M5))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=lu(r,2),a=i[0],o=i[1];return C5(C5({},n),{},O5({},a,o))},{});return[{description:"Files",accept:e}]}return t}function $Ae(t){if(po(t))return Object.entries(t).reduce(function(e,n){var r=lu(n,2),i=r[0],a=r[1];return[].concat(y5(e),[i],y5(a))},[]).filter(function(e){return D5(e)||M5(e)}).join(",")}function qAe(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function VAe(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function D5(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function M5(t){return/^.*\.[\w]+$/.test(t)}var YAe=["children"],HAe=["open"],zAe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],WAe=["refKey","onChange","onClick"];function jAe(t){return XAe(t)||QAe(t)||k5(t)||KAe()}function KAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
318
318
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QAe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function XAe(t){if(Array.isArray(t))return nT(t)}function tT(t,e){return eNe(t)||JAe(t,e)||k5(t,e)||ZAe()}function ZAe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
319
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k5(t,e){if(t){if(typeof t=="string")return nT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nT(t,e)}}function nT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function JAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function eNe(t){if(Array.isArray(t))return t}function P5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?P5(Object(n),!0).forEach(function(r){rT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dh(t,e){if(t==null)return{};var n=tNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var iT=A.forwardRef(function(t,e){var n=t.children,r=dh(t,YAe),i=fh(r),a=i.open,o=dh(i,HAe);return A.useImperativeHandle(e,function(){return{open:a}},[a]),A.createElement(A.Fragment,null,n(jt(jt({},o),{},{open:a})))});iT.displayName="Dropzone";var L5={disabled:!1,getFilesFromEvent:pAe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};iT.defaultProps=L5,iT.propTypes={children:te.func,accept:te.objectOf(te.arrayOf(te.string)),multiple:te.bool,preventDropOnDocument:te.bool,noClick:te.bool,noKeyboard:te.bool,noDrag:te.bool,noDragEventsBubbling:te.bool,minSize:te.number,maxSize:te.number,maxFiles:te.number,disabled:te.bool,getFilesFromEvent:te.func,onFileDialogCancel:te.func,onFileDialogOpen:te.func,useFsAccessApi:te.bool,autoFocus:te.bool,onDragEnter:te.func,onDragLeave:te.func,onDragOver:te.func,onDrop:te.func,onDropAccepted:te.func,onDropRejected:te.func,onError:te.func,validator:te.func};var aT={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fh(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jt(jt({},L5),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,o=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,p=e.onDropAccepted,h=e.onDropRejected,m=e.onFileDialogCancel,g=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,S=e.preventDropOnDocument,v=e.noClick,E=e.noKeyboard,T=e.noDrag,y=e.noDragEventsBubbling,C=e.onError,N=e.validator,R=A.useMemo(function(){return $Ae(n)},[n]),x=A.useMemo(function(){return GAe(n)},[n]),w=A.useMemo(function(){return typeof g=="function"?g:F5},[g]),D=A.useMemo(function(){return typeof m=="function"?m:F5},[m]),k=A.useRef(null),P=A.useRef(null),G=A.useReducer(nNe,aT),F=tT(G,2),j=F[0],$=F[1],M=j.isFocused,I=j.isFileDialogActive,L=A.useRef(typeof window<"u"&&window.isSecureContext&&_&&UAe()),U=function(){!L.current&&I&&setTimeout(function(){if(P.current){var be=P.current.files;be.length||($({type:"closeDialog"}),D())}},300)};A.useEffect(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[P,I,D,L]);var Y=A.useRef([]),V=function(be){k.current&&k.current.contains(be.target)||(be.preventDefault(),Y.current=[])};A.useEffect(function(){return S&&(document.addEventListener("dragover",I5,!1),document.addEventListener("drop",V,!1)),function(){S&&(document.removeEventListener("dragover",I5),document.removeEventListener("drop",V))}},[k,S]),A.useEffect(function(){return!r&&b&&k.current&&k.current.focus(),function(){}},[k,b,r]);var B=A.useCallback(function(de){C?C(de):console.error(de)},[C]),q=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[].concat(jAe(Y.current),[de.target]),uh(de)&&Promise.resolve(i(de)).then(function(be){if(!(ch(de)&&!y)){var We=be.length,X=We>0&&PAe({files:be,accept:R,minSize:o,maxSize:a,multiple:s,maxFiles:l,validator:N}),z=We>0&&!X;$({isDragAccept:X,isDragReject:z,isDragActive:!0,type:"setDraggedFiles"}),c&&c(de)}}).catch(function(be){return B(be)})},[i,c,B,y,R,o,a,s,l,N]),W=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=uh(de);if(be&&de.dataTransfer)try{de.dataTransfer.dropEffect="copy"}catch{}return be&&d&&d(de),!1},[d,y]),K=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=Y.current.filter(function(X){return k.current&&k.current.contains(X)}),We=be.indexOf(de.target);We!==-1&&be.splice(We,1),Y.current=be,!(be.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(de)&&u&&u(de))},[k,u,y]),Z=A.useCallback(function(de,be){var We=[],X=[];de.forEach(function(z){var oe=N5(z,R),ae=tT(oe,2),Re=ae[0],$e=ae[1],Le=w5(z,o,a),ue=tT(Le,2),pe=ue[0],De=ue[1],Ie=N?N(z):null;if(Re&&pe&&!Ie)We.push(z);else{var Ne=[$e,De];Ie&&(Ne=Ne.concat(Ie)),X.push({file:z,errors:Ne.filter(function(Ke){return Ke})})}}),(!s&&We.length>1||s&&l>=1&&We.length>l)&&(We.forEach(function(z){X.push({file:z,errors:[kAe]})}),We.splice(0)),$({acceptedFiles:We,fileRejections:X,type:"setFiles"}),f&&f(We,X,be),X.length>0&&h&&h(X,be),We.length>0&&p&&p(We,be)},[$,s,R,o,a,l,f,p,h,N]),le=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[],uh(de)&&Promise.resolve(i(de)).then(function(be){ch(de)&&!y||Z(be,de)}).catch(function(be){return B(be)}),$({type:"reset"})},[i,Z,B,y]),ne=A.useCallback(function(){if(L.current){$({type:"openDialog"}),w();var de={multiple:s,types:x};window.showOpenFilePicker(de).then(function(be){return i(be)}).then(function(be){Z(be,null),$({type:"closeDialog"})}).catch(function(be){qAe(be)?(D(be),$({type:"closeDialog"})):VAe(be)?(L.current=!1,P.current?(P.current.value=null,P.current.click()):B(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):B(be)});return}P.current&&($({type:"openDialog"}),w(),P.current.value=null,P.current.click())},[$,w,D,_,Z,B,x,s]),Ee=A.useCallback(function(de){!k.current||!k.current.isEqualNode(de.target)||(de.key===" "||de.key==="Enter"||de.keyCode===32||de.keyCode===13)&&(de.preventDefault(),ne())},[k,ne]),_e=A.useCallback(function(){$({type:"focus"})},[]),fe=A.useCallback(function(){$({type:"blur"})},[]),Se=A.useCallback(function(){v||(BAe()?setTimeout(ne,0):ne())},[v,ne]),Te=function(be){return r?null:be},re=function(be){return E?null:Te(be)},ee=function(be){return T?null:Te(be)},me=function(be){y&&be.stopPropagation()},he=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.role,z=de.onKeyDown,oe=de.onFocus,ae=de.onBlur,Re=de.onClick,$e=de.onDragEnter,Le=de.onDragOver,ue=de.onDragLeave,pe=de.onDrop,De=dh(de,zAe);return jt(jt(rT({onKeyDown:re(ci(z,Ee)),onFocus:re(ci(oe,_e)),onBlur:re(ci(ae,fe)),onClick:Te(ci(Re,Se)),onDragEnter:ee(ci($e,q)),onDragOver:ee(ci(Le,W)),onDragLeave:ee(ci(ue,K)),onDrop:ee(ci(pe,le)),role:typeof X=="string"&&X!==""?X:"presentation"},We,k),!r&&!E?{tabIndex:0}:{}),De)}},[k,Ee,_e,fe,Se,q,W,K,le,E,T,r]),ie=A.useCallback(function(de){de.stopPropagation()},[]),Ue=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.onChange,z=de.onClick,oe=dh(de,WAe),ae=rT({accept:R,multiple:s,type:"file",style:{display:"none"},onChange:Te(ci(X,le)),onClick:Te(ci(z,ie)),tabIndex:-1},We,P);return jt(jt({},ae),oe)}},[P,n,s,le,r]);return jt(jt({},j),{},{isFocused:M&&!r,getRootProps:he,getInputProps:Ue,rootRef:k,inputRef:P,open:Te(ne)})}function nNe(t,e){switch(e.type){case"focus":return jt(jt({},t),{},{isFocused:!0});case"blur":return jt(jt({},t),{},{isFocused:!1});case"openDialog":return jt(jt({},aT),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return jt(jt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return jt({},aT);default:return t}}function F5(){}const rNe=["pdf"],iNe=["txt"],aNe=["psd"],oNe=["doc","docx"],sNe=["xls","xlsx"],lNe=["zip","rar","iso"],cNe=["ai","esp"],uNe=["ppt","pptx"],dNe=["wav","aif","mp3","aac"],fNe=["jpg","jpeg","gif","bmp","png","svg"],pNe=["m4v","avi","mpg","mp4","webm"],fr=t=>`/assets/icons/files/${t}.svg`;function B5(t){let e;switch(t==null?void 0:t.includes(jn(t))){case iNe.includes(jn(t)):e="txt";break;case lNe.includes(jn(t)):e="zip";break;case dNe.includes(jn(t)):e="audio";break;case fNe.includes(jn(t)):e="image";break;case pNe.includes(jn(t)):e="video";break;case oNe.includes(jn(t)):e="word";break;case sNe.includes(jn(t)):e="excel";break;case uNe.includes(jn(t)):e="powerpoint";break;case rNe.includes(jn(t)):e="pdf";break;case aNe.includes(jn(t)):e="photoshop";break;case cNe.includes(jn(t)):e="illustrator";break;default:e=jn(t)}return e}function hNe(t){let e;switch(B5(t)){case"folder":e=fr("ic_folder");break;case"txt":e=fr("ic_txt");break;case"zip":e=fr("ic_zip");break;case"audio":e=fr("ic_audio");break;case"video":e=fr("ic_video");break;case"word":e=fr("ic_word");break;case"excel":e=fr("ic_excel");break;case"powerpoint":e=fr("ic_power_point");break;case"pdf":e=fr("ic_pdf");break;case"photoshop":e=fr("ic_pts");break;case"illustrator":e=fr("ic_ai");break;case"image":e=fr("ic_img");break;default:e=fr("ic_file")}return e}function jn(t=""){return t&&t.split(".").pop()||""}function mNe(t){return t.split("/").pop()}function oT(t){return typeof t=="string"?{key:t,preview:t,name:mNe(t),type:jn(t)}:{key:t.preview,name:t.name,size:t.size,path:t.path,type:t.type,preview:t.preview,lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate}}const U5=({onDownload:t})=>{const e=Ra();return O.jsx(H.IconButton,{onClick:t,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:e.transitions.create("opacity"),"&:hover":{opacity:1,...sh({opacity:.64,color:e.palette.grey[900]})}},children:O.jsx(Ct,{icon:"eva:arrow-circle-down-fill",width:24})})},G5=({file:t,tooltip:e,imageView:n,onDownload:r,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:l=""}=oT(t),c=B5(s||l),u=c==="image"&&n?O.jsx(H.Box,{component:"img",src:l,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):O.jsx(H.Box,{component:"img",src:hNe(c),sx:{width:32,height:32,flexShrink:0,...i}});return e?O.jsx(H.Tooltip,{title:o,children:O.jsxs(H.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[u,r&&O.jsx(U5,{onDownload:r})]})}):O.jsxs(O.Fragment,{children:[u,r&&O.jsx(U5,{onDownload:r})]})},$5=({fileRejections:t})=>t.length?O.jsx(H.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:e=>ye(e.palette.error.main,.08),borderColor:e=>ye(e.palette.error.main,.24)},children:t.map(({file:e,errors:n})=>{const{path:r,size:i}=oT(e);return O.jsxs(H.Box,{sx:{my:1},children:[O.jsxs(H.Typography,{variant:"subtitle2",noWrap:!0,children:[r," - ",i?qS(i):""]}),n.map(a=>O.jsxs(H.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},r)})}):null,gNe=({thumbnail:t,files:e,onRemove:n,sx:r})=>e!=null&&e.length?O.jsx(Y1,{initial:!1,children:e.map(i=>{const{key:a,name:o="",size:s=0}=oT(i),l=typeof i=="string";return t?O.jsxs(H.Stack,{component:Cr.div,...il().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx(G5,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),n&&O.jsx(H.IconButton,{size:"small",onClick:()=>n(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:c=>ye(c.palette.common.white,.72),bgcolor:c=>ye(c.palette.grey[900],.48),"&:hover":{bgcolor:c=>ye(c.palette.grey[900],.72)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:16})})]},a):O.jsxs(H.Stack,{component:Cr.div,...il().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx(G5,{file:i}),O.jsxs(H.Stack,{flexGrow:1,sx:{minWidth:0},children:[O.jsx(H.Typography,{variant:"subtitle2",noWrap:!0,children:l?i:o}),O.jsx(H.Typography,{variant:"caption",sx:{color:"text.secondary"},children:l?"":qS(s)})]}),n&&O.jsx(H.IconButton,{edge:"end",size:"small",onClick:()=>n(i),children:O.jsx(Ct,{icon:"eva:close-fill"})})]},a)})}):null,_Ne=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(H.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx(yf,{alt:"file preview",src:e,sx:{borderRadius:1,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},bNe=qt("div")(({theme:t})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:t.spacing(5),borderRadius:t.shape.borderRadius,transition:t.transitions.create("padding"),backgroundColor:t.palette.background.neutral,border:`1px dashed ${ye(t.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),vNe=({header:t,description:e,sx:n,...r})=>O.jsxs(H.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...r,children:[O.jsx(ame,{sx:{width:220}}),O.jsxs("div",{children:[t||O.jsx(H.Typography,{gutterBottom:!0,variant:"h5",children:"Soltar ou selecionar arquivos"}),e||O.jsxs(H.Typography,{variant:"body2",sx:{color:"text.secondary"},children:["Solte os arquivos aqui ou clique",O.jsx(H.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})]})]}),q5=({id:t,disabled:e,multiple:n=!1,error:r,helperText:i,file:a,onDelete:o,files:s,thumbnail:l,onUpload:c,onRemove:u,onRemoveAll:d,sx:f,dropZoneProps:p,placeholderProps:h,placeholderAlt:m,image:g,tabIndex:_,...b})=>{const{getRootProps:S,getInputProps:v,isDragActive:E,isDragReject:T,fileRejections:y}=fh({multiple:n,disabled:e,...b}),C=!!a&&!n||g,N=s&&n&&s.length>0,R=T||!!r;return O.jsxs(H.Box,{sx:{width:1,position:"relative",...f},children:[O.jsxs(bNe,{...S(),sx:{...E&&{opacity:.72},...R&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...e&&{opacity:.48,pointerEvents:"none"},...p},children:[O.jsx("input",{...v(),id:t,tabIndex:_}),m?O.jsx(H.Stack,{sx:{...C&&{opacity:0}},children:m}):O.jsx(vNe,{sx:{...C&&{opacity:0}},header:h==null?void 0:h.title,description:h==null?void 0:h.description}),C&&O.jsx(_Ne,{file:a||g||""})]}),i&&i,O.jsx($5,{fileRejections:y}),C&&o&&O.jsx(H.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>ye(x.palette.common.white,.8),bgcolor:x=>ye(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>ye(x.palette.grey[900],.48)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:18})}),N&&O.jsxs(O.Fragment,{children:[O.jsx(H.Box,{sx:{my:3},children:O.jsx(gNe,{files:s,thumbnail:l,onRemove:u})}),O.jsxs(H.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[d&&O.jsx(H.Button,{color:"inherit",variant:"outlined",size:"small",onClick:d,children:"Remove all"}),c&&O.jsx(H.Button,{size:"small",variant:"contained",onClick:c,children:"Upload files"})]})]})]})},ENe=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(yf,{alt:"avatar",src:e,sx:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},SNe=qt("div")(({theme:t})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${ye(t.palette.grey[500],.32)}`})),yNe=qt("div")(({theme:t})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:t.palette.text.disabled,backgroundColor:t.palette.background.neutral,transition:t.transitions.create("opacity",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.shorter})})),V5=({error:t,file:e,image:n,disabled:r,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:l,getInputProps:c,isDragActive:u,isDragReject:d,fileRejections:f}=fh({multiple:!1,disabled:r,...s}),p=!!e||n,h=d||!!t;return O.jsxs(O.Fragment,{children:[O.jsxs(SNe,{...l(),sx:{...u&&{opacity:.72},...h&&{borderColor:"error.light",...p&&{bgcolor:"error.lighter"}},...r&&{opacity:.48,pointerEvents:"none"},...p&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[O.jsx("input",{...c(),tabIndex:o}),p&&O.jsx(ENe,{file:e||n||""}),O.jsxs(yNe,{className:"placeholder",sx:{"&:hover":{opacity:.72},...p&&{zIndex:9,opacity:0,color:"common.white",bgcolor:m=>ye(m.palette.grey[900],.64)},...h&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(Ct,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),O.jsx(H.Typography,{variant:"caption",children:e?"Update photo":"Upload photo"})]})]}),i&&i,O.jsx($5,{fileRejections:f})]})},TNe=qt("div")(({theme:t})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:t.spacing(.5),color:t.palette.text.disabled,borderRadius:t.shape.borderRadius,border:`dashed 1px ${t.palette.divider}`,backgroundColor:ye(t.palette.grey[500],.08),"&:hover":{opacity:.72}})),CNe=({placeholderAlt:t,error:e,disabled:n,sx:r,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:l,isDragReject:c}=fh({disabled:n,...a}),u=c||e;return O.jsxs(TNe,{...o(),sx:{...l&&{opacity:.72},...u&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...r},children:[O.jsx("input",{...s(),tabIndex:i}),t||O.jsx(Ct,{icon:"eva:cloud-upload-fill",width:28})]})},ONe=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function Y5(t){return t*Math.PI/180}function xNe(t,e,n){const r=Y5(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function RNe(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await ONe(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=Y5(n),{width:l,height:c}=xNe(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,f)=>{a.toBlob(p=>{d(p)},"image/png")})}const H5=(t=!1)=>{const[e,n]=A.useState(t),r=A.useCallback(()=>n(i=>!i),[]);return[e,r,n]},z5=({onFileCropped:t,onImageUploaded:e,onCancel:n,image:r})=>{const i=A.useId(),[a,o,s]=H5(),[l,c]=A.useState({x:0,y:0}),[u,d]=A.useState(1),f=A.useRef();return{id:i,crop:l,setCrop:c,zoom:u,setZoom:d,fileRef:f,onCropComplete:async(_,b)=>{try{const S=await RNe(r,b,0);f.current=new File([S],"image.png",{type:S.type})}catch{t(void 0)}},saveChanges:()=>{t(f.current),o()},cancelChanges:()=>{n&&n(),s(!1)},handleRemove:()=>{t(void 0),e(void 0),c({x:0,y:0}),d(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},W5=({id:t,open:e,onClose:n,label:r,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:l,width:c},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h})=>O.jsx(XP,{open:e,onClose:n,dialogTitle:r,actions:O.jsxs(O.Fragment,{children:[O.jsx(H.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(H.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:O.jsxs(H.Stack,{gap:2,children:[O.jsx(RP,{image:{width:c,height:l,aspect:s,imgSrc:o},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h}),O.jsxs(H.Stack,{gap:1.5,children:[O.jsxs(H.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[O.jsx(H.Typography,{variant:"body1",children:"Zoom"}),O.jsx(H.Slider,{value:d,onChange:(m,g)=>h(Array.isArray(g)?g[0]:g),min:1,max:5,size:"medium",step:.5})]}),O.jsxs(H.Stack,{direction:"row",gap:2,children:[O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"ic:outline-image-search",color:Q_.main}),component:"label",htmlFor:t,children:"Alterar"})]})]})]})}),ANe=H.styled(H.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),NNe=H.styled(H.Stack)(({theme:t})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:H.alpha(t.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),wNe=H.styled(H.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),j5=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E,toggleCropModalOpen:T}=z5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(ANe,{children:[s&&O.jsx(mf,{}),O.jsx(q5,{...u,id:d,file:l,onDrop:y=>{if(y.length>0){v(!0),E(1),S({x:0,y:0});const C=new FileReader;C.addEventListener("load",()=>{var R;const N=((R=C.result)==null?void 0:R.toString())||"";e(N),t(void 0)}),C.readAsDataURL(y[0])}},image:o,tabIndex:c}),(l||o)&&O.jsxs(NNe,{className:"actions",children:[O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:g,children:"Remover"}),O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"ic:outline-image",color:Q_.main}),onClick:T,children:"Editar"})]})]}),O.jsx(W5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},K5=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:a,fieldState:{error:o}})=>O.jsx(mg,{...a,...r,onChange:s=>a.onChange(s),error:!!o,helperText:(o==null?void 0:o.message)||e})})},ho=({name:t,helperText:e,rules:n,onChange:r,tabIndex:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:n,render:({field:{ref:s,...l},fieldState:{error:c}})=>O.jsx(H.TextField,{...l,onChange:u=>{l.onChange(u),r&&r(u)},inputRef:s,fullWidth:!0,error:!!c,helperText:(c==null?void 0:c.message)||e,...a,inputProps:{...a.inputProps,tabIndex:i}})})},Q5=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>O.jsx(QS,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},INe=({name:t,containerProps:e,required:n,rules:r,tabIndex:i})=>{const a=`${t}.zipCode`,o=`${t}.publicPlace`,s=`${t}.number`,l=`${t}.district`,c=`${t}.complement`,u=`${t}.state`,d=`${t}.city`,f=p=>{p.key==="Enter"&&p.preventDefault()};return O.jsxs(H.Stack,{gap:1.5,...e,children:[O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(Q5,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.CircularProgress,{size:24})})},rules:r,onKeyDown:f,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),O.jsxs(H.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(ho,{name:o,label:"Logradouro",onKeyDown:f,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),O.jsx(ho,{name:s,label:"Número",onKeyDown:f,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(ho,{name:l,label:"Bairro",onKeyDown:f,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),O.jsx(ho,{name:c,label:"Complemento",onKeyDown:f,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),O.jsxs(H.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(K5,{name:u,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:i}),O.jsx(ho,{name:d,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:i})]})]})},DNe=({name:t,helperText:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,render:({field:a,fieldState:{error:o}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{...a,checked:a.value,tabIndex:n}),...r}),(!!o||e)&&O.jsx(H.FormHelperText,{error:!!o,children:o?o==null?void 0:o.message:e})]})})},MNe=({row:t,name:e,label:n,options:r,spacing:i,helperText:a,...o})=>{const{control:s}=Xe.useFormContext(),l=(c,u)=>c.includes(u)?c.filter(d=>d!==u):[...c,u];return O.jsx(Xe.Controller,{name:e,control:s,render:({field:c,fieldState:{error:u}})=>O.jsxs(H.FormControl,{component:"fieldset",children:[n&&O.jsx(H.FormLabel,{component:"legend",sx:{typography:"body2"},children:n}),O.jsx(H.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:i||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:i||2}}}},children:r.map(d=>O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{checked:c.value.includes(d.value),onChange:()=>c.onChange(l(c.value,d.value))}),label:d.label,...o},d.value))}),(!!u||a)&&O.jsx(H.FormHelperText,{error:!!u,sx:{mx:0},children:u?u==null?void 0:u.message:a})]})})},kNe=typeof window<"u"?A.useLayoutEffect:A.useEffect;function sT(t,e,n,r){const i=A.useRef(e);kNe(()=>{i.current=e},[e]),A.useEffect(()=>{const a=(n==null?void 0:n.current)||window;if(!(a&&a.addEventListener))return;const o=s=>i.current(s);return a.addEventListener(t,o,r),()=>{a.removeEventListener(t,o)}},[t,n,r])}const PNe=({keyName:t,inputs:e=[],rules:n,tabIndex:r,...i})=>{const a=A.useRef(null),{control:o,setValue:s,formState:{errors:l}}=Xe.useFormContext(),c=f=>{const p=f.clipboardData.getData("text").split("");e.map((h,m)=>s(h,p[m])),f.preventDefault()},u=(f,p)=>{const{maxLength:h,value:m,name:g}=f.target,_=g.replace(t,""),b=Number(_),S=document.querySelector(`input[name=${t}${b+1}]`);m.length>h&&(f.target.value=m[0]),m.length>=h&&b<6&&S!==null&&S.focus(),p(f)};sT("paste",c,a);const d=e.some(f=>l[f]);return O.jsxs(H.Stack,{children:[O.jsx(H.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:e.map((f,p)=>O.jsx(Xe.Controller,{name:`${t}${p+1}`,control:o,rules:n,render:({field:h,fieldState:{error:m}})=>O.jsx(H.TextField,{...i,...h,autoComplete:"none",error:!!m,autoFocus:p===0,placeholder:"-",onChange:g=>{u(g,h.onChange)},onFocus:g=>g.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:r}})},f))}),d&&O.jsx(H.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},LNe=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:{...e,validate:{...e==null?void 0:e.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>O.jsx(rw,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},FNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.DatePicker,{inputRef:a,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},BNe=({name:t,label:e,rules:n,tabIndex:r,...i})=>{const{control:a,setError:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:{value:s,onChange:l},fieldState:{error:c}})=>O.jsx(rl.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...i.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:u=>l({startDate:u[0],endDate:u[1]}),onError:u=>{o(t,{message:u[0]||u[1]||void 0})},...i,slotProps:{textField:({position:u})=>{var d;return{...(d=i.slotProps)==null?void 0:d.textField,error:!!c,helperText:c==null?void 0:c.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:u==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`,inputProps:{tabIndex:r}}}},sx:{width:1}})})},UNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:a,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},GNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onBlur:o,onChange:s,value:l},fieldState:{error:c}})=>O.jsx(uP,{id:`quill${a}`,onBlur:o,onChange:(u,d,f,p)=>s(p.getLength()===1?"":u),value:l,error:!!c,helperText:(c==null?void 0:c.message)||e,...r})})},$Ne=({id:t,children:e,onSubmit:n,methods:r,...i})=>O.jsx(Xe.FormProvider,{...r,children:O.jsx(H.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,...i,children:e})}),qNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,value:o,...s},fieldState:{error:l}})=>O.jsx(zS,{value:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||e,...r,...s,name:t})})},VNe=({name:t,helperText:e,rules:n,onChange:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(Df,{...o,onChange:l=>{o.onChange(l),r&&r(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...i})})},YNe=({name:t,sx:e,rules:n,passwordSize:r,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:l}=Xe.useFormContext(),c=l(t),[u,d]=A.useState(!1),{hasNumberChar:f,hasSpecialCharacter:p,hasUpperCaseChar:h,isLengthValid:m}=Ff(c,r,o,i,a);return O.jsx(ho,{...s,name:t,type:u?"text":"password",InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.IconButton,{onClick:()=>d(!u),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(Ct,{icon:u?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:g=>{const _=Ff(g,r,o,i,a);return!_.hasNumberChar||!_.hasSpecialCharacter||!_.hasUpperCaseChar||!_.isLengthValid?"Senha inválida":!0}}},sx:{...e,"& .MuiFormHelperText-root":{display:!p||!h||!m||!f?"none":void 0}}})},HNe=({name:t,rules:e,row:n,label:r,options:i,spacing:a,helperText:o,decorated:s,onChange:l,tabIndex:c,...u})=>{const{control:d}=Xe.useFormContext(),f=r?`${t}-${r}`:"";return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:p,fieldState:{error:h}})=>O.jsxs(H.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[r&&O.jsx(H.FormLabel,{component:"legend",id:f,sx:{typography:"body2"},children:r}),O.jsx(H.RadioGroup,{...p,onChange:(m,g)=>{p.onChange(m),l&&l(m,g)},"aria-labelledby":f,row:n,...u,children:i.map(m=>O.jsx(H.FormControlLabel,{value:m.value,control:O.jsx(H.Radio,{inputProps:{tabIndex:c}}),label:m.label,sx:({palette:g})=>({"&:not(:last-of-type)":{mb:a||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${H.alpha(g.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...p.value===m.value&&{borderColor:"primary.main",backgroundColor:H.alpha(g.primary.main,.05)}}})},m.value))}),(!!h||o)&&O.jsx(H.FormHelperText,{error:!!h,sx:{mx:0},children:h?h==null?void 0:h.message:o})]})})},zNe=({name:t,rules:e,...n})=>{const{control:r}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:r,rules:e,render:({field:{onChange:i,onBlur:a,value:o},fieldState:{error:s}})=>O.jsx(o5,{onChange:i,onBlur:a,value:o,...n,error:!!s,helperText:s==null?void 0:s.message})})},WNe=({name:t,helperText:e,onChange:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Switch,{...o,checked:o.value,onChange:(l,c)=>{o.onChange(l),n&&n(l,c)},inputProps:{tabIndex:r}}),...i}),(!!s||e)&&O.jsx(H.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:e})]})})},jNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.TimePicker,{ampm:!1,format:"HH:mm",inputRef:a,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})};function X5(t,e){const{watch:n,setValue:r}=Xe.useFormContext(),[i,a]=A.useState(e),o=n(t)||[];return{uploadFile:async f=>{if(!f){r(t,void 0),a(void 0);return}r(t,f),a(Object.assign(f,{preview:URL.createObjectURL(f)}))},uploadFiles:async f=>{r(t,[...o,...f.map(p=>Object.assign(p,{preview:URL.createObjectURL(p)}))])},handleDeleteFile:()=>{r(t,void 0),a(void 0)},handleRemoveAll:()=>{r(t,void 0)},handleRemove:f=>{const p=o.filter(h=>h!==f);r(t,p)},file:i,setFileValue:a}}const KNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=X5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(j5,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},QNe=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E}=z5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(H.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&O.jsx(wNe,{}),O.jsx(V5,{...u,id:d,file:l,onDrop:T=>{if(T.length>0){v(!0),E(1),S({x:0,y:0});const y=new FileReader;y.addEventListener("load",()=>{var N;const C=((N=y.result)==null?void 0:N.toString())||"";e(C),t(void 0)}),y.readAsDataURL(T[0])}},image:o,tabIndex:c})]}),O.jsx(W5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},XNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=X5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(QNe,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},ZNe=()=>{const[t,e]=A.useState(!1),[n,r]=A.useState(document.activeElement);return A.useEffect(()=>{const i=o=>r(o.target),a=()=>r(null);return window.addEventListener("focus",i,!0),window.addEventListener("blur",a,!0),e(!0),()=>{window.removeEventListener("focus",i),window.removeEventListener("blur",a)}},[]),{activeElement:n,listenersReady:t}};function JNe(){const[t,e]=A.useState(null);return{copiedText:t,copy:async r=>{if(!(navigator!=null&&navigator.clipboard))return!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch{return e(null),!1}}}}const ewe=({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}={page:0,perPage:25})=>{const o=Mi.useGridApiRef(),[s,l]=A.useState({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}),c=({pageSize:m=25,page:g=0})=>{l(_=>({..._,page:g,perPage:m}))},u=m=>l(g=>({...g,page:0,search:m})),d=m=>l(g=>({...g,searchValue:m})),f=()=>l(m=>({...m,page:0,search:m.searchValue})),p=(m,g)=>l(_=>({..._,sort:m,dir:g})),h=()=>{o.current.setPage(0),c({page:0})};return{...s,apiRef:o,page:s.page||0,perPage:s.perPage||25,handlePaginationModelChange:c,handleSearch:u,handleSort:p,handleSearchValue:d,applySearchValue:f,goToPageFirstPage:h}},twe=(t,e)=>Hve(t,e),nwe=t=>{const e=A.useRef();return twe(t,e.current)||(e.current=t),e.current},rwe=(t,e)=>{A.useEffect(t,e.map(nwe))},iwe=()=>{const t=A.useRef(!0);return t.current?(t.current=!1,!0):t.current};function awe(t=""){const[e,n]=A.useState(t);return{currentTab:e,onChangeTab:(r,i)=>{n(i)},setCurrentTab:n}}function owe({items:t,itemsPerPage:e}){const[n,r]=A.useState(1),i=Math.ceil(t.length/e),a=t.slice((n-1)*e,n*e);return{currentPage:n,totalPages:i,currentItems:a,goToPage:c=>{c>0&&c<=i&&r(c)},nextPage:()=>{n<i&&r(c=>c+1)},prevPage:()=>{n>1&&r(c=>c-1)}}}const swe=(t,e,n="mousedown")=>{sT(n,r=>{const i=t==null?void 0:t.current;!i||i.contains(r.target)||e(r)})},lwe=Object.freeze(Object.defineProperty({__proto__:null,downloadFile:(t,e,n)=>{const r=`data:application/octet-stream;base64,${n}`,i=document.createElement("a"),a=`${t.replace(e,"")}.${e}`;i.href=r,i.download=a,i.click()}},Symbol.toStringTag,{value:"Module"}));function cwe(t){return $_({},t)}var Z5=1440,uwe=2520,lT=43200,dwe=86400;function fwe(t,e,n){var r,i;Ce(2,arguments);var a=Nr(),o=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:a.locale)!==null&&r!==void 0?r:sf;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var s=ms(t,e);if(isNaN(s))throw new RangeError("Invalid time value");var l=$_(cwe(n),{addSuffix:!!(n!=null&&n.addSuffix),comparison:s}),c,u;s>0?(c=Oe(e),u=Oe(t)):(c=Oe(t),u=Oe(e));var d=lw(u,c),f=(gs(u)-gs(c))/1e3,p=Math.round((d-f)/60),h;if(p<2)return n!=null&&n.includeSeconds?d<5?o.formatDistance("lessThanXSeconds",5,l):d<10?o.formatDistance("lessThanXSeconds",10,l):d<20?o.formatDistance("lessThanXSeconds",20,l):d<40?o.formatDistance("halfAMinute",0,l):d<60?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",1,l):p===0?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",p,l);if(p<45)return o.formatDistance("xMinutes",p,l);if(p<90)return o.formatDistance("aboutXHours",1,l);if(p<Z5){var m=Math.round(p/60);return o.formatDistance("aboutXHours",m,l)}else{if(p<uwe)return o.formatDistance("xDays",1,l);if(p<lT){var g=Math.round(p/Z5);return o.formatDistance("xDays",g,l)}else if(p<dwe)return h=Math.round(p/lT),o.formatDistance("aboutXMonths",h,l)}if(h=k_(u,c),h<12){var _=Math.round(p/lT);return o.formatDistance("xMonths",_,l)}else{var b=h%12,S=Math.floor(h/12);return b<3?o.formatDistance("aboutXYears",S,l):b<9?o.formatDistance("overXYears",S,l):o.formatDistance("almostXYears",S+1,l)}}function pwe(t,e){return Ce(1,arguments),fwe(t,Date.now(),e)}function hwe(t){Ce(1,arguments);var e=Oe(t),n=e.getTime();return n}function mwe(t,e){const n=e||"dd/MM/yyyy";return t?U_(new Date(t),n):null}function gwe(t,e){const n=e||"dd/MM/yyyy HH:mm:ss";return t?U_(new Date(t),n):null}function _we(t){return t?hwe(new Date(t)):null}function bwe(t){return t?pwe(new Date(t),{addSuffix:!0}):null}const vwe=Object.freeze(Object.defineProperty({__proto__:null,fDate:mwe,fDateTime:gwe,fTimestamp:_we,fToNow:bwe},Symbol.toStringTag,{value:"Module"}));function Ewe(t){const e=t.match(/\/([^/]+)/);return e?e[0]:t}const Swe=Object.freeze(Object.defineProperty({__proto__:null,getRoot:Ewe},Symbol.toStringTag,{value:"Module"}));function ywe(t,e,n="asc"){return t.slice().sort((r,i)=>{const a=r[e],o=i[e];return a<o?n==="asc"?-1:1:a>o?n==="asc"?1:-1:0})}function Twe(t,e,n){const r=[...n],i=r.splice(t,1)[0];return r.splice(e,0,i),r}const Cwe=Object.freeze(Object.defineProperty({__proto__:null,sort:ywe,updatePosition:Twe},Symbol.toStringTag,{value:"Module"})),cT=(t="",e)=>{let n="",r=0;return[...e].forEach(i=>{n+=i==="#"?t[r++]||"_":i}),n},Owe=Object.freeze(Object.defineProperty({__proto__:null,applyMask:cT,cnpjMask:t=>cT(t.replace(/\D/g,""),"##.###.###/####-##"),cpfMask:t=>cT(t.replace(/\D/g,""),"###.###.###-##")},Symbol.toStringTag,{value:"Module"}));function xwe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Rwe=t=>function(n){return O.jsx(A.Suspense,{fallback:O.jsx(mf,{}),children:O.jsx(t,{...n})})},Awe=Object.freeze(Object.defineProperty({__proto__:null,default:M8},Symbol.toStringTag,{value:"Module"}));se.Address=INe,se.Autocomplete=mg,se.AutocompleteField=K5,se.Checkbox=DNe,se.Codes=PNe,se.ColorPickerField=LNe,se.ColorPickerInput=rw,se.Common=Zhe,se.Confirm=Jhe,se.CustomAvatar=jw,se.CustomAvatarGroup=Kw,se.DataGrid=sme,se.DatePicker=FNe,se.DateRangePicker=BNe,se.DateTimePicker=UNe,se.Delayed=lme,se.DialogAnimate=k8,se.Drawer=vme,se.Editor=uP,se.EditorField=GNe,se.EmptyView=Xw,se.FabButtonAnimate=H1,se.Field=ho,se.FixedProgressBar=mf,se.Form=$Ne,se.IconButtonAnimate=z1,se.Iconify=Ct,se.Image=yf,se.ImageCrop=RP,se.Incrementer=zS,se.IncrementerField=qNe,se.Label=$P,se.MaskedInput=QS,se.MaskedInputField=Q5,se.MaterialDesignContent=Ex,se.MenuPopover=xSe,se.Modal=XP,se.ModalActions=ISe,se.MotionContainer=N$,se.MotionLazyContainer=QO,se.MotionViewport=A$,se.MultiCheckbox=MNe,se.NavSectionHorizontal=rAe,se.NavSectionMini=YRe,se.NavSectionVertical=QRe,se.NavSectionVerticalWithButtons=cAe,se.NumberInput=Df,se.NumberInputField=VNe,se.PasswordField=YNe,se.PasswordRules=FSe,se.Portal=ZP,se.RadioGroupField=HNe,se.SQLEditor=o5,se.SQLEditorEditorField=zNe,se.Scrollbar=cI,se.SearchInput=NRe,se.SnackbarContent=Wm,se.SnackbarProvider=Tx,se.Steps=DRe,se.Switch=WNe,se.TRANSITION=gT,se.TabPanel=MRe,se.TextAnimate=P8,se.ThemeProvider=Ww,se.TimePicker=jNe,se.Transition=od,se.Upload=q5,se.UploadAvatar=V5,se.UploadAvatarWithCropField=XNe,se.UploadBox=CNe,se.UploadWithCrop=j5,se.UploadWithCropField=KNe,se.cssStyles=FRe,se.file=lwe,se.formatNumber=UEe,se.formatTime=vwe,se.loadable=Rwe,se.mask=Owe,se.number=MEe,se.routes=Swe,se.sort=Cwe,se.useActiveElement=ZNe,se.useActiveLink=oh,se.useCopyToClipboard=JNe,se.useDatagrid=ewe,se.useDeepCompareEffect=rwe,se.useEventListener=sT,se.useIsMounting=iwe,se.useOnClickOutside=swe,se.usePagination=owe,se.useResponsive=KO,se.useSnackbar=sq,se.useTabs=awe,se.useToggle=H5,se.uuidv4=xwe,se.validators=kSe,se.varBgColor=vU,se.varBgKenburns=EU,se.varBgPan=SU,se.varBounce=gU,se.varContainer=uu,se.varFade=il,se.varFlip=pU,se.varHover=bU,se.varPath=uU,se.varRotate=_U,se.varScale=mU,se.varSlide=hU,se.varTranEnter=Ze,se.varTranExit=rt,se.varTranHover=dU,se.varZoom=fU,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|
|
319
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k5(t,e){if(t){if(typeof t=="string")return nT(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nT(t,e)}}function nT(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function JAe(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(t);!(i=(o=n.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){a=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function eNe(t){if(Array.isArray(t))return t}function P5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?P5(Object(n),!0).forEach(function(r){rT(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P5(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function rT(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dh(t,e){if(t==null)return{};var n=tNe(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function tNe(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var iT=A.forwardRef(function(t,e){var n=t.children,r=dh(t,YAe),i=fh(r),a=i.open,o=dh(i,HAe);return A.useImperativeHandle(e,function(){return{open:a}},[a]),A.createElement(A.Fragment,null,n(jt(jt({},o),{},{open:a})))});iT.displayName="Dropzone";var L5={disabled:!1,getFilesFromEvent:pAe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};iT.defaultProps=L5,iT.propTypes={children:te.func,accept:te.objectOf(te.arrayOf(te.string)),multiple:te.bool,preventDropOnDocument:te.bool,noClick:te.bool,noKeyboard:te.bool,noDrag:te.bool,noDragEventsBubbling:te.bool,minSize:te.number,maxSize:te.number,maxFiles:te.number,disabled:te.bool,getFilesFromEvent:te.func,onFileDialogCancel:te.func,onFileDialogOpen:te.func,useFsAccessApi:te.bool,autoFocus:te.bool,onDragEnter:te.func,onDragLeave:te.func,onDragOver:te.func,onDrop:te.func,onDropAccepted:te.func,onDropRejected:te.func,onError:te.func,validator:te.func};var aT={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fh(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=jt(jt({},L5),t),n=e.accept,r=e.disabled,i=e.getFilesFromEvent,a=e.maxSize,o=e.minSize,s=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,f=e.onDrop,p=e.onDropAccepted,h=e.onDropRejected,m=e.onFileDialogCancel,g=e.onFileDialogOpen,_=e.useFsAccessApi,b=e.autoFocus,S=e.preventDropOnDocument,v=e.noClick,E=e.noKeyboard,T=e.noDrag,y=e.noDragEventsBubbling,C=e.onError,N=e.validator,R=A.useMemo(function(){return $Ae(n)},[n]),x=A.useMemo(function(){return GAe(n)},[n]),w=A.useMemo(function(){return typeof g=="function"?g:F5},[g]),D=A.useMemo(function(){return typeof m=="function"?m:F5},[m]),k=A.useRef(null),P=A.useRef(null),G=A.useReducer(nNe,aT),F=tT(G,2),j=F[0],$=F[1],M=j.isFocused,I=j.isFileDialogActive,L=A.useRef(typeof window<"u"&&window.isSecureContext&&_&&UAe()),U=function(){!L.current&&I&&setTimeout(function(){if(P.current){var be=P.current.files;be.length||($({type:"closeDialog"}),D())}},300)};A.useEffect(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[P,I,D,L]);var Y=A.useRef([]),V=function(be){k.current&&k.current.contains(be.target)||(be.preventDefault(),Y.current=[])};A.useEffect(function(){return S&&(document.addEventListener("dragover",I5,!1),document.addEventListener("drop",V,!1)),function(){S&&(document.removeEventListener("dragover",I5),document.removeEventListener("drop",V))}},[k,S]),A.useEffect(function(){return!r&&b&&k.current&&k.current.focus(),function(){}},[k,b,r]);var B=A.useCallback(function(de){C?C(de):console.error(de)},[C]),q=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[].concat(jAe(Y.current),[de.target]),uh(de)&&Promise.resolve(i(de)).then(function(be){if(!(ch(de)&&!y)){var We=be.length,X=We>0&&PAe({files:be,accept:R,minSize:o,maxSize:a,multiple:s,maxFiles:l,validator:N}),z=We>0&&!X;$({isDragAccept:X,isDragReject:z,isDragActive:!0,type:"setDraggedFiles"}),c&&c(de)}}).catch(function(be){return B(be)})},[i,c,B,y,R,o,a,s,l,N]),W=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=uh(de);if(be&&de.dataTransfer)try{de.dataTransfer.dropEffect="copy"}catch{}return be&&d&&d(de),!1},[d,y]),K=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de);var be=Y.current.filter(function(X){return k.current&&k.current.contains(X)}),We=be.indexOf(de.target);We!==-1&&be.splice(We,1),Y.current=be,!(be.length>0)&&($({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(de)&&u&&u(de))},[k,u,y]),Z=A.useCallback(function(de,be){var We=[],X=[];de.forEach(function(z){var oe=N5(z,R),ae=tT(oe,2),Re=ae[0],$e=ae[1],Le=w5(z,o,a),ue=tT(Le,2),pe=ue[0],De=ue[1],Ie=N?N(z):null;if(Re&&pe&&!Ie)We.push(z);else{var Ne=[$e,De];Ie&&(Ne=Ne.concat(Ie)),X.push({file:z,errors:Ne.filter(function(Ke){return Ke})})}}),(!s&&We.length>1||s&&l>=1&&We.length>l)&&(We.forEach(function(z){X.push({file:z,errors:[kAe]})}),We.splice(0)),$({acceptedFiles:We,fileRejections:X,type:"setFiles"}),f&&f(We,X,be),X.length>0&&h&&h(X,be),We.length>0&&p&&p(We,be)},[$,s,R,o,a,l,f,p,h,N]),le=A.useCallback(function(de){de.preventDefault(),de.persist(),me(de),Y.current=[],uh(de)&&Promise.resolve(i(de)).then(function(be){ch(de)&&!y||Z(be,de)}).catch(function(be){return B(be)}),$({type:"reset"})},[i,Z,B,y]),ne=A.useCallback(function(){if(L.current){$({type:"openDialog"}),w();var de={multiple:s,types:x};window.showOpenFilePicker(de).then(function(be){return i(be)}).then(function(be){Z(be,null),$({type:"closeDialog"})}).catch(function(be){qAe(be)?(D(be),$({type:"closeDialog"})):VAe(be)?(L.current=!1,P.current?(P.current.value=null,P.current.click()):B(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):B(be)});return}P.current&&($({type:"openDialog"}),w(),P.current.value=null,P.current.click())},[$,w,D,_,Z,B,x,s]),Ee=A.useCallback(function(de){!k.current||!k.current.isEqualNode(de.target)||(de.key===" "||de.key==="Enter"||de.keyCode===32||de.keyCode===13)&&(de.preventDefault(),ne())},[k,ne]),_e=A.useCallback(function(){$({type:"focus"})},[]),fe=A.useCallback(function(){$({type:"blur"})},[]),Se=A.useCallback(function(){v||(BAe()?setTimeout(ne,0):ne())},[v,ne]),Te=function(be){return r?null:be},re=function(be){return E?null:Te(be)},ee=function(be){return T?null:Te(be)},me=function(be){y&&be.stopPropagation()},he=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.role,z=de.onKeyDown,oe=de.onFocus,ae=de.onBlur,Re=de.onClick,$e=de.onDragEnter,Le=de.onDragOver,ue=de.onDragLeave,pe=de.onDrop,De=dh(de,zAe);return jt(jt(rT({onKeyDown:re(ci(z,Ee)),onFocus:re(ci(oe,_e)),onBlur:re(ci(ae,fe)),onClick:Te(ci(Re,Se)),onDragEnter:ee(ci($e,q)),onDragOver:ee(ci(Le,W)),onDragLeave:ee(ci(ue,K)),onDrop:ee(ci(pe,le)),role:typeof X=="string"&&X!==""?X:"presentation"},We,k),!r&&!E?{tabIndex:0}:{}),De)}},[k,Ee,_e,fe,Se,q,W,K,le,E,T,r]),ie=A.useCallback(function(de){de.stopPropagation()},[]),Ue=A.useMemo(function(){return function(){var de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},be=de.refKey,We=be===void 0?"ref":be,X=de.onChange,z=de.onClick,oe=dh(de,WAe),ae=rT({accept:R,multiple:s,type:"file",style:{display:"none"},onChange:Te(ci(X,le)),onClick:Te(ci(z,ie)),tabIndex:-1},We,P);return jt(jt({},ae),oe)}},[P,n,s,le,r]);return jt(jt({},j),{},{isFocused:M&&!r,getRootProps:he,getInputProps:Ue,rootRef:k,inputRef:P,open:Te(ne)})}function nNe(t,e){switch(e.type){case"focus":return jt(jt({},t),{},{isFocused:!0});case"blur":return jt(jt({},t),{},{isFocused:!1});case"openDialog":return jt(jt({},aT),{},{isFileDialogActive:!0});case"closeDialog":return jt(jt({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return jt(jt({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return jt(jt({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return jt({},aT);default:return t}}function F5(){}const rNe=["pdf"],iNe=["txt"],aNe=["psd"],oNe=["doc","docx"],sNe=["xls","xlsx"],lNe=["zip","rar","iso"],cNe=["ai","esp"],uNe=["ppt","pptx"],dNe=["wav","aif","mp3","aac"],fNe=["jpg","jpeg","gif","bmp","png","svg"],pNe=["m4v","avi","mpg","mp4","webm"],fr=t=>`/assets/icons/files/${t}.svg`;function B5(t){let e;switch(t==null?void 0:t.includes(jn(t))){case iNe.includes(jn(t)):e="txt";break;case lNe.includes(jn(t)):e="zip";break;case dNe.includes(jn(t)):e="audio";break;case fNe.includes(jn(t)):e="image";break;case pNe.includes(jn(t)):e="video";break;case oNe.includes(jn(t)):e="word";break;case sNe.includes(jn(t)):e="excel";break;case uNe.includes(jn(t)):e="powerpoint";break;case rNe.includes(jn(t)):e="pdf";break;case aNe.includes(jn(t)):e="photoshop";break;case cNe.includes(jn(t)):e="illustrator";break;default:e=jn(t)}return e}function hNe(t){let e;switch(B5(t)){case"folder":e=fr("ic_folder");break;case"txt":e=fr("ic_txt");break;case"zip":e=fr("ic_zip");break;case"audio":e=fr("ic_audio");break;case"video":e=fr("ic_video");break;case"word":e=fr("ic_word");break;case"excel":e=fr("ic_excel");break;case"powerpoint":e=fr("ic_power_point");break;case"pdf":e=fr("ic_pdf");break;case"photoshop":e=fr("ic_pts");break;case"illustrator":e=fr("ic_ai");break;case"image":e=fr("ic_img");break;default:e=fr("ic_file")}return e}function jn(t=""){return t&&t.split(".").pop()||""}function mNe(t){return t.split("/").pop()}function oT(t){return typeof t=="string"?{key:t,preview:t,name:mNe(t),type:jn(t)}:{key:t.preview,name:t.name,size:t.size,path:t.path,type:t.type,preview:t.preview,lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate}}const U5=({onDownload:t})=>{const e=Ra();return O.jsx(H.IconButton,{onClick:t,sx:{p:0,top:0,right:0,width:1,height:1,zIndex:9,opacity:0,position:"absolute",borderRadius:"unset",justifyContent:"center",bgcolor:"grey.800",color:"common.white",transition:e.transitions.create("opacity"),"&:hover":{opacity:1,...sh({opacity:.64,color:e.palette.grey[900]})}},children:O.jsx(Ct,{icon:"eva:arrow-circle-down-fill",width:24})})},G5=({file:t,tooltip:e,imageView:n,onDownload:r,sx:i,imgSx:a})=>{const{name:o="",path:s="",preview:l=""}=oT(t),c=B5(s||l),u=c==="image"&&n?O.jsx(H.Box,{component:"img",src:l,sx:{width:1,height:1,flexShrink:0,objectFit:"cover",...a}}):O.jsx(H.Box,{component:"img",src:hNe(c),sx:{width:32,height:32,flexShrink:0,...i}});return e?O.jsx(H.Tooltip,{title:o,children:O.jsxs(H.Stack,{flexShrink:0,component:"span",alignItems:"center",justifyContent:"center",sx:{width:"fit-content",height:"inherit"},children:[u,r&&O.jsx(U5,{onDownload:r})]})}):O.jsxs(O.Fragment,{children:[u,r&&O.jsx(U5,{onDownload:r})]})},$5=({fileRejections:t})=>t.length?O.jsx(H.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:e=>ye(e.palette.error.main,.08),borderColor:e=>ye(e.palette.error.main,.24)},children:t.map(({file:e,errors:n})=>{const{path:r,size:i}=oT(e);return O.jsxs(H.Box,{sx:{my:1},children:[O.jsxs(H.Typography,{variant:"subtitle2",noWrap:!0,children:[r," - ",i?qS(i):""]}),n.map(a=>O.jsxs(H.Box,{component:"span",sx:{typography:"caption"},children:["- ",a.message]},a.code))]},r)})}):null,gNe=({thumbnail:t,files:e,onRemove:n,sx:r})=>e!=null&&e.length?O.jsx(Y1,{initial:!1,children:e.map(i=>{const{key:a,name:o="",size:s=0}=oT(i),l=typeof i=="string";return t?O.jsxs(H.Stack,{component:Cr.div,...il().inUp,alignItems:"center",display:"inline-flex",justifyContent:"center",sx:{m:.5,width:80,height:80,borderRadius:1.25,overflow:"hidden",position:"relative",border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx(G5,{tooltip:!0,imageView:!0,file:i,sx:{position:"absolute"},imgSx:{position:"absolute"}}),n&&O.jsx(H.IconButton,{size:"small",onClick:()=>n(i),sx:{top:4,right:4,p:"1px",position:"absolute",color:c=>ye(c.palette.common.white,.72),bgcolor:c=>ye(c.palette.grey[900],.48),"&:hover":{bgcolor:c=>ye(c.palette.grey[900],.72)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:16})})]},a):O.jsxs(H.Stack,{component:Cr.div,...il().inUp,spacing:2,direction:"row",alignItems:"center",sx:{my:1,px:1,py:.75,borderRadius:.75,border:c=>`solid 1px ${c.palette.divider}`,...r},children:[O.jsx(G5,{file:i}),O.jsxs(H.Stack,{flexGrow:1,sx:{minWidth:0},children:[O.jsx(H.Typography,{variant:"subtitle2",noWrap:!0,children:l?i:o}),O.jsx(H.Typography,{variant:"caption",sx:{color:"text.secondary"},children:l?"":qS(s)})]}),n&&O.jsx(H.IconButton,{edge:"end",size:"small",onClick:()=>n(i),children:O.jsx(Ct,{icon:"eva:close-fill"})})]},a)})}):null,_Ne=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(H.Stack,{position:"absolute",width:1,height:1,maxHeight:"100%",alignItems:"center",justifyContent:"center",top:0,right:0,bottom:0,left:0,padding:2,margin:"auto",children:O.jsx(yf,{alt:"file preview",src:e,sx:{borderRadius:1,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},bNe=qt("div")(({theme:t})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:t.spacing(5),borderRadius:t.shape.borderRadius,transition:t.transitions.create("padding"),backgroundColor:t.palette.background.neutral,border:`1px dashed ${ye(t.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),vNe=({header:t,description:e,sx:n,...r})=>O.jsxs(H.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...r,children:[O.jsx(ame,{sx:{width:220}}),O.jsxs("div",{children:[t||O.jsx(H.Typography,{gutterBottom:!0,variant:"h5",children:"Soltar ou selecionar arquivos"}),e||O.jsxs(H.Typography,{variant:"body2",sx:{color:"text.secondary"},children:["Solte os arquivos aqui ou clique",O.jsx(H.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})]})]}),q5=({id:t,disabled:e,multiple:n=!1,error:r,helperText:i,file:a,onDelete:o,files:s,thumbnail:l,onUpload:c,onRemove:u,onRemoveAll:d,sx:f,dropZoneProps:p,placeholderProps:h,placeholderAlt:m,image:g,tabIndex:_,...b})=>{const{getRootProps:S,getInputProps:v,isDragActive:E,isDragReject:T,fileRejections:y}=fh({multiple:n,disabled:e,...b}),C=!!a&&!n||g,N=s&&n&&s.length>0,R=T||!!r;return O.jsxs(H.Box,{sx:{width:1,position:"relative",...f},children:[O.jsxs(bNe,{...S(),sx:{...E&&{opacity:.72},...R&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...e&&{opacity:.48,pointerEvents:"none"},...p},children:[O.jsx("input",{...v(),id:t,tabIndex:_}),m?O.jsx(H.Stack,{sx:{...C&&{opacity:0}},children:m}):O.jsx(vNe,{sx:{...C&&{opacity:0}},header:h==null?void 0:h.title,description:h==null?void 0:h.description}),C&&O.jsx(_Ne,{file:a||g||""})]}),i&&i,O.jsx($5,{fileRejections:y}),C&&o&&O.jsx(H.IconButton,{size:"small",onClick:o,sx:{top:16,right:16,zIndex:9,position:"absolute",color:x=>ye(x.palette.common.white,.8),bgcolor:x=>ye(x.palette.grey[900],.72),"&:hover":{bgcolor:x=>ye(x.palette.grey[900],.48)}},children:O.jsx(Ct,{icon:"eva:close-fill",width:18})}),N&&O.jsxs(O.Fragment,{children:[O.jsx(H.Box,{sx:{my:3},children:O.jsx(gNe,{files:s,thumbnail:l,onRemove:u})}),O.jsxs(H.Stack,{direction:"row",justifyContent:"flex-end",spacing:1.5,children:[d&&O.jsx(H.Button,{color:"inherit",variant:"outlined",size:"small",onClick:d,children:"Remove all"}),c&&O.jsx(H.Button,{size:"small",variant:"contained",onClick:c,children:"Upload files"})]})]})]})},ENe=({file:t})=>{if(!t)return null;const e=typeof t=="string"?t:t.preview;return O.jsx(yf,{alt:"avatar",src:e,sx:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},SNe=qt("div")(({theme:t})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${ye(t.palette.grey[500],.32)}`})),yNe=qt("div")(({theme:t})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:t.palette.text.disabled,backgroundColor:t.palette.background.neutral,transition:t.transitions.create("opacity",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.shorter})})),V5=({error:t,file:e,image:n,disabled:r,helperText:i,sx:a,tabIndex:o,...s})=>{const{getRootProps:l,getInputProps:c,isDragActive:u,isDragReject:d,fileRejections:f}=fh({multiple:!1,disabled:r,...s}),p=!!e||n,h=d||!!t;return O.jsxs(O.Fragment,{children:[O.jsxs(SNe,{...l(),sx:{...u&&{opacity:.72},...h&&{borderColor:"error.light",...p&&{bgcolor:"error.lighter"}},...r&&{opacity:.48,pointerEvents:"none"},...p&&{"&:hover":{"& .placeholder":{opacity:1}}},...a},children:[O.jsx("input",{...c(),tabIndex:o}),p&&O.jsx(ENe,{file:e||n||""}),O.jsxs(yNe,{className:"placeholder",sx:{"&:hover":{opacity:.72},...p&&{zIndex:9,opacity:0,color:"common.white",bgcolor:m=>ye(m.palette.grey[900],.64)},...h&&{color:"error.main",bgcolor:"error.lighter"}},children:[O.jsx(Ct,{icon:"ic:round-add-a-photo",width:24,sx:{mb:1}}),O.jsx(H.Typography,{variant:"caption",children:e?"Update photo":"Upload photo"})]})]}),i&&i,O.jsx($5,{fileRejections:f})]})},TNe=qt("div")(({theme:t})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:t.spacing(.5),color:t.palette.text.disabled,borderRadius:t.shape.borderRadius,border:`dashed 1px ${t.palette.divider}`,backgroundColor:ye(t.palette.grey[500],.08),"&:hover":{opacity:.72}})),CNe=({placeholderAlt:t,error:e,disabled:n,sx:r,tabIndex:i,...a})=>{const{getRootProps:o,getInputProps:s,isDragActive:l,isDragReject:c}=fh({disabled:n,...a}),u=c||e;return O.jsxs(TNe,{...o(),sx:{...l&&{opacity:.72},...u&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...r},children:[O.jsx("input",{...s(),tabIndex:i}),t||O.jsx(Ct,{icon:"eva:cloud-upload-fill",width:28})]})},ONe=t=>new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",i=>n(i)),r.setAttribute("crossOrigin","anonymous"),r.src=t});function Y5(t){return t*Math.PI/180}function xNe(t,e,n){const r=Y5(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}async function RNe(t,e,n=0,r={horizontal:!1,vertical:!1}){const i=await ONe(t),a=document.createElement("canvas"),o=a.getContext("2d");if(!o)return null;const s=Y5(n),{width:l,height:c}=xNe(i.width,i.height,n);a.width=l,a.height=c,o.translate(l/2,c/2),o.rotate(s),o.scale(r.horizontal?-1:1,r.vertical?-1:1),o.translate(-i.width/2,-i.height/2),o.drawImage(i,0,0);const u=o.getImageData(e.x,e.y,e.width,e.height);return a.width=e.width,a.height=e.height,o.putImageData(u,0,0),new Promise((d,f)=>{a.toBlob(p=>{d(p)},"image/png")})}const H5=(t=!1)=>{const[e,n]=A.useState(t),r=A.useCallback(()=>n(i=>!i),[]);return[e,r,n]},z5=({onFileCropped:t,onImageUploaded:e,onCancel:n,image:r})=>{const i=A.useId(),[a,o,s]=H5(),[l,c]=A.useState({x:0,y:0}),[u,d]=A.useState(1),f=A.useRef();return{id:i,crop:l,setCrop:c,zoom:u,setZoom:d,fileRef:f,onCropComplete:async(_,b)=>{try{const S=await RNe(r,b,0);f.current=new File([S],"image.png",{type:S.type})}catch{t(void 0)}},saveChanges:()=>{t(f.current),o()},cancelChanges:()=>{n&&n(),s(!1)},handleRemove:()=>{t(void 0),e(void 0),c({x:0,y:0}),d(1),s(!1)},cropModalOpen:a,toggleCropModalOpen:o,setCropModalOpen:s}},W5=({id:t,open:e,onClose:n,label:r,onSave:i,onRemove:a,imgSrc:o,aspect:s,size:{height:l,width:c},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h})=>O.jsx(XP,{open:e,onClose:n,dialogTitle:r,actions:O.jsxs(O.Fragment,{children:[O.jsx(H.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),O.jsx(H.Button,{variant:"contained",size:"medium",onClick:i,children:"Salvar"})]}),children:O.jsxs(H.Stack,{gap:2,children:[O.jsx(RP,{image:{width:c,height:l,aspect:s,imgSrc:o},crop:u,zoom:d,onCropComplete:f,onCropChange:p,onZoomChange:h}),O.jsxs(H.Stack,{gap:1.5,children:[O.jsxs(H.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[O.jsx(H.Typography,{variant:"body1",children:"Zoom"}),O.jsx(H.Slider,{value:d,onChange:(m,g)=>h(Array.isArray(g)?g[0]:g),min:1,max:5,size:"medium",step:.5})]}),O.jsxs(H.Stack,{direction:"row",gap:2,children:[O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:a,children:"Remover"}),O.jsx(H.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:O.jsx(Ct,{icon:"ic:outline-image-search",color:Q_.main}),component:"label",htmlFor:t,children:"Alterar"})]})]})]})}),ANe=H.styled(H.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),NNe=H.styled(H.Stack)(({theme:t})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:H.alpha(t.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),wNe=H.styled(H.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),j5=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E,toggleCropModalOpen:T}=z5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(ANe,{children:[s&&O.jsx(mf,{}),O.jsx(q5,{...u,id:d,file:l,onDrop:y=>{if(y.length>0){v(!0),E(1),S({x:0,y:0});const C=new FileReader;C.addEventListener("load",()=>{var R;const N=((R=C.result)==null?void 0:R.toString())||"";e(N),t(void 0)}),C.readAsDataURL(y[0])}},image:o,tabIndex:c}),(l||o)&&O.jsxs(NNe,{className:"actions",children:[O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"eva:trash-2-outline",color:"error.main"}),onClick:g,children:"Remover"}),O.jsx(H.Button,{color:"inherit",startIcon:O.jsx(Ct,{icon:"ic:outline-image",color:Q_.main}),onClick:T,children:"Editar"})]})]}),O.jsx(W5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},K5=({name:t,helperText:e,rules:n,onSelectOption:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(mg,{...o,...i,onChange:l=>{r&&r(l),o.onChange(l)},error:!!s,helperText:(s==null?void 0:s.message)||e})})},ho=({name:t,helperText:e,rules:n,onChange:r,tabIndex:i,...a})=>{const{control:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:o,rules:n,render:({field:{ref:s,...l},fieldState:{error:c}})=>O.jsx(H.TextField,{...l,onChange:u=>{l.onChange(u),r&&r(u)},inputRef:s,fullWidth:!0,error:!!c,helperText:(c==null?void 0:c.message)||e,...a,inputProps:{...a.inputProps,tabIndex:i}})})},Q5=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onChange:o,value:s,ref:l},fieldState:{error:c}})=>O.jsx(QS,{ref:l,...r,name:a,value:s,error:!!c,helperText:(c==null?void 0:c.message)||e,onChange:({target:{value:u}})=>o(u)})})},INe=({name:t,containerProps:e,required:n,rules:r,tabIndex:i})=>{const a=`${t}.zipCode`,o=`${t}.publicPlace`,s=`${t}.number`,l=`${t}.district`,c=`${t}.complement`,u=`${t}.state`,d=`${t}.city`,f=p=>{p.key==="Enter"&&p.preventDefault()};return O.jsxs(H.Stack,{gap:1.5,...e,children:[O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(Q5,{name:a,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.CircularProgress,{size:24})})},rules:r,onKeyDown:f,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:i}),O.jsxs(H.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[O.jsx(ho,{name:o,label:"Logradouro",onKeyDown:f,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:i}),O.jsx(ho,{name:s,label:"Número",onKeyDown:f,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:i})]})]}),O.jsxs(H.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[O.jsx(ho,{name:l,label:"Bairro",onKeyDown:f,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:i}),O.jsx(ho,{name:c,label:"Complemento",onKeyDown:f,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:i})]}),O.jsxs(H.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[O.jsx(K5,{name:u,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:i}),O.jsx(ho,{name:d,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:i})]})]})},DNe=({name:t,helperText:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,render:({field:a,fieldState:{error:o}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{...a,checked:a.value,tabIndex:n}),...r}),(!!o||e)&&O.jsx(H.FormHelperText,{error:!!o,children:o?o==null?void 0:o.message:e})]})})},MNe=({row:t,name:e,label:n,options:r,spacing:i,helperText:a,...o})=>{const{control:s}=Xe.useFormContext(),l=(c,u)=>c.includes(u)?c.filter(d=>d!==u):[...c,u];return O.jsx(Xe.Controller,{name:e,control:s,render:({field:c,fieldState:{error:u}})=>O.jsxs(H.FormControl,{component:"fieldset",children:[n&&O.jsx(H.FormLabel,{component:"legend",sx:{typography:"body2"},children:n}),O.jsx(H.FormGroup,{sx:{...t&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:i||0},...t&&{mr:0,"&:not(:last-of-type)":{mr:i||2}}}},children:r.map(d=>O.jsx(H.FormControlLabel,{control:O.jsx(H.Checkbox,{checked:c.value.includes(d.value),onChange:()=>c.onChange(l(c.value,d.value))}),label:d.label,...o},d.value))}),(!!u||a)&&O.jsx(H.FormHelperText,{error:!!u,sx:{mx:0},children:u?u==null?void 0:u.message:a})]})})},kNe=typeof window<"u"?A.useLayoutEffect:A.useEffect;function sT(t,e,n,r){const i=A.useRef(e);kNe(()=>{i.current=e},[e]),A.useEffect(()=>{const a=(n==null?void 0:n.current)||window;if(!(a&&a.addEventListener))return;const o=s=>i.current(s);return a.addEventListener(t,o,r),()=>{a.removeEventListener(t,o)}},[t,n,r])}const PNe=({keyName:t,inputs:e=[],rules:n,tabIndex:r,...i})=>{const a=A.useRef(null),{control:o,setValue:s,formState:{errors:l}}=Xe.useFormContext(),c=f=>{const p=f.clipboardData.getData("text").split("");e.map((h,m)=>s(h,p[m])),f.preventDefault()},u=(f,p)=>{const{maxLength:h,value:m,name:g}=f.target,_=g.replace(t,""),b=Number(_),S=document.querySelector(`input[name=${t}${b+1}]`);m.length>h&&(f.target.value=m[0]),m.length>=h&&b<6&&S!==null&&S.focus(),p(f)};sT("paste",c,a);const d=e.some(f=>l[f]);return O.jsxs(H.Stack,{children:[O.jsx(H.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:a,children:e.map((f,p)=>O.jsx(Xe.Controller,{name:`${t}${p+1}`,control:o,rules:n,render:({field:h,fieldState:{error:m}})=>O.jsx(H.TextField,{...i,...h,autoComplete:"none",error:!!m,autoFocus:p===0,placeholder:"-",onChange:g=>{u(g,h.onChange)},onFocus:g=>g.currentTarget.select(),InputProps:{sx:{width:{xs:36,sm:56},height:{xs:36,sm:56},"& input":{p:0,textAlign:"center"}}},inputProps:{maxLength:1,type:"number",tabIndex:r}})},f))}),d&&O.jsx(H.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},LNe=({name:t,rules:e,helperText:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:{...e,validate:{...e==null?void 0:e.validate,validation:a=>{const o="#"+a.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(o)?!0:"Cor inválida"}}},render:({field:{ref:a,onChange:o,...s},fieldState:{error:l}})=>O.jsx(rw,{...s,onChangeColor:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||n,...r})})},FNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.DatePicker,{inputRef:a,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},BNe=({name:t,label:e,rules:n,tabIndex:r,...i})=>{const{control:a,setError:o}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:{value:s,onChange:l},fieldState:{error:c}})=>O.jsx(rl.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...i.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:u=>l({startDate:u[0],endDate:u[1]}),onError:u=>{o(t,{message:u[0]||u[1]||void 0})},...i,slotProps:{textField:({position:u})=>{var d;return{...(d=i.slotProps)==null?void 0:d.textField,error:!!c,helperText:c==null?void 0:c.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:u==="start"?`${e} (Dt. Início)`:`${e} (Dt. Fim)`,inputProps:{tabIndex:r}}}},sx:{width:1}})})},UNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:a,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},GNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{name:a,onBlur:o,onChange:s,value:l},fieldState:{error:c}})=>O.jsx(uP,{id:`quill${a}`,onBlur:o,onChange:(u,d,f,p)=>s(p.getLength()===1?"":u),value:l,error:!!c,helperText:(c==null?void 0:c.message)||e,...r})})},$Ne=({id:t,children:e,onSubmit:n,methods:r,...i})=>O.jsx(Xe.FormProvider,{...r,children:O.jsx(H.Stack,{component:"form",id:t,onSubmit:n,flex:1,width:1,noValidate:!0,...i,children:e})}),qNe=({name:t,helperText:e,rules:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:n,render:({field:{ref:a,value:o,...s},fieldState:{error:l}})=>O.jsx(zS,{value:o,inputRef:a,fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||e,...r,...s,name:t})})},VNe=({name:t,helperText:e,rules:n,onChange:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,rules:n,render:({field:o,fieldState:{error:s}})=>O.jsx(Df,{...o,onChange:l=>{o.onChange(l),r&&r(l)},fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||e,...i})})},YNe=({name:t,sx:e,rules:n,passwordSize:r,specialCharacter:i,upperCaseChar:a,numberChar:o,...s})=>{const{watch:l}=Xe.useFormContext(),c=l(t),[u,d]=A.useState(!1),{hasNumberChar:f,hasSpecialCharacter:p,hasUpperCaseChar:h,isLengthValid:m}=Ff(c,r,o,i,a);return O.jsx(ho,{...s,name:t,type:u?"text":"password",InputProps:{endAdornment:O.jsx(H.InputAdornment,{position:"end",children:O.jsx(H.IconButton,{onClick:()=>d(!u),edge:"end","aria-label":"Mostrar/Ocultar senha",children:O.jsx(Ct,{icon:u?"eva:eye-off-fill":"eva:eye-fill"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:g=>{const _=Ff(g,r,o,i,a);return!_.hasNumberChar||!_.hasSpecialCharacter||!_.hasUpperCaseChar||!_.isLengthValid?"Senha inválida":!0}}},sx:{...e,"& .MuiFormHelperText-root":{display:!p||!h||!m||!f?"none":void 0}}})},HNe=({name:t,rules:e,row:n,label:r,options:i,spacing:a,helperText:o,decorated:s,onChange:l,tabIndex:c,...u})=>{const{control:d}=Xe.useFormContext(),f=r?`${t}-${r}`:"";return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:p,fieldState:{error:h}})=>O.jsxs(H.FormControl,{component:"fieldset",sx:{...s&&{paddingLeft:1.5}},children:[r&&O.jsx(H.FormLabel,{component:"legend",id:f,sx:{typography:"body2"},children:r}),O.jsx(H.RadioGroup,{...p,onChange:(m,g)=>{p.onChange(m),l&&l(m,g)},"aria-labelledby":f,row:n,...u,children:i.map(m=>O.jsx(H.FormControlLabel,{value:m.value,control:O.jsx(H.Radio,{inputProps:{tabIndex:c}}),label:m.label,sx:({palette:g})=>({"&:not(:last-of-type)":{mb:a||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:a||2}},...s&&{border:`1px solid ${H.alpha(g.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(a||0)/2||1,...p.value===m.value&&{borderColor:"primary.main",backgroundColor:H.alpha(g.primary.main,.05)}}})},m.value))}),(!!h||o)&&O.jsx(H.FormHelperText,{error:!!h,sx:{mx:0},children:h?h==null?void 0:h.message:o})]})})},zNe=({name:t,rules:e,...n})=>{const{control:r}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:r,rules:e,render:({field:{onChange:i,onBlur:a,value:o},fieldState:{error:s}})=>O.jsx(o5,{onChange:i,onBlur:a,value:o,...n,error:!!s,helperText:s==null?void 0:s.message})})},WNe=({name:t,helperText:e,onChange:n,tabIndex:r,...i})=>{const{control:a}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:a,render:({field:o,fieldState:{error:s}})=>O.jsxs("div",{children:[O.jsx(H.FormControlLabel,{control:O.jsx(H.Switch,{...o,checked:o.value,onChange:(l,c)=>{o.onChange(l),n&&n(l,c)},inputProps:{tabIndex:r}}),...i}),(!!s||e)&&O.jsx(H.FormHelperText,{error:!!s,children:s?s==null?void 0:s.message:e})]})})},jNe=({name:t,rules:e,tabIndex:n,...r})=>{const{control:i}=Xe.useFormContext();return O.jsx(Xe.Controller,{name:t,control:i,rules:e,render:({field:{ref:a,...o},fieldState:{error:s}})=>{var l;return O.jsx(rl.TimePicker,{ampm:!1,format:"HH:mm",inputRef:a,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...r.localeText},...o,...r,value:o.value?new Date(o.value):null,slotProps:{textField:{...(l=r.slotProps)==null?void 0:l.textField,error:!!s,helperText:s==null?void 0:s.message,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})};function X5(t,e){const{watch:n,setValue:r}=Xe.useFormContext(),[i,a]=A.useState(e),o=n(t)||[];return{uploadFile:async f=>{if(!f){r(t,void 0),a(void 0);return}r(t,f),a(Object.assign(f,{preview:URL.createObjectURL(f)}))},uploadFiles:async f=>{r(t,[...o,...f.map(p=>Object.assign(p,{preview:URL.createObjectURL(p)}))])},handleDeleteFile:()=>{r(t,void 0),a(void 0)},handleRemoveAll:()=>{r(t,void 0)},handleRemove:f=>{const p=o.filter(h=>h!==f);r(t,p)},file:i,setFileValue:a}}const KNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=X5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(j5,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},QNe=({onFileCropped:t,onImageUploaded:e,onCancel:n,aspect:r,size:i,label:a,image:o="",uploading:s,file:l,tabIndex:c,...u})=>{const{id:d,crop:f,cropModalOpen:p,zoom:h,cancelChanges:m,handleRemove:g,onCropComplete:_,saveChanges:b,setCrop:S,setCropModalOpen:v,setZoom:E}=z5({image:o,onFileCropped:t,onImageUploaded:e,onCancel:n});return O.jsxs(O.Fragment,{children:[O.jsxs(H.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[s&&O.jsx(wNe,{}),O.jsx(V5,{...u,id:d,file:l,onDrop:T=>{if(T.length>0){v(!0),E(1),S({x:0,y:0});const y=new FileReader;y.addEventListener("load",()=>{var N;const C=((N=y.result)==null?void 0:N.toString())||"";e(C),t(void 0)}),y.readAsDataURL(T[0])}},image:o,tabIndex:c})]}),O.jsx(W5,{id:d,open:p,onClose:m,label:a,aspect:r,crop:f,zoom:h,onCropComplete:_,onCropChange:S,onZoomChange:E,imgSrc:o,onRemove:g,onSave:b,size:i})]})},XNe=({name:t,rules:e,helperText:n,aspect:r,label:i,size:a,image:o,onFileCropped:s,onImageUploaded:l,onCancel:c,...u})=>{const{control:d}=Xe.useFormContext(),{uploadFile:f,file:p,setFileValue:h}=X5(t);return O.jsx(Xe.Controller,{name:t,control:d,rules:e,render:({field:{value:m},fieldState:{error:g}})=>O.jsx(QNe,{accept:{"image/*":[]},file:m?p:void 0,onFileCropped:_=>{f(_),s&&s(_)},onImageUploaded:l,onCancel:()=>{h(void 0),c&&c()},error:!!g,disableMultiple:!0,helperText:(!!g||n)&&O.jsx(H.FormHelperText,{error:!!g,sx:{px:2},children:g?g==null?void 0:g.message:n}),aspect:r,label:i,size:a,image:o,...u})})},ZNe=()=>{const[t,e]=A.useState(!1),[n,r]=A.useState(document.activeElement);return A.useEffect(()=>{const i=o=>r(o.target),a=()=>r(null);return window.addEventListener("focus",i,!0),window.addEventListener("blur",a,!0),e(!0),()=>{window.removeEventListener("focus",i),window.removeEventListener("blur",a)}},[]),{activeElement:n,listenersReady:t}};function JNe(){const[t,e]=A.useState(null);return{copiedText:t,copy:async r=>{if(!(navigator!=null&&navigator.clipboard))return!1;try{return await navigator.clipboard.writeText(r),e(r),!0}catch{return e(null),!1}}}}const ewe=({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}={page:0,perPage:25})=>{const o=Mi.useGridApiRef(),[s,l]=A.useState({page:t,perPage:e,dir:n,search:r,searchValue:i,sort:a}),c=({pageSize:m=25,page:g=0})=>{l(_=>({..._,page:g,perPage:m}))},u=m=>l(g=>({...g,page:0,search:m})),d=m=>l(g=>({...g,searchValue:m})),f=()=>l(m=>({...m,page:0,search:m.searchValue})),p=(m,g)=>l(_=>({..._,sort:m,dir:g})),h=()=>{o.current.setPage(0),c({page:0})};return{...s,apiRef:o,page:s.page||0,perPage:s.perPage||25,handlePaginationModelChange:c,handleSearch:u,handleSort:p,handleSearchValue:d,applySearchValue:f,goToPageFirstPage:h}},twe=(t,e)=>Hve(t,e),nwe=t=>{const e=A.useRef();return twe(t,e.current)||(e.current=t),e.current},rwe=(t,e)=>{A.useEffect(t,e.map(nwe))},iwe=()=>{const t=A.useRef(!0);return t.current?(t.current=!1,!0):t.current};function awe(t=""){const[e,n]=A.useState(t);return{currentTab:e,onChangeTab:(r,i)=>{n(i)},setCurrentTab:n}}function owe({items:t,itemsPerPage:e}){const[n,r]=A.useState(1),i=Math.ceil(t.length/e),a=t.slice((n-1)*e,n*e);return{currentPage:n,totalPages:i,currentItems:a,goToPage:c=>{c>0&&c<=i&&r(c)},nextPage:()=>{n<i&&r(c=>c+1)},prevPage:()=>{n>1&&r(c=>c-1)}}}const swe=(t,e,n="mousedown")=>{sT(n,r=>{const i=t==null?void 0:t.current;!i||i.contains(r.target)||e(r)})},lwe=Object.freeze(Object.defineProperty({__proto__:null,downloadFile:(t,e,n)=>{const r=`data:application/octet-stream;base64,${n}`,i=document.createElement("a"),a=`${t.replace(e,"")}.${e}`;i.href=r,i.download=a,i.click()}},Symbol.toStringTag,{value:"Module"}));function cwe(t){return $_({},t)}var Z5=1440,uwe=2520,lT=43200,dwe=86400;function fwe(t,e,n){var r,i;Ce(2,arguments);var a=Nr(),o=(r=(i=n==null?void 0:n.locale)!==null&&i!==void 0?i:a.locale)!==null&&r!==void 0?r:sf;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var s=ms(t,e);if(isNaN(s))throw new RangeError("Invalid time value");var l=$_(cwe(n),{addSuffix:!!(n!=null&&n.addSuffix),comparison:s}),c,u;s>0?(c=Oe(e),u=Oe(t)):(c=Oe(t),u=Oe(e));var d=lw(u,c),f=(gs(u)-gs(c))/1e3,p=Math.round((d-f)/60),h;if(p<2)return n!=null&&n.includeSeconds?d<5?o.formatDistance("lessThanXSeconds",5,l):d<10?o.formatDistance("lessThanXSeconds",10,l):d<20?o.formatDistance("lessThanXSeconds",20,l):d<40?o.formatDistance("halfAMinute",0,l):d<60?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",1,l):p===0?o.formatDistance("lessThanXMinutes",1,l):o.formatDistance("xMinutes",p,l);if(p<45)return o.formatDistance("xMinutes",p,l);if(p<90)return o.formatDistance("aboutXHours",1,l);if(p<Z5){var m=Math.round(p/60);return o.formatDistance("aboutXHours",m,l)}else{if(p<uwe)return o.formatDistance("xDays",1,l);if(p<lT){var g=Math.round(p/Z5);return o.formatDistance("xDays",g,l)}else if(p<dwe)return h=Math.round(p/lT),o.formatDistance("aboutXMonths",h,l)}if(h=k_(u,c),h<12){var _=Math.round(p/lT);return o.formatDistance("xMonths",_,l)}else{var b=h%12,S=Math.floor(h/12);return b<3?o.formatDistance("aboutXYears",S,l):b<9?o.formatDistance("overXYears",S,l):o.formatDistance("almostXYears",S+1,l)}}function pwe(t,e){return Ce(1,arguments),fwe(t,Date.now(),e)}function hwe(t){Ce(1,arguments);var e=Oe(t),n=e.getTime();return n}function mwe(t,e){const n=e||"dd/MM/yyyy";return t?U_(new Date(t),n):null}function gwe(t,e){const n=e||"dd/MM/yyyy HH:mm:ss";return t?U_(new Date(t),n):null}function _we(t){return t?hwe(new Date(t)):null}function bwe(t){return t?pwe(new Date(t),{addSuffix:!0}):null}const vwe=Object.freeze(Object.defineProperty({__proto__:null,fDate:mwe,fDateTime:gwe,fTimestamp:_we,fToNow:bwe},Symbol.toStringTag,{value:"Module"}));function Ewe(t){const e=t.match(/\/([^/]+)/);return e?e[0]:t}const Swe=Object.freeze(Object.defineProperty({__proto__:null,getRoot:Ewe},Symbol.toStringTag,{value:"Module"}));function ywe(t,e,n="asc"){return t.slice().sort((r,i)=>{const a=r[e],o=i[e];return a<o?n==="asc"?-1:1:a>o?n==="asc"?1:-1:0})}function Twe(t,e,n){const r=[...n],i=r.splice(t,1)[0];return r.splice(e,0,i),r}const Cwe=Object.freeze(Object.defineProperty({__proto__:null,sort:ywe,updatePosition:Twe},Symbol.toStringTag,{value:"Module"})),cT=(t="",e)=>{let n="",r=0;return[...e].forEach(i=>{n+=i==="#"?t[r++]||"_":i}),n},Owe=Object.freeze(Object.defineProperty({__proto__:null,applyMask:cT,cnpjMask:t=>cT(t.replace(/\D/g,""),"##.###.###/####-##"),cpfMask:t=>cT(t.replace(/\D/g,""),"###.###.###-##")},Symbol.toStringTag,{value:"Module"}));function xwe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Rwe=t=>function(n){return O.jsx(A.Suspense,{fallback:O.jsx(mf,{}),children:O.jsx(t,{...n})})},Awe=Object.freeze(Object.defineProperty({__proto__:null,default:M8},Symbol.toStringTag,{value:"Module"}));se.Address=INe,se.Autocomplete=mg,se.AutocompleteField=K5,se.Checkbox=DNe,se.Codes=PNe,se.ColorPickerField=LNe,se.ColorPickerInput=rw,se.Common=Zhe,se.Confirm=Jhe,se.CustomAvatar=jw,se.CustomAvatarGroup=Kw,se.DataGrid=sme,se.DatePicker=FNe,se.DateRangePicker=BNe,se.DateTimePicker=UNe,se.Delayed=lme,se.DialogAnimate=k8,se.Drawer=vme,se.Editor=uP,se.EditorField=GNe,se.EmptyView=Xw,se.FabButtonAnimate=H1,se.Field=ho,se.FixedProgressBar=mf,se.Form=$Ne,se.IconButtonAnimate=z1,se.Iconify=Ct,se.Image=yf,se.ImageCrop=RP,se.Incrementer=zS,se.IncrementerField=qNe,se.Label=$P,se.MaskedInput=QS,se.MaskedInputField=Q5,se.MaterialDesignContent=Ex,se.MenuPopover=xSe,se.Modal=XP,se.ModalActions=ISe,se.MotionContainer=N$,se.MotionLazyContainer=QO,se.MotionViewport=A$,se.MultiCheckbox=MNe,se.NavSectionHorizontal=rAe,se.NavSectionMini=YRe,se.NavSectionVertical=QRe,se.NavSectionVerticalWithButtons=cAe,se.NumberInput=Df,se.NumberInputField=VNe,se.PasswordField=YNe,se.PasswordRules=FSe,se.Portal=ZP,se.RadioGroupField=HNe,se.SQLEditor=o5,se.SQLEditorEditorField=zNe,se.Scrollbar=cI,se.SearchInput=NRe,se.SnackbarContent=Wm,se.SnackbarProvider=Tx,se.Steps=DRe,se.Switch=WNe,se.TRANSITION=gT,se.TabPanel=MRe,se.TextAnimate=P8,se.ThemeProvider=Ww,se.TimePicker=jNe,se.Transition=od,se.Upload=q5,se.UploadAvatar=V5,se.UploadAvatarWithCropField=XNe,se.UploadBox=CNe,se.UploadWithCrop=j5,se.UploadWithCropField=KNe,se.cssStyles=FRe,se.file=lwe,se.formatNumber=UEe,se.formatTime=vwe,se.loadable=Rwe,se.mask=Owe,se.number=MEe,se.routes=Swe,se.sort=Cwe,se.useActiveElement=ZNe,se.useActiveLink=oh,se.useCopyToClipboard=JNe,se.useDatagrid=ewe,se.useDeepCompareEffect=rwe,se.useEventListener=sT,se.useIsMounting=iwe,se.useOnClickOutside=swe,se.usePagination=owe,se.useResponsive=KO,se.useSnackbar=sq,se.useTabs=awe,se.useToggle=H5,se.uuidv4=xwe,se.validators=kSe,se.varBgColor=vU,se.varBgKenburns=EU,se.varBgPan=SU,se.varBounce=gU,se.varContainer=uu,se.varFade=il,se.varFlip=pU,se.varHover=bU,se.varPath=uU,se.varRotate=_U,se.varScale=mU,se.varSlide=hU,se.varTranEnter=Ze,se.varTranExit=rt,se.varTranHover=dU,se.varZoom=fU,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|