@zydon/common 1.2.12 → 1.2.13

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/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAoMA,QAAA,MAAM,GAAG,+CAgCR,CAAC;AAEF,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAqMA,QAAA,MAAM,GAAG,+CA4DR,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/PasswordField/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqF/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/PasswordField/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4F/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -5,5 +5,9 @@ export type PasswordFieldProps = BaseField<TextFieldProps> & {
5
5
  specialCharacter?: boolean;
6
6
  upperCaseChar?: boolean;
7
7
  numberChar?: boolean;
8
+ showErrorMessage?: boolean;
9
+ match?: {
10
+ fieldPassword: string;
11
+ };
8
12
  };
9
13
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/PasswordField/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,CAAC,GAAG;IAC3D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/components/hook-form/PasswordField/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,CAAC,GAAG;IAC3D,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-c968e21a.js";
1
+ import { p as rt, f as C, n as B, r as mn, c as gn, i as tt, d as Ts, a as yn, v as Vs, w as ie, b as yt, e as K, g as R, t as Pt, h as et, j as Ss, k as bs, l as k, m as nt, o as vn, q as xt, s as vt, u as As, x as Ds, y as Cs, z as at, A as Ms, B as Pn, C as Kt, D as xn, E as Tn, F as w, G as zt, H as dt, P as ws, I as Ls, L as Rs, S as Bs, J as Vn, K as Sn, M as bn, N as Et, O as jt, Q as ye, R as Ht, T as Fs, U as An, V as Dn, W as Es, X as js, Y as Cn, Z as Mn, _ as ks, $ as Is, a0 as Os, a1 as Us, a2 as Ns, a3 as Gs, a4 as $s, a5 as Ks, a6 as zs, a7 as Hs } from "./index-d30e2227.js";
2
2
  import wn, { useContext as _t, useId as _s, useEffect as Ws } from "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -6737,7 +6737,7 @@ const N2u = ({
6737
6737
  ...a,
6738
6738
  children: n
6739
6739
  }
6740
- ), bn1 = () => import("./features-57e6d739.js").then((e) => e.default), nHn = ({ children: e }) => /* @__PURE__ */ m.jsx(iQr, { strict: !0, features: bn1, children: /* @__PURE__ */ m.jsxs(Wn.div, { style: { height: "100%" }, children: [
6740
+ ), bn1 = () => import("./features-526ecab1.js").then((e) => e.default), nHn = ({ children: e }) => /* @__PURE__ */ m.jsx(iQr, { strict: !0, features: bn1, children: /* @__PURE__ */ m.jsxs(Wn.div, { style: { height: "100%" }, children: [
6741
6741
  " ",
6742
6742
  e,
6743
6743
  " "
@@ -277562,15 +277562,17 @@ const gNn = ({
277562
277562
  specialCharacter: r,
277563
277563
  upperCaseChar: u,
277564
277564
  numberChar: c,
277565
- ...l
277565
+ showErrorMessage: l,
277566
+ match: f,
277567
+ ...s
277566
277568
  }) => {
277567
- const { watch: f } = At(), s = f(e), [d, g] = ct(!1), {
277568
- hasNumberChar: _,
277569
- hasSpecialCharacter: v,
277570
- hasUpperCaseChar: C,
277571
- isLengthValid: h
277569
+ const { watch: d } = At(), g = d(e), [_, v] = ct(!1), {
277570
+ hasNumberChar: C,
277571
+ hasSpecialCharacter: h,
277572
+ hasUpperCaseChar: b,
277573
+ isLengthValid: p
277572
277574
  } = Lvt(
277573
- s,
277575
+ g,
277574
277576
  a,
277575
277577
  c,
277576
277578
  r,
@@ -277579,22 +277581,17 @@ const gNn = ({
277579
277581
  return /* @__PURE__ */ m.jsx(
277580
277582
  gn,
277581
277583
  {
277582
- ...l,
277584
+ ...s,
277583
277585
  name: e,
277584
- type: d ? "text" : "password",
277586
+ type: _ ? "text" : "password",
277585
277587
  InputProps: {
277586
277588
  endAdornment: /* @__PURE__ */ m.jsx(EN, { position: "end", children: /* @__PURE__ */ m.jsx(
277587
277589
  _n,
277588
277590
  {
277589
- onClick: () => g(!d),
277591
+ onClick: () => v(!_),
277590
277592
  edge: "end",
277591
277593
  "aria-label": "Mostrar/Ocultar senha",
277592
- children: /* @__PURE__ */ m.jsx(
277593
- lt,
277594
- {
277595
- icon: d ? "VIEW_OFF" : "VIEW_ON"
277596
- }
277597
- )
277594
+ children: /* @__PURE__ */ m.jsx(lt, { icon: _ ? "VIEW_OFF" : "VIEW_ON" })
277598
277595
  }
277599
277596
  ) })
277600
277597
  },
@@ -277602,22 +277599,22 @@ const gNn = ({
277602
277599
  ...n,
277603
277600
  validate: {
277604
277601
  ...n == null ? void 0 : n.validate,
277605
- validationPassword: (b) => {
277606
- const p = Lvt(
277607
- b,
277602
+ validationPassword: (y) => {
277603
+ const M = Lvt(
277604
+ y,
277608
277605
  a,
277609
277606
  c,
277610
277607
  r,
277611
277608
  u
277612
277609
  );
277613
- return !p.hasNumberChar || !p.hasSpecialCharacter || !p.hasUpperCaseChar || !p.isLengthValid ? "Senha inválida" : !0;
277610
+ return !M.hasNumberChar || !M.hasSpecialCharacter || !M.hasUpperCaseChar || !M.isLengthValid ? "Senha inválida" : f && f.fieldPassword && d(f.fieldPassword) !== y ? "As senhas devem ser iguais" : !0;
277614
277611
  }
277615
277612
  }
277616
277613
  },
277617
277614
  sx: {
277618
277615
  ...t,
277619
277616
  "& .MuiFormHelperText-root": {
277620
- display: !v || !C || !h || !_ ? "none" : void 0
277617
+ display: (!h || !b || !p || !C) && !l ? "none" : void 0
277621
277618
  }
277622
277619
  }
277623
277620
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aa as c, aU as d, ab as m, aV as p, ac as C, ad as v, bH as T, bL as S, bK as g, bJ as k, aW as A, aY as P, aZ as I, ae as h, af as F, ag as B, ah as x, ai as y, aj as D, ak as M, a_ as f, a$ as w, b0 as R, al as E, bc as L, am as N, an as U, ao as W, be as H, b1 as O, ap as G, b2 as V, aq as q, ar as z, bf as K, as as Z, at as j, au as J, b3 as Q, av as X, a8 as Y, aw as _, ax as $, b4 as aa, bA as sa, ay as ea, az as oa, aA as ra, bh as ta, bi as ba, bg as ia, aX as na, aB as la, b5 as ua, b6 as ca, aC as da, aD as ma, b7 as pa, aE as Ca, aF as va, aG as Ta, bB as Sa, bC as ga, aH as ka, aI as Aa, aJ as Pa, aK as Ia, b8 as ha, bj as Fa, aL as Ba, bP as xa, bQ as ya, bN as Da, bS as Ma, bR as fa, bO as wa, bd as Ra, aM as Ea, aN as La, b9 as Na, bD as Ua, aO as Wa, aP as Ha, ba as Oa, aQ as Ga, aR as Va, bb as qa, aT as za, aS as Ka, bE as Za, ce as ja, c8 as Ja, bT as Qa, bF as Xa, c5 as Ya, c6 as _a, c7 as $a, bU as as, cg as ss, cd as es, cc as os, c9 as rs, ca as ts, bV as bs, bI as is, bW as ns, bX as ls, bY as us, bZ as cs, b_ as ds, a9 as ms, c4 as ps, c3 as Cs, c2 as vs, b$ as Ts, bG as Ss, bM as gs, c0 as ks, c1 as As, cf as Ps, cb as Is, bx as hs, by as Fs, bz as Bs, bq as xs, bt as ys, bl as Ds, bn as Ms, bs as fs, bk as ws, br as Rs, bp as Es, bo as Ls, bv as Ns, bw as Us, bu as Ws, bm as Hs } from "./index-c968e21a.js";
1
+ import { aa as c, aU as d, ab as m, aV as p, ac as C, ad as v, bH as T, bL as S, bK as g, bJ as k, aW as A, aY as P, aZ as I, ae as h, af as F, ag as B, ah as x, ai as y, aj as D, ak as M, a_ as f, a$ as w, b0 as R, al as E, bc as L, am as N, an as U, ao as W, be as H, b1 as O, ap as G, b2 as V, aq as q, ar as z, bf as K, as as Z, at as j, au as J, b3 as Q, av as X, a8 as Y, aw as _, ax as $, b4 as aa, bA as sa, ay as ea, az as oa, aA as ra, bh as ta, bi as ba, bg as ia, aX as na, aB as la, b5 as ua, b6 as ca, aC as da, aD as ma, b7 as pa, aE as Ca, aF as va, aG as Ta, bB as Sa, bC as ga, aH as ka, aI as Aa, aJ as Pa, aK as Ia, b8 as ha, bj as Fa, aL as Ba, bP as xa, bQ as ya, bN as Da, bS as Ma, bR as fa, bO as wa, bd as Ra, aM as Ea, aN as La, b9 as Na, bD as Ua, aO as Wa, aP as Ha, ba as Oa, aQ as Ga, aR as Va, bb as qa, aT as za, aS as Ka, bE as Za, ce as ja, c8 as Ja, bT as Qa, bF as Xa, c5 as Ya, c6 as _a, c7 as $a, bU as as, cg as ss, cd as es, cc as os, c9 as rs, ca as ts, bV as bs, bI as is, bW as ns, bX as ls, bY as us, bZ as cs, b_ as ds, a9 as ms, c4 as ps, c3 as Cs, c2 as vs, b$ as Ts, bG as Ss, bM as gs, c0 as ks, c1 as As, cf as Ps, cb as Is, bx as hs, by as Fs, bz as Bs, bq as xs, bt as ys, bl as Ds, bn as Ms, bs as fs, bk as ws, br as Rs, bp as Es, bo as Ls, bv as Ns, bw as Us, bu as Ws, bm as Hs } from "./index-d30e2227.js";
2
2
  import "react";
3
3
  import "@mui/material";
4
4
  import "@emotion/react";
@@ -35503,4 +35503,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
35503
35503
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $a2(e){if(Array.isArray(e))return oBn(e)}function DZn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function BZn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DZn(Object(n),!0).forEach(function(a){WZn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DZn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function WZn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U_t(e,t){return Ha2(e)||za2(e,t)||IZn(e,t)||xa2()}function xa2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35504
35504
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IZn(e,t){if(e){if(typeof e=="string")return oBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oBn(e,t)}}function oBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function za2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function Ha2(e){if(Array.isArray(e))return e}var Aa2="file-invalid-type",Ra2="file-too-large",Va2="file-too-small",Fa2="too-many-files",Na2=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:Aa2,message:"File type must be ".concat(n)}},$Zn=function(t){return{code:Ra2,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},xZn=function(t){return{code:Va2,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ta2={code:Fa2,message:"Too many files"};function zZn(e,t){var n=e.type==="application/x-moz-file"||Ba2(e,t);return[n,n?null:Na2(t)]}function HZn(e,t,n){if(rT(e.size))if(rT(t)&&rT(n)){if(e.size>n)return[!1,$Zn(n)];if(e.size<t)return[!1,xZn(t)]}else{if(rT(t)&&e.size<t)return[!1,xZn(t)];if(rT(n)&&e.size>n)return[!1,$Zn(n)]}return[!0,null]}function rT(e){return e!=null}function Za2(e){var t=e.files,n=e.accept,a=e.minSize,r=e.maxSize,u=e.multiple,c=e.maxFiles,l=e.validator;return!u&&t.length>1||u&&c>=1&&t.length>c?!1:t.every(function(f){var s=zZn(f,n),d=U_t(s,1),g=d[0],_=HZn(f,a,r),m=U_t(_,1),C=m[0],h=l?l(f):null;return g&&C&&!h})}function iCt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function oCt(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function AZn(e){e.preventDefault()}function Ua2(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Ga2(e){return e.indexOf("Edge/")!==-1}function Ya2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Ua2(e)||Ga2(e)}function Oc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){for(var r=arguments.length,u=new Array(r>1?r-1:0),c=1;c<r;c++)u[c-1]=arguments[c];return t.some(function(l){return!iCt(a)&&l&&l.apply(void 0,[a].concat(u)),iCt(a)})}}function Ka2(){return"showOpenFilePicker"in window}function Xa2(e){if(rT(e)){var t=Object.entries(e).filter(function(n){var a=U_t(n,2),r=a[0],u=a[1],c=!0;return RZn(r)||(console.warn('Skipped "'.concat(r,'" 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.')),c=!1),(!Array.isArray(u)||!u.every(VZn))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,a){var r=U_t(a,2),u=r[0],c=r[1];return BZn(BZn({},n),{},WZn({},u,c))},{});return[{description:"Files",accept:t}]}return e}function Qa2(e){if(rT(e))return Object.entries(e).reduce(function(t,n){var a=U_t(n,2),r=a[0],u=a[1];return[].concat(SZn(t),[r],SZn(u))},[]).filter(function(t){return RZn(t)||VZn(t)}).join(",")}function Ja2(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function qa2(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function RZn(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function VZn(e){return/^.*\.[\w]+$/.test(e)}var ei2=["children"],ti2=["open"],ni2=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],ri2=["refKey","onChange","onClick"];function ai2(e){return ui2(e)||oi2(e)||FZn(e)||ii2()}function ii2(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
35505
35505
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oi2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ui2(e){if(Array.isArray(e))return cBn(e)}function uBn(e,t){return fi2(e)||li2(e,t)||FZn(e,t)||ci2()}function ci2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
35506
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZn(e,t){if(e){if(typeof e=="string")return cBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cBn(e,t)}}function cBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function li2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function fi2(e){if(Array.isArray(e))return e}function NZn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NZn(Object(n),!0).forEach(function(a){lBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NZn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function lBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uCt(e,t){if(e==null)return{};var n=si2(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function si2(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var fBn=o.forwardRef(function(e,t){var n=e.children,a=uCt(e,ei2),r=cCt(a),u=r.open,c=uCt(r,ti2);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(wt(wt({},c),{},{open:u})))});fBn.displayName="Dropzone";var TZn={disabled:!1,getFilesFromEvent:ja2,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};fBn.defaultProps=TZn,fBn.propTypes={children:M.func,accept:M.objectOf(M.arrayOf(M.string)),multiple:M.bool,preventDropOnDocument:M.bool,noClick:M.bool,noKeyboard:M.bool,noDrag:M.bool,noDragEventsBubbling:M.bool,minSize:M.number,maxSize:M.number,maxFiles:M.number,disabled:M.bool,getFilesFromEvent:M.func,onFileDialogCancel:M.func,onFileDialogOpen:M.func,useFsAccessApi:M.bool,autoFocus:M.bool,onDragEnter:M.func,onDragLeave:M.func,onDragOver:M.func,onDrop:M.func,onDropAccepted:M.func,onDropRejected:M.func,onError:M.func,validator:M.func};var sBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function cCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=wt(wt({},TZn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,_=t.onDrop,m=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,L=t.noClick,j=t.noKeyboard,P=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return Qa2(n)},[n]),z=o.useMemo(function(){return Xa2(n)},[n]),V=o.useMemo(function(){return typeof b=="function"?b:ZZn},[b]),I=o.useMemo(function(){return typeof h=="function"?h:ZZn},[h]),x=o.useRef(null),N=o.useRef(null),$=o.useReducer(di2,sBn),F=uBn($,2),ne=F[0],re=F[1],H=ne.isFocused,R=ne.isFileDialogActive,G=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Ka2()),ue=function(){!G.current&&R&&setTimeout(function(){if(N.current){var he=N.current.files;he.length||(re({type:"closeDialog"}),I())}},300)};o.useEffect(function(){return window.addEventListener("focus",ue,!1),function(){window.removeEventListener("focus",ue,!1)}},[N,R,I,G]);var q=o.useRef([]),de=function(he){x.current&&x.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return w&&(document.addEventListener("dragover",AZn,!1),document.addEventListener("drop",de,!1)),function(){w&&(document.removeEventListener("dragover",AZn),document.removeEventListener("drop",de))}},[x,w]),o.useEffect(function(){return!a&&y&&x.current&&x.current.focus(),function(){}},[x,y,a]);var ce=o.useCallback(function(K){D?D(K):console.error(K)},[D]),Ce=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K),q.current=[].concat(ai2(q.current),[K.target]),oCt(K)&&Promise.resolve(r(K)).then(function(he){if(!(iCt(K)&&!k)){var rt=he.length,ze=rt>0&&Za2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),Mt=rt>0&&!ze;re({isDragAccept:ze,isDragReject:Mt,isDragActive:!0,type:"setDraggedFiles"}),s&&s(K)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K);var he=oCt(K);if(he&&K.dataTransfer)try{K.dataTransfer.dropEffect="copy"}catch{}return he&&g&&g(K),!1},[g,k]),X=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K);var he=q.current.filter(function(ze){return x.current&&x.current.contains(ze)}),rt=he.indexOf(K.target);rt!==-1&&he.splice(rt,1),q.current=he,!(he.length>0)&&(re({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),oCt(K)&&d&&d(K))},[x,d,k]),ge=o.useCallback(function(K,he){var rt=[],ze=[];K.forEach(function(Mt){var je=zZn(Mt,B),Yt=uBn(je,2),fn=Yt[0],jc=Yt[1],AO=HZn(Mt,c,u),RO=uBn(AO,2),aT=RO[0],iT=RO[1],oT=S?S(Mt):null;if(fn&&aT&&!oT)rt.push(Mt);else{var uT=[jc,iT];oT&&(uT=uT.concat(oT)),ze.push({file:Mt,errors:uT.filter(function(cT){return cT})})}}),(!l&&rt.length>1||l&&f>=1&&rt.length>f)&&(rt.forEach(function(Mt){ze.push({file:Mt,errors:[Ta2]})}),rt.splice(0)),re({acceptedFiles:rt,fileRejections:ze,type:"setFiles"}),_&&_(rt,ze,he),ze.length>0&&C&&C(ze,he),rt.length>0&&m&&m(rt,he)},[re,l,B,c,u,f,_,m,C,S]),Be=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K),q.current=[],oCt(K)&&Promise.resolve(r(K)).then(function(he){iCt(K)&&!k||ge(he,K)}).catch(function(he){return ce(he)}),re({type:"reset"})},[r,ge,ce,k]),T=o.useCallback(function(){if(G.current){re({type:"openDialog"}),V();var K={multiple:l,types:z};window.showOpenFilePicker(K).then(function(he){return r(he)}).then(function(he){ge(he,null),re({type:"closeDialog"})}).catch(function(he){Ja2(he)?(I(he),re({type:"closeDialog"})):qa2(he)?(G.current=!1,N.current?(N.current.value=null,N.current.click()):ce(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."))):ce(he)});return}N.current&&(re({type:"openDialog"}),V(),N.current.value=null,N.current.click())},[re,V,I,p,ge,ce,z,l]),Qe=o.useCallback(function(K){!x.current||!x.current.isEqualNode(K.target)||(K.key===" "||K.key==="Enter"||K.keyCode===32||K.keyCode===13)&&(K.preventDefault(),T())},[x,T]),fe=o.useCallback(function(){re({type:"focus"})},[]),Q=o.useCallback(function(){re({type:"blur"})},[]),_e=o.useCallback(function(){L||(Ya2()?setTimeout(T,0):T())},[L,T]),Oe=function(he){return a?null:he},U=function(he){return j?null:Oe(he)},pe=function(he){return P?null:Oe(he)},Le=function(he){k&&he.stopPropagation()},$e=o.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=K.refKey,rt=he===void 0?"ref":he,ze=K.role,Mt=K.onKeyDown,je=K.onFocus,Yt=K.onBlur,fn=K.onClick,jc=K.onDragEnter,AO=K.onDragOver,RO=K.onDragLeave,aT=K.onDrop,iT=uCt(K,ni2);return wt(wt(lBn({onKeyDown:U(Oc(Mt,Qe)),onFocus:U(Oc(je,fe)),onBlur:U(Oc(Yt,Q)),onClick:Oe(Oc(fn,_e)),onDragEnter:pe(Oc(jc,Ce)),onDragOver:pe(Oc(AO,le)),onDragLeave:pe(Oc(RO,X)),onDrop:pe(Oc(aT,Be)),role:typeof ze=="string"&&ze!==""?ze:"presentation"},rt,x),!a&&!j?{tabIndex:0}:{}),iT)}},[x,Qe,fe,Q,_e,Ce,le,X,Be,j,P,a]),xe=o.useCallback(function(K){K.stopPropagation()},[]),Vt=o.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=K.refKey,rt=he===void 0?"ref":he,ze=K.onChange,Mt=K.onClick,je=uCt(K,ri2),Yt=lBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:Oe(Oc(ze,Be)),onClick:Oe(Oc(Mt,xe)),tabIndex:-1},rt,N);return wt(wt({},Yt),je)}},[N,n,l,Be,a]);return wt(wt({},ne),{},{isFocused:H&&!a,getRootProps:$e,getInputProps:Vt,rootRef:x,inputRef:N,open:Oe(T)})}function di2(e,t){switch(t.type){case"focus":return wt(wt({},e),{},{isFocused:!0});case"blur":return wt(wt({},e),{},{isFocused:!1});case"openDialog":return wt(wt({},sBn),{},{isFileDialogActive:!0});case"closeDialog":return wt(wt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return wt(wt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return wt(wt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return wt({},sBn);default:return e}}function ZZn(){}const UZn=({fileRejections:e})=>e.length?v.jsx(E.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>Y(t.palette.error.main,.08),borderColor:t=>Y(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=aBn(t);return v.jsxs(E.Box,{sx:{my:1},children:[v.jsxs(E.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?UDn(r):""]}),n.map(u=>v.jsxs(E.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,gi2=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return v.jsx(E.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:v.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},_i2=Ht("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${Y(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),mi2=({header:e,description:t,sx:n,...a})=>v.jsxs(E.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[v.jsx(En2,{sx:{width:220}}),v.jsxs("div",{children:[v.jsx(E.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),v.jsx(E.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||v.jsxs(v.Fragment,{children:["Solte os arquivos aqui ou clique",v.jsx(E.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),GZn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,sx:d,dropZoneProps:g,placeholderProps:_,placeholderAlt:m,image:C,tabIndex:h,...b})=>{const{getRootProps:p,getInputProps:y,isDragActive:w,isDragReject:L,fileRejections:j}=cCt({multiple:n,disabled:t,...b}),P=!!u&&!n||C,k=l&&n&&l.length>0,D=L||!!a;return v.jsxs(E.Box,{sx:{width:1,position:"relative",...d},children:[v.jsxs(_i2,{...p(),sx:{...w&&{opacity:.72},...D&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...g},children:[v.jsx("input",{...y(),id:e,tabIndex:h}),m?v.jsx(E.Stack,{sx:{...P&&{opacity:0}},children:m}):v.jsx(mi2,{sx:{...P&&{opacity:0}},header:_==null?void 0:_.title,description:_==null?void 0:_.description}),P&&v.jsx(gi2,{file:u||C||""})]}),r&&v.jsx(E.FormHelperText,{error:!!a,sx:S=>({mx:"14px",color:t?S.palette.grey[500]:void 0}),children:r}),v.jsx(UZn,{fileRejections:j}),P&&c&&v.jsx(E.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:S=>Y(S.palette.common.white,.8),bgcolor:S=>Y(S.palette.grey[900],.72),"&:hover":{bgcolor:S=>Y(S.palette.grey[900],.48)}},children:v.jsx(tt,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&v.jsx(v.Fragment,{children:v.jsx(E.Box,{sx:{my:3},children:v.jsx(ba2,{files:l,thumbnail:f,onRemove:s})})})]})},vi2=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return v.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},hi2=Ht("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${Y(e.palette.grey[500],.32)}`})),Ci2=Ht("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),YZn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:g,fileRejections:_}=cCt({multiple:!1,disabled:a,...l}),m=!!t||n,C=g||!!e;return v.jsxs(v.Fragment,{children:[v.jsxs(hi2,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...m&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...m&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[v.jsx("input",{...s(),tabIndex:c}),m&&v.jsx(vi2,{file:t||n||""}),v.jsxs(Ci2,{className:"placeholder",sx:{"&:hover":{opacity:.72},...m&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>Y(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[v.jsx(tt,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),v.jsx(E.Typography,{variant:"caption",children:t?"Update photo":"Upload photo"})]})]}),r&&r,v.jsx(UZn,{fileRejections:_})]})},bi2=Ht("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:Y(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),yi2=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=cCt({disabled:n,...u}),d=s||t;return v.jsxs(bi2,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[v.jsx("input",{...l(),tabIndex:r}),e||v.jsx(tt,{icon:"CLOUD_UPLOAD",width:28})]})},pi2=e=>new Promise((t,n)=>{const a=new Image;a.addEventListener("load",()=>t(a)),a.addEventListener("error",r=>n(r)),a.setAttribute("crossOrigin","anonymous"),a.src=e});function KZn(e){return e*Math.PI/180}function Oi2(e,t,n){const a=KZn(n);return{width:Math.abs(Math.cos(a)*e)+Math.abs(Math.sin(a)*t),height:Math.abs(Math.sin(a)*e)+Math.abs(Math.cos(a)*t)}}async function ji2(e,t,n=0,a={horizontal:!1,vertical:!1}){const r=await pi2(e),u=document.createElement("canvas"),c=u.getContext("2d");if(!c)return null;const l=KZn(n),{width:f,height:s}=Oi2(r.width,r.height,n);u.width=f,u.height=s,c.translate(f/2,s/2),c.rotate(l),c.scale(a.horizontal?-1:1,a.vertical?-1:1),c.translate(-r.width/2,-r.height/2),c.drawImage(r,0,0);const d=c.getImageData(t.x,t.y,t.width,t.height);return u.width=t.width,u.height=t.height,c.putImageData(d,0,0),new Promise((g,_)=>{u.toBlob(m=>{g(m)},"image/png")})}const XZn=({onFileCropped:e,onImageUploaded:t,onCancel:n,image:a})=>{const r=o.useId(),[u,c,l]=CSn(),[f,s]=o.useState({x:0,y:0}),[d,g]=o.useState(1),_=o.useRef();return{id:r,crop:f,setCrop:s,zoom:d,setZoom:g,fileRef:_,onCropComplete:async(p,y)=>{try{const w=await ji2(a,y,0);_.current=new File([w],"image.png",{type:w.type})}catch{e(void 0)}},saveChanges:()=>{e(_.current),c()},cancelChanges:()=>{n&&n(),l(!1)},handleRemove:()=>{e(void 0),t(void 0),s({x:0,y:0}),g(1),l(!1)},cropModalOpen:u,toggleCropModalOpen:c,setCropModalOpen:l}},QZn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,imgSrc:c,aspect:l,size:{height:f,width:s},crop:d,zoom:g,onCropComplete:_,onCropChange:m,onZoomChange:C})=>v.jsx(mZn,{open:t,onClose:n,dialogTitle:a,actions:v.jsxs(v.Fragment,{children:[v.jsx(E.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),v.jsx(E.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),children:v.jsxs(E.Stack,{gap:2,children:[v.jsx(ZTn,{image:{width:s,height:f,aspect:l,imgSrc:c},crop:d,zoom:g,onCropComplete:_,onCropChange:m,onZoomChange:C}),v.jsxs(E.Stack,{gap:1.5,children:[v.jsxs(E.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[v.jsx(E.Typography,{variant:"body1",children:"Zoom"}),v.jsx(E.Slider,{value:g,onChange:(h,b)=>C(Array.isArray(b)?b[0]:b),min:1,max:5,size:"medium",step:.5})]}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(E.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:u,children:"Remover"}),v.jsx(E.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:v.jsx(tt,{icon:"SEARCH_IMAGE",color:$Dn.main}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})}),wi2=E.styled(E.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),Mi2=E.styled(E.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:E.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),Li2=E.styled(E.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),JZn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,size:r,label:u,image:c="",uploading:l,file:f,tabIndex:s,...d})=>{const{id:g,crop:_,cropModalOpen:m,zoom:C,cancelChanges:h,handleRemove:b,onCropComplete:p,saveChanges:y,setCrop:w,setCropModalOpen:L,setZoom:j,toggleCropModalOpen:P}=XZn({image:c,onFileCropped:e,onImageUploaded:t,onCancel:n});return v.jsxs(v.Fragment,{children:[v.jsxs(wi2,{children:[l&&v.jsx(Rht,{}),v.jsx(GZn,{...d,id:g,file:f,onDrop:k=>{if(k.length>0){L(!0),j(1),w({x:0,y:0});const D=new FileReader;D.addEventListener("load",()=>{var B;const S=((B=D.result)==null?void 0:B.toString())||"";t(S),e(void 0)}),D.readAsDataURL(k[0])}},image:c,tabIndex:s}),(f||c)&&v.jsxs(Mi2,{className:"actions",children:[v.jsx(E.Button,{color:"inherit",startIcon:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:b,children:"Remover"}),v.jsx(E.Button,{color:"inherit",startIcon:v.jsx(tt,{icon:"SEARCH_IMAGE",color:$Dn.main}),onClick:P,children:"Editar"})]})]}),v.jsx(QZn,{id:g,open:m,onClose:h,label:u,aspect:a,crop:_,zoom:C,onCropComplete:p,onCropChange:w,onZoomChange:j,imgSrc:c,onRemove:b,onSave:y,size:r})]})},Pi2=E.styled(E.Stack)(({theme:e})=>({padding:24,backgroundColor:"white",borderRadius:16,border:`1px solid ${e.palette.grey[300]}`})),Ei2=({children:e,...t})=>v.jsx(Pi2,{gap:3,...t,children:e}),nn=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>v.jsx(E.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},qZn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>v.jsxs("div",{children:[v.jsx(E.FormControlLabel,{control:v.jsx(E.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&v.jsx(E.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},ki2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],Si2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Di2=E.styled(E.Stack)(({theme:e})=>({border:`1px solid ${E.alpha(e.palette.primary.main,.3)}`,backgroundColor:E.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Bi2=E.styled(E.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),Wi2=E.styled(E.IconButton)(()=>({height:"38px",alignSelf:"center"})),Ii2=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return v.jsxs(v.Fragment,{children:[n&&v.jsxs(Di2,{children:[v.jsx(tt,{icon:"INFO_CIRCLE"}),v.jsx(E.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&v.jsx(nn,{name:"name",label:"Nome do webhook"}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),v.jsx(nn,{name:"filter",label:"Filtro"})]}),t&&e&&v.jsxs(v.Fragment,{children:[v.jsx(nn,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),v.jsx(nn,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(Bi2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:v.jsx(tt,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),v.jsx(nn,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsxs(E.Stack,{width:"35%",gap:2,children:[v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),v.jsx(dBn,{name:"content_type",options:ki2,row:!0,decorated:!0})]}),v.jsxs(E.Stack,{gap:2,children:[v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),v.jsx(dBn,{name:"http_method",options:Si2,row:!0,decorated:!0})]})]}),v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),v.jsx(qZn,{name:"active",label:"Ativo"}),v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),v.jsx(nn,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),v.jsx(Wi2,{onClick:()=>c(s),color:"error",children:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),v.jsx(oRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),v.jsx(E.Divider,{})]})},eUn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>v.jsx(Qkn,{...c,...r,onChange:f=>{a&&a(f),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},tUn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:l,ref:f},fieldState:{error:s}})=>v.jsx(eBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},$i2=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,g=`${e}.city`,_=m=>{m.key==="Enter"&&m.preventDefault()};return v.jsxs(E.Stack,{gap:1.5,...t,children:[v.jsxs(E.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[v.jsx(tUn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(E.CircularProgress,{size:24})})},rules:a,onKeyDown:_,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),v.jsxs(E.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[v.jsx(nn,{name:c,label:"Logradouro",onKeyDown:_,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),v.jsx(nn,{name:l,label:"Número",onKeyDown:_,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),v.jsxs(E.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[v.jsx(nn,{name:f,label:"Bairro",onKeyDown:_,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),v.jsx(nn,{name:s,label:"Complemento",onKeyDown:_,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),v.jsxs(E.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[v.jsx(eUn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),v.jsx(nn,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},xi2=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>v.jsxs("div",{children:[v.jsx(E.FormControlLabel,{control:v.jsx(E.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&v.jsx(E.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},zi2=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(g,_)=>g.includes(_)?g.filter(m=>m!==_):[...g,_];return v.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:g=[],..._},fieldState:{error:m}})=>v.jsxs(E.FormControl,{component:"fieldset",children:[a&&v.jsx(E.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),v.jsx(E.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>v.jsx(E.FormControlLabel,{control:v.jsx(E.Checkbox,{checked:g.includes(C.value),onChange:()=>_.onChange(d(g,C.value))}),label:C.label,...f},C.value))}),(!!m||c)&&v.jsx(E.FormHelperText,{error:!!m,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:m?m==null?void 0:m.message:c})]})})},Hi2=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=_=>{const m=_.clipboardData.getData("text").split("");t.map((C,h)=>l(C,m[h])),_.preventDefault()},d=(_,m)=>{const{maxLength:C,value:h,name:b}=_.target,p=b.replace(e,""),y=Number(p),w=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(_.target.value=h[0]),h.length>=C&&y<6&&w!==null&&w.focus(),m(_)};hSn("paste",s,u);const g=t.some(_=>f[_]);return v.jsxs(E.Stack,{children:[v.jsx(E.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((_,m)=>v.jsx(Ie.Controller,{name:`${e}${m+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>v.jsx(E.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:m===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},_))}),g&&v.jsx(E.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},Ai2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>v.jsx(_Nn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},Ri2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Vi2=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:g}})=>v.jsx(lT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:_=>d({startDate:_[0],endDate:_[1]}),onError:_=>{f(e,{message:_[0]||_[1]||void 0})},...c,slotProps:{textField:({position:_})=>{var m;return{...(m=c.slotProps)==null?void 0:m.textField,required:u,error:!!g,helperText:(g==null?void 0:g.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:_==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},Fi2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Ni2=({id:e,children:t,onSubmit:n,methods:a,...r})=>v.jsx(Ie.FormProvider,{...a,children:v.jsx(E.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Ti2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>v.jsx(XDn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},Zi2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>v.jsx(Qht,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},Ui2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,...l})=>{const{watch:f}=Ie.useFormContext(),s=f(e),[d,g]=o.useState(!1),{hasNumberChar:_,hasSpecialCharacter:m,hasUpperCaseChar:C,isLengthValid:h}=nCt(s,a,c,r,u);return v.jsx(nn,{...l,name:e,type:d?"text":"password",InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(E.IconButton,{onClick:()=>g(!d),edge:"end","aria-label":"Mostrar/Ocultar senha",children:v.jsx(tt,{icon:d?"VIEW_OFF":"VIEW_ON"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:b=>{const p=nCt(b,a,c,r,u);return!p.hasNumberChar||!p.hasSpecialCharacter||!p.hasUpperCaseChar||!p.isLengthValid?"Senha inválida":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:!m||!C||!h||!_?"none":void 0}}})},dBn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:g,..._})=>{const{control:m}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return v.jsx(Ie.Controller,{name:e,control:m,rules:t,render:({field:h,fieldState:{error:b}})=>v.jsxs(E.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&v.jsx(E.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),v.jsx(E.RadioGroup,{..._,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>v.jsx(E.FormControlLabel,{value:p.value,control:v.jsx(E.Radio,{inputProps:{tabIndex:s},disabled:g,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${E.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:E.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&v.jsx(E.FormHelperText,{error:!!b,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Gi2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Yi2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,size:r,label:u,image:c="",uploading:l,file:f,tabIndex:s,...d})=>{const{id:g,crop:_,cropModalOpen:m,zoom:C,cancelChanges:h,handleRemove:b,onCropComplete:p,saveChanges:y,setCrop:w,setCropModalOpen:L,setZoom:j}=XZn({image:c,onFileCropped:e,onImageUploaded:t,onCancel:n});return v.jsxs(v.Fragment,{children:[v.jsxs(E.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[l&&v.jsx(Li2,{}),v.jsx(YZn,{...d,id:g,file:f,onDrop:P=>{if(P.length>0){L(!0),j(1),w({x:0,y:0});const k=new FileReader;k.addEventListener("load",()=>{var S;const D=((S=k.result)==null?void 0:S.toString())||"";t(D),e(void 0)}),k.readAsDataURL(P[0])}},image:c,tabIndex:s})]}),v.jsx(QZn,{id:g,open:m,onClose:h,label:u,aspect:a,crop:_,zoom:C,onCropComplete:p,onCropChange:w,onZoomChange:j,imgSrc:c,onRemove:b,onSave:y,size:r})]})};function nUn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async _=>{if(!_){a(e,void 0),u(void 0);return}a(e,_),u(Object.assign(_,{preview:URL.createObjectURL(_)}))},uploadFiles:async _=>{a(e,[...c,..._.map(m=>Object.assign(m,{preview:URL.createObjectURL(m)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:_=>{const m=c.filter(C=>C!==_);a(e,m)},file:r,setFileValue:u}}const Ki2=({name:e,rules:t,helperText:n,aspect:a,label:r,size:u,image:c,onFileCropped:l,onImageUploaded:f,onCancel:s,...d})=>{const{control:g}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:C}=nUn(e);return v.jsx(Ie.Controller,{name:e,control:g,rules:t,render:({field:{value:h},fieldState:{error:b}})=>v.jsx(Yi2,{accept:{"image/*":[]},file:h?m:void 0,onFileCropped:p=>{_(p),l&&l(p)},onImageUploaded:f,onCancel:()=>{C(void 0),s&&s()},error:!!b,disableMultiple:!0,helperText:(!!b||n)&&v.jsx(E.FormHelperText,{error:!!b,sx:{px:2},children:b?b==null?void 0:b.message:n}),aspect:a,label:r,size:u,image:c,...d})})},Xi2=({name:e,rules:t,helperText:n,aspect:a,label:r,size:u,image:c,onFileCropped:l,onImageUploaded:f,onCancel:s,...d})=>{const{control:g}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:C}=nUn(e);return v.jsx(Ie.Controller,{name:e,control:g,rules:t,render:({field:{value:h},fieldState:{error:b}})=>v.jsx(JZn,{accept:{"image/*":[]},file:h?m:void 0,onFileCropped:p=>{_(p),l&&l(p)},onImageUploaded:f,onCancel:()=>{C(void 0),s&&s()},error:!!b,disableMultiple:!0,helperText:(!!b||n)&&v.jsx(E.FormHelperText,{error:!!b,sx:{px:2},children:b?b==null?void 0:b.message:n}),aspect:a,label:r,size:u,image:c,...d})})},Qi2=Object.freeze(Object.defineProperty({__proto__:null,default:EXn},Symbol.toStringTag,{value:"Module"}));A.ActionButton=oRn,A.Address=$i2,A.Autocomplete=Qkn,A.AutocompleteField=eUn,A.BuilderLayout=$So,A.BuilderSidebar=uzo,A.Carousel=CLo,A.CarouselArrowIndex=fEo,A.CarouselArrows=JPo,A.CarouselDots=OLo,A.Checkbox=xi2,A.Codes=Hi2,A.ColorPickerField=Ai2,A.ColorPickerInput=_Nn,A.Common=bn2,A.CommonSSR=pn2,A.Confirm=On2,A.CustomAvatar=_Tn,A.CustomAvatarGroup=mTn,A.DataGrid=Sn2,A.DatePicker=Ri2,A.DateRangePicker=Vi2,A.DateTimePicker=Fi2,A.Delayed=Dn2,A.DialogAnimate=eQn,A.Drawer=Fn2,A.EmptyContent=AHn,A.EmptyView=hTn,A.FabButtonAnimate=t$n,A.Field=nn,A.FixedProgressBar=Rht,A.Form=Ni2,A.HelpButton=bRn,A.Icon=tt,A.IconButtonAnimate=n$n,A.Iconify=vr,A.ImageCrop=ZTn,A.Incrementer=XDn,A.IncrementerField=Ti2,A.Label=iZn,A.Lightbox=dSo,A.LoadingScreen=Ur2,A.MaskedInput=eBn,A.MaskedInputField=tUn,A.MaterialDesignContent=Axn,A.MenuPopover=l12,A.Modal=mZn,A.ModalActions=_12,A.MotionContainer=yer,A.MotionLazyContainer=Kbt,A.MotionViewport=ber,A.MultiCheckbox=zi2,A.NumberInput=Qht,A.NumberInputField=Zi2,A.PasswordField=Ui2,A.PasswordRules=y12,A.Portal=vZn,A.RadioGroupField=dBn,A.SavedChanges=V12,A.Scrollbar=kTn,A.SearchInput=F12,A.SnackbarContent=ryt,A.SnackbarProvider=Fxn,A.SplashScreen=N12,A.Steps=U12,A.StyledTab=G12,A.StyledTabs=Y12,A.Switch=qZn,A.TRANSITION=OBn,A.TabPanel=K12,A.TableEmptyRows=hEo,A.TableHeadCustom=bEo,A.TableNoData=mEo,A.TablePaginationCustom=pEo,A.TableSelectedAction=yEo,A.TableSkeleton=vEo,A.TextAnimate=tQn,A.TextMaxLine=yZn,A.ThemeProvider=gTn,A.TimePicker=Gi2,A.Transition=nvt,A.Upload=GZn,A.UploadAvatar=YZn,A.UploadAvatarWithCropField=Ki2,A.UploadBox=yi2,A.UploadWithCrop=JZn,A.UploadWithCropField=Xi2,A.Webhook=Ii2,A.WhiteBox=Ei2,A.color=qe2,A.cssStyles=cEo,A.emptyRows=sEo,A.file=p12,A.formatNumber=yr2,A.formatTime=B12,A.getComparator=dEo,A.loadable=R12,A.mask=H12,A.number=_r2,A.routes=I12,A.sort=z12,A.useActiveElement=xSo,A.useCarousel=bLo,A.useCopyToClipboard=zSo,A.useDatagrid=HSo,A.useDeepCompareEffect=Qxo,A.useEventListener=hSn,A.useIsMounting=qxo,A.useLightBox=mSo,A.useOffSetTop=rzo,A.useOnClickOutside=nzo,A.usePagination=tzo,A.useResponsive=mxn,A.useSnackbar=Jer,A.useTable=gEo,A.useTabs=ezo,A.useToggle=CSn,A.uuidv4=A12,A.validators=h12,A.varBgColor=_Un,A.varBgKenburns=mUn,A.varBgPan=vUn,A.varBounce=sUn,A.varContainer=K_t,A.varFade=Ice,A.varFlip=cUn,A.varHover=gUn,A.varPath=iUn,A.varRotate=dUn,A.varScale=fUn,A.varSlide=lUn,A.varTranEnter=We,A.varTranExit=Fe,A.varTranHover=oUn,A.varZoom=uUn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
35506
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZn(e,t){if(e){if(typeof e=="string")return cBn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cBn(e,t)}}function cBn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function li2(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a=[],r=!0,u=!1,c,l;try{for(n=n.call(e);!(r=(c=n.next()).done)&&(a.push(c.value),!(t&&a.length===t));r=!0);}catch(f){u=!0,l=f}finally{try{!r&&n.return!=null&&n.return()}finally{if(u)throw l}}return a}}function fi2(e){if(Array.isArray(e))return e}function NZn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NZn(Object(n),!0).forEach(function(a){lBn(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NZn(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function lBn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uCt(e,t){if(e==null)return{};var n=si2(e,t),a,r;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)a=u[r],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function si2(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,u;for(u=0;u<a.length;u++)r=a[u],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var fBn=o.forwardRef(function(e,t){var n=e.children,a=uCt(e,ei2),r=cCt(a),u=r.open,c=uCt(r,ti2);return o.useImperativeHandle(t,function(){return{open:u}},[u]),o.createElement(o.Fragment,null,n(wt(wt({},c),{},{open:u})))});fBn.displayName="Dropzone";var TZn={disabled:!1,getFilesFromEvent:ja2,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};fBn.defaultProps=TZn,fBn.propTypes={children:M.func,accept:M.objectOf(M.arrayOf(M.string)),multiple:M.bool,preventDropOnDocument:M.bool,noClick:M.bool,noKeyboard:M.bool,noDrag:M.bool,noDragEventsBubbling:M.bool,minSize:M.number,maxSize:M.number,maxFiles:M.number,disabled:M.bool,getFilesFromEvent:M.func,onFileDialogCancel:M.func,onFileDialogOpen:M.func,useFsAccessApi:M.bool,autoFocus:M.bool,onDragEnter:M.func,onDragLeave:M.func,onDragOver:M.func,onDrop:M.func,onDropAccepted:M.func,onDropRejected:M.func,onError:M.func,validator:M.func};var sBn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function cCt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=wt(wt({},TZn),e),n=t.accept,a=t.disabled,r=t.getFilesFromEvent,u=t.maxSize,c=t.minSize,l=t.multiple,f=t.maxFiles,s=t.onDragEnter,d=t.onDragLeave,g=t.onDragOver,_=t.onDrop,m=t.onDropAccepted,C=t.onDropRejected,h=t.onFileDialogCancel,b=t.onFileDialogOpen,p=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,L=t.noClick,j=t.noKeyboard,P=t.noDrag,k=t.noDragEventsBubbling,D=t.onError,S=t.validator,B=o.useMemo(function(){return Qa2(n)},[n]),z=o.useMemo(function(){return Xa2(n)},[n]),V=o.useMemo(function(){return typeof b=="function"?b:ZZn},[b]),I=o.useMemo(function(){return typeof h=="function"?h:ZZn},[h]),x=o.useRef(null),N=o.useRef(null),$=o.useReducer(di2,sBn),F=uBn($,2),ne=F[0],re=F[1],H=ne.isFocused,R=ne.isFileDialogActive,G=o.useRef(typeof window<"u"&&window.isSecureContext&&p&&Ka2()),ue=function(){!G.current&&R&&setTimeout(function(){if(N.current){var he=N.current.files;he.length||(re({type:"closeDialog"}),I())}},300)};o.useEffect(function(){return window.addEventListener("focus",ue,!1),function(){window.removeEventListener("focus",ue,!1)}},[N,R,I,G]);var q=o.useRef([]),de=function(he){x.current&&x.current.contains(he.target)||(he.preventDefault(),q.current=[])};o.useEffect(function(){return w&&(document.addEventListener("dragover",AZn,!1),document.addEventListener("drop",de,!1)),function(){w&&(document.removeEventListener("dragover",AZn),document.removeEventListener("drop",de))}},[x,w]),o.useEffect(function(){return!a&&y&&x.current&&x.current.focus(),function(){}},[x,y,a]);var ce=o.useCallback(function(K){D?D(K):console.error(K)},[D]),Ce=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K),q.current=[].concat(ai2(q.current),[K.target]),oCt(K)&&Promise.resolve(r(K)).then(function(he){if(!(iCt(K)&&!k)){var rt=he.length,ze=rt>0&&Za2({files:he,accept:B,minSize:c,maxSize:u,multiple:l,maxFiles:f,validator:S}),Mt=rt>0&&!ze;re({isDragAccept:ze,isDragReject:Mt,isDragActive:!0,type:"setDraggedFiles"}),s&&s(K)}}).catch(function(he){return ce(he)})},[r,s,ce,k,B,c,u,l,f,S]),le=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K);var he=oCt(K);if(he&&K.dataTransfer)try{K.dataTransfer.dropEffect="copy"}catch{}return he&&g&&g(K),!1},[g,k]),X=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K);var he=q.current.filter(function(ze){return x.current&&x.current.contains(ze)}),rt=he.indexOf(K.target);rt!==-1&&he.splice(rt,1),q.current=he,!(he.length>0)&&(re({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),oCt(K)&&d&&d(K))},[x,d,k]),ge=o.useCallback(function(K,he){var rt=[],ze=[];K.forEach(function(Mt){var je=zZn(Mt,B),Yt=uBn(je,2),fn=Yt[0],jc=Yt[1],AO=HZn(Mt,c,u),RO=uBn(AO,2),aT=RO[0],iT=RO[1],oT=S?S(Mt):null;if(fn&&aT&&!oT)rt.push(Mt);else{var uT=[jc,iT];oT&&(uT=uT.concat(oT)),ze.push({file:Mt,errors:uT.filter(function(cT){return cT})})}}),(!l&&rt.length>1||l&&f>=1&&rt.length>f)&&(rt.forEach(function(Mt){ze.push({file:Mt,errors:[Ta2]})}),rt.splice(0)),re({acceptedFiles:rt,fileRejections:ze,type:"setFiles"}),_&&_(rt,ze,he),ze.length>0&&C&&C(ze,he),rt.length>0&&m&&m(rt,he)},[re,l,B,c,u,f,_,m,C,S]),Be=o.useCallback(function(K){K.preventDefault(),K.persist(),Le(K),q.current=[],oCt(K)&&Promise.resolve(r(K)).then(function(he){iCt(K)&&!k||ge(he,K)}).catch(function(he){return ce(he)}),re({type:"reset"})},[r,ge,ce,k]),T=o.useCallback(function(){if(G.current){re({type:"openDialog"}),V();var K={multiple:l,types:z};window.showOpenFilePicker(K).then(function(he){return r(he)}).then(function(he){ge(he,null),re({type:"closeDialog"})}).catch(function(he){Ja2(he)?(I(he),re({type:"closeDialog"})):qa2(he)?(G.current=!1,N.current?(N.current.value=null,N.current.click()):ce(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."))):ce(he)});return}N.current&&(re({type:"openDialog"}),V(),N.current.value=null,N.current.click())},[re,V,I,p,ge,ce,z,l]),Qe=o.useCallback(function(K){!x.current||!x.current.isEqualNode(K.target)||(K.key===" "||K.key==="Enter"||K.keyCode===32||K.keyCode===13)&&(K.preventDefault(),T())},[x,T]),fe=o.useCallback(function(){re({type:"focus"})},[]),Q=o.useCallback(function(){re({type:"blur"})},[]),_e=o.useCallback(function(){L||(Ya2()?setTimeout(T,0):T())},[L,T]),Oe=function(he){return a?null:he},U=function(he){return j?null:Oe(he)},pe=function(he){return P?null:Oe(he)},Le=function(he){k&&he.stopPropagation()},$e=o.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=K.refKey,rt=he===void 0?"ref":he,ze=K.role,Mt=K.onKeyDown,je=K.onFocus,Yt=K.onBlur,fn=K.onClick,jc=K.onDragEnter,AO=K.onDragOver,RO=K.onDragLeave,aT=K.onDrop,iT=uCt(K,ni2);return wt(wt(lBn({onKeyDown:U(Oc(Mt,Qe)),onFocus:U(Oc(je,fe)),onBlur:U(Oc(Yt,Q)),onClick:Oe(Oc(fn,_e)),onDragEnter:pe(Oc(jc,Ce)),onDragOver:pe(Oc(AO,le)),onDragLeave:pe(Oc(RO,X)),onDrop:pe(Oc(aT,Be)),role:typeof ze=="string"&&ze!==""?ze:"presentation"},rt,x),!a&&!j?{tabIndex:0}:{}),iT)}},[x,Qe,fe,Q,_e,Ce,le,X,Be,j,P,a]),xe=o.useCallback(function(K){K.stopPropagation()},[]),Vt=o.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=K.refKey,rt=he===void 0?"ref":he,ze=K.onChange,Mt=K.onClick,je=uCt(K,ri2),Yt=lBn({accept:B,multiple:l,type:"file",style:{display:"none"},onChange:Oe(Oc(ze,Be)),onClick:Oe(Oc(Mt,xe)),tabIndex:-1},rt,N);return wt(wt({},Yt),je)}},[N,n,l,Be,a]);return wt(wt({},ne),{},{isFocused:H&&!a,getRootProps:$e,getInputProps:Vt,rootRef:x,inputRef:N,open:Oe(T)})}function di2(e,t){switch(t.type){case"focus":return wt(wt({},e),{},{isFocused:!0});case"blur":return wt(wt({},e),{},{isFocused:!1});case"openDialog":return wt(wt({},sBn),{},{isFileDialogActive:!0});case"closeDialog":return wt(wt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return wt(wt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return wt(wt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return wt({},sBn);default:return e}}function ZZn(){}const UZn=({fileRejections:e})=>e.length?v.jsx(E.Paper,{variant:"outlined",sx:{py:1,px:2,mt:3,bgcolor:t=>Y(t.palette.error.main,.08),borderColor:t=>Y(t.palette.error.main,.24)},children:e.map(({file:t,errors:n})=>{const{path:a,size:r}=aBn(t);return v.jsxs(E.Box,{sx:{my:1},children:[v.jsxs(E.Typography,{variant:"subtitle2",noWrap:!0,children:[a," - ",r?UDn(r):""]}),n.map(u=>v.jsxs(E.Box,{component:"span",sx:{typography:"caption"},children:["- ",u.message]},u.code))]},a)})}):null,gi2=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return v.jsx(E.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:v.jsx("img",{alt:"file preview",src:t,style:{borderRadius:8,width:"auto",maxWidth:"100%",maxHeight:"100%",height:"auto"}})})},_i2=Ht("div")(({theme:e})=>({outline:"none",cursor:"pointer",overflow:"hidden",position:"relative",padding:e.spacing(5),borderRadius:e.shape.borderRadius,transition:e.transitions.create("padding"),backgroundColor:e.palette.background.neutral,border:`1px dashed ${Y(e.palette.grey[500],.32)}`,"&:hover":{opacity:.72}})),mi2=({header:e,description:t,sx:n,...a})=>v.jsxs(E.Stack,{spacing:5,alignItems:"center",justifyContent:"center",direction:{xs:"column",md:"row"},sx:{width:1,textAlign:{xs:"center",md:"left"},...n},...a,children:[v.jsx(En2,{sx:{width:220}}),v.jsxs("div",{children:[v.jsx(E.Typography,{gutterBottom:!0,variant:"h5",children:e||"Soltar ou selecionar arquivos"}),v.jsx(E.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t||v.jsxs(v.Fragment,{children:["Solte os arquivos aqui ou clique",v.jsx(E.Typography,{variant:"body2",component:"span",sx:{mx:.5,color:"primary.main",textDecoration:"underline"},children:"procurar"}),"na sua máquina"]})})]})]}),GZn=({id:e,disabled:t,multiple:n=!1,error:a,helperText:r,file:u,onDelete:c,files:l,thumbnail:f,onRemove:s,sx:d,dropZoneProps:g,placeholderProps:_,placeholderAlt:m,image:C,tabIndex:h,...b})=>{const{getRootProps:p,getInputProps:y,isDragActive:w,isDragReject:L,fileRejections:j}=cCt({multiple:n,disabled:t,...b}),P=!!u&&!n||C,k=l&&n&&l.length>0,D=L||!!a;return v.jsxs(E.Box,{sx:{width:1,position:"relative",...d},children:[v.jsxs(_i2,{...p(),sx:{...w&&{opacity:.72},...D&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...t&&{opacity:.48,pointerEvents:"none"},...g},children:[v.jsx("input",{...y(),id:e,tabIndex:h}),m?v.jsx(E.Stack,{sx:{...P&&{opacity:0}},children:m}):v.jsx(mi2,{sx:{...P&&{opacity:0}},header:_==null?void 0:_.title,description:_==null?void 0:_.description}),P&&v.jsx(gi2,{file:u||C||""})]}),r&&v.jsx(E.FormHelperText,{error:!!a,sx:S=>({mx:"14px",color:t?S.palette.grey[500]:void 0}),children:r}),v.jsx(UZn,{fileRejections:j}),P&&c&&v.jsx(E.IconButton,{size:"small",onClick:c,sx:{top:16,right:16,zIndex:9,position:"absolute",color:S=>Y(S.palette.common.white,.8),bgcolor:S=>Y(S.palette.grey[900],.72),"&:hover":{bgcolor:S=>Y(S.palette.grey[900],.48)}},children:v.jsx(tt,{icon:"CLOSE_MARK_BUTTON",width:18})}),k&&v.jsx(v.Fragment,{children:v.jsx(E.Box,{sx:{my:3},children:v.jsx(ba2,{files:l,thumbnail:f,onRemove:s})})})]})},vi2=({file:e})=>{if(!e)return null;const t=typeof e=="string"?e:e.preview;return v.jsx("img",{alt:"avatar",src:t,style:{zIndex:8,overflow:"hidden",borderRadius:"50%",position:"absolute",width:"calc(100% - 16px)",height:"calc(100% - 16px)"}})},hi2=Ht("div")(({theme:e})=>({width:144,height:144,margin:"auto",display:"flex",cursor:"pointer",overflow:"hidden",borderRadius:"50%",alignItems:"center",position:"relative",justifyContent:"center",border:`1px dashed ${Y(e.palette.grey[500],.32)}`})),Ci2=Ht("div")(({theme:e})=>({zIndex:7,display:"flex",borderRadius:"50%",position:"absolute",alignItems:"center",flexDirection:"column",justifyContent:"center",width:"calc(100% - 16px)",height:"calc(100% - 16px)",color:e.palette.text.disabled,backgroundColor:e.palette.background.neutral,transition:e.transitions.create("opacity",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.shorter})})),YZn=({error:e,file:t,image:n,disabled:a,helperText:r,sx:u,tabIndex:c,...l})=>{const{getRootProps:f,getInputProps:s,isDragActive:d,isDragReject:g,fileRejections:_}=cCt({multiple:!1,disabled:a,...l}),m=!!t||n,C=g||!!e;return v.jsxs(v.Fragment,{children:[v.jsxs(hi2,{...f(),sx:{...d&&{opacity:.72},...C&&{borderColor:"error.light",...m&&{bgcolor:"error.lighter"}},...a&&{opacity:.48,pointerEvents:"none"},...m&&{"&:hover":{"& .placeholder":{opacity:1}}},...u},children:[v.jsx("input",{...s(),tabIndex:c}),m&&v.jsx(vi2,{file:t||n||""}),v.jsxs(Ci2,{className:"placeholder",sx:{"&:hover":{opacity:.72},...m&&{zIndex:9,opacity:0,color:"common.white",bgcolor:h=>Y(h.palette.grey[900],.64)},...C&&{color:"error.main",bgcolor:"error.lighter"}},children:[v.jsx(tt,{icon:"ADD_IMAGE",width:24,sx:{mb:1}}),v.jsx(E.Typography,{variant:"caption",children:t?"Update photo":"Upload photo"})]})]}),r&&r,v.jsx(UZn,{fileRejections:_})]})},bi2=Ht("div")(({theme:e})=>({width:64,height:64,fontSize:24,display:"flex",flexShrink:0,cursor:"pointer",alignItems:"center",justifyContent:"center",margin:e.spacing(.5),color:e.palette.text.disabled,borderRadius:e.shape.borderRadius,border:`dashed 1px ${e.palette.divider}`,backgroundColor:Y(e.palette.grey[500],.08),"&:hover":{opacity:.72}})),yi2=({placeholderAlt:e,error:t,disabled:n,sx:a,tabIndex:r,...u})=>{const{getRootProps:c,getInputProps:l,isDragActive:f,isDragReject:s}=cCt({disabled:n,...u}),d=s||t;return v.jsxs(bi2,{...c(),sx:{...f&&{opacity:.72},...d&&{color:"error.main",bgcolor:"error.lighter",borderColor:"error.light"},...n&&{opacity:.48,pointerEvents:"none"},...a},children:[v.jsx("input",{...l(),tabIndex:r}),e||v.jsx(tt,{icon:"CLOUD_UPLOAD",width:28})]})},pi2=e=>new Promise((t,n)=>{const a=new Image;a.addEventListener("load",()=>t(a)),a.addEventListener("error",r=>n(r)),a.setAttribute("crossOrigin","anonymous"),a.src=e});function KZn(e){return e*Math.PI/180}function Oi2(e,t,n){const a=KZn(n);return{width:Math.abs(Math.cos(a)*e)+Math.abs(Math.sin(a)*t),height:Math.abs(Math.sin(a)*e)+Math.abs(Math.cos(a)*t)}}async function ji2(e,t,n=0,a={horizontal:!1,vertical:!1}){const r=await pi2(e),u=document.createElement("canvas"),c=u.getContext("2d");if(!c)return null;const l=KZn(n),{width:f,height:s}=Oi2(r.width,r.height,n);u.width=f,u.height=s,c.translate(f/2,s/2),c.rotate(l),c.scale(a.horizontal?-1:1,a.vertical?-1:1),c.translate(-r.width/2,-r.height/2),c.drawImage(r,0,0);const d=c.getImageData(t.x,t.y,t.width,t.height);return u.width=t.width,u.height=t.height,c.putImageData(d,0,0),new Promise((g,_)=>{u.toBlob(m=>{g(m)},"image/png")})}const XZn=({onFileCropped:e,onImageUploaded:t,onCancel:n,image:a})=>{const r=o.useId(),[u,c,l]=CSn(),[f,s]=o.useState({x:0,y:0}),[d,g]=o.useState(1),_=o.useRef();return{id:r,crop:f,setCrop:s,zoom:d,setZoom:g,fileRef:_,onCropComplete:async(p,y)=>{try{const w=await ji2(a,y,0);_.current=new File([w],"image.png",{type:w.type})}catch{e(void 0)}},saveChanges:()=>{e(_.current),c()},cancelChanges:()=>{n&&n(),l(!1)},handleRemove:()=>{e(void 0),t(void 0),s({x:0,y:0}),g(1),l(!1)},cropModalOpen:u,toggleCropModalOpen:c,setCropModalOpen:l}},QZn=({id:e,open:t,onClose:n,label:a,onSave:r,onRemove:u,imgSrc:c,aspect:l,size:{height:f,width:s},crop:d,zoom:g,onCropComplete:_,onCropChange:m,onZoomChange:C})=>v.jsx(mZn,{open:t,onClose:n,dialogTitle:a,actions:v.jsxs(v.Fragment,{children:[v.jsx(E.Button,{variant:"outlined",size:"medium",onClick:n,color:"inherit",children:"Cancelar"}),v.jsx(E.Button,{variant:"contained",size:"medium",onClick:r,children:"Salvar"})]}),children:v.jsxs(E.Stack,{gap:2,children:[v.jsx(ZTn,{image:{width:s,height:f,aspect:l,imgSrc:c},crop:d,zoom:g,onCropComplete:_,onCropChange:m,onZoomChange:C}),v.jsxs(E.Stack,{gap:1.5,children:[v.jsxs(E.Stack,{width:1,direction:"row",gap:3,flex:1,alignItems:"center",mr:"auto",children:[v.jsx(E.Typography,{variant:"body1",children:"Zoom"}),v.jsx(E.Slider,{value:g,onChange:(h,b)=>C(Array.isArray(b)?b[0]:b),min:1,max:5,size:"medium",step:.5})]}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(E.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:u,children:"Remover"}),v.jsx(E.Button,{variant:"outlined",color:"inherit",size:"large",fullWidth:!0,startIcon:v.jsx(tt,{icon:"SEARCH_IMAGE",color:$Dn.main}),component:"label",htmlFor:e,children:"Alterar"})]})]})]})}),wi2=E.styled(E.Stack)({position:"relative",width:"100%",borderRadius:8,overflow:"hidden","&:hover .actions":{display:"flex"}}),Mi2=E.styled(E.Stack)(({theme:e})=>({display:"none",position:"absolute",alignItems:"center",justifyContent:"center",flexDirection:"row",gap:12,width:"100%",height:"100%",backgroundColor:E.alpha(e.palette.primary.main,.9),zIndex:999,button:{"&, &:hover, &:focus":{backgroundColor:"#fff"}}})),Li2=E.styled(E.CircularProgress)({position:"absolute",width:"100%",height:"100%",zIndex:99,backgroundColor:"#fff",borderRadius:"50%"}),JZn=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,size:r,label:u,image:c="",uploading:l,file:f,tabIndex:s,...d})=>{const{id:g,crop:_,cropModalOpen:m,zoom:C,cancelChanges:h,handleRemove:b,onCropComplete:p,saveChanges:y,setCrop:w,setCropModalOpen:L,setZoom:j,toggleCropModalOpen:P}=XZn({image:c,onFileCropped:e,onImageUploaded:t,onCancel:n});return v.jsxs(v.Fragment,{children:[v.jsxs(wi2,{children:[l&&v.jsx(Rht,{}),v.jsx(GZn,{...d,id:g,file:f,onDrop:k=>{if(k.length>0){L(!0),j(1),w({x:0,y:0});const D=new FileReader;D.addEventListener("load",()=>{var B;const S=((B=D.result)==null?void 0:B.toString())||"";t(S),e(void 0)}),D.readAsDataURL(k[0])}},image:c,tabIndex:s}),(f||c)&&v.jsxs(Mi2,{className:"actions",children:[v.jsx(E.Button,{color:"inherit",startIcon:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02",color:"error.main"}),onClick:b,children:"Remover"}),v.jsx(E.Button,{color:"inherit",startIcon:v.jsx(tt,{icon:"SEARCH_IMAGE",color:$Dn.main}),onClick:P,children:"Editar"})]})]}),v.jsx(QZn,{id:g,open:m,onClose:h,label:u,aspect:a,crop:_,zoom:C,onCropComplete:p,onCropChange:w,onZoomChange:j,imgSrc:c,onRemove:b,onSave:y,size:r})]})},Pi2=E.styled(E.Stack)(({theme:e})=>({padding:24,backgroundColor:"white",borderRadius:16,border:`1px solid ${e.palette.grey[300]}`})),Ei2=({children:e,...t})=>v.jsx(Pi2,{gap:3,...t,children:e}),nn=({name:e,helperText:t,rules:n,onChange:a,tabIndex:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:n,render:({field:{ref:l,...f},fieldState:{error:s}})=>v.jsx(E.TextField,{...f,onChange:d=>{f.onChange(d),a&&a(d)},inputRef:l,fullWidth:!0,error:!!s,helperText:(s==null?void 0:s.message)||t,...u,inputProps:{...u.inputProps,tabIndex:r}})})},qZn=({name:e,helperText:t,onChange:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,render:({field:c,fieldState:{error:l}})=>v.jsxs("div",{children:[v.jsx(E.FormControlLabel,{control:v.jsx(E.Switch,{...c,checked:c.value,onChange:(f,s)=>{c.onChange(f),n&&n(f,s)},inputProps:{tabIndex:a}}),...r}),(!!l||t)&&v.jsx(E.FormHelperText,{error:!!l,sx:f=>({mx:"14px",color:r.disabled?f.palette.grey[500]:void 0}),children:l?l==null?void 0:l.message:t})]})})},ki2=[{label:"JSON",value:"JSON"},{label:"XML",value:"XML"},{label:"BINÁRIO",value:"BYTEA"}],Si2=[{label:"PUT",value:"PUT"},{label:"POST",value:"POST"},{label:"GET",value:"GET"},{label:"DELETE",value:"DELETE"}],Di2=E.styled(E.Stack)(({theme:e})=>({border:`1px solid ${E.alpha(e.palette.primary.main,.3)}`,backgroundColor:E.alpha(e.palette.primary.main,.05),flexDirection:"row",alignItems:"center",padding:10,gap:10,borderRadius:8,marginBottom:8,svg:{color:e.palette.primary.main}})),Bi2=E.styled(E.IconButton)(({theme:e})=>({svg:{color:`${e.palette.primary.main} !important`}})),Wi2=E.styled(E.IconButton)(()=>({height:"38px",alignSelf:"center"})),Ii2=({webhookData:e,isEditing:t=!1,haveTip:n=!1})=>{const{control:a}=Ie.useFormContext(),{fields:r,append:u,remove:c}=Ie.useFieldArray({name:"headers",control:a}),l=()=>{u({value:"",name:""})};return v.jsxs(v.Fragment,{children:[n&&v.jsxs(Di2,{children:[v.jsx(tt,{icon:"INFO_CIRCLE"}),v.jsx(E.Typography,{variant:"caption",color:"text.secondary",children:"Webhooks permitem que serviços externos sejam notificados quando determinados eventos acontecem. Saiba mais acessando a documentação do Webhook"})]}),t&&v.jsx(nn,{name:"name",label:"Nome do webhook"}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{name:"url",label:"URL de endpoint",rules:{required:{value:!0,message:"Url é obrigatório"}}}),v.jsx(nn,{name:"filter",label:"Filtro"})]}),t&&e&&v.jsxs(v.Fragment,{children:[v.jsx(nn,{variant:"filled",name:"solution",label:"Solução",disabled:!0}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{variant:"filled",name:"resource",label:"Origem",disabled:!0}),v.jsx(nn,{variant:"filled",name:"resourceID",label:"ID origem",disabled:!0,InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(Bi2,{onClick:()=>navigator.clipboard.writeText(e.resourceID),children:v.jsx(tt,{className:"copyIcon",icon:"COPY_CONTENT"})})})}}),v.jsx(nn,{variant:"filled",name:"event",label:"Evento",disabled:!0})]})]}),v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsxs(E.Stack,{width:"35%",gap:2,children:[v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Tipo de conteúdo:"}),v.jsx(dBn,{name:"content_type",options:ki2,row:!0,decorated:!0})]}),v.jsxs(E.Stack,{gap:2,children:[v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Métodos Http:"}),v.jsx(dBn,{name:"http_method",options:Si2,row:!0,decorated:!0})]})]}),v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Status:"}),v.jsx(qZn,{name:"active",label:"Ativo"}),v.jsx(E.Typography,{color:"text.secondary",variant:"overline",children:"Cabeçalho:"}),r==null?void 0:r.map((f,s)=>v.jsxs(E.Stack,{direction:"row",gap:2,children:[v.jsx(nn,{name:`headers.${s}.name`,label:"Chave",rules:{required:{value:!0,message:"Chave é obrigatório"}}}),v.jsx(nn,{name:`headers.${s}.value`,label:"Valor",rules:{required:{value:!0,message:"Valor é obrigatório"}}}),v.jsx(Wi2,{onClick:()=>c(s),color:"error",children:v.jsx(tt,{icon:"DELETE_MARK_BUTTON_02"})})]},f.id)),v.jsx(oRn,{actionType:"NEW",size:"large",variant:"outlined",color:"inherit",fullWidth:!0,onClick:()=>l(),children:"Adicionar novo cabeçalho"}),v.jsx(E.Divider,{})]})},eUn=({name:e,helperText:t,rules:n,onSelectOption:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>v.jsx(Qkn,{...c,...r,onChange:f=>{a&&a(f),c.onChange(f)},error:!!l,helperText:(l==null?void 0:l.message)||t})})},tUn=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{name:u,onChange:c,value:l,ref:f},fieldState:{error:s}})=>v.jsx(eBn,{ref:f,...a,name:u,value:l,error:!!s,helperText:(s==null?void 0:s.message)||t,onChange:({target:{value:d}})=>c(d)})})},$i2=({name:e,containerProps:t,required:n,rules:a,tabIndex:r})=>{const u=`${e}.zipCode`,c=`${e}.publicPlace`,l=`${e}.number`,f=`${e}.district`,s=`${e}.complement`,d=`${e}.state`,g=`${e}.city`,_=m=>{m.key==="Enter"&&m.preventDefault()};return v.jsxs(E.Stack,{gap:1.5,...t,children:[v.jsxs(E.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[v.jsx(tUn,{name:u,label:"CEP",mask:[{mask:"00000-000"}],InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(E.CircularProgress,{size:24})})},rules:a,onKeyDown:_,required:n,sx:{width:"auto",flex:1,minWidth:160},tabIndex:r}),v.jsxs(E.Stack,{direction:{xs:"column",sm:"row"},gap:1.5,flex:{xs:1,md:"1 1 50%"},children:[v.jsx(nn,{name:c,label:"Logradouro",onKeyDown:_,inputProps:{maxLength:70},sx:{width:"auto",minWidth:250,flex:1},tabIndex:r}),v.jsx(nn,{name:l,label:"Número",onKeyDown:_,inputProps:{maxLength:6},sx:{width:"auto",minWidth:100},tabIndex:r})]})]}),v.jsxs(E.Stack,{direction:{xs:"column",md:"row"},gap:1.5,flexWrap:"wrap",children:[v.jsx(nn,{name:f,label:"Bairro",onKeyDown:_,inputProps:{maxLength:20},sx:{width:"auto",flex:{xs:1,md:"1 1 100px"}},tabIndex:r}),v.jsx(nn,{name:s,label:"Complemento",onKeyDown:_,inputProps:{maxLength:30},sx:{minWidth:200,width:"auto",flex:{xs:1,md:"1 1 500px"}},tabIndex:r})]}),v.jsxs(E.Stack,{gap:1.5,flexWrap:"wrap",direction:{xs:"column",sm:"row"},children:[v.jsx(eUn,{name:d,label:"Estado",options:[],disabled:!0,required:n,sx:{flex:1},tabIndex:r}),v.jsx(nn,{name:g,label:"Cidade",disabled:!0,required:n,sx:{flex:1},tabIndex:r})]})]})},xi2=({name:e,rules:t,helperText:n,tabIndex:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:t,render:({field:c,fieldState:{error:l}})=>v.jsxs("div",{children:[v.jsx(E.FormControlLabel,{control:v.jsx(E.Checkbox,{...c,checked:c.value,tabIndex:a}),...r}),(!!l||n)&&v.jsx(E.FormHelperText,{error:!!l,children:l?l==null?void 0:l.message:n})]})})},zi2=({row:e,name:t,rules:n,label:a,options:r,spacing:u,helperText:c,required:l,...f})=>{const{control:s}=Ie.useFormContext(),d=(g,_)=>g.includes(_)?g.filter(m=>m!==_):[...g,_];return v.jsx(Ie.Controller,{name:t,control:s,rules:n,render:({field:{value:g=[],..._},fieldState:{error:m}})=>v.jsxs(E.FormControl,{component:"fieldset",children:[a&&v.jsx(E.FormLabel,{component:"legend",sx:{typography:"body2"},required:l,children:a}),v.jsx(E.FormGroup,{sx:{...e&&{flexDirection:"row"},"& .MuiFormControlLabel-root":{"&:not(:last-of-type)":{mb:u||0},...e&&{mr:0,"&:not(:last-of-type)":{mr:u||2}}}},children:r.map(C=>v.jsx(E.FormControlLabel,{control:v.jsx(E.Checkbox,{checked:g.includes(C.value),onChange:()=>_.onChange(d(g,C.value))}),label:C.label,...f},C.value))}),(!!m||c)&&v.jsx(E.FormHelperText,{error:!!m,sx:C=>({color:f.disabled?C.palette.grey[500]:void 0}),children:m?m==null?void 0:m.message:c})]})})},Hi2=({keyName:e,inputs:t=[],rules:n,tabIndex:a,...r})=>{const u=o.useRef(null),{control:c,setValue:l,formState:{errors:f}}=Ie.useFormContext(),s=_=>{const m=_.clipboardData.getData("text").split("");t.map((C,h)=>l(C,m[h])),_.preventDefault()},d=(_,m)=>{const{maxLength:C,value:h,name:b}=_.target,p=b.replace(e,""),y=Number(p),w=document.querySelector(`input[name=${e}${y+1}]`);h.length>C&&(_.target.value=h[0]),h.length>=C&&y<6&&w!==null&&w.focus(),m(_)};hSn("paste",s,u);const g=t.some(_=>f[_]);return v.jsxs(E.Stack,{children:[v.jsx(E.Stack,{direction:"row",spacing:2,justifyContent:"center",ref:u,children:t.map((_,m)=>v.jsx(Ie.Controller,{name:`${e}${m+1}`,control:c,rules:n,render:({field:C,fieldState:{error:h}})=>v.jsx(E.TextField,{...r,...C,autoComplete:"none",error:!!h,autoFocus:m===0,placeholder:"-",onChange:b=>{d(b,C.onChange)},onFocus:b=>b.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:a}})},_))}),g&&v.jsx(E.FormHelperText,{error:!0,sx:{px:2},children:"Código é obrigatório"})]})},Ai2=({name:e,rules:t,helperText:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:{...t,validate:{...t==null?void 0:t.validate,validation:u=>{const c="#"+u.replaceAll("#","");return/^#([0-9A-Fa-f]{3}){1,2}$/.test(c)?!0:"Cor inválida"}}},render:({field:{ref:u,onChange:c,...l},fieldState:{error:f}})=>v.jsx(_Nn,{...l,onChangeColor:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||n,...a})})},Ri2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.DatePicker,{inputRef:l,format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Vi2=({name:e,label:t,rules:n,tabIndex:a,helperText:r,required:u,...c})=>{const{control:l,setError:f}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:l,rules:n,render:({field:{value:s,onChange:d},fieldState:{error:g}})=>v.jsx(lT.DateRangePicker,{format:"dd/MM/yyyy",localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",...c.localeText},value:[(s==null?void 0:s.startDate)||null,(s==null?void 0:s.endDate)||null],onChange:_=>d({startDate:_[0],endDate:_[1]}),onError:_=>{f(e,{message:_[0]||_[1]||void 0})},...c,slotProps:{textField:({position:_})=>{var m;return{...(m=c.slotProps)==null?void 0:m.textField,required:u,error:!!g,helperText:(g==null?void 0:g.message)||r,autoComplete:"off",spellCheck:"false",fullWidth:!0,label:_==="start"?`${t} (Dt. Início)`:`${t} (Dt. Fim)`,inputProps:{tabIndex:a}}}},sx:{width:1}})})},Fi2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.DateTimePicker,{format:"dd/MM/yyyy HH:mm",inputRef:l,localeText:{previousMonth:"Mês anterior",nextMonth:"Próximo mês",fieldDayPlaceholder:()=>"dd",fieldMonthPlaceholder:()=>"mm",fieldYearPlaceholder:()=>"aaaa",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,required:r,error:!!s,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Ni2=({id:e,children:t,onSubmit:n,methods:a,...r})=>v.jsx(Ie.FormProvider,{...a,children:v.jsx(E.Stack,{component:"form",id:e,onSubmit:n,flex:1,width:1,noValidate:!0,...r,children:t})}),Ti2=({name:e,helperText:t,rules:n,...a})=>{const{control:r}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:r,rules:n,render:({field:{ref:u,value:c,...l},fieldState:{error:f}})=>v.jsx(XDn,{value:c,inputRef:u,fullWidth:!0,error:!!f,helperText:(f==null?void 0:f.message)||t,...a,...l,name:e})})},Zi2=({name:e,helperText:t,rules:n,onChange:a,...r})=>{const{control:u}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:u,rules:n,render:({field:c,fieldState:{error:l}})=>v.jsx(Qht,{...c,onChange:f=>{c.onChange(f),a&&a(f)},fullWidth:!0,error:!!l,helperText:(l==null?void 0:l.message)||t,...r})})},Ui2=({name:e,sx:t,rules:n,passwordSize:a,specialCharacter:r,upperCaseChar:u,numberChar:c,showErrorMessage:l,match:f,...s})=>{const{watch:d}=Ie.useFormContext(),g=d(e),[_,m]=o.useState(!1),{hasNumberChar:C,hasSpecialCharacter:h,hasUpperCaseChar:b,isLengthValid:p}=nCt(g,a,c,r,u);return v.jsx(nn,{...s,name:e,type:_?"text":"password",InputProps:{endAdornment:v.jsx(E.InputAdornment,{position:"end",children:v.jsx(E.IconButton,{onClick:()=>m(!_),edge:"end","aria-label":"Mostrar/Ocultar senha",children:v.jsx(tt,{icon:_?"VIEW_OFF":"VIEW_ON"})})})},rules:{...n,validate:{...n==null?void 0:n.validate,validationPassword:y=>{const w=nCt(y,a,c,r,u);return!w.hasNumberChar||!w.hasSpecialCharacter||!w.hasUpperCaseChar||!w.isLengthValid?"Senha inválida":f&&f.fieldPassword&&d(f.fieldPassword)!==y?"As senhas devem ser iguais":!0}}},sx:{...t,"& .MuiFormHelperText-root":{display:(!h||!b||!p||!C)&&!l?"none":void 0}}})},dBn=({name:e,rules:t,row:n,label:a,options:r,spacing:u,helperText:c,decorated:l,onChange:f,tabIndex:s,required:d,disabled:g,..._})=>{const{control:m}=Ie.useFormContext(),C=a?`${e}-${a}`:"";return v.jsx(Ie.Controller,{name:e,control:m,rules:t,render:({field:h,fieldState:{error:b}})=>v.jsxs(E.FormControl,{component:"fieldset",sx:{...l&&{paddingLeft:1.5}},children:[a&&v.jsx(E.FormLabel,{component:"legend",id:C,sx:{typography:"body2"},required:d,children:a}),v.jsx(E.RadioGroup,{..._,...h,onChange:(p,y)=>{h.onChange(p),f&&f(p,y)},"aria-labelledby":C,row:n,children:r.map(p=>v.jsx(E.FormControlLabel,{value:p.value,control:v.jsx(E.Radio,{inputProps:{tabIndex:s},disabled:g,checked:p.value===h.value}),label:p.label,sx:({palette:y})=>({"&:not(:last-of-type)":{mb:u||0},...n&&{mr:0,"&:not(:last-of-type)":{mr:u||2}},...l&&{border:`1px solid ${E.alpha(y.grey[500],.32)}`,borderRadius:1,padding:.25,paddingRight:(u||0)/2||1,...h.value===p.value&&{borderColor:"primary.main",backgroundColor:E.alpha(y.primary.main,.05)}}})},p.value))}),(!!b||c)&&v.jsx(E.FormHelperText,{error:!!b,sx:p=>({color:g?p.palette.grey[500]:void 0}),children:b?b==null?void 0:b.message:c})]})})},Gi2=({name:e,rules:t,tabIndex:n,helperText:a,required:r,...u})=>{const{control:c}=Ie.useFormContext();return v.jsx(Ie.Controller,{name:e,control:c,rules:t,render:({field:{ref:l,...f},fieldState:{error:s}})=>{var d;return v.jsx(lT.TimePicker,{ampm:!1,format:"HH:mm",inputRef:l,localeText:{fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",...u.localeText},...f,...u,value:f.value?new Date(f.value):null,slotProps:{textField:{...(d=u.slotProps)==null?void 0:d.textField,error:!!s,required:r,helperText:(s==null?void 0:s.message)||a,autoComplete:"off",spellCheck:"false",fullWidth:!0,inputProps:{tabIndex:n}},openPickerButton:{tabIndex:n}}})}})},Yi2=({onFileCropped:e,onImageUploaded:t,onCancel:n,aspect:a,size:r,label:u,image:c="",uploading:l,file:f,tabIndex:s,...d})=>{const{id:g,crop:_,cropModalOpen:m,zoom:C,cancelChanges:h,handleRemove:b,onCropComplete:p,saveChanges:y,setCrop:w,setCropModalOpen:L,setZoom:j}=XZn({image:c,onFileCropped:e,onImageUploaded:t,onCancel:n});return v.jsxs(v.Fragment,{children:[v.jsxs(E.Stack,{position:"relative",alignItems:"center",justifyContent:"center",children:[l&&v.jsx(Li2,{}),v.jsx(YZn,{...d,id:g,file:f,onDrop:P=>{if(P.length>0){L(!0),j(1),w({x:0,y:0});const k=new FileReader;k.addEventListener("load",()=>{var S;const D=((S=k.result)==null?void 0:S.toString())||"";t(D),e(void 0)}),k.readAsDataURL(P[0])}},image:c,tabIndex:s})]}),v.jsx(QZn,{id:g,open:m,onClose:h,label:u,aspect:a,crop:_,zoom:C,onCropComplete:p,onCropChange:w,onZoomChange:j,imgSrc:c,onRemove:b,onSave:y,size:r})]})};function nUn(e,t){const{watch:n,setValue:a}=Ie.useFormContext(),[r,u]=o.useState(t),c=n(e)||[];return{uploadFile:async _=>{if(!_){a(e,void 0),u(void 0);return}a(e,_),u(Object.assign(_,{preview:URL.createObjectURL(_)}))},uploadFiles:async _=>{a(e,[...c,..._.map(m=>Object.assign(m,{preview:URL.createObjectURL(m)}))])},handleDeleteFile:()=>{a(e,void 0),u(void 0)},handleRemoveAll:()=>{a(e,void 0)},handleRemove:_=>{const m=c.filter(C=>C!==_);a(e,m)},file:r,setFileValue:u}}const Ki2=({name:e,rules:t,helperText:n,aspect:a,label:r,size:u,image:c,onFileCropped:l,onImageUploaded:f,onCancel:s,...d})=>{const{control:g}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:C}=nUn(e);return v.jsx(Ie.Controller,{name:e,control:g,rules:t,render:({field:{value:h},fieldState:{error:b}})=>v.jsx(Yi2,{accept:{"image/*":[]},file:h?m:void 0,onFileCropped:p=>{_(p),l&&l(p)},onImageUploaded:f,onCancel:()=>{C(void 0),s&&s()},error:!!b,disableMultiple:!0,helperText:(!!b||n)&&v.jsx(E.FormHelperText,{error:!!b,sx:{px:2},children:b?b==null?void 0:b.message:n}),aspect:a,label:r,size:u,image:c,...d})})},Xi2=({name:e,rules:t,helperText:n,aspect:a,label:r,size:u,image:c,onFileCropped:l,onImageUploaded:f,onCancel:s,...d})=>{const{control:g}=Ie.useFormContext(),{uploadFile:_,file:m,setFileValue:C}=nUn(e);return v.jsx(Ie.Controller,{name:e,control:g,rules:t,render:({field:{value:h},fieldState:{error:b}})=>v.jsx(JZn,{accept:{"image/*":[]},file:h?m:void 0,onFileCropped:p=>{_(p),l&&l(p)},onImageUploaded:f,onCancel:()=>{C(void 0),s&&s()},error:!!b,disableMultiple:!0,helperText:(!!b||n)&&v.jsx(E.FormHelperText,{error:!!b,sx:{px:2},children:b?b==null?void 0:b.message:n}),aspect:a,label:r,size:u,image:c,...d})})},Qi2=Object.freeze(Object.defineProperty({__proto__:null,default:EXn},Symbol.toStringTag,{value:"Module"}));A.ActionButton=oRn,A.Address=$i2,A.Autocomplete=Qkn,A.AutocompleteField=eUn,A.BuilderLayout=$So,A.BuilderSidebar=uzo,A.Carousel=CLo,A.CarouselArrowIndex=fEo,A.CarouselArrows=JPo,A.CarouselDots=OLo,A.Checkbox=xi2,A.Codes=Hi2,A.ColorPickerField=Ai2,A.ColorPickerInput=_Nn,A.Common=bn2,A.CommonSSR=pn2,A.Confirm=On2,A.CustomAvatar=_Tn,A.CustomAvatarGroup=mTn,A.DataGrid=Sn2,A.DatePicker=Ri2,A.DateRangePicker=Vi2,A.DateTimePicker=Fi2,A.Delayed=Dn2,A.DialogAnimate=eQn,A.Drawer=Fn2,A.EmptyContent=AHn,A.EmptyView=hTn,A.FabButtonAnimate=t$n,A.Field=nn,A.FixedProgressBar=Rht,A.Form=Ni2,A.HelpButton=bRn,A.Icon=tt,A.IconButtonAnimate=n$n,A.Iconify=vr,A.ImageCrop=ZTn,A.Incrementer=XDn,A.IncrementerField=Ti2,A.Label=iZn,A.Lightbox=dSo,A.LoadingScreen=Ur2,A.MaskedInput=eBn,A.MaskedInputField=tUn,A.MaterialDesignContent=Axn,A.MenuPopover=l12,A.Modal=mZn,A.ModalActions=_12,A.MotionContainer=yer,A.MotionLazyContainer=Kbt,A.MotionViewport=ber,A.MultiCheckbox=zi2,A.NumberInput=Qht,A.NumberInputField=Zi2,A.PasswordField=Ui2,A.PasswordRules=y12,A.Portal=vZn,A.RadioGroupField=dBn,A.SavedChanges=V12,A.Scrollbar=kTn,A.SearchInput=F12,A.SnackbarContent=ryt,A.SnackbarProvider=Fxn,A.SplashScreen=N12,A.Steps=U12,A.StyledTab=G12,A.StyledTabs=Y12,A.Switch=qZn,A.TRANSITION=OBn,A.TabPanel=K12,A.TableEmptyRows=hEo,A.TableHeadCustom=bEo,A.TableNoData=mEo,A.TablePaginationCustom=pEo,A.TableSelectedAction=yEo,A.TableSkeleton=vEo,A.TextAnimate=tQn,A.TextMaxLine=yZn,A.ThemeProvider=gTn,A.TimePicker=Gi2,A.Transition=nvt,A.Upload=GZn,A.UploadAvatar=YZn,A.UploadAvatarWithCropField=Ki2,A.UploadBox=yi2,A.UploadWithCrop=JZn,A.UploadWithCropField=Xi2,A.Webhook=Ii2,A.WhiteBox=Ei2,A.color=qe2,A.cssStyles=cEo,A.emptyRows=sEo,A.file=p12,A.formatNumber=yr2,A.formatTime=B12,A.getComparator=dEo,A.loadable=R12,A.mask=H12,A.number=_r2,A.routes=I12,A.sort=z12,A.useActiveElement=xSo,A.useCarousel=bLo,A.useCopyToClipboard=zSo,A.useDatagrid=HSo,A.useDeepCompareEffect=Qxo,A.useEventListener=hSn,A.useIsMounting=qxo,A.useLightBox=mSo,A.useOffSetTop=rzo,A.useOnClickOutside=nzo,A.usePagination=tzo,A.useResponsive=mxn,A.useSnackbar=Jer,A.useTable=gEo,A.useTabs=ezo,A.useToggle=CSn,A.uuidv4=A12,A.validators=h12,A.varBgColor=_Un,A.varBgKenburns=mUn,A.varBgPan=vUn,A.varBounce=sUn,A.varContainer=K_t,A.varFade=Ice,A.varFlip=cUn,A.varHover=gUn,A.varPath=iUn,A.varRotate=dUn,A.varScale=fUn,A.varSlide=lUn,A.varTranEnter=We,A.varTranExit=Fe,A.varTranHover=oUn,A.varZoom=uUn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
3
  "private": false,
4
- "version": "1.2.12",
4
+ "version": "1.2.13",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",